1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +02:00

Many changes in doc

This commit is contained in:
Sebastien Helleu
2008-09-05 18:52:59 +02:00
parent e43dd39646
commit ae612a811b
112 changed files with 15244 additions and 1079 deletions
+64 -35
View File
@@ -1104,22 +1104,28 @@ command_help (void *data, struct t_gui_buffer *buffer,
if (ptr_option)
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL,
_("Option \"%s%s%s\": %s"),
gui_chat_printf (NULL, _("Option \"%s%s%s\":"),
GUI_COLOR(GUI_COLOR_CHAT_CHANNEL),
argv[1],
GUI_COLOR(GUI_COLOR_CHAT),
GUI_COLOR(GUI_COLOR_CHAT));
gui_chat_printf (NULL, " %s: %s",
_("description"),
_(ptr_option->description));
switch (ptr_option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
gui_chat_printf (NULL, _(" type: boolean ('on' or 'off')"));
gui_chat_printf (NULL, _(" value: %s%s%s (default: %s)"),
gui_chat_printf (NULL, " %s: %s",
_("type"), _("boolean"));
gui_chat_printf (NULL, " %s: on, off",
_("values"));
gui_chat_printf (NULL, " %s: %s",
_("default value"),
(CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
"on" : "off");
gui_chat_printf (NULL, " %s: %s%s",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
(CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
"on" : "off",
GUI_COLOR(GUI_COLOR_CHAT),
(CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
"on" : "off");
break;
case CONFIG_OPTION_TYPE_INTEGER:
@@ -1146,60 +1152,83 @@ command_help (void *data, struct t_gui_buffer *buffer,
strcat (string, ", ");
i++;
}
gui_chat_printf (NULL, " %s: %s",
_("type"), _("string"));
gui_chat_printf (NULL, " %s: %s",
_("values"), string);
gui_chat_printf (NULL, " %s: '%s'",
_("default value"),
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]);
gui_chat_printf (NULL,
_(" type: string (%s)"),
string);
gui_chat_printf (NULL,
_(" value: '%s%s%s' (default: '%s')"),
" %s: '%s%s%s'",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
ptr_option->string_values[CONFIG_INTEGER(ptr_option)],
GUI_COLOR(GUI_COLOR_CHAT),
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]);
GUI_COLOR(GUI_COLOR_CHAT));
free (string);
}
}
else
{
gui_chat_printf (NULL, _(" type: integer (between %d and %d)"),
ptr_option->min,
ptr_option->max);
gui_chat_printf (NULL, _(" value: %s%d%s (default: %d)"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
CONFIG_INTEGER(ptr_option),
GUI_COLOR(GUI_COLOR_CHAT),
gui_chat_printf (NULL, " %s: %s",
_("type"), _("integer"));
gui_chat_printf (NULL, " %s: %d .. %d",
_("values"),
ptr_option->min, ptr_option->max);
gui_chat_printf (NULL, " %s: %d",
_("default value"),
CONFIG_INTEGER_DEFAULT(ptr_option));
gui_chat_printf (NULL, " %s: %s%d",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
CONFIG_INTEGER(ptr_option));
}
break;
case CONFIG_OPTION_TYPE_STRING:
switch (ptr_option->max)
{
case 0:
gui_chat_printf (NULL, _(" type: string (any string)"));
gui_chat_printf (NULL, " %s: %s",
_("type"), _("string"));
gui_chat_printf (NULL, " %s: %s",
_("values"), _("any string"));
break;
case 1:
gui_chat_printf (NULL, _(" type: char (any char)"));
gui_chat_printf (NULL, " %s: %s",
_("type"), _("string"));
gui_chat_printf (NULL, " %s: %s",
_("values"), _("any char"));
break;
default:
gui_chat_printf (NULL, _(" type: string (limit: %d chars)"),
gui_chat_printf (NULL, " %s: %s",
_("type"), _("string"));
gui_chat_printf (NULL, " %s: %s (%s: %d)",
_("values"), _("any string"),
_("max chars"),
ptr_option->max);
break;
}
gui_chat_printf (NULL,
_(" value: '%s%s%s' (default: '%s')"),
gui_chat_printf (NULL, " %s: '%s'",
_("default value"),
CONFIG_STRING_DEFAULT(ptr_option));
gui_chat_printf (NULL, " %s: '%s%s%s'",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
CONFIG_STRING(ptr_option),
GUI_COLOR(GUI_COLOR_CHAT),
CONFIG_STRING_DEFAULT(ptr_option));
GUI_COLOR(GUI_COLOR_CHAT));
break;
case CONFIG_OPTION_TYPE_COLOR:
gui_chat_printf (NULL,
_(" type: color (values depend on GUI used)"));
gui_chat_printf (NULL,
_(" value: %s%s%s (default: %s)"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
gui_color_get_name (CONFIG_COLOR(ptr_option)),
GUI_COLOR(GUI_COLOR_CHAT),
gui_chat_printf (NULL, " %s: %s",
_("type"), _("color"));
gui_chat_printf (NULL, " %s: %s",
_("values"), _("a color name"));
gui_chat_printf (NULL, " %s: %s",
_("default value"),
gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option)));
gui_chat_printf (NULL, " %s: %s%s",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_HOST),
gui_color_get_name (CONFIG_COLOR(ptr_option)));
break;
case CONFIG_NUM_OPTION_TYPES:
break;
+1 -1
View File
@@ -887,7 +887,7 @@ string_build_with_exploded (char **exploded_string, const char *separator)
}
/*
* string_split_command: split a list of commands separated by 'sep'
* string_split_command: split a list of commands separated by 'separator'
* and ecscaped with '\'
* - empty commands are removed
* - spaces on the left of each commands are stripped
+2 -2
View File
@@ -62,7 +62,7 @@ utf8_has_8bits (const char *string)
/*
* utf8_is_valid: return 1 if UTF-8 string is valid, 0 otherwise
* if error is not NULL, it's set with first non valid UTF-8
* if error is not NULL, it is set with first non valid UTF-8
* char in string, if any
*/
@@ -404,7 +404,7 @@ utf8_add_offset (const char *string, int offset)
}
/*
* utf8_real_pos: get real position in UTF-8
* utf8_real_pos: get real position in UTF-8 string
* for example: ("aébc", 2) returns 3
*/
+2 -3
View File
@@ -170,13 +170,12 @@ util_create_dir (const char *directory, int permissions)
void
util_exec_on_files (const char *directory, void *data,
int (*callback)(void *data, const char *filename))
void (*callback)(void *data, const char *filename))
{
char complete_filename[1024];
DIR *dir;
struct dirent *entry;
struct stat statbuf;
int rc;
if (!directory || !callback)
return;
@@ -191,7 +190,7 @@ util_exec_on_files (const char *directory, void *data,
lstat (complete_filename, &statbuf);
if (!S_ISDIR(statbuf.st_mode))
{
rc = (*callback) (data, complete_filename);
(*callback) (data, complete_filename);
}
}
closedir (dir);
+2 -2
View File
@@ -27,8 +27,8 @@ extern int util_get_time_length (const char *time_format);
extern void util_catch_signal (int signum, void (*handler)(int));
extern int util_create_dir (const char *directory, int permissions);
extern void util_exec_on_files (const char *directory, void *data,
int (*callback)(void *data,
const char *filename));
void (*callback)(void *data,
const char *filename));
extern char *util_search_full_lib_name (const char *filename,
const char *sys_directory);
extern int util_weechat_version_cmp (const char *version1,
+1 -3
View File
@@ -536,7 +536,7 @@ plugin_load (const char *filename)
* but only it this is really a dynamic library
*/
int
void
plugin_auto_load_file (void *plugin, const char *filename)
{
char *pos;
@@ -559,8 +559,6 @@ plugin_auto_load_file (void *plugin, const char *filename)
}
else
plugin_load (filename);
return 1;
}
/*
+2 -2
View File
@@ -246,13 +246,13 @@ weechat_lua_load (const char *filename)
* weechat_lua_load_cb: callback for weechat_script_auto_load() function
*/
int
void
weechat_lua_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
return weechat_lua_load (filename);
weechat_lua_load (filename);
}
/*
+2 -2
View File
@@ -375,13 +375,13 @@ weechat_perl_load (const char *filename)
* weechat_perl_load_cb: callback for weechat_script_auto_load() function
*/
int
void
weechat_perl_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
return weechat_perl_load (filename);
weechat_perl_load (filename);
}
/*
+2 -2
View File
@@ -440,13 +440,13 @@ weechat_python_load (const char *filename)
* weechat_python_load_cb: callback for script_auto_load() function
*/
int
void
weechat_python_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
return weechat_python_load (filename);
weechat_python_load (filename);
}
/*
+2 -2
View File
@@ -421,13 +421,13 @@ weechat_ruby_load (const char *filename)
* weechat_ruby_load_cb: callback for weechat_script_auto_load() function
*/
int
void
weechat_ruby_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
return weechat_ruby_load (filename);
weechat_ruby_load (filename);
}
/*
+2 -2
View File
@@ -93,7 +93,7 @@ script_init (struct t_weechat_plugin *weechat_plugin,
int (*callback_signal_buffer_closed)(void *data, const char *signal,
const char *type_data,
void *signal_data),
int (*callback_load_file)(void *data, const char *filename))
void (*callback_load_file)(void *data, const char *filename))
{
char *string, *completion = "list|listfull|load|autoload|reload|unload %f";
int length;
@@ -208,7 +208,7 @@ script_str2ptr (const char *pointer_str)
void
script_auto_load (struct t_weechat_plugin *weechat_plugin,
int (*callback)(void *data, const char *filename))
void (*callback)(void *data, const char *filename))
{
char *dir_home, *dir_name;
int dir_length;
+2 -2
View File
@@ -73,11 +73,11 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
const char *signal,
const char *type_data,
void *signal_data),
int (*callback_load_file)(void *data, const char *filename));
void (*callback_load_file)(void *data, const char *filename));
extern char *script_ptr2str (void *pointer);
extern void *script_str2ptr (const char *pointer_str);
extern void script_auto_load (struct t_weechat_plugin *weechat_plugin,
int (*callback)(void *data, const char *filename));
void (*callback)(void *data, const char *filename));
extern struct t_plugin_script *script_search (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
const char *name);
+38 -22
View File
@@ -132,7 +132,7 @@ struct t_weechat_plugin
int (*strncasecmp) (const char *string1, const char *string2, int max);
int (*strcmp_ignore_chars) (const char *string1, const char *string2,
const char *chars_ignored, int case_sensitive);
char *(*strcasestr) (const char *string1, const char *string2);
char *(*strcasestr) (const char *string, const char *search);
int (*string_match) (const char *string, const char *mask,
int case_sensitive);
char *(*string_replace) (const char *string, const char *search,
@@ -170,7 +170,7 @@ struct t_weechat_plugin
int (*mkdir_home) (const char *directory, int mode);
int (*mkdir) (const char *directory, int mode);
void (*exec_on_files) (const char *directory, void *data,
int (*callback)(void *data, const char *filename));
void (*callback)(void *data, const char *filename));
/* util */
int (*timeval_cmp) (struct timeval *tv1, struct timeval *tv2);
@@ -179,7 +179,8 @@ struct t_weechat_plugin
/* sorted list */
struct t_weelist *(*list_new) ();
struct t_weelist_item *(*list_add) (struct t_weelist *weelist, const char *data,
struct t_weelist_item *(*list_add) (struct t_weelist *weelist,
const char *data,
const char *where);
struct t_weelist_item *(*list_search) (struct t_weelist *weelist,
const char *data);
@@ -262,8 +263,8 @@ struct t_weechat_plugin
int (*config_string_to_boolean) (const char *text);
int (*config_option_reset) (struct t_config_option *option,
int run_callback);
int (*config_option_set) (struct t_config_option *option, const char *value,
int run_callback);
int (*config_option_set) (struct t_config_option *option,
const char *value, int run_callback);
int (*config_option_unset) (struct t_config_option *option);
void (*config_option_rename) (struct t_config_option *option,
const char *new_name);
@@ -274,7 +275,8 @@ struct t_weechat_plugin
char *(*config_string) (struct t_config_option *option);
int (*config_color) (struct t_config_option *option);
void (*config_write_line) (struct t_config_file *config_file,
const char *option_name, const char *value, ...);
const char *option_name,
const char *value, ...);
int (*config_write) (struct t_config_file *config_file);
int (*config_read) (struct t_config_file *config_file);
int (*config_reload) (struct t_config_file *config_file);
@@ -300,8 +302,10 @@ struct t_weechat_plugin
/* hooks */
struct t_hook *(*hook_command) (struct t_weechat_plugin *plugin,
const char *command, const char *description,
const char *args, const char *args_description,
const char *command,
const char *description,
const char *args,
const char *args_description,
const char *completion,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
@@ -333,11 +337,13 @@ struct t_weechat_plugin
time_t date,
int tags_count,
char **tags,
const char *prefix, const char *message),
const char *prefix,
const char *message),
void *callback_data);
struct t_hook *(*hook_signal) (struct t_weechat_plugin *plugin,
const char *signal,
int (*callback)(void *data, const char *signal,
int (*callback)(void *data,
const char *signal,
const char *type_data,
void *signal_data),
void *callback_data);
@@ -345,7 +351,8 @@ struct t_weechat_plugin
void *signal_data);
struct t_hook *(*hook_config) (struct t_weechat_plugin *plugin,
const char *option,
int (*callback)(void *data, const char *option,
int (*callback)(void *data,
const char *option,
const char *value),
void *callback_data);
struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin,
@@ -366,7 +373,8 @@ struct t_weechat_plugin
const char *string),
void *callback_data);
char *(*hook_modifier_exec) (struct t_weechat_plugin *plugin,
const char *modifier, const char *modifier_data,
const char *modifier,
const char *modifier_data,
const char *string);
struct t_hook *(*hook_info) (struct t_weechat_plugin *plugin,
const char *info_name,
@@ -396,27 +404,34 @@ struct t_weechat_plugin
int (*close_callback)(void *data,
struct t_gui_buffer *buffer),
void *close_callback_data);
struct t_gui_buffer *(*buffer_search) (const char *category, const char *name);
struct t_gui_buffer *(*buffer_search) (const char *category,
const char *name);
void (*buffer_clear) (struct t_gui_buffer *buffer);
void (*buffer_close) (struct t_gui_buffer *buffer, int switch_to_another);
int (*buffer_get_integer) (struct t_gui_buffer *buffer, const char *property);
char *(*buffer_get_string) (struct t_gui_buffer *buffer, const char *property);
void *(*buffer_get_pointer) (struct t_gui_buffer *buffer, const char *property);
int (*buffer_get_integer) (struct t_gui_buffer *buffer,
const char *property);
char *(*buffer_get_string) (struct t_gui_buffer *buffer,
const char *property);
void *(*buffer_get_pointer) (struct t_gui_buffer *buffer,
const char *property);
void (*buffer_set) (struct t_gui_buffer *buffer, const char *property,
void *value);
/* nicklist */
struct t_gui_nick_group *(*nicklist_add_group) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *parent_group,
const char *name, const char *color,
const char *name,
const char *color,
int visible);
struct t_gui_nick_group *(*nicklist_search_group) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *from_group,
const char *name);
struct t_gui_nick *(*nicklist_add_nick) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *group,
const char *name, const char *color,
char prefix, const char *prefix_color,
const char *name,
const char *color,
char prefix,
const char *prefix_color,
int visible);
struct t_gui_nick *(*nicklist_search_nick) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *from_group,
@@ -434,7 +449,8 @@ struct t_weechat_plugin
char *(*build_callback)(void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
int max_width, int max_height),
int max_width,
int max_height),
void *build_callback_data);
void (*bar_item_update) (const char *name);
void (*bar_item_remove) (struct t_gui_bar_item *item);
@@ -560,8 +576,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_plugin->strcmp_ignore_chars(__string1, __string2, \
__chars_ignored, \
__case_sensitive)
#define weechat_strcasestr(__string1, __string2) \
weechat_plugin->strcasestr(__string1, __string2)
#define weechat_strcasestr(__string, __search) \
weechat_plugin->strcasestr(__string, __search)
#define weechat_string_match(__string, __mask, __case_sensitive) \
weechat_plugin->string_match(__string, __mask, __case_sensitive)
#define weechat_string_replace(__string, __search, __replace) \