Lines Matching refs:yield
600 '''Recursively find all messages. For each, yield name, DescriptorProto.'''
608 yield sub_names, submsg
611 yield x
615 For each, yield name, FieldDescriptorProto.
618 yield names, extension
622 yield subname, extension
677 yield item
692 yield message_by_name[msgname]
709 yield '/* Automatically generated nanopb header */\n'
711 yield '/* Generated by %s */\n\n' % (nanopb_version)
713 yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
716 yield '#ifndef _PB_%s_\n' % symbol
717 yield '#define _PB_%s_\n' % symbol
719 yield options.libformat % ('pb.h')
722 yield options.libformat
723 yield '\n'
727 yield options.genformat % (noext + '.' + options.extension + '.h')
728 yield '\n'
730 yield '#ifdef __cplusplus\n'
731 yield 'extern "C" {\n'
732 yield '#endif\n\n'
734 yield '/* Enum definitions */\n'
736 yield str(enum) + '\n\n'
738 yield '/* Struct definitions */\n'
740 yield msg.types()
741 yield str(msg) + '\n\n'
744 yield '/* Extensions */\n'
746 yield extension.extension_decl()
747 yield '\n'
749 yield '/* Default values for struct fields */\n'
751 yield msg.default_decl(True)
752 yield '\n'
754 yield '/* Field tags (for use in manual encoding/decoding) */\n'
757 yield field.tags()
759 yield extension.tags()
760 yield '\n'
762 yield '/* Struct field encoding specification for nanopb */\n'
764 yield msg.fields_declaration() + '\n'
765 yield '\n'
767 yield '/* Maximum encoded size of messages (where known) */\n'
772 yield '#define %-40s %s\n' % (identifier, msize)
773 yield '\n'
775 yield '#ifdef __cplusplus\n'
776 yield '} /* extern "C" */\n'
777 yield '#endif\n'
780 yield '\n#endif\n'
785 yield '/* Automatically generated nanopb constant definitions */\n'
787 yield '/* Generated by %s */\n\n' % (nanopb_version)
789 yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
790 yield options.genformat % (headername)
791 yield '\n'
794 yield msg.default_decl(False)
796 yield '\n\n'
799 yield msg.fields_definition() + '\n\n'
802 yield ext.extension_def() + '\n'
810 yield '\n/* Check that missing required fields will be properly detected */\n'
811 yield '#if PB_MAX_REQUIRED_FIELDS < %d\n' % largest_count
812 yield '#error Properly detecting missing required fields in %s requires \\\n' % largest_msg.name
813 yield ' setting PB_MAX_REQUIRED_FIELDS to %d or more.\n' % largest_count
814 yield '#endif\n'
831 yield '\n/* Check that field information fits in pb_field_t */\n'
834 yield '#if !defined(PB_FIELD_32BIT)\n'
836 yield '#error Field descriptor for %s is too large. Define PB_FIELD_32BIT to fix this.\n' % worst_field
840 yield '/* If you get an error here, it means that you need to define PB_FIELD_32BIT\n'
841 yield ' * compile-time option. You can do that in pb.h or on compiler command line.\n'
842 yield ' * \n'
843 yield ' * The reason you need to do this is that some of your messages contain tag\n'
844 yield ' * numbers or field sizes that are larger than what can fit in 8 or 16 bit\n'
845 yield ' * field descriptors.\n'
846 yield ' */\n'
847 yield 'STATIC_ASSERT((%s), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_%s)\n'%(assertion,msgs)
848 yield '#endif\n\n'
851 yield '#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)\n'
853 yield
857 yield '/* If you get an error here, it means that you need to define PB_FIELD_16BIT\n'
858 yield ' * compile-time option. You can do that in pb.h or on compiler command line.\n'
859 yield ' * \n'
860 yield ' * The reason you need to do this is that some of your messages contain tag\n'
861 yield ' * numbers or field sizes that are larger than what can fit in the default\n'
862 yield ' * 8 bit descriptors.\n'
863 yield ' */\n'
864 yield 'STATIC_ASSERT((%s), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_%s)\n'%(assertion,msgs)
865 yield '#endif\n\n'
875 yield '\n'
876 yield '/* On some platforms (such as AVR), double is really float.\n'
877 yield ' * These are not directly supported by nanopb, but see example_avr_double.\n'
878 yield ' * To get rid of this error, remove any double fields from your .proto.\n'
879 yield ' */\n'
880 yield 'STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)\n'
882 yield '\n'