[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] [ENTRANCE][PATCH] entrance_edit2



Yesterday morning, I woke with a start... just had to do something to quell the uprising in my mind... then... i... (oops... wrong list ;) )

Anyways, as part of my entrance reading excersise, I've been working on one of the todo items for entrance since yesterday morning - a command line configuration utitlity for entrance. There is one already included with it, that doesn't quite work called entrance_edit. This patch creates entrance_edit2, which IMOHO was way simpler to implement. Also, there is a library which the patched Makefile doesn't yet install onto the system, but can be used by GUI clients wishing to access entrance's configurations.

This code works end-to-end, the things left are probably a few code cleanups here and there.

Usage:

When called without arguments, entrance_edit2 will list all current parameters and their values. For instance:

attempts = 5
xserver = /x/server/options -foo -bar

To set a new value call the listed option as an argument... For instance, to set the number of attempts to 10, instead of the default 5, do:

entrance_edit2 --attempts 10

Ditto for xserver:

entrance_edit2 --xserver "/some/new/path --and --options"

You'll want to try these especially (note that you can combine all arguments as a single command, as normally obtained):

entrance_edit2 --background "/path/to/some/cool/e/background.edj"
entrance_edit2 --theme "darkrock.edj"
entrance_edit2 --greeting-before "<insert cool greeting here>"


Any issues to be ironed out... send to moi.

Cheers,
Essien

NB: I have some other entrance minor cleanup patches I sent in earlier... no responses on those... i'll prolly send them again
diff -Naur entrance/configure.in entrance.edit/configure.in
--- entrance/configure.in	2006-06-11 23:20:19.000000000 +0100
+++ entrance.edit/configure.in	2006-07-21 02:13:11.000000000 +0100
@@ -7,6 +7,7 @@
 AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_STDC
+AC_PROG_LIBTOOL
 AC_HEADER_STDC
 
 if test "x${prefix}" = "xNONE"; then
diff -Naur entrance/src/daemon/Entrance_Edit.h entrance.edit/src/daemon/Entrance_Edit.h
--- entrance/src/daemon/Entrance_Edit.h	1970-01-01 01:00:00.000000000 +0100
+++ entrance.edit/src/daemon/Entrance_Edit.h	2006-07-21 02:13:58.000000000 +0100
@@ -0,0 +1,46 @@
+#ifndef ENTRANCE_EDIT_H
+#define ENTRANCE_EDIT_H
+
+#define ENTRANCE_EDIT_KEY_DAEMON_ATTEMPTS_INT "/entranced/attempts"
+#define ENTRANCE_EDIT_KEY_DAEMON_XSERVER_STR "/entranced/xserver"
+
+#define ENTRANCE_EDIT_KEY_CLIENT_XSESSION_STR "/entrance/xsession"
+#define ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT "/entrance/auth"
+#define ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT "/entrance/engine"
+#define ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT "/entrance/system/reboot"
+#define ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT "/entrance/system/halt"
+
+#define ENTRANCE_EDIT_KEY_CLIENT_THEME_STR "/entrance/theme"
+#define ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR "/entrance/background"
+#define ENTRANCE_EDIT_KEY_CLIENT_POINTER_STR "/entrance/pointer"
+#define ENTRANCE_EDIT_KEY_CLIENT_GREETING_BEFORE_STR "/entrance/greeting/before"
+#define ENTRANCE_EDIT_KEY_CLIENT_GREETING_AFTER_STR "/entrance/greeting/after"
+#define ENTRANCE_EDIT_KEY_CLIENT_DATE_FORMAT_STR "/entrance/date_format"
+#define ENTRANCE_EDIT_KEY_CLIENT_TIME_FORMAT_STR "/entrance/time_format"
+
+#define ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT	"/entrance/autologin/mode"
+#define ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR "/entrance/autologin/user"
+#define ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT "/entrance/presel/mode" /*presel == preselect?*/
+#define ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR "/entrance/presel/prevuser"
+
+#define ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT "/entrance/user/remember"
+#define ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT "/entrance/user/remember_n"
+#define ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT "/entrance/user/count"
+
+#define ENTRANCE_EDIT_KEY_CLIENT_SESSION_COUNT_INT "/entrance/session/count"
+#define ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_SESSION_STR "/entrance/session/0/session"
+#define ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_TITLE_STR "/entrance/session/0/title"
+#define ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_ICON_STR "/entrance/session/0/icon"
+
+int entrance_edit_init(const char*);
+int entrance_edit_shutdown();
+
+void entrance_edit_list();
+
+int entrance_edit_int_get(const char*);
+int entrance_edit_int_set(const char*, int);
+
+char* entrance_edit_string_get(const char*);
+int entrance_edit_string_set(const char*, char*);
+
+#endif
diff -Naur entrance/src/daemon/Makefile.am entrance.edit/src/daemon/Makefile.am
--- entrance/src/daemon/Makefile.am	2006-05-06 09:05:15.000000000 +0100
+++ entrance.edit/src/daemon/Makefile.am	2006-07-21 02:13:58.000000000 +0100
@@ -4,10 +4,18 @@
 
 entrancelibdir = $(libdir)/$(PACKAGE)
 
+bin_PROGRAMS=entrance_edit2
 sbin_PROGRAMS = entranced
 entrancelib_SCRIPTS = entrance_wrapper
 
+lib_LTLIBRARIES=libentrance_edit.la
+
 entranced_SOURCES = \
 	auth.c auth.h Entranced.h ipc.c ipc.h md5.c md5.h spawner.c util.c util.h
 
 entranced_LDADD = @X_LIBS@ -lXau @ECORE_LIBS@
+
+entrance_edit2_SOURCES = Entranced.h entrance_edit_main.c Entrance_Edit.h
+entrance_edit2_LDADD = @ECORE_LIBS@ -lentrance_edit
+
+libentrance_edit_la_SOURCES=Entranced.h entrance_edit.c Entrance_Edit.h
diff -Naur entrance/src/daemon/entrance_edit.c entrance.edit/src/daemon/entrance_edit.c
--- entrance/src/daemon/entrance_edit.c	1970-01-01 01:00:00.000000000 +0100
+++ entrance.edit/src/daemon/entrance_edit.c	2006-07-21 02:13:58.000000000 +0100
@@ -0,0 +1,200 @@
+#include <string.h>
+#include <unistd.h>
+#include <Ecore_Config.h>
+#include "Entranced.h"
+#include "Entrance_Edit.h"
+
+#define _CONF_INIT_DOMAIN "entrance"
+#define _CONF_FILENAME "entrance_config.cfg"
+
+
+
+struct __Entranced_Edit {
+	char* config_file;
+};
+
+typedef struct __Entranced_Edit _Entranced_Edit;
+typedef struct __Entranced_Edit* Entranced_Edit;
+
+static Entranced_Edit _entrance_edit;
+
+static int _entrance_edit_new();
+static void _entrance_edit_free();
+static void _entrance_edit_save();
+static void _entrance_edit_defaults_set();
+
+int entrance_edit_init(const char *filename)
+{
+	int status;
+
+	ecore_init();
+	if(ecore_config_init(_CONF_INIT_DOMAIN) != ECORE_CONFIG_ERR_SUCC) {
+		ecore_shutdown();
+		return 0;
+	}
+
+
+	_entrance_edit_defaults_set();
+
+	if(!_entrance_edit_new()) {
+		ecore_shutdown();
+		return 0;
+	}
+
+	if(filename) {
+		_entrance_edit->config_file = strdup(filename);
+	} 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) {
+		return 0;
+	}
+
+	return 1;
+}
+
+
+int entrance_edit_shutdown()
+{
+	_entrance_edit_save();
+	_entrance_edit_free();
+	ecore_config_shutdown();
+	ecore_shutdown();
+
+	/*TODO: Properly fix error codes */
+	return 1;
+}
+
+
+void entrance_edit_list()
+{
+	/*TODO:eet_list anyone?*/
+	printf("Entrance Daemon Settings\n");
+	printf("  attempts = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_DAEMON_ATTEMPTS_INT));
+	printf("  xserver = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_DAEMON_XSERVER_STR));
+	printf("Entrance Client Settings\n");
+	printf("  xsession = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_XSESSION_STR));
+	printf("  auth = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT));
+	printf("  engine = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT));
+	printf("  reboot = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT)); 
+	printf("  halt = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT));
+	printf("  theme = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_THEME_STR));
+	printf("  background = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR));
+	printf("  pointer = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_POINTER_STR));
+	printf("  greeting-before = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_GREETING_BEFORE_STR));
+	printf("  greeting-after = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_GREETING_AFTER_STR));
+	printf("  date-format = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_DATE_FORMAT_STR));
+	printf("  time-format = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_TIME_FORMAT_STR));
+	printf("  autologin-mode = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT));
+	printf("  autologin-user = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR));
+	printf("  presel-mode = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT));
+	printf("  presel-prevuser = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR));
+	printf("  user-remember = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT));
+	printf("  user-remember-count = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT));
+	printf("  user-count = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT));
+	printf("  session-count = %d\n", entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_SESSION_COUNT_INT));
+	printf("  default-session = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_SESSION_STR));
+	printf("  default-session-title = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_TITLE_STR));
+	printf("  default-session-icon = \"%s\"\n", entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_ICON_STR));
+}
+
+/*TODO: instead of bleh_TYPE_get/set, etc
+ * since we know the ENTRANCE_EDIT_KEY_TYPE_foobar
+ * contants, we can use a string search on the keys
+ * and just have entrance_edit_value_set/get that
+ * internally calls the right _type_get/set
+ * this makes the api even more compact.
+ * ALAS!!! There is no function overloading in C :(
+ *
+ * It may be neater to hide the data type specifics
+ * behind functions like:
+ * entrance_edit_auth_set/get, entrance_edit_theme_set/get
+ * */
+
+int entrance_edit_int_get(const char *key)
+{
+	return ecore_config_int_get(key);
+}
+
+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)
+{
+	return ecore_config_string_get(key);
+}
+
+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()
+{
+	_entrance_edit = calloc(1, sizeof(_Entranced_Edit));
+	if(!_entrance_edit) {
+		return 0;
+	} 
+
+	return 1;
+}
+
+static void _entrance_edit_free()
+{
+	if(_entrance_edit) {
+		if(_entrance_edit->config_file) {
+			free(_entrance_edit->config_file);
+		}
+
+		free(_entrance_edit);
+	}
+}
+
+static void _entrance_edit_save()
+{
+	if(_entrance_edit) {
+		ecore_config_file_save(_entrance_edit->config_file);
+	}
+}
+
+static void _entrance_edit_defaults_set()
+{
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_DAEMON_XSERVER_STR, DEFAULT_X_SERVER);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_DAEMON_ATTEMPTS_INT, 5);
+
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_XSESSION_STR, ENTRANCE_XSESSION);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT, 1);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT, 0);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT, 1);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT, 1);
+
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_THEME_STR, "default.edj");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR, "");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_POINTER_STR, PACKAGE_DATA_DIR "/images/pointer.png");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_GREETING_BEFORE_STR, "Welcome to");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_GREETING_AFTER_STR, "");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_DATE_FORMAT_STR, "%x");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_TIME_FORMAT_STR, "%X");
+
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT, 0);
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR, "");
+
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT, 1);
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR, "");
+
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT, 1);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT, 5);
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT, 0);
+
+	ecore_config_int_default(ENTRANCE_EDIT_KEY_CLIENT_SESSION_COUNT_INT, 1);
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_SESSION_STR, "default");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_TITLE_STR, "Default");
+	ecore_config_string_default(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_ICON_STR, "default.png");
+}
diff -Naur entrance/src/daemon/entrance_edit_main.c entrance.edit/src/daemon/entrance_edit_main.c
--- entrance/src/daemon/entrance_edit_main.c	1970-01-01 01:00:00.000000000 +0100
+++ entrance.edit/src/daemon/entrance_edit_main.c	2006-07-21 02:13:58.000000000 +0100
@@ -0,0 +1,297 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include "Entrance_Edit.h"
+
+void usage()
+{
+	printf("entrance_edit - Commandline config file editor for Entrance daemon\n");
+	printf("Usage: %s [OPTION <value>] ...\n\n", "entrance_edit");
+	printf("   --help                       Show this help text and exit\n");
+	printf("   --attempts ATTEMPTS          Set the number of retry attempts to ATTEMPTS\n");
+	printf("   --xserver XSERVER            Manually set the location of the X server executable. Else\n");
+	printf("                                    use the default location\n");
+	/*TODO: first we must be able to create a fresh config file before we start specifying alternate ones*/
+	/*printf("   -c, --config-file CONFIGFILE     Manually specify config file. Else, use the default location\n");*/
+	printf("\nNOTE: When called without any argument, entrance_edit will list all values of all parameters\n");
+
+	exit(EXIT_SUCCESS);
+}
+
+int main(int argc, char** argv)
+{
+
+	struct option d_opt[] = {
+		{"help", 0, 0, 'h'},
+		{"attempts", 1, 0, 'a'},
+		{"xserver", 1, 0, 'x'},
+		{"xsession", 1, 0, 'X'},
+		{"auth", 1, 0, 'A'},
+		{"engine", 1, 0, 'e'},
+		{"reboot", 1, 0, 'r'},
+		{"halt", 1, 0, 'H'},
+		{"theme", 1, 0, 't'},
+		{"background", 1, 0, 'b'},
+		{"pointer", 1, 0, 'p'},
+		{"greeting-before", 1, 0, 'g'},
+		{"greeting-after", 1, 0, 'T'},
+		{"date-format", 1, 0, 'd'},
+		{"time-format", 1, 0, 'i'},
+		{"autologin-mode", 1, 0, 'm'},
+		{"autologin-user", 1, 0, 'u'},
+		{"presel-mode", 1, 0, 'M'},
+		{"presel-prevuser", 1, 0, 'U'},
+		{"user-remember", 1, 0, 'R'},
+		{"user-remember-count", 1, 0, 'n'},
+		{"user-count", 1, 0, 'N'},
+		{"session-count", 1, 0, 's'},
+		{"default-session", 1, 0, 'S'},
+		{"default-session-title", 1, 0, 'o'},
+		{"default-session-icon", 1, 0, 'I'},
+		{0, 0, 0, 0}
+	};
+
+	/*TODO: This profileration of config_* variables
+	 * are crying out to be properly grouped. Either as members
+	 * of a struct or a hash-table. The code just looks whack!!
+	 *
+	 * Also, the options struct array, may be better utitlized
+	 * if the config_* variables are filled directly, by specifying
+	 * then in the array, instead of strduping on a match.
+	 * see: man getopt_long_only for details
+	 * */
+
+	int flag_list = 1;
+
+	int config_attempts = -1, config_auth = -1, config_engine = -1, config_reboot = -1,
+		config_halt = -1, config_autologin_mode = -1, config_presel_mode = -1,
+		config_user_remember = -1, config_user_remember_count = -1,
+		config_user_count = -1, config_session_count = -1;
+
+	char* config_file = NULL;
+	char* config_xserver = NULL;
+	char* config_xsession = NULL;
+	char* config_theme = NULL;
+	char* config_background = NULL;
+	char* config_pointer = NULL;
+	char* config_greeting_before = NULL;
+	char* config_greeting_after = NULL;
+	char* config_date_format = NULL;
+	char* config_time_format = NULL;
+	char* config_autologin_user = NULL;
+	char* config_presel_prevuser = NULL;
+	char* config_default_session = NULL;
+	char* config_default_session_title = NULL;
+	char* config_default_session_icon = NULL;
+
+
+	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) {
+			case 'a':
+				config_attempts = atoi(optarg);
+				break;
+			case 'A':
+				config_auth = atoi(optarg);
+				break;
+			case 'b':
+				config_background = strdup(optarg);
+				break;
+			case 'd':
+				config_date_format = strdup(optarg);
+				break;
+			case 'e':
+				config_engine = atoi(optarg);
+				break;
+			case 'g':
+				config_greeting_before = strdup(optarg);
+				break;
+			case 'h':
+				usage();
+				break;
+			case 'H':
+				config_halt = atoi(optarg);
+				break;
+			case 'i':
+				config_time_format = strdup(optarg);
+				break;
+			case 'I':
+				config_default_session_icon = strdup(optarg);
+				break;
+			case 'm':
+				config_autologin_mode = atoi(optarg);
+				break;
+			case 'M':
+				config_presel_mode = atoi(optarg);
+				break;
+			case 'n':
+				config_user_remember_count = atoi(optarg);
+				break;
+			case 'N':
+				config_user_count = atoi(optarg);
+				break;
+			case 'o':
+				config_default_session_title = strdup(optarg);
+				break;
+			case 'p':
+				config_pointer = strdup(optarg);
+				break;
+			case 'r':
+				config_reboot = atoi(optarg);
+				break;
+			case 'R':
+				config_user_remember = atoi(optarg);
+				break;
+			case 's':
+				config_session_count = atoi(optarg);
+				break;
+			case 'S':
+				config_default_session = strdup(optarg);
+				break;
+			case 't':
+				config_theme = strdup(optarg);
+				break;
+			case 'T':
+				config_greeting_after = strdup(optarg);
+				break;
+			case 'u':
+				config_autologin_user = strdup(optarg);
+				break;
+			case 'U':
+				config_presel_prevuser = strdup(optarg);
+				break;
+			case 'x':
+				config_xserver = strdup(optarg);
+				break;
+			case 'X':
+				config_xsession = strdup(optarg);
+				break;
+			default:
+				usage();
+				break;
+		}
+		flag_list = 0;
+	}
+
+
+	if(!entrance_edit_init(config_file)) {
+		exit(EXIT_FAILURE);
+	}
+
+	if(flag_list) {
+		entrance_edit_list();
+		exit(EXIT_SUCCESS);
+	}
+
+	/*TODO: for int config_*'s consider using a flag
+	 * to check if it has been modified or not.
+	 * checking for >= 0 may break if entrance begins
+	 * to use negative values as valid values.
+	 * */
+
+	if(config_attempts >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_DAEMON_ATTEMPTS_INT, config_attempts);
+	}
+
+	if(config_xserver >= 0) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_DAEMON_XSERVER_STR, config_xserver);
+	}
+
+	if(config_auth >= 0) { 
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT, config_auth);
+	}
+
+	if(config_engine >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT, config_engine);
+	}
+	
+	if(config_reboot >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT, config_reboot);
+	}
+	
+	if(config_halt >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT, config_halt);
+	}
+	
+	if(config_autologin_mode >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT, config_autologin_mode);
+	}
+	
+	if(config_presel_mode >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT, config_presel_mode);
+	}
+	
+	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) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT, config_user_remember_count);
+	}
+
+	if(config_user_count >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT, config_user_count);
+	}
+	
+	if(config_session_count >= 0) {
+		entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_COUNT_INT, config_session_count);
+	}
+
+	if(config_xsession) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_XSESSION_STR, config_xsession);
+	}
+	
+	if(config_background) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_BACKGROUND_STR, config_background);
+	}
+
+	if(config_pointer) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_POINTER_STR, config_pointer);
+	}
+
+	if(config_greeting_before) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_GREETING_BEFORE_STR, config_greeting_before);
+	}
+
+	if(config_greeting_after) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_GREETING_AFTER_STR, config_greeting_after);
+	}
+
+	if(config_date_format) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_DATE_FORMAT_STR, config_date_format);
+	}
+
+	if(config_time_format) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_TIME_FORMAT_STR, config_time_format);
+	}
+
+	if(config_autologin_user) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR, config_autologin_user);
+	}
+
+	if(config_presel_prevuser) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR, config_presel_prevuser);
+	}
+
+	if(config_default_session) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_SESSION_STR, config_default_session);
+	}
+
+	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) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_SESSION_0_ICON_STR, config_default_session_icon);
+	}
+
+	if(config_theme) {
+		entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_THEME_STR, config_theme);
+	}
+
+	entrance_edit_shutdown(config_file);
+	exit(EXIT_SUCCESS);
+}
+