Commits

Kevin Lyda committed ce09b9b

Doc fixes.

Get doxygen to run clean. Fix a few other missing bits.

  • Participants
  • Parent commits 60fc563

Comments (0)

Files changed (7)

 pkgconfig_DATA = protobuf-c-text/libprotobuf-c-text.pc
 
 # Static analysis.
-analyze_srcs = $(protobuf_c_text_libprotobuf_c_text_la_SOURCES)
+analyze_srcs = protobuf-c-text/generate.c protobuf-c-text/parse.c
 .PHONY: analyze
 analyze: all
 	@for f in $(analyze_srcs); do \
 pkgconfig_DATA = protobuf-c-text/libprotobuf-c-text.pc
 
 # Static analysis.
-analyze_srcs = $(protobuf_c_text_libprotobuf_c_text_la_SOURCES)
+analyze_srcs = protobuf-c-text/generate.c protobuf-c-text/parse.c
 
 # Test programs.
 t_c_dump_SOURCES = t/c-dump.c t/broken-alloc.h t/broken-alloc.c
 
 ## Dependencies
 
-The `re2c` parser is required to generate the lexer (`parser.re`).
+The [re2c](http://re2c.org/) parser is required to generate the
+lexer (`parser.re`).
 
 ## Testing
 
 Memory allocation:
   * Script this for the tests:
     https://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html
+
+Packaging:
+  * Ubuntu PPA?
+  * homebrew?

protobuf-c-text/generate.c

  * @{
  */
 
+/** Quick macro to call \c allocator->free. */
 #define PBC_FREE(ptr) allocator->free(allocator->allocator_data, ptr)
 
 /** A dynamic string struct.

protobuf-c-text/parse.re

   return NULL;
 }
 
+/** Amount of data to read from a file each time. */
 #define CHUNK 4096
 
 /** Function to request more data from input source in \c Scanner.
   return scanner->limit >= scanner->cursor? 1: 0;
 }
 
+/** Return the token. */
 #define RETURN(tt) { t.id = tt; return t; }
+/** Retrieves more input if available. */
 #define YYFILL(n) { fill_result = fill(scanner, allocator); \
-                    if (fill_result <=0) \
+                    if (fill_result <= 0) \
                       RETURN((fill_result == -1? TOK_MALLOC_ERR: TOK_EOF)); }
 
 /** Generated lexer.
   STATE_DONE        /**< Nothing more to read or there's been an error. */
 } StateId;
 
+/** Max size of an error message. */
 #define STATE_ERROR_STR_MAX 160
+
 /** Maintain state for the FSM.
  *
  * Tracks the current state of the FSM.
  * \param[in,out] state A state struct pointer - the is the state
  *                      for the FSM.
  * \param[in,out] scanner The state struct for the scanner.
+ * \param[in] descriptor Message descriptor.
  * \param[in] allocator Allocator functions.
  * \return Success (1) or failure (0). Failure is due to out of
  *         memory errors.

protobuf-c-text/protobuf-c-util.h

 
 /* These are lifted from the protobuf-c lib */
 
+/** Used to define STRUCT_MEMBER() and STRUCT_MEMBER_PTR(). */
 #define STRUCT_MEMBER_P(struct_p, struct_offset) \
       ((void *) ((uint8_t *) (struct_p) + (struct_offset)))
 
+/** Return a field from a message based on offset and type. */
 #define STRUCT_MEMBER(member_type, struct_p, struct_offset) \
       (*(member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset)))
 
+/** Return a pointer to a field in a message based on offset and type. */
 #define STRUCT_MEMBER_PTR(member_type, struct_p, struct_offset) \
       ((member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset)))