Enlightenment CVS committal Author : essiene Project : e17 Module : apps/entrance
Dir : e17/apps/entrance/src/daemon Modified Files: entrance_edit.c entrance_edit_main.c Log Message: Modify indenting to match rest of entrance. =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/daemon/entrance_edit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- entrance_edit.c 28 Jul 2006 02:48:09 -0000 1.2 +++ entrance_edit.c 28 Jul 2006 03:20:10 -0000 1.3 @@ -22,12 +22,14 @@ static void _entrance_edit_free(); static void _entrance_edit_defaults_set(); -int entrance_edit_init(const char *filename) +int +entrance_edit_init(const char *filename) { int status; ecore_init(); - if(ecore_config_init(_CONF_INIT_DOMAIN) != ECORE_CONFIG_ERR_SUCC) { + if(ecore_config_init(_CONF_INIT_DOMAIN) != ECORE_CONFIG_ERR_SUCC) + { ecore_shutdown(); return 0; } @@ -35,20 +37,25 @@ _entrance_edit_defaults_set(); - if(!_entrance_edit_new()) { + if(!_entrance_edit_new()) + { ecore_shutdown(); return 0; } - if(filename) { + if(filename) + { _entrance_edit->config_file = strdup(filename); - } else { + } + else + { _entrance_edit->config_file = strdup(PACKAGE_CFG_DIR "/" _CONF_FILENAME); } status = ecore_config_file_load(_entrance_edit->config_file); - if(status != ECORE_CONFIG_ERR_SUCC) { + if(status != ECORE_CONFIG_ERR_SUCC) + { return 0; } @@ -56,7 +63,8 @@ } -int entrance_edit_shutdown() +int +entrance_edit_shutdown() { _entrance_edit_free(); ecore_config_shutdown(); @@ -66,18 +74,24 @@ return 1; } -int entrance_edit_save() +int +entrance_edit_save() { - if(_entrance_edit) { - if(ecore_config_file_save(_entrance_edit->config_file) != ECORE_CONFIG_ERR_SUCC) { + if(_entrance_edit) + { + if(ecore_config_file_save(_entrance_edit->config_file) != ECORE_CONFIG_ERR_SUCC) + { return 0; - } else { + } + else + { return 1; } } } -void entrance_edit_list() +void +entrance_edit_list() { /*TODO:eet_list anyone?*/ printf("Entrance Daemon Settings\n"); @@ -122,42 +136,51 @@ * entrance_edit_auth_set/get, entrance_edit_theme_set/get * */ -int entrance_edit_int_get(const char *key) +int +entrance_edit_int_get(const char *key) { return ecore_config_int_get(key); } -int entrance_edit_int_set(const char *key, int val) +int +entrance_edit_int_set(const char *key, int val) { return ecore_config_int_set(key, val); } -char* entrance_edit_string_get(const char *key) +char* +entrance_edit_string_get(const char *key) { return ecore_config_string_get(key); } -int entrance_edit_string_set(const char *key, char* val) +int +entrance_edit_string_set(const char *key, char* val) { return ecore_config_string_set(key, val); } /*private parts - oops!!!*/ -static int _entrance_edit_new() +static int +_entrance_edit_new() { _entrance_edit = calloc(1, sizeof(_Entranced_Edit)); - if(!_entrance_edit) { + if(!_entrance_edit) + { return 0; } return 1; } -static void _entrance_edit_free() +static void +_entrance_edit_free() { - if(_entrance_edit) { - if(_entrance_edit->config_file) { + if(_entrance_edit) + { + if(_entrance_edit->config_file) + { free(_entrance_edit->config_file); } =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/daemon/entrance_edit_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- entrance_edit_main.c 28 Jul 2006 02:48:09 -0000 1.2 +++ entrance_edit_main.c 28 Jul 2006 03:20:10 -0000 1.3 @@ -5,7 +5,8 @@ #include <getopt.h> #include "Entrance_Edit.h" -void usage() +void +usage() { printf("entrance_edit - Commandline config file editor for Entrance daemon\n"); printf("Usage: %s [OPTION <value>] ...\n\n", "entrance_edit"); @@ -20,7 +21,8 @@ exit(EXIT_SUCCESS); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { struct option d_opt[] = { @@ -88,8 +90,10 @@ int c; - while((c = getopt_long_only(argc, argv, ":a:A:b:d:e:g:hH:i:I:m:M:n:N:o:p:r:R:s:S:t:T:u:U:x:X:", d_opt, NULL)) != -1) { - switch(c) { + while((c = getopt_long_only(argc, argv, ":a:A:b:d:e:g:hH:i:I:m:M:n:N:o:p:r:R:s:S:t:T:u:U:x:X:", d_opt, NULL)) != -1) + { + switch(c) + { case 'a': config_attempts = atoi(optarg); break; @@ -176,13 +180,17 @@ } - if(!entrance_edit_init(config_file)) { + if(!entrance_edit_init(config_file)) + { exit(EXIT_FAILURE); } - if(flag_list) { + if(flag_list) + { entrance_edit_list(); - } else { + } + else + { /*TODO: for int config_*'s consider using a flag * to check if it has been modified or not. @@ -190,107 +198,133 @@ * to use negative values as valid values. * */ - if(config_attempts >= 0) { + if(config_attempts >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_DAEMON_ATTEMPTS_INT, config_attempts); } - if(config_xserver >= 0) { + if(config_xserver >= 0) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_DAEMON_XSERVER_STR, config_xserver); } - if(config_auth >= 0) { + if(config_auth >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT, config_auth); } - if(config_engine >= 0) { + if(config_engine >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT, config_engine); } - if(config_reboot >= 0) { + if(config_reboot >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT, config_reboot); } - if(config_halt >= 0) { + if(config_halt >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT, config_halt); } - if(config_autologin_mode >= 0) { + if(config_autologin_mode >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT, config_autologin_mode); } - if(config_presel_mode >= 0) { + if(config_presel_mode >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT, config_presel_mode); } - if(config_user_remember >= 0) { + if(config_user_remember >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT, config_user_remember); } - if(config_user_remember_count >= 0) { + if(config_user_remember_count >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT, config_user_remember_count); } - if(config_user_count >= 0) { + if(config_user_count >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT, config_user_count); } - if(config_session_count >= 0) { + if(config_session_count >= 0) + { entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_COUNT_INT, config_session_count); } - if(config_xsession) { + if(config_xsession) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_XSESSION_STR, config_xsession); } - if(config_background) { + if(config_background) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR, config_background); } - if(config_pointer) { + if(config_pointer) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_POINTER_STR, config_pointer); } - if(config_greeting_before) { + if(config_greeting_before) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_GREETING_BEFORE_STR, config_greeting_before); } - if(config_greeting_after) { + if(config_greeting_after) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_GREETING_AFTER_STR, config_greeting_after); } - if(config_date_format) { + if(config_date_format) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_DATE_FORMAT_STR, config_date_format); } - if(config_time_format) { + if(config_time_format) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_TIME_FORMAT_STR, config_time_format); } - if(config_autologin_user) { + if(config_autologin_user) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR, config_autologin_user); } - if(config_presel_prevuser) { + if(config_presel_prevuser) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR, config_presel_prevuser); } - if(config_default_session) { + if(config_default_session) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_SESSION_STR, config_default_session); } - if(config_default_session_title) { + if(config_default_session_title) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_TITLE_STR, config_default_session_title); } - if(config_default_session_icon) { + if(config_default_session_icon) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_ICON_STR, config_default_session_icon); } - if(config_theme) { + if(config_theme) + { entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_THEME_STR, config_theme); } - if(!entrance_edit_save()) { + if(!entrance_edit_save()) + { fprintf(stderr, "entrance_edit: Error writing to config file!\n"); } } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs