author | franky |
Sat, 18 May 2019 20:44:01 +0200 | |
changeset 2339 | 7f11a567d236 |
parent 2309 | e00ae0763468 |
permissions | -rw-r--r-- |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1598
diff
changeset
|
1 |
#ifndef __MCABBER_SETTINGS_H__ |
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1598
diff
changeset
|
2 |
#define __MCABBER_SETTINGS_H__ 1 |
279 | 3 |
|
498
879ffddc13b0
Suppress a compilation warning
Mikael Berthe <mikael@lilotux.net>
parents:
364
diff
changeset
|
4 |
#include <ctype.h> |
279 | 5 |
#include <glib.h> |
6 |
||
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1598
diff
changeset
|
7 |
#include <mcabber/roster.h> |
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1598
diff
changeset
|
8 |
#include <mcabber/config.h> |
294
871e53769084
Allow one status message per Jabber status
Mikael Berthe <mikael@lilotux.net>
parents:
292
diff
changeset
|
9 |
|
498
879ffddc13b0
Suppress a compilation warning
Mikael Berthe <mikael@lilotux.net>
parents:
364
diff
changeset
|
10 |
#ifndef isblank |
292
96917f04c841
Define isblank() when C99 is not used
Mikael Berthe <mikael@lilotux.net>
parents:
288
diff
changeset
|
11 |
# define isblank(c) ((c) == 0x20 || (c) == 0x09) |
96917f04c841
Define isblank() when C99 is not used
Mikael Berthe <mikael@lilotux.net>
parents:
288
diff
changeset
|
12 |
#endif |
96917f04c841
Define isblank() when C99 is not used
Mikael Berthe <mikael@lilotux.net>
parents:
288
diff
changeset
|
13 |
|
294
871e53769084
Allow one status message per Jabber status
Mikael Berthe <mikael@lilotux.net>
parents:
292
diff
changeset
|
14 |
|
279 | 15 |
#define SETTINGS_TYPE_OPTION 1 |
16 |
#define SETTINGS_TYPE_ALIAS 2 |
|
17 |
#define SETTINGS_TYPE_BINDING 3 |
|
1299
3b338a5c01fc
OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1197
diff
changeset
|
18 |
#ifdef HAVE_LIBOTR |
3b338a5c01fc
OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1197
diff
changeset
|
19 |
#define SETTINGS_TYPE_OTR 4 |
3b338a5c01fc
OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1197
diff
changeset
|
20 |
#endif |
279 | 21 |
|
22 |
#define settings_opt_get(k) settings_get(SETTINGS_TYPE_OPTION, k) |
|
23 |
#define settings_opt_get_int(k) settings_get_int(SETTINGS_TYPE_OPTION, k) |
|
24 |
||
2309
e00ae0763468
Do not use litteral command char (':', '/')
Mikael Berthe <mikael@lilotux.net>
parents:
2204
diff
changeset
|
25 |
#define COMMAND_CHAR (vi_mode ? ':' : '/') |
e00ae0763468
Do not use litteral command char (':', '/')
Mikael Berthe <mikael@lilotux.net>
parents:
2204
diff
changeset
|
26 |
#define COMMAND_CHARSTR (vi_mode ? ":" : "/") |
e00ae0763468
Do not use litteral command char (':', '/')
Mikael Berthe <mikael@lilotux.net>
parents:
2204
diff
changeset
|
27 |
#define VI_SEARCH_COMMAND_CHAR '/' |
e00ae0763468
Do not use litteral command char (':', '/')
Mikael Berthe <mikael@lilotux.net>
parents:
2204
diff
changeset
|
28 |
|
e00ae0763468
Do not use litteral command char (':', '/')
Mikael Berthe <mikael@lilotux.net>
parents:
2204
diff
changeset
|
29 |
extern gboolean vi_mode; |
967 | 30 |
|
1673 | 31 |
typedef gchar *(*settings_guard_t)(const gchar *key, const gchar *new_value); |
32 |
||
1065
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
33 |
void settings_init(void); |
2339 | 34 |
void settings_free(void); |
2204
ccd4ffa41a1b
Use XDG configuration directory if a config file exists
Mikael Berthe <mikael@lilotux.net>
parents:
1811
diff
changeset
|
35 |
const gchar *settings_get_mcabber_config_dir(void); |
1192 | 36 |
int cfg_read_file(char *filename, guint mainfile); |
1074
b2fc694a8228
Fix a few memory leaks after calls to parse_assigment()
Mikael Berthe <mikael@lilotux.net>
parents:
1070
diff
changeset
|
37 |
guint parse_assigment(gchar *assignment, gchar **pkey, gchar **pval); |
1768
d80a9e32ab1a
Refuse to replace existing guards
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1673
diff
changeset
|
38 |
gboolean settings_set_guard(const gchar *key, settings_guard_t guard); |
1673 | 39 |
void settings_del_guard(const gchar *key); |
40 |
void settings_opt_set_raw(const gchar *key, const gchar *value); |
|
281
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
280
diff
changeset
|
41 |
void settings_set(guint type, const gchar *key, const gchar *value); |
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
280
diff
changeset
|
42 |
void settings_del(guint type, const gchar *key); |
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
280
diff
changeset
|
43 |
const gchar *settings_get(guint type, const gchar *key); |
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
280
diff
changeset
|
44 |
int settings_get_int(guint type, const gchar *key); |
294
871e53769084
Allow one status message per Jabber status
Mikael Berthe <mikael@lilotux.net>
parents:
292
diff
changeset
|
45 |
const gchar *settings_get_status_msg(enum imstatus status); |
867
7f056c566569
Commands /alias & /bind list the key bindings and aliases
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
46 |
void settings_foreach(guint type, |
1070
9eaacc0ad3a2
Use a hash for settings
Mikael Berthe <mikael@lilotux.net>
parents:
1065
diff
changeset
|
47 |
void (*pfunc)(char *k, char *v, void *param), |
867
7f056c566569
Commands /alias & /bind list the key bindings and aliases
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
48 |
void *param); |
279 | 49 |
|
1065
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
50 |
void settings_pgp_setdisabled(const char *bjid, guint value); |
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
51 |
guint settings_pgp_getdisabled(const char *bjid); |
1197 | 52 |
void settings_pgp_setforce(const char *bjid, guint value); |
53 |
guint settings_pgp_getforce(const char *bjid); |
|
1065
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
54 |
void settings_pgp_setkeyid(const char *bjid, const char *keyid); |
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
55 |
const char *settings_pgp_getkeyid(const char *bjid); |
230dca34dbea
Extand pgp_data structure
Mikael Berthe <mikael@lilotux.net>
parents:
1004
diff
changeset
|
56 |
|
1301
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
57 |
#ifdef HAVE_LIBOTR |
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
58 |
guint settings_otr_getpolicy(const char *bjid); |
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
59 |
void settings_otr_setpolicy(const char *bjid, guint value); |
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
60 |
#endif |
37b41ed9ed35
Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
1299
diff
changeset
|
61 |
|
1141
5be2408a6534
Add option "max_history_blocks"
Mikael Berthe <mikael@lilotux.net>
parents:
1074
diff
changeset
|
62 |
guint get_max_history_blocks(void); |
5be2408a6534
Add option "max_history_blocks"
Mikael Berthe <mikael@lilotux.net>
parents:
1074
diff
changeset
|
63 |
|
1395
d431cd75eb53
Use bookmarked nickname when manually joining a room
Mikael Berthe <mikael@lilotux.net>
parents:
1301
diff
changeset
|
64 |
char *default_muc_nickname(const char *roomid); |
1004
b57a01ffeed6
Use existing conference bookmarks
Mikael Berthe <mikael@lilotux.net>
parents:
967
diff
changeset
|
65 |
|
288 | 66 |
const gchar *isbound(int key); |
67 |
||
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1598
diff
changeset
|
68 |
#endif /* __MCABBER_SETTINGS_H__ */ |
279 | 69 |
|
1811 | 70 |
/* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ |