libxfce4util Reference Manual |
---|
XDG Base Directory support — Implementation of the XDG Base Directory Specification.
#include <libxfce4util/libxfce4util.h> gchar* xfce_xdg_cache_path (const gchar *resource); gchar* xfce_xdg_save_config_path (const gchar *resource); gchar* xfce_xdg_save_data_path (const gchar *resource); gchar* xfce_xdg_load_config_path (const gchar *resource); gchar* xfce_xdg_load_data_path (const gchar *resource); gchar** xfce_xdg_load_config_paths (const gchar *resource); gchar** xfce_xdg_load_data_paths (const gchar *resource);
The XDG Base Directory Specification defines where certain files should be looked for by defining one or more base directories relative to which files should be located.
This implementation is based on version 0.6 of the Base Directory Specification.
Since the Specification is not yet finished, and may change in the future, this implementation may also change, though I'll try to avoid API changes if possible.
gchar* xfce_xdg_cache_path (const gchar *resource);
Ensures that $XDG_CACHE_HOME/resource/ exist and returns its path. resource should normally be the name of your application. Use this to store user specific non-essential data files.
resource : | resource path below the cache dir. The string value must neither begin nor end with a slash '/'. |
Returns : | the path to the cache directory for resource or NULL on error. |
gchar* xfce_xdg_save_config_path (const gchar *resource);
Ensures that $XDG_CONFIG_HOME/resource/ exist and returns its path. resource should normally be the name of your application. Use this when saving configuration settings. Use the xfce_xdg_load_config_path() or xfce_xdg_load_config_paths() functions for loading.
resource : | resource path below the users config directory. The string must neither begin nor end with a slash '/'. |
Returns : | the path to the users config directory for resource or NULL on error. |
gchar* xfce_xdg_save_data_path (const gchar *resource);
Ensures that $XDG_CONFIG_HOME/resource/ exist and returns its path. resource is the name of some shared resource. Use this when updating a shared (between programs) database. Use the xfce_xdg_load_data_path() or xfce_xdg_load_data_paths() functions for loading.
resource : | resource path below the users data directory. The string must neither begin nor end with a slash '/'. |
Returns : | the path to the users config directory for resource or NULL on error. |
gchar* xfce_xdg_load_config_path (const gchar *resource);
Returns the absolute path to the first directory named resource in the configuration search path, where the users configuration directory is searched first and afterwards the system wide configuration storages as defined in the "Basedir specification".
resource : | config resource identifier, must neither begin nor end with the slash '/' character. |
Returns : | the path to the first directory named resource in the configuration search path or NULL if no such directory exists. |
gchar* xfce_xdg_load_data_path (const gchar *resource);
Returns the absolute path to the first directory named resource in the datadir search path, where the users configuration directory is searched first and afterwards the system wide configuration storages as defined in the "Basedir specification".
resource : | data resource identifier, must neither begin nor end with the slash '/' character. |
Returns : | the path to the first directory named resource in the datadir search path or NULL if no such directory exists. |
gchar** xfce_xdg_load_config_paths (const gchar *resource);
Returns a list of paths to directories named resource in the configuration search path.
resource : | config resource identifier, must neither begin nor end with the slash '/' character. |
Returns : | list of paths to directories named resource in the configuration search path. |
gchar** xfce_xdg_load_data_paths (const gchar *resource);
Returns a list of paths to directories named resource in the datadir search path.
resource : | config resource identifier, must neither begin nor end with the slash '/' character. |
Returns : | list of paths to directories named resource in the datadir search path. |
<< Xfce Desktop Support | XfceDesktopEntry >> |