common.h 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#include <glib.h>

typedef struct
{
  guint16 le;
} dfi_uint16;

typedef struct
{
  guint32 le;
} dfi_uint32;

typedef struct
{
  dfi_uint32 offset;
} dfi_pointer;

typedef struct
{
  dfi_uint32 offset;
} dfi_string;

typedef dfi_uint16 dfi_id;

struct dfi_id_list
{
  dfi_uint16 n_ids;
  dfi_uint16 ids[1];
};

struct dfi_string_list
{
  dfi_uint16 n_strings;
  dfi_uint16 padding;
  dfi_string strings[1];
};

struct dfi_text_index_item
{
  dfi_string key;

  union
    {
      dfi_id      pair[2];
      dfi_pointer pointer;
    } value;
};

struct dfi_text_index
{
  dfi_uint32                 n_items;
  struct dfi_text_index_item items[1];
};

struct dfi_keyfile
{
  dfi_uint16 n_groups;
  dfi_uint16 n_items;
};

struct dfi_keyfile_group
{
  dfi_id     name_id;
  dfi_uint16 items_index;
};

struct dfi_keyfile_item
{
  dfi_id     key_id;
  dfi_id     locale_id;
  dfi_string value;
};

struct dfi_pointer_array
{
  dfi_pointer associated_string_list;
  dfi_pointer pointers[1];
};

struct dfi_header
{
  dfi_pointer app_names;       /* string list */
  dfi_pointer key_names;       /* string list */
  dfi_pointer locale_names;    /* string list */
  dfi_pointer group_names;     /* string list */

  dfi_pointer implementors;    /* pointer array of id lists, associated with group_names */
  dfi_pointer text_indexes;    /* pointer array of text indexes, associated with locale_names */
  dfi_pointer desktop_files;   /* pointer array of desktop files, associated with app_names */

  dfi_pointer mime_types;      /* text index */
};