1. 26 Mar, 2014 1 commit
  2. 24 Mar, 2014 3 commits
    • Robert Edmonds's avatar
      configure.ac: check for a libprotoc header file · 16e3465d
      Robert Edmonds authored
      it's possible for the <google/protobuf/compiler/> header files to be
      shipped in a separate package (e.g., debian's libprotoc-dev). check for
      this at configure time rather than allowing the build process to fail.
      16e3465d
    • Oleg Efimov's avatar
      9c7f8ce7
    • Robert Edmonds's avatar
      protoc-c: preserve case in C enum value names (Issue #129) · d2658e25
      Robert Edmonds authored
      there is some confusion with regard to the use of lower case letters in
      enum values. take the following message definition:
      
          message LowerCase {
            enum CaseEnum {
              UPPER = 1;
              lower = 2;
            }
            optional CaseEnum value = 1 [default = lower];
          }
      
      this generates the following C enum:
      
          typedef enum _LowerCase__CaseEnum {
            LOWER_CASE__CASE_ENUM__UPPER = 1,
            LOWER_CASE__CASE_ENUM__lower = 2
              _PROTOBUF_C_FORCE_ENUM_TO_BE_INT_SIZE(LOWER_CASE__CASE_ENUM)
          } LowerCase__CaseEnum;
      
      note that the case of the enum value 'lower' was preserved in the C
      symbol name as 'LOWER_CASE__CASE_ENUM__lower', but that the _INIT macro
      references the same enum value with the (non-existent) C symbol name
      'LOWER_CASE__CASE_ENUM__LOWER':
      
          #define LOWER_CASE__INIT \
           { PROTOBUF_C_MESSAGE_INIT (&lower_case__descriptor) \
              , 0,LOWER_CASE__CASE_ENUM__LOWER }
      
      additionally, the ProtobufCEnumValue array generated also refers to the
      same enum value with the (non-existent) upper cased version:
      
          const ProtobufCEnumValue lower_case__case_enum__enum_values_by_number[2] =
          {
            { "UPPER", "LOWER_CASE__CASE_ENUM__UPPER", 1 },
            { "lower", "LOWER_CASE__CASE_ENUM__LOWER", 2 },
          };
      
      we should preserve the existing behavior of copying the case from the
      enum values in the message definition and fix up the places where the
      (non-existent) upper case version is used, rather than changing the enum
      definition itself to match the case used in the _INIT macro and
      enum_values_by_number array, because it's possible that there might be
      existing working code that uses enum values with lower case letters that
      would be affected by such a change.
      
      incidentally, google's C++ protobuf implementation preserves case in
      enum values. protoc --cpp_out generates the following enum declaration
      for the message descriptor above:
      
          enum LowerCase_CaseEnum {
            LowerCase_CaseEnum_UPPER = 1,
            LowerCase_CaseEnum_lower = 2
          };
      d2658e25
  3. 19 Mar, 2014 2 commits
  4. 14 Mar, 2014 3 commits
  5. 07 Mar, 2014 1 commit
  6. 17 Feb, 2014 2 commits
  7. 16 Feb, 2014 1 commit
    • Kevin Lyda's avatar
      Autoconf configuration for doxygen. · b9f94db3
      Kevin Lyda authored
      Still need to add the comments in the source code. Currently I've
      seeded it with the libprotobuf-c files.  I've configured it
      to make man pages and html pages.  Might not be ideal, but makes it easy
      for me to check things (html is nicer, but man pages are handier for
      remote servers).
      b9f94db3
  8. 10 Feb, 2014 1 commit
  9. 25 Jan, 2014 1 commit
  10. 17 Jan, 2014 1 commit
  11. 14 Jan, 2014 22 commits
  12. 13 Jan, 2014 2 commits
    • Robert Edmonds's avatar
      protobuf-c: remove alloc_failed_warning and protobuf_c_out_of_memory · 8216865a
      Robert Edmonds authored
      in general, libraries shouldn't be responsible for terminating the
      program if memory allocation fails. if we need to allocate memory and
      can't, we should be returning a failure indicator, not providing a
      strange interface to the user for receiving a callback in the event of
      such an error.
      
      also in general, libraries should never write to stdout or stderr.
      
      this breaks the API/ABI and will require a note in the ChangeLog.
      8216865a
    • Robert Edmonds's avatar
      protobuf-c: remove tmp_alloc and max_alloca fields of ProtobufCAllocator · 8cd5f676
      Robert Edmonds authored
      i'm confused as to why these fields exist, since the typical
      implementation of a "temporary alloc" would be something like alloca(),
      and alloca() is usually just inlined code that adjusts the stack
      pointer, which is not a function whose address could be taken.
      
      this breaks the API/ABI and will require a note in the ChangeLog.
      
      possibly we could revisit the idea of "temporary allocations" by using
      C99 variable length arrays. this would have the advantage of being
      standardized, unlike alloca().
      8cd5f676