Redesigned the WMUD_*_ERROR GQuarks
They are now conform to GLib's method (which is more secure I think) Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
parent
8835cb258b
commit
4e659a9ef7
@ -33,12 +33,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* WMUD_CONFIG_ERROR:
|
|
||||||
*
|
|
||||||
* the GQuark for the config error GError
|
|
||||||
*/
|
|
||||||
GQuark WMUD_CONFIG_ERROR = 0;
|
|
||||||
/**
|
/**
|
||||||
* active_config:
|
* active_config:
|
||||||
*
|
*
|
||||||
@ -46,6 +40,12 @@ GQuark WMUD_CONFIG_ERROR = 0;
|
|||||||
*/
|
*/
|
||||||
ConfigData *active_config = NULL;
|
ConfigData *active_config = NULL;
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
wmud_config_error_quark()
|
||||||
|
{
|
||||||
|
return g_quark_from_static_string("wmud-config-error");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmud_configdata_free:
|
* wmud_configdata_free:
|
||||||
* @config_data: pointer to the ConfigData struct to free
|
* @config_data: pointer to the ConfigData struct to free
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
extern GQuark WMUD_CONFIG_ERROR;
|
#define WMUD_CONFIG_ERROR wmud_config_error_quark()
|
||||||
|
GQuark wmud_config_error_quark();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmudConfigError:
|
* wmudConfigError:
|
||||||
|
12
wmud/db.c
12
wmud/db.c
@ -36,14 +36,14 @@
|
|||||||
* different (e.g MySQL or PostgreSQL) database.
|
* different (e.g MySQL or PostgreSQL) database.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* WMUD_DB_ERROR:
|
|
||||||
*
|
|
||||||
* the GQuark for the database error GError
|
|
||||||
*/
|
|
||||||
GQuark WMUD_DB_ERROR = 0;
|
|
||||||
static sqlite3 *dbh = NULL;
|
static sqlite3 *dbh = NULL;
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
wmud_db_error_quark()
|
||||||
|
{
|
||||||
|
return g_quark_from_static_string("wmud-db-error");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmud_db_init:
|
* wmud_db_init:
|
||||||
* @err: a GError to put error messages in it
|
* @err: a GError to put error messages in it
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
|
|
||||||
#include "wmud-types.h"
|
#include "wmud-types.h"
|
||||||
|
|
||||||
extern GQuark WMUD_DB_ERROR;
|
#define WMUD_DB_ERROR wmud_db_error_quark()
|
||||||
|
GQuark wmud_db_error_quark();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmudDbError:
|
* wmudDbError:
|
||||||
|
@ -45,6 +45,12 @@ static wmudCommand command_list[] = {
|
|||||||
{ NULL, NULL },
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GQuark
|
||||||
|
wmud_interpreter_error_quark()
|
||||||
|
{
|
||||||
|
return g_quark_from_static_string("wmud-interpreter-error");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destroy_string:
|
* destroy_string:
|
||||||
* @string: a GString to destroy
|
* @string: a GString to destroy
|
||||||
|
@ -51,7 +51,8 @@ typedef struct _wmudCommand {
|
|||||||
wmudCommandFunc commandFunc;
|
wmudCommandFunc commandFunc;
|
||||||
} wmudCommand;
|
} wmudCommand;
|
||||||
|
|
||||||
GQuark WMUD_INTERPRETER_ERROR;
|
#define WMUD_INTERPRETER_ERROR wmud_interpreter_error_quark()
|
||||||
|
GQuark wmud_interpreter_error_quark();
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
WMUD_INTERPRETER_ERROR_DUPCMD
|
WMUD_INTERPRETER_ERROR_DUPCMD
|
||||||
|
@ -121,10 +121,6 @@ debug_context(char *file, int line)
|
|||||||
void
|
void
|
||||||
wmud_type_init(void)
|
wmud_type_init(void)
|
||||||
{
|
{
|
||||||
WMUD_CONFIG_ERROR = g_quark_from_string("wmud-config-error");
|
|
||||||
WMUD_DB_ERROR = g_quark_from_string("wmud-db-error");
|
|
||||||
WMUD_INTERPRETER_ERROR = g_quark_from_string("wmud-interpreter-error");
|
|
||||||
WMUD_WORLD_ERROR = g_quark_from_string("wmud-world-error");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,11 @@ struct dirCheckData {
|
|||||||
gboolean sane;
|
gboolean sane;
|
||||||
};
|
};
|
||||||
|
|
||||||
GQuark WMUD_WORLD_ERROR = 0;
|
GQuark
|
||||||
|
wmud_world_error_quark()
|
||||||
|
{
|
||||||
|
return g_quark_from_static_string("wmud-world-error");
|
||||||
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
check_plane_dups2(wmudPlane *plane, gchar *name)
|
check_plane_dups2(wmudPlane *plane, gchar *name)
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
extern GQuark WMUD_WORLD_ERROR;
|
#define WMUD_WORLD_ERROR wmud_world_error_quark()
|
||||||
|
GQuark wmud_world_error_quark();
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
WMUD_WORLD_ERROR_DUPPLANE,
|
WMUD_WORLD_ERROR_DUPPLANE,
|
||||||
WMUD_WORLD_ERROR_DUPPLANET,
|
WMUD_WORLD_ERROR_DUPPLANET,
|
||||||
|
Loading…
Reference in New Issue
Block a user