mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 01:25:42 +02:00
api: add new function hdata_check_pointer
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
WeeChat ChangeLog
|
||||
=================
|
||||
Sébastien Helleu <flashcode@flashtux.org>
|
||||
v0.3.7-dev, 2011-12-16
|
||||
v0.3.7-dev, 2011-12-17
|
||||
|
||||
|
||||
Version 0.3.7 (under dev!)
|
||||
@@ -35,8 +35,8 @@ Version 0.3.7 (under dev!)
|
||||
* core: fix compilation error with "pid_t" on Mac OS X (bug #34639)
|
||||
* core: enable background process under Cygwin to connect to servers, fix
|
||||
reconnection problem (bug #34626)
|
||||
* api: add new functions strcasecmp_range, strncasecmp_range, hdata_char and
|
||||
nicklist_get_next_item
|
||||
* api: add new functions strcasecmp_range, strncasecmp_range,
|
||||
hdata_check_pointer, hdata_char and nicklist_get_next_item
|
||||
* irc: reset read marker of current buffer on manual /join
|
||||
* irc: fix crash when signon time in message 317 (whois, idle) is invalid
|
||||
(too large) (bug #34905)
|
||||
|
||||
@@ -356,8 +356,9 @@ Liste der Skript API Funktionen:
|
||||
infolist_time, infolist_free
|
||||
| hdata |
|
||||
hdata_get, hdata_get_var_offset, hdata_get_var_type_string,
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_move, hdata_integer, hdata_long,
|
||||
hdata_string, hdata_pointer, hdata_time, hdata_get_string
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_check_pointer, hdata_move,
|
||||
hdata_char, hdata_integer, hdata_long, hdata_string, hdata_pointer,
|
||||
hdata_time, hdata_get_string
|
||||
| Upgrade |
|
||||
upgrade_new, upgrade_write_object, upgrade_read, upgrade_close
|
||||
|========================================
|
||||
|
||||
@@ -12324,8 +12324,16 @@ C example:
|
||||
int offset = weechat_hdata_get_var_offset (hdata, "name");
|
||||
----------------------------------------
|
||||
|
||||
[NOTE]
|
||||
This function is not available in scripting API.
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----------------------------------------
|
||||
# prototype
|
||||
offset = weechat.hdata_get_var_offset(hdata, name)
|
||||
|
||||
# example
|
||||
offset = weechat.hdata_get(hdata, "name")
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_get_var_type
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -12585,6 +12593,65 @@ hdata = weechat.hdata_get("buffer")
|
||||
buffers = weechat.hdata_get_list(hdata, "gui_buffers")
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_check_pointer
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
_New in version 0.3.7._
|
||||
|
||||
Check if a pointer is valid for a hdata and a list pointer.
|
||||
|
||||
Prototype:
|
||||
|
||||
[source,C]
|
||||
----------------------------------------
|
||||
int weechat_hdata_check_pointer (struct t_hdata *hdata, void *list, void *pointer);
|
||||
----------------------------------------
|
||||
|
||||
Arguments:
|
||||
|
||||
* 'hdata': hdata pointer
|
||||
* 'list': list pointer
|
||||
* 'pointer': pointer to check
|
||||
|
||||
Return value:
|
||||
|
||||
* 1 if pointer is in list, 0 if not found
|
||||
|
||||
C example:
|
||||
|
||||
[source,C]
|
||||
----------------------------------------
|
||||
/* check if a buffer pointer is valid */
|
||||
struct t_hdata *hdata = weechat_hdata_get ("buffer");
|
||||
if (weechat_hdata_check_pointer (hdata,
|
||||
weechat_hdata_get_list (hdata, "gui_buffers"),
|
||||
ptr_buffer))
|
||||
{
|
||||
/* valid pointer */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid pointer */
|
||||
}
|
||||
----------------------------------------
|
||||
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----------------------------------------
|
||||
# prototype
|
||||
rc = weechat.hdata_check_pointer(hdata, list, pointer)
|
||||
|
||||
# example
|
||||
hdata = weechat.hdata_get("buffer")
|
||||
if weechat.hdata_check_pointer(hdata, weechat.hdata_get_list(hdata, "gui_buffers"), ptr_buffer):
|
||||
# valid pointer
|
||||
# ...
|
||||
else:
|
||||
# invalid pointer
|
||||
# ...
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_move
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -347,8 +347,9 @@ List of functions in script API:
|
||||
infolist_time, infolist_free
|
||||
| hdata |
|
||||
hdata_get, hdata_get_var_offset, hdata_get_var_type_string,
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_move, hdata_integer, hdata_long,
|
||||
hdata_string, hdata_pointer, hdata_time, hdata_get_string
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_check_pointer, hdata_move,
|
||||
hdata_char, hdata_integer, hdata_long, hdata_string, hdata_pointer,
|
||||
hdata_time, hdata_get_string
|
||||
| upgrade |
|
||||
upgrade_new, upgrade_write_object, upgrade_read, upgrade_close
|
||||
|========================================
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -356,8 +356,9 @@ Liste des fonctions de l'API script :
|
||||
infolist_time, infolist_free
|
||||
| hdata |
|
||||
hdata_get, hdata_get_var_offset, hdata_get_var_type_string,
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_move, hdata_integer, hdata_long,
|
||||
hdata_string, hdata_pointer, hdata_time, hdata_get_string
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_check_pointer, hdata_move,
|
||||
hdata_char, hdata_integer, hdata_long, hdata_string, hdata_pointer,
|
||||
hdata_time, hdata_get_string
|
||||
| mise à jour |
|
||||
upgrade_new, upgrade_write_object, upgrade_read, upgrade_close
|
||||
|========================================
|
||||
|
||||
@@ -12441,8 +12441,16 @@ Esempio in C:
|
||||
int offset = weechat_hdata_get_var_offset (hdata, "name");
|
||||
----------------------------------------
|
||||
|
||||
[NOTE]
|
||||
Questa funzione non è disponibile nelle API per lo scripting.
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----------------------------------------
|
||||
# prototipo
|
||||
offset = weechat.hdata_get_var_offset(hdata, name)
|
||||
|
||||
# esempio
|
||||
offset = weechat.hdata_get(hdata, "name")
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_get_var_type
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -12703,6 +12711,69 @@ hdata = weechat.hdata_get("buffer")
|
||||
buffers = weechat.hdata_get_list(hdata, "gui_buffers")
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_check_pointer
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
_Novità nella versione 0.3.7._
|
||||
|
||||
// TRANSLATION MISSING
|
||||
Check if a pointer is valid for a hdata and a list pointer.
|
||||
|
||||
Prototipo:
|
||||
|
||||
[source,C]
|
||||
----------------------------------------
|
||||
int weechat_hdata_check_pointer (struct t_hdata *hdata, void *list, void *pointer);
|
||||
----------------------------------------
|
||||
|
||||
Argomenti:
|
||||
|
||||
* 'hdata': puntatore hdata
|
||||
// TRANSLATION MISSING
|
||||
* 'list': list pointer
|
||||
// TRANSLATION MISSING
|
||||
* 'pointer': pointer to check
|
||||
|
||||
Valore restituito:
|
||||
|
||||
// TRANSLATION MISSING
|
||||
* 1 if pointer is in list, 0 if not found
|
||||
|
||||
Esempio in C:
|
||||
|
||||
[source,C]
|
||||
----------------------------------------
|
||||
/* check if a buffer pointer is valid */
|
||||
struct t_hdata *hdata = weechat_hdata_get ("buffer");
|
||||
if (weechat_hdata_check_pointer (hdata,
|
||||
weechat_hdata_get_list (hdata, "gui_buffers"),
|
||||
ptr_buffer))
|
||||
{
|
||||
/* valid pointer */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid pointer */
|
||||
}
|
||||
----------------------------------------
|
||||
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----------------------------------------
|
||||
# prototipo
|
||||
rc = weechat.hdata_check_pointer(hdata, list, pointer)
|
||||
|
||||
# esempio
|
||||
hdata = weechat.hdata_get("buffer")
|
||||
if weechat.hdata_check_pointer(hdata, weechat.hdata_get_list(hdata, "gui_buffers"), ptr_buffer):
|
||||
# valid pointer
|
||||
# ...
|
||||
else:
|
||||
# invalid pointer
|
||||
# ...
|
||||
----------------------------------------
|
||||
|
||||
weechat_hdata_move
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -353,10 +353,11 @@ Elenco di funzioni nelle API per gli script:
|
||||
infolist_get, infolist_next, infolist_prev, infolist_reset_item_cursor, +
|
||||
infolist_fields, infolist_integer, infolist_string, infolist_pointer, +
|
||||
infolist_time, infolist_free
|
||||
| hdata |
|
||||
| hdata |
|
||||
hdata_get, hdata_get_var_offset, hdata_get_var_type_string,
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_move, hdata_integer, hdata_long,
|
||||
hdata_string, hdata_pointer, hdata_time, hdata_get_string
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_check_pointer, hdata_move,
|
||||
hdata_char, hdata_integer, hdata_long, hdata_string, hdata_pointer,
|
||||
hdata_time, hdata_get_string
|
||||
| aggiornamento |
|
||||
upgrade_new, upgrade_write_object, upgrade_read, upgrade_close
|
||||
|========================================
|
||||
|
||||
@@ -347,8 +347,9 @@ Lista funkcji w API skryptów:
|
||||
infolist_time, infolist_free
|
||||
| hdata |
|
||||
hdata_get, hdata_get_var_offset, hdata_get_var_type_string,
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_move, hdata_integer, hdata_long,
|
||||
hdata_string, hdata_pointer, hdata_time, hdata_get_string
|
||||
hdata_get_var_hdata, hdata_get_list, hdata_check_pointer, hdata_move,
|
||||
hdata_char, hdata_integer, hdata_long, hdata_string, hdata_pointer,
|
||||
hdata_time, hdata_get_string
|
||||
| uaktualnienie |
|
||||
upgrade_new, upgrade_write_object, upgrade_read, upgrade_close
|
||||
|========================================
|
||||
|
||||
@@ -235,6 +235,33 @@ hdata_get_list (struct t_hdata *hdata, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* hdata_check_pointer: check if a pointer is valid for a given hdata/list
|
||||
* return 1 if pointer exists in list
|
||||
* 0 if pointer does not exist
|
||||
*/
|
||||
|
||||
int
|
||||
hdata_check_pointer (struct t_hdata *hdata, void *list, void *pointer)
|
||||
{
|
||||
void *ptr_current;
|
||||
|
||||
if (hdata && list && pointer)
|
||||
{
|
||||
if (pointer == list)
|
||||
return 1;
|
||||
ptr_current = list;
|
||||
while (ptr_current)
|
||||
{
|
||||
ptr_current = hdata_move (hdata, ptr_current, 1);
|
||||
if (ptr_current && (ptr_current == pointer))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* hdata_move: move pointer to another element in list
|
||||
*/
|
||||
|
||||
@@ -61,6 +61,8 @@ extern void *hdata_get_var (struct t_hdata *hdata, void *pointer,
|
||||
extern void *hdata_get_var_at_offset (struct t_hdata *hdata, void *pointer,
|
||||
int offset);
|
||||
extern void *hdata_get_list (struct t_hdata *hdata, const char *name);
|
||||
extern int hdata_check_pointer (struct t_hdata *hdata, void *list,
|
||||
void *pointer);
|
||||
extern void *hdata_move (struct t_hdata *hdata, void *pointer, int count);
|
||||
extern char hdata_char (struct t_hdata *hdata, void *pointer,
|
||||
const char *name);
|
||||
|
||||
@@ -739,6 +739,7 @@ plugin_load (const char *filename, int argc, char **argv)
|
||||
new_plugin->hdata_get_var = &hdata_get_var;
|
||||
new_plugin->hdata_get_var_at_offset = &hdata_get_var_at_offset;
|
||||
new_plugin->hdata_get_list = &hdata_get_list;
|
||||
new_plugin->hdata_check_pointer = &hdata_check_pointer;
|
||||
new_plugin->hdata_move = &hdata_move;
|
||||
new_plugin->hdata_char = &hdata_char;
|
||||
new_plugin->hdata_integer = &hdata_integer;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5329,6 +5329,31 @@ weechat_lua_api_hdata_get_list (lua_State *L)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_lua_api_hdata_check_pointer: check pointer with hdata/list
|
||||
*/
|
||||
|
||||
static int
|
||||
weechat_lua_api_hdata_check_pointer (lua_State *L)
|
||||
{
|
||||
const char *hdata, *list, *pointer;
|
||||
int value;
|
||||
|
||||
API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0));
|
||||
if (lua_gettop (lua_current_interpreter) < 3)
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
hdata = lua_tostring (lua_current_interpreter, -3);
|
||||
list = lua_tostring (lua_current_interpreter, -2);
|
||||
pointer = lua_tostring (lua_current_interpreter, -1);
|
||||
|
||||
value = weechat_hdata_check_pointer (script_str2ptr (hdata),
|
||||
script_str2ptr (list),
|
||||
script_str2ptr (pointer));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_lua_api_hdata_move: move pointer to another element in list
|
||||
*/
|
||||
@@ -6238,6 +6263,7 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
|
||||
{ "hdata_get_var_type_string", &weechat_lua_api_hdata_get_var_type_string },
|
||||
{ "hdata_get_var_hdata", &weechat_lua_api_hdata_get_var_hdata },
|
||||
{ "hdata_get_list", &weechat_lua_api_hdata_get_list },
|
||||
{ "hdata_check_pointer", &weechat_lua_api_hdata_check_pointer },
|
||||
{ "hdata_move", &weechat_lua_api_hdata_move },
|
||||
{ "hdata_char", &weechat_lua_api_hdata_char },
|
||||
{ "hdata_integer", &weechat_lua_api_hdata_integer },
|
||||
|
||||
@@ -5069,6 +5069,31 @@ XS (XS_weechat_api_hdata_get_list)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat::hdata_check_pointer: check pointer with hdata/list
|
||||
*/
|
||||
|
||||
XS (XS_weechat_api_hdata_check_pointer)
|
||||
{
|
||||
char *hdata, *list, *pointer;
|
||||
int value;
|
||||
dXSARGS;
|
||||
|
||||
API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0));
|
||||
if (items < 3)
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
hdata = SvPV_nolen (ST (0));
|
||||
list = SvPV_nolen (ST (1));
|
||||
pointer = SvPV_nolen (ST (2));
|
||||
|
||||
value = weechat_hdata_check_pointer (script_str2ptr (hdata),
|
||||
script_str2ptr (list),
|
||||
script_str2ptr (pointer));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat::hdata_move: move pointer to another element in list
|
||||
*/
|
||||
@@ -5595,6 +5620,7 @@ weechat_perl_api_init (pTHX)
|
||||
newXS ("weechat::hdata_get_var_type_string", XS_weechat_api_hdata_get_var_type_string, "weechat");
|
||||
newXS ("weechat::hdata_get_var_hdata", XS_weechat_api_hdata_get_var_hdata, "weechat");
|
||||
newXS ("weechat::hdata_get_list", XS_weechat_api_hdata_get_list, "weechat");
|
||||
newXS ("weechat::hdata_check_pointer", XS_weechat_api_hdata_check_pointer, "weechat");
|
||||
newXS ("weechat::hdata_move", XS_weechat_api_hdata_move, "weechat");
|
||||
newXS ("weechat::hdata_char", XS_weechat_api_hdata_char, "weechat");
|
||||
newXS ("weechat::hdata_integer", XS_weechat_api_hdata_integer, "weechat");
|
||||
|
||||
@@ -5249,6 +5249,30 @@ weechat_python_api_hdata_get_list (PyObject *self, PyObject *args)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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, "" },
|
||||
|
||||
@@ -6028,6 +6028,36 @@ weechat_ruby_api_hdata_get_list (VALUE class, VALUE hdata, VALUE name)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_ruby_api_hdata_check_pointer: check pointer with hdata/list
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_hdata_check_pointer (VALUE class, VALUE hdata, VALUE list,
|
||||
VALUE pointer)
|
||||
{
|
||||
char *c_hdata, *c_list, *c_pointer;
|
||||
int value;
|
||||
|
||||
API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0));
|
||||
if (NIL_P (hdata) || NIL_P (list) || NIL_P (pointer))
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
Check_Type (hdata, T_STRING);
|
||||
Check_Type (list, T_STRING);
|
||||
Check_Type (pointer, T_STRING);
|
||||
|
||||
c_hdata = StringValuePtr (hdata);
|
||||
c_list = StringValuePtr (list);
|
||||
c_pointer = StringValuePtr (pointer);
|
||||
|
||||
value = weechat_hdata_check_pointer (script_str2ptr (c_hdata),
|
||||
script_str2ptr (c_list),
|
||||
script_str2ptr (c_pointer));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_ruby_api_hdata_move: move pointer to another element in list
|
||||
*/
|
||||
@@ -6657,6 +6687,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_get_var_type_string", &weechat_ruby_api_hdata_get_var_type_string, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_get_var_hdata", &weechat_ruby_api_hdata_get_var_hdata, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_get_list", &weechat_ruby_api_hdata_get_list, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_check_pointer", &weechat_ruby_api_hdata_check_pointer, 3);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_move", &weechat_ruby_api_hdata_move, 3);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_char", &weechat_ruby_api_hdata_char, 3);
|
||||
rb_define_module_function (ruby_mWeechat, "hdata_integer", &weechat_ruby_api_hdata_integer, 3);
|
||||
|
||||
@@ -5772,6 +5772,33 @@ weechat_tcl_api_hdata_get_list (ClientData clientData, Tcl_Interp *interp,
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_tcl_api_hdata_check_pointer: check pointer with hdata/list
|
||||
*/
|
||||
|
||||
static int
|
||||
weechat_tcl_api_hdata_check_pointer (ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *hdata, *list, *pointer;
|
||||
int result, i;
|
||||
|
||||
API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0));
|
||||
if (objc < 4)
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
hdata = Tcl_GetStringFromObj (objv[1], &i);
|
||||
list = Tcl_GetStringFromObj (objv[2], &i);
|
||||
pointer = Tcl_GetStringFromObj (objv[3], &i);
|
||||
|
||||
result = weechat_hdata_check_pointer (script_str2ptr (hdata),
|
||||
script_str2ptr (list),
|
||||
script_str2ptr (pointer));
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_tcl_api_hdata_move: move pointer to another element in list
|
||||
*/
|
||||
@@ -6568,6 +6595,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
|
||||
weechat_tcl_api_hdata_get_var_hdata, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp, "weechat::hdata_get_list",
|
||||
weechat_tcl_api_hdata_get_list, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp, "weechat::hdata_check_pointer",
|
||||
weechat_tcl_api_hdata_check_pointer, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp, "weechat::hdata_move",
|
||||
weechat_tcl_api_hdata_move, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
Tcl_CreateObjCommand (interp, "weechat::hdata_integer",
|
||||
|
||||
@@ -46,7 +46,7 @@ struct timeval;
|
||||
*/
|
||||
|
||||
/* API version (used to check that plugin has same API and can be loaded) */
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20111206-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20111217-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -827,6 +827,8 @@ struct t_weechat_plugin
|
||||
void *(*hdata_get_var_at_offset) (struct t_hdata *hdata, void *pointer,
|
||||
int offset);
|
||||
void *(*hdata_get_list) (struct t_hdata *hdata, const char *name);
|
||||
int (*hdata_check_pointer) (struct t_hdata *hdata, void *list,
|
||||
void *pointer);
|
||||
void *(*hdata_move) (struct t_hdata *hdata, void *pointer, int count);
|
||||
char (*hdata_char) (struct t_hdata *hdata, void *pointer,
|
||||
const char *name);
|
||||
@@ -1573,6 +1575,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
|
||||
__offset)
|
||||
#define weechat_hdata_get_list(__hdata, __name) \
|
||||
weechat_plugin->hdata_get_list(__hdata, __name)
|
||||
#define weechat_hdata_check_pointer(__hdata, __list, __pointer) \
|
||||
weechat_plugin->hdata_check_pointer(__hdata, __list, __pointer)
|
||||
#define weechat_hdata_move(__hdata, __pointer, __count) \
|
||||
weechat_plugin->hdata_move(__hdata, __pointer, __count)
|
||||
#define weechat_hdata_char(__hdata, __pointer, __name) \
|
||||
|
||||
Reference in New Issue
Block a user