mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
core: add type char for hdata and function hdata_char in plugin/script API
This commit is contained in:
@@ -5270,6 +5270,31 @@ weechat_python_api_hdata_move (PyObject *self, PyObject *args)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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, "" },
|
||||
|
||||
Reference in New Issue
Block a user