GLib Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#include <glib.h> #define GLIB_MAJOR_VERSION #define GLIB_MINOR_VERSION #define GLIB_MICRO_VERSION #define GLIB_CHECK_VERSION (major,minor,micro) #define G_DIR_SEPARATOR #define G_DIR_SEPARATOR_S #define G_SEARCHPATH_SEPARATOR #define G_SEARCHPATH_SEPARATOR_S #define TRUE #define FALSE #define NULL #define MIN (a, b) #define MAX (a, b) #define ABS (a) #define CLAMP (x, low, high) #define G_STRUCT_MEMBER (member_type, struct_p, struct_offset) #define G_STRUCT_MEMBER_P (struct_p, struct_offset) #define G_STRUCT_OFFSET (struct_type, member) |
#define GLIB_CHECK_VERSION(major,minor,micro) |
Checks the version of the GLib library. It returns TRUE if the GLib library is the same or newer than the given version.
#define G_DIR_SEPARATOR |
The directory separator character. This is '/' on Unix machines and '\' under Windows.
#define G_DIR_SEPARATOR_S |
The directory separator as a string. This is "/" on Unix machines and "\" under Windows.
#define G_SEARCHPATH_SEPARATOR |
The search path separator character. This is ':' on Unix machines and ';' under Windows.
#define G_SEARCHPATH_SEPARATOR_S |
The search path separator as a string. This is ":" on Unix machines and ";" under Windows.
#define ABS(a) (((a) < 0) ? -(a) : (a)) |
Calculates the absolute value of a. The absolute value is simply the number with any negative sign taken away.
For example,
ABS(-10) is 10.
ABS(10) is also 10.
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) |
Ensures that x is between the limits set by low and high.
For example,
CLAMP(5, 10, 15) is 10.
CLAMP(15, 5, 10) is 10.
CLAMP(20, 15, 25) is 20.
#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) |
Returns a member of a structure at a given offset, using the given type.
#define G_STRUCT_MEMBER_P(struct_p, struct_offset) |
Returns an untyped pointer to a given offset of a struct.