Kaydet (Commit) 31a4eddf authored tarafından Enrico Tröger's avatar Enrico Tröger

Add utils_copy_environment() to the plugin API.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4764 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst aea9e1cb
......@@ -7,6 +7,9 @@
* wscript:
Fix/Improve GIT repository detection
(patch by Thomas Martitz, thanks).
* plugins/geanyfunctions.h, src/plugindata.h, src/plugins.c,
src/utils.c:
Add utils_copy_environment() to the plugin API.
2010-03-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
......@@ -232,6 +232,8 @@
geany_functions->p_utils->utils_str_remove_chars
#define utils_get_file_list_full \
geany_functions->p_utils->utils_get_file_list_full
#define utils_copy_environment \
geany_functions->p_utils->utils_copy_environment
#define ui_dialog_vbox_new \
geany_functions->p_ui->ui_dialog_vbox_new
#define ui_frame_new_with_alignment \
......
......@@ -50,7 +50,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
GEANY_API_VERSION = 176,
GEANY_API_VERSION = 177,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */
......@@ -393,6 +393,8 @@ typedef struct UtilsFuncs
gchar* (*utils_str_remove_chars) (gchar *string, const gchar *chars);
GSList* (*utils_get_file_list_full)(const gchar *path, gboolean full_path, gboolean sort,
GError **error);
gchar** (*utils_copy_environment)(const gchar **exclude_vars, const gchar *first_varname, ...);
}
UtilsFuncs;
......
......@@ -210,6 +210,7 @@ static UtilsFuncs utils_funcs = {
&utils_str_middle_truncate,
&utils_str_remove_chars,
&utils_get_file_list_full,
&utils_copy_environment
};
static UIUtilsFuncs uiutils_funcs = {
......
......@@ -1916,12 +1916,20 @@ static gboolean str_in_array(const gchar **haystack, const gchar *needle)
}
/* Copies the current environment into a new array.
* exclude_vars is a NULL-terminated array of variable names which should be not copied.
/**
* Copies the current environment into a new array.
* @a exclude_vars is a @c NULL-terminated array of variable names which should be not copied.
* All further arguments are key, value pairs of variables which should be added to
* the environment.
*
* The argument list must be terminated with NULL. */
* The argument list must be @c NULL-terminated.
*
* @param exclude_vars @c NULL-terminated array of variable names to exclude.
* @param first_varname Name of the first variable to copy into the new array.
* @param ... Key-value pairs of variable names and values, @c NULL-terminated.
*
* @return The new environment array.
**/
gchar **utils_copy_environment(const gchar **exclude_vars, const gchar *first_varname, ...)
{
gchar **result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment