5 #define PRF_QP_STRING 3
10 typedef void (*PrefEvalFunc
)(StrBuf
*Preference
, long lvalue
);
12 void _RegisterPreference(const char *Setting
, long SettingLen
,
16 const char *OnLoadName
);
18 #define RegisterPreference(a, b, c, d) _RegisterPreference(a, sizeof(a) -1, b, c, d, #d)
20 void load_preferences(void);
21 void save_preferences(void);
22 #define get_preference(a, b) get_PREFERENCE(a, sizeof(a) - 1, b)
23 #define get_pref(a, b) get_PREFERENCE(SKEY(a), b)
24 int get_PREFERENCE(const char *key
, size_t keylen
, StrBuf
**value
);
25 #define set_preference(a, b, c) set_PREFERENCE(a, sizeof(a) - 1, b, c)
26 #define set_pref(a, b, c) set_PREFERENCE(SKEY(a), b, c)
27 void set_PREFERENCE(const char *key
, size_t keylen
, StrBuf
*value
, int save_to_server
);
29 #define get_pref_long(a, b, c) get_PREF_LONG(a, sizeof(a) - 1, b, c)
30 int get_PREF_LONG(const char *key
, size_t keylen
, long *value
, long Default
);
31 #define set_pref_long(a, b, c) set_PREF_LONG(a, sizeof(a) - 1, b, c)
32 void set_PREF_LONG(const char *key
, size_t keylen
, long value
, int save_to_server
);
34 #define get_pref_yesno(a, b, c) get_PREF_YESNO(a, sizeof(a) - 1, b, c)
35 int get_PREF_YESNO(const char *key
, size_t keylen
, int *value
, int Default
);
36 #define set_pref_yesno(a, b, c) set_PREF_YESNO(a, sizeof(a) - 1, b, c)
37 void set_PREF_YESNO(const char *key
, size_t keylen
, long value
, int save_to_server
);
39 #define get_room_pref(a) get_ROOM_PREFS(a, sizeof(a) - 1)
40 StrBuf
*get_ROOM_PREFS(const char *key
, size_t keylen
);
42 #define set_room_pref(a, b, c) set_ROOM_PREFS(a, sizeof(a) - 1, b, c)
43 void set_ROOM_PREFS(const char *key
, size_t keylen
, StrBuf
*value
, int save_to_server
);
46 #define get_x_pref(a, b) get_ROOM_PREFS(a, sizeof(a) - 1, b, sizeof(b) - 1)
47 const StrBuf
*get_X_PREFS(const char *key
, size_t keylen
,
48 const char *xkey
, size_t xkeylen
);
50 #define set_x_pref(a, b, c) set_ROOM_PREFS(a, sizeof(a) - 1, b, sizeof(b) - 1, c, d)
51 void set_X_PREFS(const char *key
, size_t keylen
, const char *xkey
, size_t xkeylen
, StrBuf
*value
, int save_to_server
);