![]() |
![]() |
![]() |
PolicyKit Library Reference Manual | ![]() |
---|---|---|---|---|
enum PolKitErrorCode; struct PolKitError; PolKitErrorCode polkit_error_get_error_code (PolKitError *error); const char* polkit_error_get_error_message (PolKitError *error); void polkit_error_free (PolKitError *error); void polkit_error_set_error (PolKitError **error, PolKitErrorCode error_code, const char *format, ...);
typedef enum { POLKIT_ERROR_OUT_OF_MEMORY, POLKIT_ERROR_POLICY_FILE_INVALID } PolKitErrorCode;
Error codes returned by PolicyKit
PolKitErrorCode polkit_error_get_error_code (PolKitError *error);
Returns the error code.
error : |
the error object |
Returns : | A value from the PolKitErrorCode enumeration. |
const char* polkit_error_get_error_message (PolKitError *error);
Get the error message.
error : |
the error object |
Returns : | A string describing the error. Caller shall not free this string. |
void polkit_error_set_error (PolKitError **error, PolKitErrorCode error_code, const char *format, ...);
Sets an error. If OOM, the error will be set to a pre-allocated OOM error.
error : |
the error object |
error_code : |
A value from the PolKitErrorCode enumeration. |
format : |
printf style formatting string |
... : |
printf style arguments |