![]() |
![]() |
![]() |
liblangtag Documentation | ![]() |
---|---|---|---|---|
Top | Description |
void lt_error_clear (lt_error_t *error
); lt_bool_t lt_error_is_set (lt_error_t *error
,lt_error_type_t type
); lt_error_t * lt_error_new (void
); void lt_error_print (lt_error_t *error
,lt_error_type_t type
); lt_error_t * lt_error_ref (lt_error_t *error
); lt_error_t * lt_error_set (lt_error_t **error
,lt_error_type_t type
,const char *message
); lt_error_t; enum lt_error_type_t; void lt_error_unref (lt_error_t *error
);
void lt_error_clear (lt_error_t *error
);
Clean up all of the errors in error
.
|
a lt_error_t |
lt_bool_t lt_error_is_set (lt_error_t *error
,lt_error_type_t type
);
Checks if error
contains type
of errors. if LT_ERR_ANY is set to type
,
all the types of the errors are targeted. otherwise the result is filtered
out by type
.
|
a lt_error_t |
|
a lt_error_type_t |
Returns : |
TRUE if any, otherwise FALSE
|
lt_error_t * lt_error_new (void
);
Creates lt_error_t object. this function is protected and not supposed
to use in applications directly. Use lt_error_set()
.
Returns : |
a newly allocated lt_error_t. it has to be freed
with lt_error_unref() . [transfer full]
|
void lt_error_print (lt_error_t *error
,lt_error_type_t type
);
Output the error messages in error
according to type
.
|
a lt_error_t |
|
a lt_error_type_t |
lt_error_t * lt_error_ref (lt_error_t *error
);
Inscreases the reference count of error
.
|
a lt_error_t |
Returns : |
the same error object. [transfer none]
|
lt_error_t * lt_error_set (lt_error_t **error
,lt_error_type_t type
,const char *message
);
Sets the error into error
according to the given parameters.
|
a return location for a lt_error_t |
|
a lt_error_type_t |
|
the string format to output the error messages |
Returns : |
an instance of lt_error_t |
typedef struct _lt_error_t lt_error_t;
All the fields in the lt_error_t structure are private to the lt_error_t implementation.
enum lt_error_type_t { LT_ERR_UNKNOWN = -1, LT_ERR_SUCCESS = 0, LT_ERR_OOM, LT_ERR_FAIL_ON_XML, LT_ERR_EOT, LT_ERR_FAIL_ON_SCANNER, LT_ERR_NO_TAG, LT_ERR_INVALID, LT_ERR_ANY };
Error code used in this library.
unknown error happened. | |
an operation is succeeded. | |
Out of memory occurred. | |
an error happened in libxml2. | |
No tokens to scan. | |
an error happened in the scanner. | |
No tags to process. | |
Invalid operation. | |
No real error, but just a flag to query all of errors or ask if any errors happen |
void lt_error_unref (lt_error_t *error
);
Decreases the reference count of error
. when its reference count
drops to 0, the object is finalized (i.e. its memory is freed).
|
a lt_error_t |