Top | ![]() |
![]() |
![]() |
![]() |
errorerror — Functions for allocating and manipulating lu_error structures. |
#define | LU_ERROR_CHECK() |
void | lu_error_new () |
void | lu_error_free () |
gboolean | lu_error_is_success () |
gboolean | lu_error_is_warning () |
gboolean | lu_error_is_error () |
const char * | lu_strerror () |
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.
A struct lu_error contains an error code and a human-readable, possibly
translated error string. The error string uses the encoding specified by
the LC_CTYPE
locale category.
#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, and calls abort()
on failure. This
macro is used by many internal functions to check that an error has not
already occurred when they are invoked.
void lu_error_new (struct lu_error **error
,enum lu_status code
,const char *fmt
,...
);
Creates a new lu_error structure.
void
lu_error_free (struct lu_error **error
);
Frees an lu_error structure.
error |
A pointer to a pointer to the structure to be freed. The pointer is
set to |
gboolean
lu_error_is_success (enum lu_status status
);
Check if the error code held by an error structure is a success code.
gboolean
lu_error_is_warning (enum lu_status status
);
Check if the error code held by an error structure is a warning code.
gboolean
lu_error_is_error (enum lu_status status
);
Check if the error code held by an error structure is an error code.
Program-readable error/status codes. Note that new ones may be added in the future, even for existing operations.
Success. |
||
Module disabled by configuration. |
||
Generic error. |
||
Not enough privileges. |
||
Access denied. |
||
Bad user/group name. |
||
Bad user/group id. |
||
User/group name in use. |
||
User/group id in use. |
||
Error manipulating terminal attributes. |
||
Error opening file. |
||
Error locking file. |
||
Error statting file. |
||
Error reading file. |
||
Error writing to file. |
||
Data not found in file. |
||
Internal initialization error. |
||
Error loading module. |
||
Error resolving symbol in module. |
||
Library/module version mismatch. |
||
Unlocking would make the password field empty. Since: 0.53 |
||
Invalid attribute value. Since: 0.56 |
||
Invalid module combination. Since: 0.57 |
||
User's home directory not owned by them. Since: 0.60 |
struct lu_error { enum lu_status code; char *string; };
Error and status information.
enum lu_status |
A program-readable error code. |
|
A human-readable, possibly translated error string. The error
string uses the encoding specified by the |