core: add NM_UTILS_ERROR

This commit is contained in:
Thomas Haller 2016-04-17 12:57:44 +02:00
parent 383997306d
commit 9a127cd424
2 changed files with 23 additions and 0 deletions

View file

@ -59,6 +59,8 @@
#define CLOCK_BOOTTIME 7
#endif
G_DEFINE_QUARK (nm-utils-error-quark, nm_utils_error)
G_STATIC_ASSERT (sizeof (NMUtilsTestFlags) <= sizeof (int));
int _nm_utils_testing = 0;

View file

@ -232,4 +232,25 @@ gboolean nm_utils_get_testing_initialized (void);
NMUtilsTestFlags nm_utils_get_testing (void);
void _nm_utils_set_testing (NMUtilsTestFlags flags);
/*****************************************************************************/
/**
* NMUtilsError:
* @NM_UTILS_ERROR_UNKNOWN: unknown or unclassified error
* @NM_UTILS_ERROR_CANCELLED_DISPOSING: when disposing an object that has
* pending aynchronous operations, the operation is cancelled with this
* error reason. Depending on the usage, this might indicate a bug because
* usually the target object should stay alive as long as there are pending
* operations.
*/
typedef enum {
NM_UTILS_ERROR_UNKNOWN = 0, /*< nick=Unknown >*/
NM_UTILS_ERROR_CANCELLED_DISPOSING, /*< nick=CancelledDisposing >*/
} NMUtilsError;
#define NM_UTILS_ERROR (nm_utils_error_quark ())
GQuark nm_utils_error_quark (void);
/*****************************************************************************/
#endif /* __NETWORKMANAGER_UTILS_H__ */