X11workbench Toolkit
1.0
|
Macros | |
#define | INVALID_HANDLE_VALUE |
INVALID HANDLE VALUE equivalent. More... | |
#define | HAS_WB_UINT64_BUILTIN |
defined whenever the 'WB_UINT64' data type is a 'built in' data type | |
#define | WB_C99_INITIALIZERS /* allow C99-style initializers */ |
Defined in 'platform_helper.h' when the compiler supports C99 initializers. | |
#define | __PACKED__ /* platform dependent; actual def must be a blank or doxygen barphs on it */ |
PACKED definition. More... | |
#define | DECLARE_SORT_FUNCTION(fn_name, p0, p1, p2) int fn_name(void *p0, const void *p1, const void *p2) |
Wrapper to declare a sort function for QSORT_R. More... | |
#define | QSORT_R(base, nmemb, size, thunk, compar) my_qsort_r((base),(nmemb),(size),(thunk),(compar)) |
Local implementation of qsort_r() for operating systems that do not have it. More... | |
#define | WB_STRINGIZE(X) WB_STRINGIZE_INTERNAL(X) |
stringize a macro argument More... | |
#define | WB_STRINGIZE_INTERNAL(X) #X |
helper to stringize a macro argument | |
#define | WB_UNLIKELY(x) (__builtin_expect (!!(x), 0)) |
optimization for code branching when condition is 'unlikely'. use within conditionals More... | |
#define | WB_LIKELY(x) (__builtin_expect (!!(x), 1)) |
optimization for code branching when condition is 'likely'. use within conditionals More... | |
#define | WB_UNUSED __attribute__((unused)) |
marks a variable as likely to be 'unused'. warning abatement. Place macro directly after the variable name More... | |
#define | WB_INTERNAL_ATOM_MIN_VAL 0x3f000000L |
The minimum 'internal' Atom value used by the toolkit. More... | |
#define | WB_SECURE_HASH_TIMEOUT 60000 |
#define __PACKED__ /* platform dependent; actual def must be a blank or doxygen barphs on it */ |
PACKED definition.
This assignes the 'packed' attribute; i.e. byte-level alignment. Not valid for Microsoft's compilers
Definition at line 521 of file platform_helper.h.
#define DECLARE_SORT_FUNCTION | ( | fn_name, | |
p0, | |||
p1, | |||
p2 | |||
) | int fn_name(void *p0, const void *p1, const void *p2) |
Wrapper to declare a sort function for QSORT_R.
fn_name | The function name |
p0 | The 'thunk' parameter passed in by QSORT_R |
p1 | The first compare parameter |
p2 | The second compare parameter |
Use this wrapper macro to properly declare a compare function for QSORT_R, similar to the following example:
this helps resolve the known platform differences in qsort_r() for POSIX systems
Definition at line 1356 of file platform_helper.h.
#define INVALID_HANDLE_VALUE |
INVALID HANDLE VALUE equivalent.
This definition generically refers to an INVALID HANDLE, more specifically a FILE or SOCKET handle on POSIX systems
Definition at line 293 of file platform_helper.h.
#define QSORT_R | ( | base, | |
nmemb, | |||
size, | |||
thunk, | |||
compar | |||
) | my_qsort_r((base),(nmemb),(size),(thunk),(compar)) |
Local implementation of qsort_r() for operating systems that do not have it.
base | Pointer to 'base' of items to sort |
nmemb | Number of members to sort |
size | Size of a single member (including any padding) |
thunk | The value to pass along as the first parameter to 'compar' |
compar | The comparison function, declared using DECLARE_SORT_FUNCTION |
Use this UNIVERSALLY whenever you need to use qsort_r(), as it is platform independent and deals with the incompatibilities associated with the BSD version and the Linux version, as well as implementing qsort_r() for systems that do not support it directly.
Definition at line 1372 of file platform_helper.h.
#define WB_INTERNAL_ATOM_MIN_VAL 0x3f000000L |
The minimum 'internal' Atom value used by the toolkit.
This is the minimum 'internal' Atom value that is used by the toolkit. Atoms that are allocated via XInternAtom() will have a value that is LESS than WB_INTERNAL_ATOM_MIN_VAL, and anything allocated via WBGetAtom() will have a value that is GREATER THAN OR EQUAL to WB_INTERNAL_ATOM_MIN_VAL.
Use of this constant to determine 'internal' from 'X11' Atoms is based on the source code for the Xorg X11 server, which uses the function 'MakeAtom()' (in 'dix/atom.c') to allocate new atoms. These values are assigned SEQUENTIALLY, beginning with 'XA_LAST_PREDEFINED+1' and continuing from there. A value of this magnitude allows for about 1 billion Atom allocations before 'hitting the limit'. (having that many atoms would negatively impact the X windows system)
In the future, it is possible that an Atom MAY have a randomly assigned value, or a value assigned that clashes with this definition. In such a case, a major re-write might be needed to correct for it.
NOTE: This value must NOT include any of the bits 'Or'd with an Atom within a menu, such as 'WBMENU_POPUP_HIGH_BIT' or 'WBMENU_DYNAMIC_HIGH_BIT'. Otherwise, THAT architecture would need to be modified as well.the minimum 'internal' Atom value used by the toolkit
Definition at line 391 of file platform_helper.h.
#define WB_LIKELY | ( | x | ) | (__builtin_expect (!!(x), 1)) |
optimization for code branching when condition is 'likely'. use within conditionals
Definition at line 342 of file platform_helper.h.
#define WB_SECURE_HASH_TIMEOUT 60000 |
'secure hash' maximum lifetime, in milliseconds
Definition at line 590 of file platform_helper.h.
#define WB_STRINGIZE | ( | X | ) | WB_STRINGIZE_INTERNAL(X) |
stringize a macro argument
X | A macro argument that you want substituted with a stringized version |
Use this to 'stringize' a parameter passed to a macro.
Definition at line 308 of file platform_helper.h.
#define WB_UNLIKELY | ( | x | ) | (__builtin_expect (!!(x), 0)) |
optimization for code branching when condition is 'unlikely'. use within conditionals
Definition at line 332 of file platform_helper.h.
#define WB_UNUSED __attribute__((unused)) |
marks a variable as likely to be 'unused'. warning abatement. Place macro directly after the variable name
NOTE: may also be used for function parameters. In some cases a callback function may have unused
parameters passed to it. Marking them with 'WB_UNUSED' helps prevent unnecessary compiler warnings.
Definition at line 364 of file platform_helper.h.