static int _ecore_config_system_load(void) { char *buf, *p; Ecore_Config_Prop *sys; if (__ecore_config_system_init != 1) return ECORE_CONFIG_ERR_FAIL; if ((p = getenv("HOME"))) { /* debug-only ### FIXME */ if ((buf = malloc(PATH_MAX * sizeof(char)))) { snprintf(buf, PATH_MAX, "%s/.e/config.eet", p); if (ecore_config_file_load(buf) != 0) { /* even if this file (system.eet) doesn't exist we can * continue without it as it isn't striclty necessary. */ ecore_config_file_load(PACKAGE_DATA_DIR "/system.eet"); } sys = __ecore_config_bundle_local->data; while (sys) { /* unmark it modified - modification will mean it has been overridden */ sys->flags &= ~ECORE_CONFIG_FLAG_MODIFIED; /* mark as system so that examine can hide them */ sys->flags |= ECORE_CONFIG_FLAG_SYSTEM; sys = sys->next; } } free(buf); } return ECORE_CONFIG_ERR_SUCC; }
/** * Loads the default configuration. * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA * is returned if the file cannot be loaded. * @ingroup Ecore_Config_File_Group */ EAPI int ecore_config_load(void) { char file[PATH_MAX]; if (!__ecore_config_app_name) return ECORE_CONFIG_ERR_FAIL; snprintf(file, PATH_MAX, "%s/.e/apps/%s/config.eet", getenv("HOME"), __ecore_config_app_name); return ecore_config_file_load(file); }