Top |
#define | GNUI_PP_CALL() |
#define | GNUI_PP_EAT() |
#define | GNUI_PP_EXPAND() |
#define | GNUI_PP_PASTE2() |
#define | GNUI_PP_PASTE3() |
#define | GNUI_PP_STRINGIFY() |
#define | GNUI_PP_BOOL() |
#define | GNUI_PP_BOOL_NOT() |
#define | GNUI_PP_IF_NONZERO() |
#define | GNUI_PP_IF_ONE_OR_ZERO() |
#define | GNUI_PP_LITERAL_PASTE2() |
#define | GNUI_PP_LITERAL_PASTE3() |
#define | GNUI_PP_LITERAL_STRINGIFY() |
#define | GNUI_PP_WHEN_NONZERO() |
#define | GNUI_CONTAINER_OF() |
#define | GNUI_SET_POINTED_VALUE_IF_GIVEN__2_1() |
#define | GNUI_SET_IF_GREATER__2_2() |
#define | GNUI_NORMALIZE_INT_UINT_CAST__2() |
#define | GNUI_ROUND_UINT_DIVISION__1_2() |
#define | GNUI_ROUND_INT_DIVISION__2_3() |
#define | GNUI_PERPENDICULAR_ORIENTATION() |
GList * | gnui_list_prepend_llink () |
GList * | gnui_list_u_detach_and_move_to_next () |
#define | GNUI_LIST_DELETE_AND_MOVE_TO_NEXT() |
GList * | gnui_list_detach_and_move_to_next () |
bool | gnui_lists_are_equal () |
guint | gnui_signal_handlers_block_by_func () |
guint | gnui_signal_handlers_unblock_by_func () |
These macros provide more specialized features which are not needed so often by application programmers.
#define GNUI_PP_PASTE2(MACRO, ...) GNUI_PP_LITERAL_PASTE2(MACRO, __VA_ARGS__)
Paste together the expansion of two macros
#define GNUI_PP_PASTE3(MACRO1, MACRO2, ...)
Paste together the expansion of three macros
#define GNUI_PP_STRINGIFY(MACRO) GNUI_PP_LITERAL_STRINGIFY(MACRO)
Stringify the expansion of a macro
#define GNUI_PP_BOOL(COND) _GNUI_PPX_NEGA_(GNUI_PP_BOOL_NOT(COND))
Transform a condition into a literal boolean
#define GNUI_PP_BOOL_NOT(COND)
Transform a condition into a literal boolean and negate the result
#define GNUI_PP_IF_NONZERO(COND, ...)
Inline preprocessor if-else
#define GNUI_PP_IF_ONE_OR_ZERO(COND, ...)
Check if a condition is exactly one or zero
If COND
is neither 0
nor 1
the behavior is undefined.
#define GNUI_PP_LITERAL_PASTE2(MACRO, ...) MACRO##__VA_ARGS__
Paste two macro names without expanding them
#define GNUI_PP_LITERAL_PASTE3(MACRO1, MACRO2, ...) MACRO1##MACRO2##__VA_ARGS__
Paste three macro names without expanding them
#define GNUI_PP_LITERAL_STRINGIFY(MACRO) #MACRO
Stringify a macro name without expanding it
#define GNUI_CONTAINER_OF(PTR, TYPE, MEMBER)
Get the struct
that contains the pointed address as one of its members
#define GNUI_SET_POINTED_VALUE_IF_GIVEN__2_1(PTR, VAL)
Set a pointed value only if the pointer is not NULL
#define GNUI_SET_IF_GREATER__2_2(VAR, VAL)
Assign a value to a variable only if the value to assign is greater than the current value of the variable
#define GNUI_NORMALIZE_INT_UINT_CAST__2(UINT)
Sanitize a cast between a signed and an unsigned integer
#define GNUI_ROUND_UINT_DIVISION__1_2(NUM, DEN)
Round a division between two unsigned integers without float computations
#define GNUI_ROUND_INT_DIVISION__2_3(NUM, DEN)
Round a division between two signed integers
#define GNUI_PERPENDICULAR_ORIENTATION(ORIENTATION)
Find the perpendicular GtkOrientation
GList * gnui_list_prepend_llink (GList * const list
,GList * const detached_llink
);
Prepend a detached list link to a list
GList * gnui_list_u_detach_and_move_to_next (GList ** const list
,GList ** const llink
);
Like
, but the gnui_list_detach_and_move_to_next()
.prev
and .next
members of the removed element are not set to NULL
(please use it only if
you know what you are doing)
Please refer to
for an example.gnui_list_detach_and_move_to_next()
#define GNUI_LIST_DELETE_AND_MOVE_TO_NEXT(LIST, LLINK)
Removes a pointed member from a GList
, set the pointer to the next member
in the list (or to NULL
if the list is over) and free the removed
element.
This function is only sugar for loops (useful for deleting elements from a list while the loop must keep going).
Writing
1 |
GNUI_LIST_DELETE_AND_MOVE_TO_NEXT(&list, ¤t); |
is equivalent to writing
1 2 3 4 |
removed = current; current = current->next; list = g_list_remove_link(list, removed); g_list_free_1(removed); |
GList * gnui_list_detach_and_move_to_next (GList ** const list
,GList ** const llink
);
Removes a pointed member from a GList
, set the pointer to the next member
in the list (or to NULL
if the list is over) and return the removed
element.
This function is only sugar for loops (useful for removing elements from a list while the loop must keep going).
Writing
1 |
do_something(gnui_list_detach_and_move_to_next(&list, ¤t)); |
is equivalent to writing
1 2 3 4 |
removed = current; current = current->next; list = g_list_remove_link(list, removed); do_something(removed); |
bool gnui_lists_are_equal (const GList * const list1
,const GList * const list2
);
Check if two GLists
have the same elements in the same order
guint gnui_signal_handlers_block_by_func (const gpointer instance
,const GCallback func
,const gpointer data
);
Like
, but suppresses the
function-pointer-to-object-pointer cast warningg_signal_handlers_block_by_func()
return
The number of handlers that matched
guint gnui_signal_handlers_unblock_by_func (const gpointer instance
,const GCallback func
,const gpointer data
);
Like
, but suppresses the
function-pointer-to-object-pointer cast warningg_signal_handlers_unblock_by_func()