gwymacros

gwymacros — Utility macros.

Synopsis




#define     _                               (x)
#define     gwy_object_unref                (obj)
#define     GWY_SWAP                        (t, x, y)
#define     G_STRFUNC
#define     gwy_debug                       (format...)
void        gwy_debug_gnu                   (const gchar *domain,
                                             const gchar *fileline,
                                             const gchar *funcname,
                                             const gchar *format,
                                             ...);

Description

Details

_()

#define _(x) (x)

x:

gwy_object_unref()

#define     gwy_object_unref(obj)

If obj is not NULL, unreferences obj. In all cases sets obj to NULL.

If the object reference count is greater than one, assure it should be referenced elsewhere, otherwise it leaks memory.

obj: A pointer to GObject or NULL.

GWY_SWAP()

#define     GWY_SWAP(t, x, y)

Swaps two variables (more precisely lhs and rhs expressions) of type t in a single statement.

t: A C type.
x: A variable of type t to swap with x.
y: A variable of type t to swap with y.

G_STRFUNC

#define     G_STRFUNC


gwy_debug()

#define     gwy_debug(format...)

Prints a debugging message.

Does nothing if compiled without DEBUG defined.

format...: A format string followed by stuff to print.

gwy_debug_gnu ()

void        gwy_debug_gnu                   (const gchar *domain,
                                             const gchar *fileline,
                                             const gchar *funcname,
                                             const gchar *format,
                                             ...);

Print a debugging message.

To be used via gwy_debug(), should not be used directly.

domain: Log domain.
fileline: File and line info.
funcname: Function name.
format: Message format.
...: Message parameters.