summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c26
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, "" },