Internal API Reference - Macros
Desktop Apps Training - Policy Kit

Macros — Macros

 

Synopsis



#define KIT_BEGIN_DECLS
#define KIT_END_DECLS
typedef kit_bool_t;
void kit_print_backtrace (void);
#define kit_assert (expr)
#define kit_return_if_fail (expr)
#define kit_return_val_if_fail (expr,val)

Description

Various low-level macros.

 

Details

KIT_BEGIN_DECLS

#define             KIT_BEGIN_DECLS

C++ include header guard.

 


KIT_END_DECLS

#define             KIT_END_DECLS

C++ include header guard.

 


kit_bool_t

typedef int kit_bool_t;

A boolean, valid values are TRUE and FALSE.

 


kit_print_backtrace ()

void                kit_print_backtrace                 (void);

Print a back trace if built with -rdynamic or similar.

 


kit_assert()

#define             kit_assert(expr)

Debugging macro to terminate the application if the assertion fails. If the assertion fails (i.e. the expression is not true), an error message is logged and the application is terminated.

 

expr :

expression

kit_return_if_fail()

#define             kit_return_if_fail(expr)

Returns from the current function if the expression is not true. If the expression evaluates to FALSE, an error message is logged and the function returns. This can only be used in functions which do not return a value.

 

expr :

expression

kit_return_val_if_fail()

#define             kit_return_val_if_fail(expr,val)

Returns from the current function, returning the value val, if the expression is not true. If the expression evaluates to FALSE, an error message is logged and val is returned.

 

expr :

expression

val :

the value to return if the expression evaluates does not evaluate to TRUE