1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/lxpaths.h Sun Jun 28 07:50:41 2009 +0000
1.7 + * Various path definitions and helper functions
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.22 +#ifndef lxdream_paths_H
1.23 +#define lxdream_paths_H
1.25 +/****************** System paths ****************/
1.27 + * Location of the shared lxdreamrc (e.g. /usr/local/etc/lxdreamrc)
1.29 +const char *get_sysconf_path();
1.32 + * Location of the message catalogs (e.g. /usr/local/share/locale)
1.34 +const char *get_locale_path();
1.37 + * Location of the plugins, if any (e.g. /usr/local/lib/lxdream)
1.39 +const char *get_plugin_path();
1.42 + * Location of the current user's data path (e.g. ~/.lxdream)
1.44 +const char *get_user_data_path();
1.46 +/******************** Path helpers *****************/
1.49 + * Escape a pathname if needed to prevent shell substitution.
1.50 + * @return a newly allocated string (or NULL if the input is NULL)
1.52 +gchar *get_escaped_path( const gchar *name );
1.55 + * Expand a pathname according to standard shell substitution rules
1.56 + * (excluding command substitutions).
1.57 + * @return a newly allocated string (or NULL if the input is NULL)
1.59 +gchar *get_expanded_path( const gchar *name );
1.62 + * Return an absolute path for the given input path, as a newly allocated
1.63 + * string. If the input path is already absolute, the returned string will
1.64 + * be identical to the input string.
1.66 +gchar *get_absolute_path( const gchar *path );
1.69 + * Construct a filename in the same directory as the file at. That is,
1.70 + * if at is "/tmp/foo" and filename = "bar", the function returns
1.72 + * @return a newly allocated string that must be released by the caller.
1.74 +gchar *get_filename_at( const gchar *at, const gchar *filename );
1.77 +/********************* GUI Paths ***********************/
1.78 +/* The following functions provide a cache for the most recently accessed
1.79 + * path for each config key (ie for GUI file open/save dialogs)
1.82 + * Get the path corresponding to the given global config key
1.84 +const gchar *get_gui_path(int key);
1.87 + * Override the path for the given global config key, without changing the
1.88 + * underlying configuration.
1.90 +void set_gui_path( int key, const gchar *path );
1.93 + * Notify the helper functions that the config paths have changed, in which
1.94 + * event they will revert to the config-specified versions.
1.96 +void reset_gui_paths();
1.100 +#endif /* !lxdream_paths_H */