## xsettings-common

xsettings-common

## Synopsis

    struct              XSettingsBuffer;
    struct              XSettingsColor;
    struct              XSettingsList;
    struct              XSettingsSetting;
    enum                XSettingsType;
    enum                XSettingsResult;
    XSettingsSetting *  xsettings_setting_copy              (XSettingsSetting *setting);
    void                xsettings_setting_free              (XSettingsSetting *setting);
    int                 xsettings_setting_equal             (XSettingsSetting *setting_a,
                                                             XSettingsSetting *setting_b);
    void                xsettings_list_free                 (XSettingsList *list);
    XSettingsList *     xsettings_list_copy                 (XSettingsList *list);
    XSettingsResult     xsettings_list_insert               (XSettingsList **list,
                                                             XSettingsSetting *setting);
    XSettingsSetting *  xsettings_list_lookup               (XSettingsList *list,
                                                             const char *name);
    XSettingsResult     xsettings_list_delete               (XSettingsList **list,
                                                             const char *name);
    char                xsettings_byte_order                (void);
    #define             XSETTINGS_PAD                       (n,
                                                             m)

## Description

## Details

### struct XSettingsBuffer

    struct XSettingsBuffer {
      char byte_order;
      size_t len;
      unsigned char *data;
      unsigned char *pos;
    };

### struct XSettingsColor

    struct XSettingsColor {
      unsigned short red, green, blue, alpha;
    };

### struct XSettingsList

    struct XSettingsList {
      XSettingsSetting *setting;
      XSettingsList *next;
    };

### struct XSettingsSetting

    struct XSettingsSetting {
      char *name;
      XSettingsType type;

      union {
        int v_int;
        char *v_string;
        XSettingsColor v_color;
      } data;

      unsigned long last_change_serial;
    };

### enum XSettingsType

    typedef enum {
      XSETTINGS_TYPE_INT     = 0,
      XSETTINGS_TYPE_STRING  = 1,
      XSETTINGS_TYPE_COLOR   = 2,
      XSETTINGS_TYPE_NONE    = 0xff
    } XSettingsType;

`XSETTINGS_TYPE_INT` |
`XSETTINGS_TYPE_STRING` |
`XSETTINGS_TYPE_COLOR` |
`XSETTINGS_TYPE_NONE` |

### enum XSettingsResult

    typedef enum {
      XSETTINGS_SUCCESS,
      XSETTINGS_NO_MEM,
      XSETTINGS_ACCESS,
      XSETTINGS_FAILED,
      XSETTINGS_NO_ENTRY,
      XSETTINGS_DUPLICATE_ENTRY
    } XSettingsResult;

`XSETTINGS_SUCCESS` |
`XSETTINGS_NO_MEM` |
`XSETTINGS_ACCESS` |
`XSETTINGS_FAILED` |
`XSETTINGS_NO_ENTRY` |
`XSETTINGS_DUPLICATE_ENTRY` |

### xsettings_setting_copy ()

    XSettingsSetting *  xsettings_setting_copy              (XSettingsSetting *setting);

### xsettings_setting_free ()

    void                xsettings_setting_free              (XSettingsSetting *setting);

### xsettings_setting_equal ()

    int                 xsettings_setting_equal             (XSettingsSetting *setting_a,
                                                             XSettingsSetting *setting_b);

### xsettings_list_free ()

    void                xsettings_list_free                 (XSettingsList *list);

### xsettings_list_copy ()

    XSettingsList *     xsettings_list_copy                 (XSettingsList *list);

### xsettings_list_insert ()

    XSettingsResult     xsettings_list_insert               (XSettingsList **list,
                                                             XSettingsSetting *setting);

### xsettings_list_lookup ()

    XSettingsSetting *  xsettings_list_lookup               (XSettingsList *list,
                                                             const char *name);

### xsettings_list_delete ()

    XSettingsResult     xsettings_list_delete               (XSettingsList **list,
                                                             const char *name);

### xsettings_byte_order ()

    char                xsettings_byte_order                (void);

### XSETTINGS_PAD()

    #define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))