1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/config.h Sun Oct 21 05:21:35 2007 +0000
1.5 + * $Id: config.h,v 1.1 2007-10-17 11:26:45 nkeynes Exp $
1.7 + * User configuration support
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_config_H
1.23 +#define lxdream_config_H 1
1.25 +#include <glib/gtypes.h>
1.27 +#define CONFIG_TYPE_NONE 0
1.28 +#define CONFIG_TYPE_FILE 1
1.29 +#define CONFIG_TYPE_PATH 2
1.30 +#define CONFIG_TYPE_KEY 3
1.32 +#define DEFAULT_CONFIG_FILENAME "lxdreamrc"
1.34 +typedef struct lxdream_config_entry {
1.37 + const gchar *default_value;
1.39 +} *lxdream_config_entry_t;
1.41 +typedef struct lxdream_config_group {
1.43 + struct lxdream_config_entry *params;
1.44 +} *lxdream_config_group_t;
1.46 +#define CONFIG_BIOS_PATH 0
1.47 +#define CONFIG_FLASH_PATH 1
1.48 +#define CONFIG_DEFAULT_PATH 2
1.49 +#define CONFIG_SAVE_PATH 3
1.50 +#define CONFIG_BOOTSTRAP 4
1.52 +extern struct lxdream_config_group lxdream_config_root[];
1.54 +/* Global config values */
1.55 +const gchar *lxdream_get_config_value( int key );
1.57 +void lxdream_set_config_value( int key, const gchar *value );
1.60 + * Search the standard locations for the configuration file:
1.61 + * $HOME/.lxdreamrc
1.63 + * $SYSCONF_DIR/lxdreamrc
1.64 + * @return TRUE if the file was found, otherwise FALSE.
1.66 +gboolean lxdream_find_config( );
1.69 + * Set the configuration file filename to the supplied string.
1.70 + * The string is copied internally (ie can be released by the
1.73 +void lxdream_set_config_filename( const gchar *filename );
1.76 + * Load the configuration from the previously determined filename.
1.78 +gboolean lxdream_load_config( );
1.81 + * Update the configuration
1.83 +gboolean lxdream_save_config( );
1.86 +#endif /* !lxdream_config_H */