From 0f9c35e214a7d047286b0d2ae69fcd60b223b9d4 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Fri, 2 Dec 2011 00:43:12 +0100 Subject: add documentation for plugin config framework --- plugins/plugin20.html | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index 787c048b..b36490ba 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -81,6 +81,11 @@ margin-right: 32px;
xchat_strip
xchat_free
+
xchat_set_pluginpref_str +
xchat_get_pluginpref_str +
xchat_set_pluginpref_int +
xchat_get_pluginpref_int +

xchat_list_get
xchat_list_free
xchat_list_fields (not documented yet) @@ -998,5 +1003,85 @@ A newly allocated string or NULL for failure. You must free this string with xch

+

 xchat_set_pluginpref_str() (new for 2.8.10)

+Prototype: int xchat_set_pluginpref_str (xchat_plugin *ph, const char *var, const char *value); +
+
Description: Saves a plugin-specific setting with string value to a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
var: Name of the setting to save. +
value: String value of the the setting. +
+
+Returns: 1 for success, 0 for failure. +

Example: +
+
int xchat_plugin_init (xchat_plugin *plugin_handle,
+			char **plugin_name,
+			char **plugin_desc,
+			char **plugin_version,
+			char *arg)
+{
+	ph = plugin_handle;
+	*plugin_name = "Tester Thingie";
+	*plugin_desc = "Testing stuff";
+	*plugin_version = "1.0";
+
+	xchat_set_pluginpref_str (ph, "myvar1", "I want to save this string!");
+	xchat_set_pluginpref_str (ph, "myvar2", "This is important, too.");
+
+	return 1;       /* return 1 for success */
+}
+
+In the example above, the settings will be saved to the plugin_tester_thingie.conf file, and its content will be: +
+
myvar1 = I want to save this string!
+myvar2 = This is important, too.
+
+You should never need to edit this file manually. +


+ +

 xchat_get_pluginpref_str() (new for 2.8.10)

+Prototype: int xchat_get_pluginpref_str (xchat_plugin *ph, const char *var, char *dest); +
+
Description: Loads a plugin-specific setting with string value from a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
var: Name of the setting to load. +
dest: Array to save the loaded setting's string value to. +
+
+Returns: 1 for success, 0 for failure. +


+ +

 xchat_set_pluginpref_int() (new for 2.8.10)

+Prototype: int xchat_set_pluginpref_int (xchat_plugin *ph, const char *var, int value); +
+
Description: Saves a plugin-specific setting with decimal value to a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
var: Name of the setting to save. +
value: Decimal value of the the setting. +
+
+Returns: 1 for success, 0 for failure. +


+ +

 xchat_get_pluginpref_int() (new for 2.8.10)

+Prototype: int xchat_get_pluginpref_int (xchat_plugin *ph, const char *var); +
+
Description: Loads a plugin-specific setting with decimal value from a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
var: Name of the setting to load. +
+
+Returns: The decimal value of the requested setting upon success, -1 for failure. +


+ -- cgit 1.4.1 From 71036733e31a72fa49bc992d8ca7217774c8e00c Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Fri, 2 Dec 2011 15:37:40 +0100 Subject: add example for sanitizing xchat_set_pluginpref_int input --- plugins/plugin20.html | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index b36490ba..a9aaaace 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -1068,7 +1068,32 @@ You should never need to edit this file manually.
Returns: 1 for success, 0 for failure. -


+

Example: +
+
static int saveint_cb (char *word[], char *word_eol[], void *user_data)
+{
+	int buffer = atoi (word[2]);
+
+	if (buffer > 0 && buffer < INT_MAX)
+	{
+		if (xchat_set_pluginpref_int (ph, "myint1", buffer))
+		{
+			xchat_printf (ph, "Setting successfully saved!\n");
+		}
+		else
+		{
+			xchat_printf (ph, "Error while saving!\n");
+		}
+	}
+	else
+	{
+		xchat_printf (ph, "Invalid input!\n");
+	}
+
+	return XCHAT_EAT_XCHAT;
+}
+
+

 xchat_get_pluginpref_int() (new for 2.8.10)

Prototype: int xchat_get_pluginpref_int (xchat_plugin *ph, const char *var); -- cgit 1.4.1 From 4942dc667f3ff40601b7afd2efd91dff1f73789a Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 15 Jan 2012 19:07:48 +0100 Subject: refactor plugin config API and add skeleton for xchat_pluginpref_list --- plugins/plugin20.html | 61 ++++++++++++++++++++++++++++++++++------------- plugins/xchat-plugin.h | 37 ++++++++++++++++------------ src/common/plugin.c | 37 ++++++++++++++++------------ src/common/plugin.h | 12 ++++++---- src/common/xchat-plugin.h | 37 ++++++++++++++++------------ src/version-script | 11 +++++---- 6 files changed, 124 insertions(+), 71 deletions(-) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index a9aaaace..6323cd80 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -81,10 +81,12 @@ margin-right: 32px;
xchat_strip
xchat_free
-
xchat_set_pluginpref_str -
xchat_get_pluginpref_str -
xchat_set_pluginpref_int -
xchat_get_pluginpref_int +
xchat_pluginpref_set_str +
xchat_pluginpref_get_str +
xchat_pluginpref_set_int +
xchat_pluginpref_get_int +
xchat_pluginpref_delete +
xchat_pluginpref_list

xchat_list_get
xchat_list_free @@ -1003,8 +1005,8 @@ A newly allocated string or NULL for failure. You must free this string with xch

-

 xchat_set_pluginpref_str() (new for 2.8.10)

-Prototype: int xchat_set_pluginpref_str (xchat_plugin *ph, const char *var, const char *value); +

 xchat_pluginpref_set_str() (new for 2.8.10)

+Prototype: int xchat_pluginpref_set_str (xchat_plugin *ph, const char *var, const char *value);

Description: Saves a plugin-specific setting with string value to a plugin-specific config file.
@@ -1028,8 +1030,8 @@ A newly allocated string or NULL for failure. You must free this string with xch *plugin_desc = "Testing stuff"; *plugin_version = "1.0"; - xchat_set_pluginpref_str (ph, "myvar1", "I want to save this string!"); - xchat_set_pluginpref_str (ph, "myvar2", "This is important, too."); + xchat_pluginpref_set_str (ph, "myvar1", "I want to save this string!"); + xchat_pluginpref_set_str (ph, "myvar2", "This is important, too."); return 1; /* return 1 for success */ } @@ -1042,8 +1044,8 @@ myvar2 = This is important, too. You should never need to edit this file manually.


-

 xchat_get_pluginpref_str() (new for 2.8.10)

-Prototype: int xchat_get_pluginpref_str (xchat_plugin *ph, const char *var, char *dest); +

 xchat_pluginpref_get_str() (new for 2.8.10)

+Prototype: int xchat_pluginpref_get_str (xchat_plugin *ph, const char *var, char *dest);

Description: Loads a plugin-specific setting with string value from a plugin-specific config file.
@@ -1056,8 +1058,8 @@ You should never need to edit this file manually. Returns: 1 for success, 0 for failure.


-

 xchat_set_pluginpref_int() (new for 2.8.10)

-Prototype: int xchat_set_pluginpref_int (xchat_plugin *ph, const char *var, int value); +

 xchat_pluginpref_set_int() (new for 2.8.10)

+Prototype: int xchat_pluginpref_set_int (xchat_plugin *ph, const char *var, int value);

Description: Saves a plugin-specific setting with decimal value to a plugin-specific config file.
@@ -1076,7 +1078,7 @@ You should never need to edit this file manually. if (buffer > 0 && buffer < INT_MAX) { - if (xchat_set_pluginpref_int (ph, "myint1", buffer)) + if (xchat_pluginpref_set_int (ph, "myint1", buffer)) { xchat_printf (ph, "Setting successfully saved!\n"); } @@ -1093,10 +1095,11 @@ You should never need to edit this file manually. return XCHAT_EAT_XCHAT; } -

+You only need these kind of complex checks if you're saving user input, which can be non-numeric. +


-

 xchat_get_pluginpref_int() (new for 2.8.10)

-Prototype: int xchat_get_pluginpref_int (xchat_plugin *ph, const char *var); +

 xchat_pluginpref_get_int() (new for 2.8.10)

+Prototype: int xchat_pluginpref_get_int (xchat_plugin *ph, const char *var);

Description: Loads a plugin-specific setting with decimal value from a plugin-specific config file.
@@ -1108,5 +1111,31 @@ You should never need to edit this file manually. Returns: The decimal value of the requested setting upon success, -1 for failure.


+

 xchat_pluginpref_delete() (new for 2.8.10)

+Prototype: int xchat_pluginpref_delete (xchat_plugin *ph, const char *var); +
+
Description: Deletes a plugin-specific setting from a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
var: Name of the setting to delete. +
+
+Returns: 1 for success, 0 for failure. If the given setting didn't exist, it also returns 1, so 1 only indicates that the setting won't exist after the call. +


+ +

 xchat_pluginpref_list() (new for 2.8.10)

+Prototype: int xchat_pluginpref_list (xchat_plugin *ph, const char *dest); +
+
Description: Builds a comma-separated list of the currently saved settings from a plugin-specific config file. +
+
Arguments: +
ph: Plugin handle (as given to xchat_plugin_init). +
dest: Array to save the list to. +
+
+Returns: 1 for success, 0 for failure. +


+ diff --git a/plugins/xchat-plugin.h b/plugins/xchat-plugin.h index 373c664e..1b7da8fb 100644 --- a/plugins/xchat-plugin.h +++ b/plugins/xchat-plugin.h @@ -137,19 +137,21 @@ struct _xchat_plugin int flags); void (*xchat_free) (xchat_plugin *ph, void *ptr); - int (*xchat_set_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_set_str) (xchat_plugin *ph, const char *var, const char *value); - int (*xchat_get_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_get_str) (xchat_plugin *ph, const char *var, char *dest); - int (*xchat_set_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_set_int) (xchat_plugin *ph, const char *var, int value); - int (*xchat_get_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_get_int) (xchat_plugin *ph, const char *var); - int (*xchat_del_pluginpref) (xchat_plugin *ph, + int (*xchat_pluginpref_delete) (xchat_plugin *ph, const char *var); + int (*xchat_pluginpref_list) (xchat_plugin *ph, + char *dest); }; #endif @@ -306,27 +308,31 @@ xchat_free (xchat_plugin *ph, void *ptr); int -xchat_set_pluginpref_str (xchat_plugin *ph, +xchat_pluginpref_set_str (xchat_plugin *ph, const char *var, const char *value); int -xchat_get_pluginpref_str (xchat_plugin *ph, +xchat_pluginpref_get_str (xchat_plugin *ph, const char *var, char *dest); int -xchat_set_pluginpref_int (xchat_plugin *ph, +xchat_pluginpref_set_int (xchat_plugin *ph, const char *var, int value); int -xchat_get_pluginpref_int (xchat_plugin *ph, +xchat_pluginpref_get_int (xchat_plugin *ph, const char *var); int -xchat_del_pluginpref (xchat_plugin *ph, +xchat_pluginpref_delete (xchat_plugin *ph, const char *var); +int +xchat_pluginpref_list (xchat_plugin *ph, + char *dest); + #if !defined(PLUGIN_C) && defined(WIN32) #ifndef XCHAT_PLUGIN_HANDLE #define XCHAT_PLUGIN_HANDLE (ph) @@ -361,11 +367,12 @@ xchat_del_pluginpref (xchat_plugin *ph, #define xchat_send_modes ((XCHAT_PLUGIN_HANDLE)->xchat_send_modes) #define xchat_strip ((XCHAT_PLUGIN_HANDLE)->xchat_strip) #define xchat_free ((XCHAT_PLUGIN_HANDLE)->xchat_free) -#define xchat_set_pluginpref_str ((XCHAT_PLUGIN_HANDLE)->xchat_set_pluginpref_str) -#define xchat_get_pluginpref_str ((XCHAT_PLUGIN_HANDLE)->xchat_get_pluginpref_str) -#define xchat_set_pluginpref_int ((XCHAT_PLUGIN_HANDLE)->xchat_set_pluginpref_int) -#define xchat_get_pluginpref_int ((XCHAT_PLUGIN_HANDLE)->xchat_get_pluginpref_int) -#define xchat_del_pluginpref ((XCHAT_PLUGIN_HANDLE)->xchat_del_pluginpref) +#define xchat_pluginpref_set_str ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_set_str) +#define xchat_pluginpref_get_str ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_get_str) +#define xchat_pluginpref_set_int ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_set_int) +#define xchat_pluginpref_get_int ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_get_int) +#define xchat_pluginpref_delete ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_delete) +#define xchat_pluginpref_list ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_list) #endif #ifdef __cplusplus diff --git a/src/common/plugin.c b/src/common/plugin.c index b08143e0..cff8d49b 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -270,11 +270,12 @@ plugin_add (session *sess, char *filename, void *handle, void *init_func, pl->xchat_send_modes = xchat_send_modes; pl->xchat_strip = xchat_strip; pl->xchat_free = xchat_free; - pl->xchat_set_pluginpref_str = xchat_set_pluginpref_str; - pl->xchat_get_pluginpref_str = xchat_get_pluginpref_str; - pl->xchat_set_pluginpref_int = xchat_set_pluginpref_int; - pl->xchat_get_pluginpref_int = xchat_get_pluginpref_int; - pl->xchat_del_pluginpref = xchat_del_pluginpref; + pl->xchat_pluginpref_set_str = xchat_pluginpref_set_str; + pl->xchat_pluginpref_get_str = xchat_pluginpref_get_str; + pl->xchat_pluginpref_set_int = xchat_pluginpref_set_int; + pl->xchat_pluginpref_get_int = xchat_pluginpref_get_int; + pl->xchat_pluginpref_delete = xchat_pluginpref_delete; + pl->xchat_pluginpref_list = xchat_pluginpref_list; /* incase new plugins are loaded on older xchat */ pl->xchat_dummy4 = xchat_dummy; @@ -1589,7 +1590,7 @@ xchat_free (xchat_plugin *ph, void *ptr) } static int -xchat_set_pluginpref_str_real (xchat_plugin *pl, const char *var, const char *value, int mode) /* mode: 0 = delete, 1 = save */ +xchat_pluginpref_set_str_real (xchat_plugin *pl, const char *var, const char *value, int mode) /* mode: 0 = delete, 1 = save */ { FILE *fpIn; int fhOut; @@ -1702,13 +1703,13 @@ xchat_set_pluginpref_str_real (xchat_plugin *pl, const char *var, const char *va } int -xchat_set_pluginpref_str (xchat_plugin *pl, const char *var, const char *value) +xchat_pluginpref_set_str (xchat_plugin *pl, const char *var, const char *value) { - return xchat_set_pluginpref_str_real (pl, var, value, 1); + return xchat_pluginpref_set_str_real (pl, var, value, 1); } int -xchat_get_pluginpref_str (xchat_plugin *pl, const char *var, char *dest) +xchat_pluginpref_get_str (xchat_plugin *pl, const char *var, char *dest) { int fh; int l; @@ -1760,20 +1761,20 @@ xchat_get_pluginpref_str (xchat_plugin *pl, const char *var, char *dest) } int -xchat_set_pluginpref_int (xchat_plugin *pl, const char *var, int value) +xchat_pluginpref_set_int (xchat_plugin *pl, const char *var, int value) { char buffer[12]; sprintf (buffer, "%d", value); - return xchat_set_pluginpref_str_real (pl, var, buffer, 1); + return xchat_pluginpref_set_str_real (pl, var, buffer, 1); } int -xchat_get_pluginpref_int (xchat_plugin *pl, const char *var) +xchat_pluginpref_get_int (xchat_plugin *pl, const char *var) { char buffer[12]; - if (xchat_get_pluginpref_str (pl, var, buffer)) + if (xchat_pluginpref_get_str (pl, var, buffer)) { return atoi (buffer); } @@ -1784,7 +1785,13 @@ xchat_get_pluginpref_int (xchat_plugin *pl, const char *var) } int -xchat_del_pluginpref (xchat_plugin *pl, const char *var) +xchat_pluginpref_delete (xchat_plugin *pl, const char *var) { - return xchat_set_pluginpref_str_real (pl, var, 0, 0); + return xchat_pluginpref_set_str_real (pl, var, 0, 0); } + +int +xchat_pluginpref_list (char* dest) +{ + return 0; +} \ No newline at end of file diff --git a/src/common/plugin.h b/src/common/plugin.h index bb86f0a3..8c347d51 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -98,19 +98,21 @@ struct _xchat_plugin int flags); void (*xchat_free) (xchat_plugin *ph, void *ptr); - int (*xchat_set_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_set_str) (xchat_plugin *ph, const char *var, const char *value); - int (*xchat_get_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_get_str) (xchat_plugin *ph, const char *var, char *dest); - int (*xchat_set_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_set_int) (xchat_plugin *ph, const char *var, int value); - int (*xchat_get_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_get_int) (xchat_plugin *ph, const char *var); - int (*xchat_del_pluginpref) (xchat_plugin *ph, + int (*xchat_pluginpref_delete) (xchat_plugin *ph, const char *var); + int (*xchat_pluginpref_list) (xchat_plugin *ph, + char *dest); void *(*xchat_dummy4) (xchat_plugin *ph); void *(*xchat_dummy3) (xchat_plugin *ph); void *(*xchat_dummy2) (xchat_plugin *ph); diff --git a/src/common/xchat-plugin.h b/src/common/xchat-plugin.h index 373c664e..1b7da8fb 100644 --- a/src/common/xchat-plugin.h +++ b/src/common/xchat-plugin.h @@ -137,19 +137,21 @@ struct _xchat_plugin int flags); void (*xchat_free) (xchat_plugin *ph, void *ptr); - int (*xchat_set_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_set_str) (xchat_plugin *ph, const char *var, const char *value); - int (*xchat_get_pluginpref_str) (xchat_plugin *ph, + int (*xchat_pluginpref_get_str) (xchat_plugin *ph, const char *var, char *dest); - int (*xchat_set_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_set_int) (xchat_plugin *ph, const char *var, int value); - int (*xchat_get_pluginpref_int) (xchat_plugin *ph, + int (*xchat_pluginpref_get_int) (xchat_plugin *ph, const char *var); - int (*xchat_del_pluginpref) (xchat_plugin *ph, + int (*xchat_pluginpref_delete) (xchat_plugin *ph, const char *var); + int (*xchat_pluginpref_list) (xchat_plugin *ph, + char *dest); }; #endif @@ -306,27 +308,31 @@ xchat_free (xchat_plugin *ph, void *ptr); int -xchat_set_pluginpref_str (xchat_plugin *ph, +xchat_pluginpref_set_str (xchat_plugin *ph, const char *var, const char *value); int -xchat_get_pluginpref_str (xchat_plugin *ph, +xchat_pluginpref_get_str (xchat_plugin *ph, const char *var, char *dest); int -xchat_set_pluginpref_int (xchat_plugin *ph, +xchat_pluginpref_set_int (xchat_plugin *ph, const char *var, int value); int -xchat_get_pluginpref_int (xchat_plugin *ph, +xchat_pluginpref_get_int (xchat_plugin *ph, const char *var); int -xchat_del_pluginpref (xchat_plugin *ph, +xchat_pluginpref_delete (xchat_plugin *ph, const char *var); +int +xchat_pluginpref_list (xchat_plugin *ph, + char *dest); + #if !defined(PLUGIN_C) && defined(WIN32) #ifndef XCHAT_PLUGIN_HANDLE #define XCHAT_PLUGIN_HANDLE (ph) @@ -361,11 +367,12 @@ xchat_del_pluginpref (xchat_plugin *ph, #define xchat_send_modes ((XCHAT_PLUGIN_HANDLE)->xchat_send_modes) #define xchat_strip ((XCHAT_PLUGIN_HANDLE)->xchat_strip) #define xchat_free ((XCHAT_PLUGIN_HANDLE)->xchat_free) -#define xchat_set_pluginpref_str ((XCHAT_PLUGIN_HANDLE)->xchat_set_pluginpref_str) -#define xchat_get_pluginpref_str ((XCHAT_PLUGIN_HANDLE)->xchat_get_pluginpref_str) -#define xchat_set_pluginpref_int ((XCHAT_PLUGIN_HANDLE)->xchat_set_pluginpref_int) -#define xchat_get_pluginpref_int ((XCHAT_PLUGIN_HANDLE)->xchat_get_pluginpref_int) -#define xchat_del_pluginpref ((XCHAT_PLUGIN_HANDLE)->xchat_del_pluginpref) +#define xchat_pluginpref_set_str ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_set_str) +#define xchat_pluginpref_get_str ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_get_str) +#define xchat_pluginpref_set_int ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_set_int) +#define xchat_pluginpref_get_int ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_get_int) +#define xchat_pluginpref_delete ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_delete) +#define xchat_pluginpref_list ((XCHAT_PLUGIN_HANDLE)->xchat_pluginpref_list) #endif #ifdef __cplusplus diff --git a/src/version-script b/src/version-script index fe04dd46..4441aeae 100644 --- a/src/version-script +++ b/src/version-script @@ -30,10 +30,11 @@ EXPORTED { xchat_send_modes; xchat_strip; xchat_free; - xchat_set_pluginpref_str; - xchat_get_pluginpref_str; - xchat_set_pluginpref_int; - xchat_get_pluginpref_int; - xchat_del_pluginpref; + xchat_pluginpref_set_str; + xchat_pluginpref_get_str; + xchat_pluginpref_set_int; + xchat_pluginpref_get_int; + xchat_pluginpref_delete; + xchat_pluginpref_list; local: *; }; -- cgit 1.4.1 From 3e93c323922ef073b2db9c61e5f04f4bc3db0637 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 15 Jan 2012 21:24:56 +0100 Subject: additional hints about xchat_pluginpref_list return value --- plugins/plugin20.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index 6323cd80..32b479a7 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -1134,7 +1134,7 @@ You only need these kind of complex checks if you're saving user input, which ca
dest: Array to save the list to.
-Returns: 1 for success, 0 for failure. +Returns: 1 for success, 0 for failure (nonexistent, empty or inaccessible config file).


-- cgit 1.4.1 From 66e0f75e148110d489d3a5f680e620fdf45a4451 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 15 Jan 2012 22:31:39 +0100 Subject: fix prototype in plugin docs --- plugins/plugin20.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index 32b479a7..fcdff2ed 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -1125,7 +1125,7 @@ You only need these kind of complex checks if you're saving user input, which ca


 xchat_pluginpref_list() (new for 2.8.10)

-Prototype: int xchat_pluginpref_list (xchat_plugin *ph, const char *dest); +Prototype: int xchat_pluginpref_list (xchat_plugin *ph, char *dest);

Description: Builds a comma-separated list of the currently saved settings from a plugin-specific config file.
-- cgit 1.4.1