summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/python/weechat-python-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-12-17 17:03:39 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-12-17 17:03:39 +0100
commitbd3f554e0228e5aec087b07a269596b487f3a60f (patch)
tree4861f8e07c16073791a44033450e729b62b64679 /src/plugins/scripts/python/weechat-python-api.c
parentdc8807a4173ccabbe3bb03d3f1d02c8b11580056 (diff)
downloadweechat-bd3f554e0228e5aec087b07a269596b487f3a60f.zip
api: add new function hdata_check_pointer
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index c02716c73..0048ee518 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -5250,6 +5250,30 @@ weechat_python_api_hdata_get_list (PyObject *self, PyObject *args)
}
/*
+ * weechat_python_api_hdata_check_pointer: check pointer with hdata/list
+ */
+
+static PyObject *
+weechat_python_api_hdata_check_pointer (PyObject *self, PyObject *args)
+{
+ char *hdata, *list, *pointer;
+ int value;
+
+ API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0));
+ hdata = NULL;
+ list = NULL;
+ pointer = NULL;
+ if (!PyArg_ParseTuple (args, "sss", &hdata, &list, &pointer))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ value = weechat_hdata_check_pointer (script_str2ptr (hdata),
+ script_str2ptr (list),
+ script_str2ptr (pointer));
+
+ API_RETURN_INT(value);
+}
+
+/*
* weechat_python_api_hdata_move: move pointer to another element in list
*/
@@ -5765,6 +5789,7 @@ PyMethodDef weechat_python_funcs[] =
{ "hdata_get_var_type_string", &weechat_python_api_hdata_get_var_type_string, METH_VARARGS, "" },
{ "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_check_pointer", &weechat_python_api_hdata_check_pointer, 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, "" },