error

Name

error -- Functions for allocating and manipulating lu_error structures.

Synopsis



#define     LU_ERROR_CHECK                  (err_p_p)
void        lu_error_new                    (lu_error_t **error,
                                             lu_status_t code,
                                             const char *fmt,
                                             ...);
void        lu_error_free                   (lu_error_t **error);
gboolean    lu_error_is_success             (lu_status_t status);
gboolean    lu_error_is_warning             (lu_status_t status);
gboolean    lu_error_is_error               (lu_status_t status);
const char* lu_strerror                     (lu_error_t *error);

Description

error.h includes declarations for allocating and manipulating lu_error structures. These structures hold error and status information passed between libuser, its modules, and applications.

Details

LU_ERROR_CHECK()

#define     LU_ERROR_CHECK(err_p_p)

Checks that the given pointer to a pointer to a struct does not already point to a valid lu_error structure. This macro is used by many internal functions to check that an error has not already occurred when they are invoked.

err_p_p :

A pointer to a struct lu_error * which will be checked. If there


lu_error_new ()

void        lu_error_new                    (lu_error_t **error,
                                             lu_status_t code,
                                             const char *fmt,
                                             ...);

error :

A pointer to a struct lu_error * which will hold the newly-created error structure.

code :

fmt :

... :


lu_error_free ()

void        lu_error_free                   (lu_error_t **error);

Frees an lu_error structure.

error :

A pointer to a pointer to the structure to be freed. The pointer is set to NULL after the error is freed.


lu_error_is_success ()

gboolean    lu_error_is_success             (lu_status_t status);

Check if the error code held by an error structure is a success code.

status :

Returns :

a gboolean indicating whether or not the error is a success code.


lu_error_is_warning ()

gboolean    lu_error_is_warning             (lu_status_t status);

Check if the error code held by an error structure is a warning code.

status :

Returns :

a gboolean indicating whether or not the error is a warning code.


lu_error_is_error ()

gboolean    lu_error_is_error               (lu_status_t status);

Check if the error code held by an error structure is an error code.

status :

Returns :

a gboolean indicating whether or not the error is an error code.


lu_strerror ()

const char* lu_strerror                     (lu_error_t *error);

error :

Returns :