protobuf-c-text
Library to generate & parse text format protobufs in C.
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups
Macros
protobuf-c-util.h File Reference

Internal utility header file. More...

Go to the source code of this file.

Macros

#define STRUCT_MEMBER_P(struct_p, struct_offset)   ((void *) ((uint8_t *) (struct_p) + (struct_offset)))
 Used to define STRUCT_MEMBER() and STRUCT_MEMBER_PTR(). More...
 
#define STRUCT_MEMBER(member_type, struct_p, struct_offset)   (*(member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset)))
 Return a field from a message based on offset and type. More...
 
#define STRUCT_MEMBER_PTR(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. More...
 
#define PBC_FREE(ptr)
 Free possibly using the pbc allocator. More...
 
#define PBC_ALLOC(size)
 Allocate possibly using the pbc allocator. More...
 
#define ST_FREE(ptr)
 Free possibly using the pbc allocator (state members). More...
 
#define ST_ALLOC(size)
 Allocate possibly using the pbc allocator (state members). More...
 

Detailed Description

Internal utility header file.

Macros used by the generator and parser parts of the library.

Author
Kevin Lyda kevin.nosp@m.@ie..nosp@m.suber.nosp@m.ic.n.nosp@m.et
Date
March 2014

Definition in file protobuf-c-util.h.

Macro Definition Documentation

#define PBC_ALLOC (   size)
Value:
(allocator? \
allocator->alloc(allocator->allocator_data, size): \
malloc(size))

Allocate possibly using the pbc allocator.

Definition at line 37 of file protobuf-c-util.h.

Referenced by esc_str(), fill(), local_realloc(), rs_append(), and unesc_str().

#define PBC_FREE (   ptr)
Value:
(allocator? allocator->free(allocator->allocator_data, \
ptr): free(ptr))

Free possibly using the pbc allocator.

Definition at line 33 of file protobuf-c-util.h.

Referenced by fill(), local_realloc(), protobuf_c_text_to_string_internal(), rs_append(), scanner_free(), token_free(), and unesc_str().

#define ST_ALLOC (   size)
Value:
(state->allocator? \
state->allocator->alloc(state->allocator-> \
allocator_data, size): \
malloc(size))

Allocate possibly using the pbc allocator (state members).

Definition at line 48 of file protobuf-c-util.h.

Referenced by state_assignment(), state_init(), and state_value().

#define ST_FREE (   ptr)
Value:
(state->allocator? \
state->allocator->free(state->allocator-> \
allocator_data, ptr): \
free(ptr))

Free possibly using the pbc allocator (state members).

Definition at line 42 of file protobuf-c-util.h.

Referenced by state_free(), and state_init().

#define STRUCT_MEMBER (   member_type,
  struct_p,
  struct_offset 
)    (*(member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset)))

Return a field from a message based on offset and type.

Definition at line 25 of file protobuf-c-util.h.

Referenced by protobuf_c_text_to_string_internal(), state_assignment(), and state_value().

#define STRUCT_MEMBER_P (   struct_p,
  struct_offset 
)    ((void *) ((uint8_t *) (struct_p) + (struct_offset)))

Used to define STRUCT_MEMBER() and STRUCT_MEMBER_PTR().

Definition at line 21 of file protobuf-c-util.h.

#define STRUCT_MEMBER_PTR (   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.

Definition at line 29 of file protobuf-c-util.h.

Referenced by state_value().