Search
lxdream.org :: lxdream/src/config.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.h
changeset 1036:af7b0c5905dd
prev1034:7044e01148f0
next1038:f220d18c0615
author nkeynes
date Wed Jun 24 06:06:40 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Support shell substitutions in config paths
Keep track of last folder in file dialogs
Fix out-of-dateness in GTK path dialog
file annotate diff log raw
1.1 --- a/src/config.h Wed Jun 24 02:41:12 2009 +0000
1.2 +++ b/src/config.h Wed Jun 24 06:06:40 2009 +0000
1.3 @@ -62,15 +62,32 @@
1.4 extern struct lxdream_config_group lxdream_config_root[];
1.5
1.6 /* Global config values */
1.7 -const gchar *lxdream_get_config_value( int key );
1.8 -const struct lxdream_config_entry * lxdream_get_config_entry( int key );
1.9 +const gchar *lxdream_get_global_config_value( int key );
1.10 +const struct lxdream_config_entry * lxdream_get_global_config_entry( int key );
1.11 +void lxdream_set_global_config_value( int key, const gchar *value );
1.12 +
1.13 void lxdream_register_config_group( const gchar *key, lxdream_config_entry_t group );
1.14 -void lxdream_set_global_config_value( int key, const gchar *value );
1.15 void lxdream_set_config_value( lxdream_config_entry_t entry, const gchar *value );
1.16 gboolean lxdream_set_group_value( lxdream_config_group_t group, const gchar *key, const gchar *value );
1.17 void lxdream_copy_config_list( lxdream_config_entry_t dest, lxdream_config_entry_t src );
1.18
1.19 /**
1.20 + * Return a fully expanded path value for a key - this performs substitutions
1.21 + * for ~ and simple shell variables ($VAR and ${VAR})
1.22 + *
1.23 + * The returned string is newly allocated and must be freed by the caller
1.24 + */
1.25 +gchar *lxdream_get_global_config_path_value( int key );
1.26 +
1.27 +/**
1.28 + * Set a path value for a key, escaping if necessary to protect against
1.29 + * shell-substitution on the round trip.
1.30 + *
1.31 + * @return the resultant config value.
1.32 + */
1.33 +const gchar *lxdream_set_global_config_path_value( int key, const gchar *value );
1.34 +
1.35 +/**
1.36 * Construct a list of strings for the given config key - The caller is
1.37 * responsible for freeing the list and its values.
1.38 */
1.39 @@ -106,6 +123,19 @@
1.40 */
1.41 gboolean lxdream_save_config( );
1.42
1.43 +/**
1.44 + * Escape a pathname if needed to prevent shell substitution.
1.45 + * @return a newly allocated string (or NULL if the input is NULL)
1.46 + */
1.47 +gchar *get_escaped_path( const gchar *name );
1.48 +
1.49 +/**
1.50 + * Expand a pathname according to standard shell substitution rules
1.51 + * (excluding command substitutions).
1.52 + * @return a newly allocated string (or NULL if the input is NULL)
1.53 + */
1.54 +gchar *get_expanded_path( const gchar *name );
1.55 +
1.56 #ifdef __cplusplus
1.57 }
1.58 #endif
.