1
/* readbinaryplist.h -- header to read preference files
3
Roger B. Dannenberg, Jun 2008
11
#define MAX_KEY_SIZE 256
15
// Object tags (high nybble)
16
kTAG_SIMPLE = 0x00, // Null, true, false, filler, or invalid
21
kTAG_ASCIISTRING = 0x50,
22
kTAG_UNICODESTRING = 0x60,
25
kTAG_DICTIONARY = 0xD0,
27
// "simple" object values
33
kVALUE_FULLDATETAG = 0x33 // Dates are tagged with a whole byte.
40
} pldata_node, *pldata_ptr;
44
struct value_struct **array;
46
} array_node, *array_ptr;
49
// a dict_node is a list of <key, value> pairs
50
typedef struct dict_struct {
51
struct value_struct *key;
52
struct value_struct *value;
53
struct dict_struct *next;
54
} dict_node, *dict_ptr;
57
// an value_node is a value with a tag telling the type
58
typedef struct value_struct {
67
struct dict_struct *dict;
69
} value_node, *value_ptr;
72
value_ptr bplist_read_file(char *filename);
73
value_ptr bplist_read_user_pref(char *filename);
74
value_ptr bplist_read_system_pref(char *filename);
75
void bplist_free_data();
77
/*************** functions for accessing values ****************/
79
char *value_get_asciistring(value_ptr v);
80
value_ptr value_dict_lookup_using_string(value_ptr v, char *key);
81
value_ptr value_dict_lookup_using_path(value_ptr v, char *path);
83
/*************** functions for debugging ***************/
85
void plist_print(value_ptr v);