![]() |
![]() |
![]() |
GSK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Helpful MacrosHelpful Macros — Various macros to eliminate tedious typing, beyond those provided by glib. |
#define GSK_DECLARE_POOL_ALLOCATORS (Type, type, pool_count) #define GSK_STRUCT_MEMBER_SIZE (type, member) #define GSK_STRUCT_MEMBER_END_OFFSET (struct, member) #define _ (s) #define GSK_SKIP_CHAR_TYPE (ptr, condition) #define GSK_SKIP_WHITESPACE (char_ptr) #define GSK_SKIP_NONWHITESPACE (char_ptr)
#define GSK_DECLARE_POOL_ALLOCATORS(Type, type, pool_count)
Declare static inline functions type_free and type_alloc,
(where type is the second parameter to this macro)
which use GMemChunks to implement fast allocation.
Type
is the name of the name of structure to allocate;
and pool_count
is the number to allocate at once.
|
Real type of the things to allocate. |
|
Lowercased type name, for mangling into the function name. |
|
Number of things to allocate at once. |
#define GSK_STRUCT_MEMBER_SIZE(type, member)
Find size in bytes of a structure member.
|
|
|
#define GSK_STRUCT_MEMBER_END_OFFSET(struct, member)
Find offset of a member's end in bytes.
|
|
|
#define GSK_SKIP_CHAR_TYPE(ptr, condition)
Skip ptr
along until it fails the condition
.
|
pointer to a NUL-terminated string. |
|
function predicate to test characters with. |
#define GSK_SKIP_WHITESPACE(char_ptr)
Skip char_ptr
along until it gets to a non-whitespace character, or the end of the string.
|
the pointer to advance. |