1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 22:25:42 +02:00

Added new functions and script name completion in script plugins, fixed some bugs in weelist management and script plugins

New functions in script plugins API: gettext, ngettext, list_new, list_add,
list_search, list_casesearch, list_get, list_set, list_next, list_prev,
list_string, list_size, list_remove, list_remove_all, list_free.
This commit is contained in:
Sebastien Helleu
2008-01-16 10:19:25 +01:00
parent e173014aec
commit 697f070725
11 changed files with 2660 additions and 590 deletions
File diff suppressed because it is too large Load Diff
+26 -1
View File
@@ -20,6 +20,10 @@
#undef _
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
@@ -396,6 +400,25 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
/*
* weechat_lua_completion_cb: callback for script completion
*/
int
weechat_lua_completion_cb (void *data, char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
/* make C compiler happy */
(void) data;
(void) completion;
(void) buffer;
script_completion (weechat_lua_plugin, list, lua_scripts);
return WEECHAT_RC_OK;
}
/*
* weechat_lua_dump_data_cb: dump Lua plugin data in WeeChat log file
*/
@@ -426,7 +449,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
weechat_lua_plugin = plugin;
script_init (weechat_lua_plugin,
&weechat_lua_command_cb, &weechat_lua_dump_data_cb,
&weechat_lua_command_cb,
&weechat_lua_completion_cb,
&weechat_lua_dump_data_cb,
&weechat_lua_load_cb);
/* init ok */
File diff suppressed because it is too large Load Diff
+22 -1
View File
@@ -537,6 +537,25 @@ weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
/*
* weechat_perl_completion_cb: callback for script completion
*/
int
weechat_perl_completion_cb (void *data, char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
/* make C compiler happy */
(void) data;
(void) completion;
(void) buffer;
script_completion (weechat_perl_plugin, list, perl_scripts);
return WEECHAT_RC_OK;
}
/*
* weechat_perl_dump_data_cb: dump Perl plugin data in WeeChat log file
*/
@@ -584,7 +603,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
#endif
script_init (weechat_perl_plugin,
&weechat_perl_command_cb, &weechat_perl_dump_data_cb,
&weechat_perl_command_cb,
&weechat_perl_completion_cb,
&weechat_perl_dump_data_cb,
&weechat_perl_load_cb);
/* init ok */
File diff suppressed because it is too large Load Diff
+22 -1
View File
@@ -565,6 +565,25 @@ weechat_python_command_cb (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
/*
* weechat_python_completion_cb: callback for script completion
*/
int
weechat_python_completion_cb (void *data, char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
/* make C compiler happy */
(void) data;
(void) completion;
(void) buffer;
script_completion (weechat_python_plugin, list, python_scripts);
return WEECHAT_RC_OK;
}
/*
* weechat_python_dump_data_cb: dump Python plugin data in WeeChat log file
*/
@@ -621,7 +640,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
}
script_init (weechat_python_plugin,
&weechat_python_command_cb, &weechat_python_dump_data_cb,
&weechat_python_command_cb,
&weechat_python_completion_cb,
&weechat_python_dump_data_cb,
&weechat_python_load_cb);
/* init ok */
File diff suppressed because it is too large Load Diff
+31 -1
View File
@@ -25,6 +25,15 @@
#include <sys/types.h>
#include <sys/stat.h>
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../../weechat-plugin.h"
#include "../script.h"
#include "weechat-ruby.h"
@@ -562,6 +571,25 @@ weechat_ruby_command_cb (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
/*
* weechat_ruby_completion_cb: callback for script completion
*/
int
weechat_ruby_completion_cb (void *data, char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
/* make C compiler happy */
(void) data;
(void) completion;
(void) buffer;
script_completion (weechat_ruby_plugin, list, ruby_scripts);
return WEECHAT_RC_OK;
}
/*
* weechat_ruby_dump_data_cb: dump Ruby plugin data in WeeChat log file
*/
@@ -669,7 +697,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
}
script_init (weechat_ruby_plugin,
&weechat_ruby_command_cb, &weechat_ruby_dump_data_cb,
&weechat_ruby_command_cb,
&weechat_ruby_completion_cb,
&weechat_ruby_dump_data_cb,
&weechat_ruby_load_cb);
/* init ok */
File diff suppressed because it is too large Load Diff
+8 -2
View File
@@ -61,12 +61,15 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
int (*callback_completion)(void *data, char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
int (*callback_signal_dump)(void *data, char *signal,
char *type_data,
void *signal_data),
int (*callback_load_file)(void *data, char *filename));
extern char *script_pointer_to_string (void *pointer);
extern void *script_string_to_pointer (char *pointer_str);
extern char *script_ptr2str (void *pointer);
extern void *script_str2ptr (char *pointer_str);
extern void script_auto_load (struct t_weechat_plugin *weechat_plugin,
int (*callback)(void *data, char *filename));
extern struct t_plugin_script *script_search (struct t_weechat_plugin *weechat_plugin,
@@ -83,6 +86,9 @@ extern struct t_plugin_script *script_add (struct t_weechat_plugin *weechat_plug
extern void script_remove (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
struct t_plugin_script *script);
extern void script_completion (struct t_weechat_plugin *weechat_plugin,
struct t_weelist *list,
struct t_plugin_script *scripts);
extern void script_display_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
char *name, int full);