Commit 2debda2f authored by Sven Neumann's avatar Sven Neumann
Browse files

doumented gimpenv


--Sven
parent 7512a83a
Sun Feb 6 23:45:09 CET 2000 Sven Neumann <sven@gimp.org>
Sun Feb 7 00:14:26 CET 2000 Sven Neumann <sven@gimp.org>
 
* libgimp/gimpenv.[ch]: use g* types and moved the documentation
into the C file where it is parseable by the documentation system
* libgimp/gimpmatrix.[ch]: use g* types and name the parameters
in the header.
 
......
Sun Feb 6 23:44:17 CET 2000 Sven Neumann <sven@gimp.org>
Sun Feb 7 00:14:26 CET 2000 Sven Neumann <sven@gimp.org>
* devel-docs/libgimp/libgimp-decl.txt
* devel-docs/libgimp/tmpl/gimpmatrix.sgml: documented gimpmatrix
* libgimp/libgimp-decl.txt
* libgimp/tmpl/gimpenv.sgml: documented gimpenv
* libgimp/tmpl/gimpmatrix.sgml: documented gimpmatrix
* devel-docs/libgimp/tmpl/gimpcolorspace.sgml
* devel-docs/libgimp/tmpl/gimpmenu.sgml: cleanup
* libgimp/tmpl/gimpcolorspace.sgml
* libgimp/tmpl/gimpmenu.sgml: cleanup
Sun Feb 6 22:15:20 CET 2000 Sven Neumann <sven@gimp.org>
......
......@@ -3262,22 +3262,22 @@ GimpChainButton *gcb
</MACRO>
<FUNCTION>
<NAME>gimp_directory</NAME>
<RETURNS>char *</RETURNS>
<RETURNS>gchar *</RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gimp_personal_rc_file</NAME>
<RETURNS>char *</RETURNS>
char *basename
<RETURNS>gchar *</RETURNS>
gchar *basename
</FUNCTION>
<FUNCTION>
<NAME>gimp_data_directory</NAME>
<RETURNS>char *</RETURNS>
<RETURNS>gchar *</RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gimp_gtkrc</NAME>
<RETURNS>char *</RETURNS>
<RETURNS>gchar *</RETURNS>
void
</FUNCTION>
<USER_FUNCTION>
......
......@@ -2,11 +2,12 @@
gimpenv
<!-- ##### SECTION Short_Description ##### -->
Functions to access the GIMP environment.
<!-- ##### SECTION Long_Description ##### -->
<para>
A set of functions to find the locations of GIMP's data directories and
configuration files.
</para>
<!-- ##### SECTION See_Also ##### -->
......
......@@ -33,12 +33,34 @@
extern const char *__XOS2RedirRoot(const char *);
#endif
char *
gimp_directory ()
/**
* gimp_directory:
*
* Returns the user-specific GIMP settings directory. If the environment
* variable GIMP_DIRECTORY exists, it is used. If it is an absolute path,
* it is used as is. If it is a relative path, it is taken to be a
* subdirectory of the home directory. If it is relative path, and no home
* directory can be determined, it is taken to be a subdirectory of
* gimp_data_directory().
*
* The usual case is that no GIMP_DIRECTORY environment variable exists,
* and then we use the GIMPDIR subdirectory of the home directory. If no
* home directory exists, we use a per-user subdirectory of
* gimp_data_directory().
* In any case, we always return some non-empty string, whether it
* corresponds to an existing directory or not.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The user-specific GIMP settings directory.
*/
gchar*
gimp_directory (void)
{
static char *gimp_dir = NULL;
char *env_gimp_dir;
char *home_dir;
static gchar *gimp_dir = NULL;
gchar *env_gimp_dir;
gchar *home_dir;
if (gimp_dir != NULL)
return gimp_dir;
......@@ -96,8 +118,19 @@ gimp_directory ()
return gimp_dir;
}
char *
gimp_personal_rc_file (char *basename)
/**
* gimp_personal_rc_file:
* @basename: The basename of a rc_file.
*
* Returns the name of a file in the user-specific GIMP settings directory.
*
* The returned string is allocated dynamically and *SHOULD* be freed
* with g_free() after use.
*
* Returns: The name of a file in the user-specific GIMP settings directory.
*/
gchar*
gimp_personal_rc_file (gchar *basename)
{
return g_strconcat (gimp_directory (),
G_DIR_SEPARATOR_S,
......@@ -105,11 +138,25 @@ gimp_personal_rc_file (char *basename)
NULL);
}
char *
gimp_data_directory ()
/**
* gimp_data_directory:
*
* Returns the top directory for GIMP data. If the environment variable
* GIMP_DATADIR exists, that is used. It should be an absolute pathname.
* Otherwise, on Unix the compile-time defined directory is used. On
* Win32, the installation directory as deduced from the executable's
* name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The top directory for GIMP data.
*/
gchar*
gimp_data_directory (void)
{
static char *gimp_data_dir = NULL;
char *env_gimp_data_dir = NULL;
static gchar *gimp_data_dir = NULL;
gchar *env_gimp_data_dir = NULL;
if (gimp_data_dir != NULL)
return gimp_data_dir;
......@@ -136,8 +183,8 @@ gimp_data_directory ()
#endif
#else
/* Figure it out from the executable name */
char filename[MAX_PATH];
char *sep1, *sep2;
gchar filename[MAX_PATH];
gchar *sep1, *sep2;
if (GetModuleFileName (NULL, filename, sizeof (filename)) == 0)
g_error ("GetModuleFilename failed\n");
......@@ -167,16 +214,20 @@ gimp_data_directory ()
return gimp_data_dir;
}
/* gimp_gtkrc returns the name of the GIMP's application-specific
* gtkrc file.
/**
* gimp_gtkrc:
*
* Returns the name of the GIMP's application-specific gtkrc file.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The name of the GIMP's application-specific gtkrc file.
*/
char*
gimp_gtkrc ()
gchar*
gimp_gtkrc (void)
{
static char *gimp_gtkrc_filename = NULL;
static gchar *gimp_gtkrc_filename = NULL;
if (gimp_gtkrc_filename != NULL)
return gimp_gtkrc_filename;
......@@ -188,3 +239,7 @@ gimp_gtkrc ()
NULL);
return gimp_gtkrc_filename;
}
......@@ -25,55 +25,12 @@
extern "C" {
#endif /* __cplusplus */
/* gimp_directory() returns the user-specific GIMP settings
* directory. If the environment variable GIMP_DIRECTORY exists, that
* is used. If it is an absolute path, it is used as is. If it is a
* relative path, it is taken to be a subdirectory of the home
* directory. If it is relative, and no home directory can be
* determined, it is taken to be a subdirectory of
* gimp_data_directory().
*
* The usual case is that no GIMP_DIRECTORY envvar exists, and then we
* use the GIMPDIR subdirectory of the home directory. If no home
* directory exists, we use a per-user subdirectory of
* gimp_data_directory().
*
* In any case, we always return some non-empty string, whether it
* corresponds to an existing directory or not.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_directory (void);
/* gimp_personal_rc_file() returns the name of a file in the
* user-specific GIMP settings directory.
*
* The returned string is allocated dynamically and *SHOULD* be freed
* with g_free() after use.
*/
char *gimp_personal_rc_file (char *basename);
/* gimp_data_directory returns the top directory for GIMP data. If
* the environment variable GIMP_DATADIR exists, that is used. It
* should be an absolute pathname.
*
* Otherwise, on Unix the compile-time defined directory is used. On
* Win32, the installation directory as deduced from the executable's
* name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_data_directory (void);
/* For information look into the C source or the html documentation */
/* gimp_gtkrc returns the name of the GIMP's application-specific
* gtkrc file.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_gtkrc (void);
gchar* gimp_directory (void);
gchar* gimp_personal_rc_file (gchar *basename);
gchar* gimp_data_directory (void);
gchar* gimp_gtkrc (void);
#ifdef __cplusplus
}
......
......@@ -33,12 +33,34 @@
extern const char *__XOS2RedirRoot(const char *);
#endif
char *
gimp_directory ()
/**
* gimp_directory:
*
* Returns the user-specific GIMP settings directory. If the environment
* variable GIMP_DIRECTORY exists, it is used. If it is an absolute path,
* it is used as is. If it is a relative path, it is taken to be a
* subdirectory of the home directory. If it is relative path, and no home
* directory can be determined, it is taken to be a subdirectory of
* gimp_data_directory().
*
* The usual case is that no GIMP_DIRECTORY environment variable exists,
* and then we use the GIMPDIR subdirectory of the home directory. If no
* home directory exists, we use a per-user subdirectory of
* gimp_data_directory().
* In any case, we always return some non-empty string, whether it
* corresponds to an existing directory or not.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The user-specific GIMP settings directory.
*/
gchar*
gimp_directory (void)
{
static char *gimp_dir = NULL;
char *env_gimp_dir;
char *home_dir;
static gchar *gimp_dir = NULL;
gchar *env_gimp_dir;
gchar *home_dir;
if (gimp_dir != NULL)
return gimp_dir;
......@@ -96,8 +118,19 @@ gimp_directory ()
return gimp_dir;
}
char *
gimp_personal_rc_file (char *basename)
/**
* gimp_personal_rc_file:
* @basename: The basename of a rc_file.
*
* Returns the name of a file in the user-specific GIMP settings directory.
*
* The returned string is allocated dynamically and *SHOULD* be freed
* with g_free() after use.
*
* Returns: The name of a file in the user-specific GIMP settings directory.
*/
gchar*
gimp_personal_rc_file (gchar *basename)
{
return g_strconcat (gimp_directory (),
G_DIR_SEPARATOR_S,
......@@ -105,11 +138,25 @@ gimp_personal_rc_file (char *basename)
NULL);
}
char *
gimp_data_directory ()
/**
* gimp_data_directory:
*
* Returns the top directory for GIMP data. If the environment variable
* GIMP_DATADIR exists, that is used. It should be an absolute pathname.
* Otherwise, on Unix the compile-time defined directory is used. On
* Win32, the installation directory as deduced from the executable's
* name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The top directory for GIMP data.
*/
gchar*
gimp_data_directory (void)
{
static char *gimp_data_dir = NULL;
char *env_gimp_data_dir = NULL;
static gchar *gimp_data_dir = NULL;
gchar *env_gimp_data_dir = NULL;
if (gimp_data_dir != NULL)
return gimp_data_dir;
......@@ -136,8 +183,8 @@ gimp_data_directory ()
#endif
#else
/* Figure it out from the executable name */
char filename[MAX_PATH];
char *sep1, *sep2;
gchar filename[MAX_PATH];
gchar *sep1, *sep2;
if (GetModuleFileName (NULL, filename, sizeof (filename)) == 0)
g_error ("GetModuleFilename failed\n");
......@@ -167,16 +214,20 @@ gimp_data_directory ()
return gimp_data_dir;
}
/* gimp_gtkrc returns the name of the GIMP's application-specific
* gtkrc file.
/**
* gimp_gtkrc:
*
* Returns the name of the GIMP's application-specific gtkrc file.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The name of the GIMP's application-specific gtkrc file.
*/
char*
gimp_gtkrc ()
gchar*
gimp_gtkrc (void)
{
static char *gimp_gtkrc_filename = NULL;
static gchar *gimp_gtkrc_filename = NULL;
if (gimp_gtkrc_filename != NULL)
return gimp_gtkrc_filename;
......@@ -188,3 +239,7 @@ gimp_gtkrc ()
NULL);
return gimp_gtkrc_filename;
}
......@@ -25,55 +25,12 @@
extern "C" {
#endif /* __cplusplus */
/* gimp_directory() returns the user-specific GIMP settings
* directory. If the environment variable GIMP_DIRECTORY exists, that
* is used. If it is an absolute path, it is used as is. If it is a
* relative path, it is taken to be a subdirectory of the home
* directory. If it is relative, and no home directory can be
* determined, it is taken to be a subdirectory of
* gimp_data_directory().
*
* The usual case is that no GIMP_DIRECTORY envvar exists, and then we
* use the GIMPDIR subdirectory of the home directory. If no home
* directory exists, we use a per-user subdirectory of
* gimp_data_directory().
*
* In any case, we always return some non-empty string, whether it
* corresponds to an existing directory or not.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_directory (void);
/* gimp_personal_rc_file() returns the name of a file in the
* user-specific GIMP settings directory.
*
* The returned string is allocated dynamically and *SHOULD* be freed
* with g_free() after use.
*/
char *gimp_personal_rc_file (char *basename);
/* gimp_data_directory returns the top directory for GIMP data. If
* the environment variable GIMP_DATADIR exists, that is used. It
* should be an absolute pathname.
*
* Otherwise, on Unix the compile-time defined directory is used. On
* Win32, the installation directory as deduced from the executable's
* name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_data_directory (void);
/* For information look into the C source or the html documentation */
/* gimp_gtkrc returns the name of the GIMP's application-specific
* gtkrc file.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*/
char *gimp_gtkrc (void);
gchar* gimp_directory (void);
gchar* gimp_personal_rc_file (gchar *basename);
gchar* gimp_data_directory (void);
gchar* gimp_gtkrc (void);
#ifdef __cplusplus
}
......
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