1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Rename plugins settings functions

This commit is contained in:
James Booth 2016-08-07 00:16:57 +01:00
parent 7bc160c24e
commit efeb2fcfcd
8 changed files with 104 additions and 104 deletions

View File

@ -399,33 +399,33 @@ api_send_stanza(const char *const stanza)
}
gboolean
api_settings_get_boolean(const char *const group, const char *const key, gboolean def)
api_settings_boolean_get(const char *const group, const char *const key, gboolean def)
{
return plugin_settings_get_boolean(group, key, def);
return plugin_settings_boolean_get(group, key, def);
}
void
api_settings_set_boolean(const char *const group, const char *const key, gboolean value)
api_settings_boolean_set(const char *const group, const char *const key, gboolean value)
{
plugin_settings_set_boolean(group, key, value);
plugin_settings_boolean_set(group, key, value);
}
char*
api_settings_get_string(const char *const group, const char *const key, const char *const def)
api_settings_string_get(const char *const group, const char *const key, const char *const def)
{
return plugin_settings_get_string(group, key, def);
return plugin_settings_string_get(group, key, def);
}
void
api_settings_set_string(const char *const group, const char *const key, const char *const value)
api_settings_string_set(const char *const group, const char *const key, const char *const value)
{
plugin_settings_set_string(group, key, value);
plugin_settings_string_set(group, key, value);
}
char**
api_settings_get_string_list(const char *const group, const char *const key)
api_settings_string_list_get(const char *const group, const char *const key)
{
return plugin_settings_get_string_list(group, key);
return plugin_settings_string_list_get(group, key);
}
void
@ -441,21 +441,21 @@ api_settings_string_list_remove(const char *const group, const char *const key,
}
int
api_settings_string_list_remove_all(const char *const group, const char *const key)
api_settings_string_list_clear(const char *const group, const char *const key)
{
return plugin_settings_string_list_remove_all(group, key);
return plugin_settings_string_list_clear(group, key);
}
int
api_settings_get_int(const char *const group, const char *const key, int def)
api_settings_int_get(const char *const group, const char *const key, int def)
{
return plugin_settings_get_int(group, key, def);
return plugin_settings_int_get(group, key, def);
}
void
api_settings_set_int(const char *const group, const char *const key, int value)
api_settings_int_set(const char *const group, const char *const key, int value)
{
plugin_settings_set_int(group, key, value);
plugin_settings_int_set(group, key, value);
}
void

View File

@ -78,16 +78,16 @@ int api_win_show_themed(const char *tag, const char *const group, const char *co
int api_send_stanza(const char *const stanza);
gboolean api_settings_get_boolean(const char *const group, const char *const key, gboolean def);
void api_settings_set_boolean(const char *const group, const char *const key, gboolean value);
char* api_settings_get_string(const char *const group, const char *const key, const char *const def);
void api_settings_set_string(const char *const group, const char *const key, const char *const value);
int api_settings_get_int(const char *const group, const char *const key, int def);
void api_settings_set_int(const char *const group, const char *const key, int value);
char** api_settings_get_string_list(const char *const group, const char *const key);
gboolean api_settings_boolean_get(const char *const group, const char *const key, gboolean def);
void api_settings_boolean_set(const char *const group, const char *const key, gboolean value);
char* api_settings_string_get(const char *const group, const char *const key, const char *const def);
void api_settings_string_set(const char *const group, const char *const key, const char *const value);
int api_settings_int_get(const char *const group, const char *const key, int def);
void api_settings_int_set(const char *const group, const char *const key, int value);
char** api_settings_string_list_get(const char *const group, const char *const key);
void api_settings_string_list_add(const char *const group, const char *const key, const char *const value);
int api_settings_string_list_remove(const char *const group, const char *const key, const char *const value);
int api_settings_string_list_remove_all(const char *const group, const char *const key);
int api_settings_string_list_clear(const char *const group, const char *const key);
void api_incoming_message(const char *const barejid, const char *const resource, const char *const message);

View File

@ -251,33 +251,33 @@ c_api_send_stanza(char *stanza)
}
static int
c_api_settings_get_boolean(char *group, char *key, int def)
c_api_settings_boolean_get(char *group, char *key, int def)
{
return api_settings_get_boolean(group, key, def);
return api_settings_boolean_get(group, key, def);
}
static void
c_api_settings_set_boolean(char *group, char *key, int value)
c_api_settings_boolean_set(char *group, char *key, int value)
{
api_settings_set_boolean(group, key, value);
api_settings_boolean_set(group, key, value);
}
static char*
c_api_settings_get_string(char *group, char *key, char *def)
c_api_settings_string_get(char *group, char *key, char *def)
{
return api_settings_get_string(group, key, def);
return api_settings_string_get(group, key, def);
}
static void
c_api_settings_set_string(char *group, char *key, char *value)
c_api_settings_string_set(char *group, char *key, char *value)
{
api_settings_set_string(group, key, value);
api_settings_string_set(group, key, value);
}
static char**
c_api_settings_get_string_list(char *group, char *key)
c_api_settings_string_list_get(char *group, char *key)
{
return api_settings_get_string_list(group, key);
return api_settings_string_list_get(group, key);
}
static void
@ -293,21 +293,21 @@ c_api_settings_string_list_remove(char *group, char *key, char *value)
}
static int
c_api_settings_string_list_remove_all(char *group, char *key)
c_api_settings_string_list_clear(char *group, char *key)
{
return api_settings_string_list_remove_all(group, key);
return api_settings_string_list_clear(group, key);
}
static int
c_api_settings_get_int(char *group, char *key, int def)
c_api_settings_int_get(char *group, char *key, int def)
{
return api_settings_get_int(group, key, def);
return api_settings_int_get(group, key, def);
}
static void
c_api_settings_set_int(char *group, char *key, int value)
c_api_settings_int_set(char *group, char *key, int value)
{
api_settings_set_int(group, key, value);
api_settings_int_set(group, key, value);
}
static void
@ -375,16 +375,16 @@ c_api_init(void)
prof_win_show = c_api_win_show;
prof_win_show_themed = c_api_win_show_themed;
prof_send_stanza = c_api_send_stanza;
prof_settings_get_boolean = c_api_settings_get_boolean;
prof_settings_set_boolean = c_api_settings_set_boolean;
prof_settings_get_string = c_api_settings_get_string;
prof_settings_set_string = c_api_settings_set_string;
prof_settings_get_int = c_api_settings_get_int;
prof_settings_set_int = c_api_settings_set_int;
prof_settings_get_string_list = c_api_settings_get_string_list;
prof_settings_boolean_get = c_api_settings_boolean_get;
prof_settings_boolean_set = c_api_settings_boolean_set;
prof_settings_string_get = c_api_settings_string_get;
prof_settings_string_set = c_api_settings_string_set;
prof_settings_int_get = c_api_settings_int_get;
prof_settings_int_set = c_api_settings_int_set;
prof_settings_string_list_get = c_api_settings_string_list_get;
prof_settings_string_list_add = c_api_settings_string_list_add;
prof_settings_string_list_remove = c_api_settings_string_list_remove;
prof_settings_string_list_remove_all = c_api_settings_string_list_remove_all;
prof_settings_string_list_clear = c_api_settings_string_list_clear;
prof_incoming_message = c_api_incoming_message;
prof_disco_add_feature = c_api_disco_add_feature;
}

View File

@ -75,16 +75,16 @@ int (*prof_win_show_themed)(PROF_WIN_TAG tag, char *group, char *key, char *def,
int (*prof_send_stanza)(char *stanza) = NULL;
int (*prof_settings_get_boolean)(char *group, char *key, int def) = NULL;
void (*prof_settings_set_boolean)(char *group, char *key, int value) = NULL;
char* (*prof_settings_get_string)(char *group, char *key, char *def) = NULL;
void (*prof_settings_set_string)(char *group, char *key, char *value) = NULL;
int (*prof_settings_get_int)(char *group, char *key, int def) = NULL;
void (*prof_settings_set_int)(char *group, char *key, int value) = NULL;
char** (*prof_settings_get_string_list)(char *group, char *key) = NULL;
int (*prof_settings_boolean_get)(char *group, char *key, int def) = NULL;
void (*prof_settings_boolean_set)(char *group, char *key, int value) = NULL;
char* (*prof_settings_string_get)(char *group, char *key, char *def) = NULL;
void (*prof_settings_string_set)(char *group, char *key, char *value) = NULL;
int (*prof_settings_int_get)(char *group, char *key, int def) = NULL;
void (*prof_settings_int_set)(char *group, char *key, int value) = NULL;
char** (*prof_settings_string_list_get)(char *group, char *key) = NULL;
void (*prof_settings_string_list_add)(char *group, char *key, char *value) = NULL;
int (*prof_settings_string_list_remove)(char *group, char *key, char *value) = NULL;
int (*prof_settings_string_list_remove_all)(char *group, char *key) = NULL;
int (*prof_settings_string_list_clear)(char *group, char *key) = NULL;
void (*prof_incoming_message)(char *barejid, char *resource, char *message) = NULL;

View File

@ -85,16 +85,16 @@ int (*prof_win_show_themed)(PROF_WIN_TAG tag, char *group, char *key, char *def,
int (*prof_send_stanza)(char *stanza);
int (*prof_settings_get_boolean)(char *group, char *key, int def);
void (*prof_settings_set_boolean)(char *group, char *key, int value);
char* (*prof_settings_get_string)(char *group, char *key, char *def);
void (*prof_settings_set_string)(char *group, char *key, char *value);
int (*prof_settings_get_int)(char *group, char *key, int def);
void (*prof_settings_set_int)(char *group, char *key, int value);
char** (*prof_settings_get_string_list)(char *group, char *key);
int (*prof_settings_boolean_get)(char *group, char *key, int def);
void (*prof_settings_boolean_set)(char *group, char *key, int value);
char* (*prof_settings_string_get)(char *group, char *key, char *def);
void (*prof_settings_string_set)(char *group, char *key, char *value);
int (*prof_settings_int_get)(char *group, char *key, int def);
void (*prof_settings_int_set)(char *group, char *key, int value);
char** (*prof_settings_string_list_get)(char *group, char *key);
void (*prof_settings_string_list_add)(char *group, char *key, char *value);
int (*prof_settings_string_list_remove)(char *group, char *key, char *value);
int (*prof_settings_string_list_remove_all)(char *group, char *key);
int (*prof_settings_string_list_clear)(char *group, char *key);
void (*prof_incoming_message)(char *barejid, char *resource, char *message);

View File

@ -666,7 +666,7 @@ python_api_send_stanza(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_get_boolean(PyObject *self, PyObject *args)
python_api_settings_boolean_get(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -681,7 +681,7 @@ python_api_settings_get_boolean(PyObject *self, PyObject *args)
int def = PyObject_IsTrue(defobj);
allow_python_threads();
int res = api_settings_get_boolean(group_str, key_str, def);
int res = api_settings_boolean_get(group_str, key_str, def);
free(group_str);
free(key_str);
disable_python_threads();
@ -694,7 +694,7 @@ python_api_settings_get_boolean(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_set_boolean(PyObject *self, PyObject *args)
python_api_settings_boolean_set(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -709,7 +709,7 @@ python_api_settings_set_boolean(PyObject *self, PyObject *args)
int val = PyObject_IsTrue(valobj);
allow_python_threads();
api_settings_set_boolean(group_str, key_str, val);
api_settings_boolean_set(group_str, key_str, val);
free(group_str);
free(key_str);
disable_python_threads();
@ -718,7 +718,7 @@ python_api_settings_set_boolean(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_get_string(PyObject *self, PyObject *args)
python_api_settings_string_get(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -733,7 +733,7 @@ python_api_settings_get_string(PyObject *self, PyObject *args)
char *def_str = python_str_or_unicode_to_string(def);
allow_python_threads();
char *res = api_settings_get_string(group_str, key_str, def_str);
char *res = api_settings_string_get(group_str, key_str, def_str);
free(group_str);
free(key_str);
free(def_str);
@ -749,7 +749,7 @@ python_api_settings_get_string(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_set_string(PyObject *self, PyObject *args)
python_api_settings_string_set(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -764,7 +764,7 @@ python_api_settings_set_string(PyObject *self, PyObject *args)
char *val_str = python_str_or_unicode_to_string(val);
allow_python_threads();
api_settings_set_string(group_str, key_str, val_str);
api_settings_string_set(group_str, key_str, val_str);
free(group_str);
free(key_str);
free(val_str);
@ -774,7 +774,7 @@ python_api_settings_set_string(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_get_int(PyObject *self, PyObject *args)
python_api_settings_int_get(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -788,7 +788,7 @@ python_api_settings_get_int(PyObject *self, PyObject *args)
char *key_str = python_str_or_unicode_to_string(key);
allow_python_threads();
int res = api_settings_get_int(group_str, key_str, def);
int res = api_settings_int_get(group_str, key_str, def);
free(group_str);
free(key_str);
disable_python_threads();
@ -797,7 +797,7 @@ python_api_settings_get_int(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_set_int(PyObject *self, PyObject *args)
python_api_settings_int_set(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -811,7 +811,7 @@ python_api_settings_set_int(PyObject *self, PyObject *args)
char *key_str = python_str_or_unicode_to_string(key);
allow_python_threads();
api_settings_set_int(group_str, key_str, val);
api_settings_int_set(group_str, key_str, val);
free(group_str);
free(key_str);
disable_python_threads();
@ -820,7 +820,7 @@ python_api_settings_set_int(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_get_string_list(PyObject *self, PyObject *args)
python_api_settings_string_list_get(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -833,7 +833,7 @@ python_api_settings_get_string_list(PyObject *self, PyObject *args)
char *key_str = python_str_or_unicode_to_string(key);
allow_python_threads();
char** c_list = api_settings_get_string_list(group_str, key_str);
char** c_list = api_settings_string_list_get(group_str, key_str);
free(group_str);
free(key_str);
disable_python_threads();
@ -915,7 +915,7 @@ python_api_settings_string_list_remove(PyObject *self, PyObject *args)
}
static PyObject*
python_api_settings_string_list_remove_all(PyObject *self, PyObject *args)
python_api_settings_string_list_clear(PyObject *self, PyObject *args)
{
PyObject *group = NULL;
PyObject *key = NULL;
@ -928,7 +928,7 @@ python_api_settings_string_list_remove_all(PyObject *self, PyObject *args)
char *key_str = python_str_or_unicode_to_string(key);
allow_python_threads();
int res = api_settings_string_list_remove_all(group_str, key_str);
int res = api_settings_string_list_clear(group_str, key_str);
free(group_str);
free(key_str);
disable_python_threads();
@ -1077,16 +1077,16 @@ static PyMethodDef apiMethods[] = {
{ "win_show", python_api_win_show, METH_VARARGS, "Show text in the window." },
{ "win_show_themed", python_api_win_show_themed, METH_VARARGS, "Show themed text in the window." },
{ "send_stanza", python_api_send_stanza, METH_VARARGS, "Send an XMPP stanza." },
{ "settings_get_boolean", python_api_settings_get_boolean, METH_VARARGS, "Get a boolean setting." },
{ "settings_set_boolean", python_api_settings_set_boolean, METH_VARARGS, "Set a boolean setting." },
{ "settings_get_string", python_api_settings_get_string, METH_VARARGS, "Get a string setting." },
{ "settings_set_string", python_api_settings_set_string, METH_VARARGS, "Set a string setting." },
{ "settings_get_int", python_api_settings_get_int, METH_VARARGS, "Get a integer setting." },
{ "settings_set_int", python_api_settings_set_int, METH_VARARGS, "Set a integer setting." },
{ "settings_get_string_list", python_api_settings_get_string_list, METH_VARARGS, "Get a string list setting." },
{ "settings_boolean_get", python_api_settings_boolean_get, METH_VARARGS, "Get a boolean setting." },
{ "settings_boolean_set", python_api_settings_boolean_set, METH_VARARGS, "Set a boolean setting." },
{ "settings_string_get", python_api_settings_string_get, METH_VARARGS, "Get a string setting." },
{ "settings_string_set", python_api_settings_string_set, METH_VARARGS, "Set a string setting." },
{ "settings_int_get", python_api_settings_int_get, METH_VARARGS, "Get a integer setting." },
{ "settings_int_set", python_api_settings_int_set, METH_VARARGS, "Set a integer setting." },
{ "settings_string_list_get", python_api_settings_string_list_get, METH_VARARGS, "Get a string list setting." },
{ "settings_string_list_add", python_api_settings_string_list_add, METH_VARARGS, "Add item to string list setting." },
{ "settings_string_list_remove", python_api_settings_string_list_remove, METH_VARARGS, "Remove item from string list setting." },
{ "settings_string_list_remove_all", python_api_settings_string_list_remove_all, METH_VARARGS, "Remove all items from string list setting." },
{ "settings_string_list_clear", python_api_settings_string_list_clear, METH_VARARGS, "Remove all items from string list setting." },
{ "incoming_message", python_api_incoming_message, METH_VARARGS, "Show an incoming message." },
{ "disco_add_feature", python_api_disco_add_feature, METH_VARARGS, "Add a feature to disco info response." },
{ NULL, NULL, 0, NULL }

View File

@ -75,7 +75,7 @@ plugin_settings_close(void)
}
gboolean
plugin_settings_get_boolean(const char *const group, const char *const key, gboolean def)
plugin_settings_boolean_get(const char *const group, const char *const key, gboolean def)
{
if (group && key && g_key_file_has_key(settings, group, key, NULL)) {
return g_key_file_get_boolean(settings, group, key, NULL);
@ -85,14 +85,14 @@ plugin_settings_get_boolean(const char *const group, const char *const key, gboo
}
void
plugin_settings_set_boolean(const char *const group, const char *const key, gboolean value)
plugin_settings_boolean_set(const char *const group, const char *const key, gboolean value)
{
g_key_file_set_boolean(settings, group, key, value);
_save_settings();
}
char*
plugin_settings_get_string(const char *const group, const char *const key, const char *const def)
plugin_settings_string_get(const char *const group, const char *const key, const char *const def)
{
if (group && key && g_key_file_has_key(settings, group, key, NULL)) {
return g_key_file_get_string(settings, group, key, NULL);
@ -104,14 +104,14 @@ plugin_settings_get_string(const char *const group, const char *const key, const
}
void
plugin_settings_set_string(const char *const group, const char *const key, const char *const value)
plugin_settings_string_set(const char *const group, const char *const key, const char *const value)
{
g_key_file_set_string(settings, group, key, value);
_save_settings();
}
int
plugin_settings_get_int(const char *const group, const char *const key, int def)
plugin_settings_int_get(const char *const group, const char *const key, int def)
{
if (group && key && g_key_file_has_key(settings, group, key, NULL)) {
return g_key_file_get_integer(settings, group, key, NULL);
@ -121,14 +121,14 @@ plugin_settings_get_int(const char *const group, const char *const key, int def)
}
void
plugin_settings_set_int(const char *const group, const char *const key, int value)
plugin_settings_int_set(const char *const group, const char *const key, int value)
{
g_key_file_set_integer(settings, group, key, value);
_save_settings();
}
gchar**
plugin_settings_get_string_list(const char *const group, const char *const key)
plugin_settings_string_list_get(const char *const group, const char *const key)
{
if (!g_key_file_has_key(settings, group, key, NULL)) {
return NULL;
@ -156,7 +156,7 @@ plugin_settings_string_list_remove(const char *const group, const char *const ke
}
int
plugin_settings_string_list_remove_all(const char *const group, const char *const key)
plugin_settings_string_list_clear(const char *const group, const char *const key)
{
if (!g_key_file_has_key(settings, group, key, NULL)) {
return 0;

View File

@ -38,15 +38,15 @@
void plugin_settings_init(void);
void plugin_settings_close(void);
gboolean plugin_settings_get_boolean(const char *const group, const char *const key, gboolean def);
void plugin_settings_set_boolean(const char *const group, const char *const key, gboolean value);
char* plugin_settings_get_string(const char *const group, const char *const key, const char *const def);
void plugin_settings_set_string(const char *const group, const char *const key, const char *const value);
int plugin_settings_get_int(const char *const group, const char *const key, int def);
void plugin_settings_set_int(const char *const group, const char *const key, int value);
char** plugin_settings_get_string_list(const char *const group, const char *const key);
gboolean plugin_settings_boolean_get(const char *const group, const char *const key, gboolean def);
void plugin_settings_boolean_set(const char *const group, const char *const key, gboolean value);
char* plugin_settings_string_get(const char *const group, const char *const key, const char *const def);
void plugin_settings_string_set(const char *const group, const char *const key, const char *const value);
int plugin_settings_int_get(const char *const group, const char *const key, int def);
void plugin_settings_int_set(const char *const group, const char *const key, int value);
char** plugin_settings_string_list_get(const char *const group, const char *const key);
void plugin_settings_string_list_add(const char *const group, const char *const key, const char *const value);
int plugin_settings_string_list_remove(const char *const group, const char *const key, const char *const value);
int plugin_settings_string_list_remove_all(const char *const group, const char *const key);
int plugin_settings_string_list_clear(const char *const group, const char *const key);
#endif