diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-25 15:09:44 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-25 15:09:44 +0100 |
commit | bfc010df2f661b8b03c59ef9af83d2128baf4c89 (patch) | |
tree | fd94fddbfef90aa4a0a4ec09b6d007451bc2047d /src/plugins/scripts/python/weechat-python-api.c | |
parent | 96940af8c3081631e9834840916a477c2df3351c (diff) | |
download | weechat-bfc010df2f661b8b03c59ef9af83d2128baf4c89.zip |
core: add type char for hdata and function hdata_char in plugin/script API
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 83bfde802..18b826ee6 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -5271,6 +5271,31 @@ weechat_python_api_hdata_move (PyObject *self, PyObject *args) } /* + * weechat_python_api_hdata_char: get char value of a variable in structure + * using hdata + */ + +static PyObject * +weechat_python_api_hdata_char (PyObject *self, PyObject *args) +{ + char *hdata, *pointer, *name; + int value; + + API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + hdata = NULL; + pointer = NULL; + name = NULL; + if (!PyArg_ParseTuple (args, "sss", &hdata, &pointer, &name)) + API_WRONG_ARGS(API_RETURN_INT(0)); + + value = (int)weechat_hdata_char (script_str2ptr (hdata), + script_str2ptr (pointer), + name); + + API_RETURN_INT(value); +} + +/* * weechat_python_api_hdata_integer: get integer value of a variable in * structure using hdata */ @@ -5733,6 +5758,7 @@ PyMethodDef weechat_python_funcs[] = { "hdata_get_var_hdata", &weechat_python_api_hdata_get_var_hdata, METH_VARARGS, "" }, { "hdata_get_list", &weechat_python_api_hdata_get_list, METH_VARARGS, "" }, { "hdata_move", &weechat_python_api_hdata_move, METH_VARARGS, "" }, + { "hdata_char", &weechat_python_api_hdata_char, METH_VARARGS, "" }, { "hdata_integer", &weechat_python_api_hdata_integer, METH_VARARGS, "" }, { "hdata_long", &weechat_python_api_hdata_long, METH_VARARGS, "" }, { "hdata_string", &weechat_python_api_hdata_string, METH_VARARGS, "" }, |