Remove complicated stuff from config_value.c that we're not using at the moment.
authorDana Jansens <danakj@orodu.net>
Mon, 8 Aug 2011 22:02:57 +0000 (18:02 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:56:02 +0000 (18:56 -0400)
openbox/config_value.c
openbox/config_value.h

index b871ec0c883b8ddad17a6a424960d55373ed4f1b..ef6db3bf82fca6630d4b42107d9a3d67d39b971a 100644 (file)
@@ -79,53 +79,6 @@ gboolean config_value_is_action_list(const ObConfigValue *v)
     return v->type == OB_CV_ACTION_LIST;
 }
 
-/**************************** pointer functions ****************************/
-
-void config_value_copy_ptr(ObConfigValue *v,
-                           ObConfigValueDataType type,
-                           ObConfigValueDataPtr p,
-                           const ObConfigValueEnum e[])
-{
-    switch (type) {
-    case OB_CONFIG_VALUE_STRING:
-        *p.string = config_value_string(v);
-        break;
-    case OB_CONFIG_VALUE_BOOLEAN:
-        *p.boolean = config_value_bool(v);
-        break;
-    case OB_CONFIG_VALUE_INTEGER:
-        *p.integer = config_value_int(v);
-        break;
-    case OB_CONFIG_VALUE_ENUM:
-        *p.enumeration = config_value_enum(v, e);
-        break;
-    case OB_CONFIG_VALUE_FRACTION: {
-        gint n, d;
-        config_value_fraction(v, &n, &d);
-        p.fraction->numer = n;
-        p.fraction->denom = d;
-        break;
-    }
-    case OB_CONFIG_VALUE_GRAVITY_COORD: {
-        GravityCoord c;
-        config_value_gravity_coord(v, &c);
-        *p.coord = c;
-        break;
-    }
-    case OB_CONFIG_VALUE_STRING_LIST: {
-        *p.list = config_value_string_list(v);
-        break;
-    }
-    case OB_CONFIG_VALUE_ACTIONLIST:
-        *p.actions = config_value_action_list(v);
-        break;
-    case NUM_OB_CONFIG_VALUE_TYPES:
-    default:
-        g_assert_not_reached();
-    }
-}
-
-
 /***************************** getter functions ****************************/
 
 const gchar* config_value_string(ObConfigValue *v)
@@ -149,19 +102,6 @@ guint config_value_int(ObConfigValue *v)
     s = v->v.string;
     return strtol(s, &s, 10);
 }
-guint config_value_enum(ObConfigValue *v, const ObConfigValueEnum choices[])
-{
-    const ObConfigValueEnum *e;
-
-    g_return_val_if_fail(v != NULL, (guint)-1);
-    g_return_val_if_fail(config_value_is_string(v), (guint)-1);
-    g_return_val_if_fail(choices != NULL, (guint)-1);
-
-    for (e = choices; e->name; ++e)
-        if (g_strcasecmp(v->v.string, e->name) == 0)
-            return e->value;
-    return (guint)-1;
-}
 void config_value_fraction(ObConfigValue *v, gint *numer, gint *denom)
 {
     gchar *s;
index d1123341bc0291ef173cb5b16165a83d51e582a1..d68dac9d1b7991298a56c96843067fd50ff5332f 100644 (file)
@@ -24,40 +24,6 @@ struct _GravityCoord;
 struct _ObActionList;
 
 typedef struct _ObConfigValue ObConfigValue;
-typedef struct _ObConfigValueEnum ObConfigValueEnum;
-
-struct _ObConfigValueEnum {
-    const gchar *name;
-    guint value;
-};
-
-typedef enum {
-    OB_CONFIG_VALUE_STRING,
-    OB_CONFIG_VALUE_BOOLEAN,
-    OB_CONFIG_VALUE_ENUM,
-    OB_CONFIG_VALUE_INTEGER,
-    OB_CONFIG_VALUE_FRACTION,
-    OB_CONFIG_VALUE_GRAVITY_COORD,
-    OB_CONFIG_VALUE_STRING_LIST,
-    OB_CONFIG_VALUE_ACTIONLIST,
-    NUM_OB_CONFIG_VALUE_TYPES
-} ObConfigValueDataType;
-
-/*! This holds a pointer to one of the possible types in ObConfigValueType. */
-typedef union _ObConfigValueDataPtr {
-    const gpointer *pointer; /*!< Generic pointer */
-    const gchar **string;
-    gboolean *boolean;
-    guint *integer;
-    guint *enumeration;
-    struct {
-        guint numer;
-        guint denom;
-    } *fraction;
-    struct _GravityCoord *coord;
-    const gchar *const**list;
-    struct _ObActionList **actions;
-} ObConfigValueDataPtr;
 
 void config_value_ref(ObConfigValue *v);
 void config_value_unref(ObConfigValue *v);
@@ -81,20 +47,11 @@ gboolean config_value_is_string(const ObConfigValue *v);
 gboolean config_value_is_string_list(const ObConfigValue *v);
 gboolean config_value_is_action_list(const ObConfigValue *v);
 
-/*! Copies the data inside @v to the destination that the pointer @p is
-  pointing to. */
-void config_value_copy_ptr(ObConfigValue *v,
-                           ObConfigValueDataType type,
-                           ObConfigValueDataPtr p,
-                           const ObConfigValueEnum e[]);
-
 /* These ones are valid on a string value */
 
 const gchar* config_value_string(ObConfigValue *v);
 gboolean config_value_bool(ObConfigValue *v);
 guint config_value_int(ObConfigValue *v);
-/*! returns (guint)-1 if an error */
-guint config_value_enum(ObConfigValue *v, const ObConfigValueEnum e[]);
 void config_value_fraction(ObConfigValue *v, gint *numer, gint *denom);
 void config_value_gravity_coord(ObConfigValue *v, struct _GravityCoord *c);