libvirt-glib-error

libvirt-glib-error

Synopsis

GError *            gvir_error_new                      (GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         ...);
GError *            gvir_error_new_literal              (GQuark domain,
                                                         gint code,
                                                         const gchar *message);
GError *            gvir_error_new_valist               (GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         va_list args);
void                gvir_set_error                      (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         ...);
void                gvir_set_error_literal              (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *message);
void                gvir_set_error_valist               (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         va_list args);

Description

Details

gvir_error_new ()

GError *            gvir_error_new                      (GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         ...);

Creates a new GError with the given domain and code, and a message formatted with format.

domain :

error domain

code :

error code

format :

printf()-style format for error message

Varargs :

parameters for message format

Returns :

a new GError

gvir_error_new_literal ()

GError *            gvir_error_new_literal              (GQuark domain,
                                                         gint code,
                                                         const gchar *message);

Creates a new GError; unlike gvir_error_new(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

domain :

error domain

code :

error code

message :

error message

Returns :

a new GError

gvir_error_new_valist ()

GError *            gvir_error_new_valist               (GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         va_list args);

Creates a new GError with the given domain and code, and a message formatted with format.

domain :

error domain

code :

error code

format :

printf()-style format for error message

args :

va_list of parameters for the message format

Returns :

a new GError

gvir_set_error ()

void                gvir_set_error                      (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         ...);

If error is NULL this does nothing. Otherwise it creates a new GError with the given domain and code, and a message formatted with format, and stores it in error.

error :

pointer to error location

domain :

error domain

code :

error code

format :

printf()-style format for error message

Varargs :

parameters for message format

gvir_set_error_literal ()

void                gvir_set_error_literal              (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *message);

If error is NULL this does nothing. Otherwise it creates a new GError and stores it in error; unlike gvir_set_error(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

error :

pointer to error location

domain :

error domain

code :

error code

message :

error message

gvir_set_error_valist ()

void                gvir_set_error_valist               (GError **error,
                                                         GQuark domain,
                                                         gint code,
                                                         const gchar *format,
                                                         va_list args);

If error is NULL this does nothing. Otherwise it creates a new GError with the given domain and code, and a message formatted with format, and stores it in error.

error :

pointer to error location

domain :

error domain

code :

error code

format :

printf()-style format for error message

args :

va_list of parameters for the message format