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

doc: add missing pointer in examples (plugin API reference)

This commit is contained in:
Sébastien Helleu
2016-03-28 13:13:28 +02:00
parent 5210ff1ae9
commit bd0d8d5a1c
4 changed files with 74 additions and 39 deletions
+15 -8
View File
@@ -175,8 +175,9 @@ struct t_weechat_plugin *weechat_plugin = NULL;
/* callback for command "/double" */
int
command_double_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
command_double_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
/* make C compiler happy */
(void) data;
@@ -5851,7 +5852,8 @@ C example:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -5902,7 +5904,8 @@ C example:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -11324,11 +11327,15 @@ Prototypes for callbacks:
[source,C]
----
int close_callback (void *data, struct t_gui_buffer *buffer);
int close_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer);
int input_callback (void *data, struct t_gui_buffer *buffer, const char *input_data);
int input_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer, const char *input_data);
int nickcmp_callback (void *data, struct t_gui_buffer *buffer, const char *nick1, const char *nick2);
int nickcmp_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *nick1, const char *nick2);
----
C example:
@@ -11336,7 +11343,7 @@ C example:
[source,C]
----
int
my_close_cb (void *data, struct t_gui_buffer *buffer)
my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
/* ... */
return WEECHAT_RC_OK;
+15 -8
View File
@@ -179,8 +179,9 @@ struct t_weechat_plugin *weechat_plugin = NULL;
/* callback pour la commande "/double" */
int
commande_double_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
commande_double_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
/* pour que le compilateur C soit content */
(void) data;
@@ -5948,7 +5949,8 @@ Exemple en C :
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "ma_section", NULL);
@@ -6000,7 +6002,8 @@ Exemple en C :
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "ma_section", NULL);
@@ -11573,11 +11576,15 @@ Prototypes pour les "callbacks" :
[source,C]
----
int close_callback (void *data, struct t_gui_buffer *buffer);
int close_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer);
int input_callback (void *data, struct t_gui_buffer *buffer, const char *input_data);
int input_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer, const char *input_data);
int nickcmp_callback (void *data, struct t_gui_buffer *buffer, const char *nick1, const char *nick2);
int nickcmp_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *nick1, const char *nick2);
----
Exemple en C :
@@ -11585,7 +11592,7 @@ Exemple en C :
[source,C]
----
int
my_close_cb (void *data, struct t_gui_buffer *buffer)
my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
/* ... */
return WEECHAT_RC_OK;
+15 -8
View File
@@ -190,8 +190,9 @@ struct t_weechat_plugin *weechat_plugin = NULL;
/* callback per il comando "/double" */
int
command_double_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
command_double_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
/* fa felice il compilatore C */
(void) data;
@@ -5999,7 +6000,8 @@ Esempio in C:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -6051,7 +6053,8 @@ Esempio in C:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -11734,11 +11737,15 @@ Prototypes for callbacks:
[source,C]
----
int close_callback (void *data, struct t_gui_buffer *buffer);
int close_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer);
int input_callback (void *data, struct t_gui_buffer *buffer, const char *input_data);
int input_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer, const char *input_data);
int nickcmp_callback (void *data, struct t_gui_buffer *buffer, const char *nick1, const char *nick2);
int nickcmp_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *nick1, const char *nick2);
----
Esempio in C:
@@ -11746,7 +11753,7 @@ Esempio in C:
[source,C]
----
int
my_close_cb (void *data, struct t_gui_buffer *buffer)
my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
/* ... */
return WEECHAT_RC_OK;
+29 -15
View File
@@ -180,8 +180,9 @@ struct t_weechat_plugin *weechat_plugin = NULL;
/* "/double" コマンドのコールバック*/
int
command_double_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
command_double_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
/* C 言語コンパイラ向けに必要 */
(void) data;
@@ -4491,8 +4492,10 @@ C 言語での使用例:
[source,C]
----
int
my_section_read_cb (void *data, struct t_config_file *config_file,
struct t_config_section *section, const char *option_name,
my_section_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
/* ... */
@@ -4503,7 +4506,8 @@ my_section_read_cb (void *data, struct t_config_file *config_file,
}
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
/* ... */
@@ -4514,7 +4518,8 @@ my_section_write_cb (void *data, struct t_config_file *config_file,
}
int
my_section_write_default_cb (void *data, struct t_config_file *config_file,
my_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
/* ... */
@@ -4525,9 +4530,11 @@ my_section_write_default_cb (void *data, struct t_config_file *config_file,
}
int
my_section_create_option_cb (void *data, struct t_config_file *config_file,
my_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
const char *option_name,
const char *value)
{
/* ... */
@@ -4538,7 +4545,8 @@ my_section_create_option_cb (void *data, struct t_config_file *config_file,
}
int
my_section_delete_option_cb (void *data, struct t_config_file *config_file,
my_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
@@ -5851,7 +5859,8 @@ C 言語での使用例:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -5902,7 +5911,8 @@ C 言語での使用例:
[source,C]
----
int
my_section_write_cb (void *data, struct t_config_file *config_file,
my_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
weechat_config_write_line (config_file, "my_section", NULL);
@@ -11337,11 +11347,15 @@ void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *proper
[source,C]
----
int close_callback (void *data, struct t_gui_buffer *buffer);
int close_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer);
int input_callback (void *data, struct t_gui_buffer *buffer, const char *input_data);
int input_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer, const char *input_data);
int nickcmp_callback (void *data, struct t_gui_buffer *buffer, const char *nick1, const char *nick2);
int nickcmp_callback (const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *nick1, const char *nick2);
----
C 言語での使用例:
@@ -11349,7 +11363,7 @@ C 言語での使用例:
[source,C]
----
int
my_close_cb (void *data, struct t_gui_buffer *buffer)
my_close_cb (const void *pointer, void *data, struct t_gui_buffer *buffer)
{
/* ... */
return WEECHAT_RC_OK;