2000-11-05  Havoc Pennington  <hp@pobox.com>

        * glib/tmpl/spawn.sgml, glib/tmpl/markup.sgml,
	glib/tmpl/fileutils.sgml: Added

	* glib/Makefile.am: Add new files

	* glib/glib-sections.txt: Add stuff from -unused

2000-11-05  Havoc Pennington  <hp@pobox.com>

* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header

* gfileutils.c (g_mkstemp): clean up docs

* gshell.h: sync param names with param names in .c file

* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc

* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
This commit is contained in:
Havoc Pennington 2000-11-05 16:38:16 +00:00 committed by Havoc Pennington
parent 56f81205cf
commit 110c6cbac8
32 changed files with 661 additions and 61 deletions

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,18 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* gutils.c (g_find_program_in_path): cleanup docs, sync param
names to those in the header
* gfileutils.c (g_mkstemp): clean up docs
* gshell.h: sync param names with param names in .c file
* gfileutils.h (enum GFileTest): remove trailing comma from last
member, confuses gtk-doc
* gmarkup.h: s/GMarkupErrorType/GMarkupError/g; to follow
convention
2000-11-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gasyncqueue.c: Added documentation for asyncronous queues.

View File

@ -1,3 +1,12 @@
2000-11-05 Havoc Pennington <hp@pobox.com>
* glib/tmpl/spawn.sgml, glib/tmpl/markup.sgml,
glib/tmpl/fileutils.sgml: Added
* glib/Makefile.am: Add new files
* glib/glib-sections.txt: Add stuff from -unused
Fri Nov 3 07:33:15 2000 Tim Janik <timj@gtk.org>
* gobject/gobject-docs.sgml: added &gobject-closures; section.

View File

@ -34,6 +34,7 @@ tmpl_sources = \
tmpl/datasets.sgml \
tmpl/date.sgml \
tmpl/error_reporting.sgml \
tmpl/fileutils.sgml \
tmpl/glib-unused.sgml \
tmpl/hash_tables.sgml \
tmpl/hooks.sgml \
@ -44,6 +45,7 @@ tmpl_sources = \
tmpl/macros.sgml \
tmpl/macros_misc.sgml \
tmpl/main.sgml \
tmpl/markup.sgml \
tmpl/memory.sgml \
tmpl/memory_chunks.sgml \
tmpl/messages.sgml \
@ -55,6 +57,8 @@ tmpl_sources = \
tmpl/random_numbers.sgml \
tmpl/relations.sgml \
tmpl/scanner.sgml \
tmpl/shell.sgml \
tmpl/spawn.sgml \
tmpl/string_chunks.sgml \
tmpl/string_utils.sgml \
tmpl/strings.sgml \

View File

@ -678,6 +678,69 @@ g_timer_reset
g_timer_destroy
</SECTION>
<SECTION>
<TITLE>Spawning Processes (fork/exec)</TITLE>
<FILE>spawn</FILE>
GSpawnError
G_SPAWN_ERROR
GSpawnFlags
GSpawnChildSetupFunc
g_spawn_async_with_pipes
g_spawn_async
g_spawn_sync
g_spawn_command_line_async
g_spawn_command_line_sync
<SUBSECTION Private>
g_spawn_error_quark
</SECTION>
<SECTION>
<TITLE>Simple XML Subset Parser</TITLE>
<FILE>markup</FILE>
GMarkupError
G_MARKUP_ERROR
GMarkupParseFlags
GMarkupParseContext
GMarkupParser
g_markup_escape_text
g_markup_parse_context_end_parse
g_markup_parse_context_free
g_markup_parse_context_get_position
g_markup_parse_context_new
g_markup_parse_context_parse
<SUBSECTION Private>
g_markup_error_quark
</SECTION>
<SECTION>
<TITLE>Shell-related Utilities</TITLE>
<FILE>shell</FILE>
GShellError
G_SHELL_ERROR
g_shell_parse_argv
g_shell_quote
g_shell_unquote
<SUBSECTION Private>
g_shell_error_quark
</SECTION>
<SECTION>
<TITLE>File Utilities</TITLE>
<FILE>fileutils</FILE>
GFileError
G_FILE_ERROR
GFileTest
g_file_error_from_errno
g_file_get_contents
g_file_test
g_mkstemp
<SUBSECTION Private>
g_file_error_quark
</SECTION>
<SECTION>
<TITLE>String Utility Functions</TITLE>
<FILE>string_utils</FILE>
@ -890,6 +953,9 @@ g_path_get_dirname
g_filename_to_utf8
g_filename_from_utf8
<SUBSECTION>
g_find_program_in_path
<SUBSECTION>
g_bit_nth_lsf
g_bit_nth_msf
@ -1223,6 +1289,7 @@ g_str_hash
<FILE>strings</FILE>
GString
g_string_new
g_string_new_len
g_string_sized_new
g_string_assign
g_string_sprintf

View File

@ -51,11 +51,11 @@ called by g_cache_remove() when the object is no longer needed (i.e. its
reference count drops to 0).
@hash_key_func: a function to create a hash value from a key.
@hash_value_func: a function to create a hash value from a value.
@key_compare_func:
@Returns: a new #GCache.
<!-- # Unused Parameters # -->
@key_equal_func: a function to compare two keys. It should return TRUE if
the two keys are equivalent.
@Returns: a new #GCache.
<!-- # Unused Parameters # -->
@key_compare_func:
<!-- ##### FUNCTION g_cache_insert ##### -->

View File

@ -0,0 +1,104 @@
<!-- ##### SECTION Title ##### -->
File Utilities
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### ENUM GFileError ##### -->
<para>
</para>
@G_FILE_ERROR_EXIST:
@G_FILE_ERROR_ISDIR:
@G_FILE_ERROR_ACCES:
@G_FILE_ERROR_NAMETOOLONG:
@G_FILE_ERROR_NOENT:
@G_FILE_ERROR_NOTDIR:
@G_FILE_ERROR_NXIO:
@G_FILE_ERROR_NODEV:
@G_FILE_ERROR_ROFS:
@G_FILE_ERROR_TXTBSY:
@G_FILE_ERROR_FAULT:
@G_FILE_ERROR_LOOP:
@G_FILE_ERROR_NOSPC:
@G_FILE_ERROR_NOMEM:
@G_FILE_ERROR_MFILE:
@G_FILE_ERROR_NFILE:
@G_FILE_ERROR_BADF:
@G_FILE_ERROR_INVAL:
@G_FILE_ERROR_PIPE:
@G_FILE_ERROR_AGAIN:
@G_FILE_ERROR_INTR:
@G_FILE_ERROR_IO:
@G_FILE_ERROR_PERM:
@G_FILE_ERROR_FAILED:
<!-- ##### MACRO G_FILE_ERROR ##### -->
<para>
</para>
<!-- ##### ENUM GFileTest ##### -->
<para>
</para>
@G_FILE_TEST_IS_REGULAR:
@G_FILE_TEST_IS_SYMLINK:
@G_FILE_TEST_IS_DIR:
@G_FILE_TEST_IS_EXECUTABLE:
@G_FILE_TEST_EXISTS:
<!-- ##### FUNCTION g_file_error_from_errno ##### -->
<para>
</para>
@err_no:
@Returns:
<!-- ##### FUNCTION g_file_get_contents ##### -->
<para>
</para>
@filename:
@contents:
@length:
@error:
@Returns:
<!-- ##### FUNCTION g_file_test ##### -->
<para>
</para>
@filename:
@test:
@Returns:
<!-- ##### FUNCTION g_mkstemp ##### -->
<para>
</para>
@tmpl:
@Returns:

View File

@ -65,17 +65,6 @@ Turns the argument into a string literal by using the '#' stringizing operator.
</para>
<!-- ##### USER_FUNCTION GEqualFunc ##### -->
<para>
Specifies the type of a function used to test two values for
equality. The function should return TRUE if both values are equal and
FALSE otherwise.
</para>
@a: a value.
@b: a value to compare with.
@Returns: TRUE if @a = @b; FALSE otherwise.
<!-- ##### FUNCTION g_convert_error_quark ##### -->
<para>

View File

@ -69,15 +69,15 @@ Hash values are used to determine where keys are stored within the
#GHashTable data structure.
The g_direct_hash(), g_int_hash() and g_str_hash() functions are provided for
some common types of keys. If hash_func is NULL, g_direct_hash() is used.
@key_compare_func:
@Returns: a new #GHashTable.
<!-- # Unused Parameters # -->
@key_equal_func: a function to check two keys for equality. This is
used when looking up keys in the #GHashTable. The g_direct_equal(),
g_int_equal() and g_str_equal() functions are provided for the most
common types of keys. If @key_equal_func is NULL, keys are compared
directly in a similar fashion to g_direct_equal(), but without the
overhead of a function call.
@Returns: a new #GHashTable.
<!-- # Unused Parameters # -->
@key_compare_func:
<!-- ##### USER_FUNCTION GHashFunc ##### -->
@ -104,6 +104,18 @@ lookup.
@Returns: the hash value corresponding to the key.
<!-- ##### USER_FUNCTION GEqualFunc ##### -->
<para>
Specifies the type of a function used to test two values for
equality. The function should return TRUE if both values are equal and
FALSE otherwise.
</para>
@a: a value.
@b: a value to compare with.
@Returns: TRUE if @a = @b; FALSE otherwise.
<!-- ##### FUNCTION g_hash_table_insert ##### -->
<para>
Inserts a new key and value into a #GHashTable.

View File

@ -0,0 +1,121 @@
<!-- ##### SECTION Title ##### -->
Simple XML Subset Parser
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### ENUM GMarkupError ##### -->
<para>
</para>
@G_MARKUP_ERROR_BAD_UTF8:
@G_MARKUP_ERROR_EMPTY:
@G_MARKUP_ERROR_PARSE:
@G_MARKUP_ERROR_UNKNOWN_ELEMENT:
@G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE:
@G_MARKUP_ERROR_INVALID_CONTENT:
<!-- ##### MACRO G_MARKUP_ERROR ##### -->
<para>
</para>
<!-- ##### ENUM GMarkupParseFlags ##### -->
<para>
</para>
@G_MARKUP_FOO:
<!-- ##### STRUCT GMarkupParseContext ##### -->
<para>
</para>
<!-- ##### STRUCT GMarkupParser ##### -->
<para>
</para>
@start_element:
@end_element:
@text:
@passthrough:
@error:
<!-- ##### FUNCTION g_markup_escape_text ##### -->
<para>
</para>
@text:
@length:
@Returns:
<!-- ##### FUNCTION g_markup_parse_context_end_parse ##### -->
<para>
</para>
@context:
@error:
@Returns:
<!-- ##### FUNCTION g_markup_parse_context_free ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION g_markup_parse_context_get_position ##### -->
<para>
</para>
@context:
@line_number:
@char_number:
<!-- ##### FUNCTION g_markup_parse_context_new ##### -->
<para>
</para>
@parser:
@flags:
@user_data:
@user_data_dnotify:
@Returns:
<!-- ##### FUNCTION g_markup_parse_context_parse ##### -->
<para>
</para>
@context:
@text:
@text_len:
@error:
@Returns:

View File

@ -188,6 +188,15 @@ freed when no longer needed.
@Returns:
<!-- ##### FUNCTION g_find_program_in_path ##### -->
<para>
</para>
@program:
@Returns:
<!-- ##### FUNCTION g_bit_nth_lsf ##### -->
<para>
Find the position of the first bit set in @mask, searching from (but not

View File

@ -83,9 +83,9 @@ Note that this must be called before any records are added to the #GRelation.
@relation: a #GRelation.
@field: the field to index, counting from 0.
@hash_func: a function to produce a hash value from the field data.
@key_compare_func:
<!-- # Unused Parameters # -->
@key_equal_func: a function to compare two values of the given field.
<!-- # Unused Parameters # -->
@key_compare_func:
<!-- ##### FUNCTION g_relation_insert ##### -->

View File

@ -0,0 +1,145 @@
<!-- ##### SECTION Title ##### -->
Spawning Processes (fork/exec)
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### ENUM GSpawnError ##### -->
<para>
</para>
@G_SPAWN_ERROR_FORK:
@G_SPAWN_ERROR_READ:
@G_SPAWN_ERROR_CHDIR:
@G_SPAWN_ERROR_ACCES:
@G_SPAWN_ERROR_PERM:
@G_SPAWN_ERROR_2BIG:
@G_SPAWN_ERROR_NOEXEC:
@G_SPAWN_ERROR_NAMETOOLONG:
@G_SPAWN_ERROR_NOENT:
@G_SPAWN_ERROR_NOMEM:
@G_SPAWN_ERROR_NOTDIR:
@G_SPAWN_ERROR_LOOP:
@G_SPAWN_ERROR_TXTBUSY:
@G_SPAWN_ERROR_IO:
@G_SPAWN_ERROR_NFILE:
@G_SPAWN_ERROR_MFILE:
@G_SPAWN_ERROR_INVAL:
@G_SPAWN_ERROR_ISDIR:
@G_SPAWN_ERROR_LIBBAD:
@G_SPAWN_ERROR_FAILED:
<!-- ##### MACRO G_SPAWN_ERROR ##### -->
<para>
</para>
<!-- ##### ENUM GSpawnFlags ##### -->
<para>
</para>
@G_SPAWN_LEAVE_DESCRIPTORS_OPEN:
@G_SPAWN_DO_NOT_REAP_CHILD:
@G_SPAWN_SEARCH_PATH:
@G_SPAWN_STDOUT_TO_DEV_NULL:
@G_SPAWN_STDERR_TO_DEV_NULL:
@G_SPAWN_CHILD_INHERITS_STDIN:
<!-- ##### USER_FUNCTION GSpawnChildSetupFunc ##### -->
<para>
</para>
@user_data:
<!-- ##### FUNCTION g_spawn_async_with_pipes ##### -->
<para>
</para>
@working_directory:
@argv:
@envp:
@flags:
@child_setup:
@user_data:
@child_pid:
@standard_input:
@standard_output:
@standard_error:
@error:
@Returns:
<!-- ##### FUNCTION g_spawn_async ##### -->
<para>
</para>
@working_directory:
@argv:
@envp:
@flags:
@child_setup:
@user_data:
@child_pid:
@error:
@Returns:
<!-- ##### FUNCTION g_spawn_sync ##### -->
<para>
</para>
@working_directory:
@argv:
@envp:
@flags:
@child_setup:
@user_data:
@standard_output:
@standard_error:
@exit_status:
@error:
@Returns:
<!-- ##### FUNCTION g_spawn_command_line_async ##### -->
<para>
</para>
@command_line:
@error:
@Returns:
<!-- ##### FUNCTION g_spawn_command_line_sync ##### -->
<para>
</para>
@command_line:
@standard_output:
@standard_error:
@exit_status:
@error:
@Returns:

View File

@ -45,6 +45,16 @@ Creates a new #GString, initialized with the given string.
@Returns: the new #GString.
<!-- ##### FUNCTION g_string_new_len ##### -->
<para>
</para>
@init:
@len:
@Returns:
<!-- ##### FUNCTION g_string_sized_new ##### -->
<para>
Creates a new GString, with enough space for @dfl_size characters.

View File

@ -502,10 +502,17 @@ g_file_get_contents (const gchar *filename,
#endif
}
/*
* mkstemp() implementation is from the GNU C library.
* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
*/
/**
* g_mkstemp:
* @tmpl: template filename
*
* Open a temporary file
* Open a temporary file. See "man mkstemp" on most UNIX-like systems.
* This is a portability wrapper, which simply calls mkstemp() on systems
* that have it, and implements it in GLib otherwise.
*
* The parameter is a string that should match the rules for mktemp, i.e.
* end in "XXXXXX". The X string will be modified to form the name
@ -516,8 +523,6 @@ g_file_get_contents (const gchar *filename,
* on platforms where there is a difference. The file handle should be
* closed with close(). In case of errors, -1 is returned.
*
* From the GNU C library.
* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
*/
int
g_mkstemp (char *tmpl)

View File

@ -65,7 +65,7 @@ typedef enum
G_FILE_TEST_IS_SYMLINK = 1 << 1,
G_FILE_TEST_IS_DIR = 1 << 2,
G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
G_FILE_TEST_EXISTS = 1 << 4,
G_FILE_TEST_EXISTS = 1 << 4
} GFileTest;
GQuark g_file_error_quark (void);

View File

@ -502,10 +502,17 @@ g_file_get_contents (const gchar *filename,
#endif
}
/*
* mkstemp() implementation is from the GNU C library.
* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
*/
/**
* g_mkstemp:
* @tmpl: template filename
*
* Open a temporary file
* Open a temporary file. See "man mkstemp" on most UNIX-like systems.
* This is a portability wrapper, which simply calls mkstemp() on systems
* that have it, and implements it in GLib otherwise.
*
* The parameter is a string that should match the rules for mktemp, i.e.
* end in "XXXXXX". The X string will be modified to form the name
@ -516,8 +523,6 @@ g_file_get_contents (const gchar *filename,
* on platforms where there is a difference. The file handle should be
* closed with close(). In case of errors, -1 is returned.
*
* From the GNU C library.
* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
*/
int
g_mkstemp (char *tmpl)

View File

@ -65,7 +65,7 @@ typedef enum
G_FILE_TEST_IS_SYMLINK = 1 << 1,
G_FILE_TEST_IS_DIR = 1 << 2,
G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
G_FILE_TEST_EXISTS = 1 << 4,
G_FILE_TEST_EXISTS = 1 << 4
} GFileTest;
GQuark g_file_error_quark (void);

View File

@ -263,7 +263,7 @@ mark_error (GMarkupParseContext *context,
static void
set_error (GMarkupParseContext *context,
GError **error,
GMarkupErrorType code,
GMarkupError code,
const gchar *format,
...)
{
@ -336,7 +336,7 @@ set_unescape_error (GMarkupParseContext *context,
GError **error,
const gchar *remaining_text,
const gchar *remaining_text_end,
GMarkupErrorType code,
GMarkupError code,
const gchar *format,
...)
{

View File

@ -39,7 +39,7 @@ typedef enum
G_MARKUP_ERROR_UNKNOWN_ELEMENT,
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
G_MARKUP_ERROR_INVALID_CONTENT
} GMarkupErrorType;
} GMarkupError;
#define G_MARKUP_ERROR g_markup_error_quark ()

View File

@ -42,8 +42,8 @@ gchar* g_shell_quote (const gchar *unquoted_string);
gchar* g_shell_unquote (const gchar *quoted_string,
GError **error);
gboolean g_shell_parse_argv (const gchar *command_line,
gint *argc,
gchar ***argv,
gint *argcp,
gchar ***argvp,
GError **error);
G_END_DECLS

View File

@ -159,29 +159,29 @@ my_strchrnul (const gchar *str, gchar c)
/**
* g_find_program_in_path:
* @file: a program name
* @program: a program name
*
* Locates the first executable named @file in the user's path, in the
* Locates the first executable named @program in the user's path, in the
* same way that execvp() would locate it. Returns an allocated string
* with the absolute path name, or NULL if the program is not found in
* the path. If @file is already an absolute path, returns a copy of
* @file if @file exists and is executable, and NULL otherwise.
* the path. If @program is already an absolute path, returns a copy of
* @program if @program exists and is executable, and NULL otherwise.
*
* Return value: absolute path, or NULL
**/
gchar*
g_find_program_in_path (const gchar *file)
g_find_program_in_path (const gchar *program)
{
gchar *path, *p, *name, *freeme;
size_t len;
size_t pathlen;
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (program != NULL, NULL);
if (*file == '/')
if (*program == '/')
{
if (g_file_test (file, G_FILE_TEST_IS_EXECUTABLE))
return g_strdup (file);
if (g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
return g_strdup (program);
else
return NULL;
}
@ -190,7 +190,7 @@ g_find_program_in_path (const gchar *file)
if (path == NULL)
{
/* There is no `PATH' in the environment. The default
* search path in libc is the current directory followed by
* search path in GNU libc is the current directory followed by
* the path `confstr' returns for `_CS_PATH'.
*/
@ -202,12 +202,12 @@ g_find_program_in_path (const gchar *file)
path = "/bin:/usr/bin:.";
}
len = strlen (file) + 1;
len = strlen (program) + 1;
pathlen = strlen (path);
freeme = name = g_malloc (pathlen + len + 1);
/* Copy the file name at the top, including '\0' */
memcpy (name + pathlen + 1, file, len);
memcpy (name + pathlen + 1, program, len);
name = name + pathlen;
/* And add the slash before the filename */
*name = '/';

View File

@ -263,7 +263,7 @@ mark_error (GMarkupParseContext *context,
static void
set_error (GMarkupParseContext *context,
GError **error,
GMarkupErrorType code,
GMarkupError code,
const gchar *format,
...)
{
@ -336,7 +336,7 @@ set_unescape_error (GMarkupParseContext *context,
GError **error,
const gchar *remaining_text,
const gchar *remaining_text_end,
GMarkupErrorType code,
GMarkupError code,
const gchar *format,
...)
{

View File

@ -39,7 +39,7 @@ typedef enum
G_MARKUP_ERROR_UNKNOWN_ELEMENT,
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
G_MARKUP_ERROR_INVALID_CONTENT
} GMarkupErrorType;
} GMarkupError;
#define G_MARKUP_ERROR g_markup_error_quark ()

View File

@ -42,8 +42,8 @@ gchar* g_shell_quote (const gchar *unquoted_string);
gchar* g_shell_unquote (const gchar *quoted_string,
GError **error);
gboolean g_shell_parse_argv (const gchar *command_line,
gint *argc,
gchar ***argv,
gint *argcp,
gchar ***argvp,
GError **error);
G_END_DECLS

View File

@ -159,29 +159,29 @@ my_strchrnul (const gchar *str, gchar c)
/**
* g_find_program_in_path:
* @file: a program name
* @program: a program name
*
* Locates the first executable named @file in the user's path, in the
* Locates the first executable named @program in the user's path, in the
* same way that execvp() would locate it. Returns an allocated string
* with the absolute path name, or NULL if the program is not found in
* the path. If @file is already an absolute path, returns a copy of
* @file if @file exists and is executable, and NULL otherwise.
* the path. If @program is already an absolute path, returns a copy of
* @program if @program exists and is executable, and NULL otherwise.
*
* Return value: absolute path, or NULL
**/
gchar*
g_find_program_in_path (const gchar *file)
g_find_program_in_path (const gchar *program)
{
gchar *path, *p, *name, *freeme;
size_t len;
size_t pathlen;
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (program != NULL, NULL);
if (*file == '/')
if (*program == '/')
{
if (g_file_test (file, G_FILE_TEST_IS_EXECUTABLE))
return g_strdup (file);
if (g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
return g_strdup (program);
else
return NULL;
}
@ -190,7 +190,7 @@ g_find_program_in_path (const gchar *file)
if (path == NULL)
{
/* There is no `PATH' in the environment. The default
* search path in libc is the current directory followed by
* search path in GNU libc is the current directory followed by
* the path `confstr' returns for `_CS_PATH'.
*/
@ -202,12 +202,12 @@ g_find_program_in_path (const gchar *file)
path = "/bin:/usr/bin:.";
}
len = strlen (file) + 1;
len = strlen (program) + 1;
pathlen = strlen (path);
freeme = name = g_malloc (pathlen + len + 1);
/* Copy the file name at the top, including '\0' */
memcpy (name + pathlen + 1, file, len);
memcpy (name + pathlen + 1, program, len);
name = name + pathlen;
/* And add the slash before the filename */
*name = '/';