diff options
Diffstat (limited to '')
-rw-r--r-- | src/conf.c | 37 | ||||
-rw-r--r-- | src/options.c | 9 | ||||
-rw-r--r-- | src/options.h | 17 |
3 files changed, 44 insertions, 19 deletions
diff --git a/src/conf.c b/src/conf.c index a40c90ad7..343a8a4c5 100644 --- a/src/conf.c +++ b/src/conf.c @@ -53,6 +53,11 @@ #define CONF_COLOR_DEFINITION "colordef" #define CONF_LIST_FORMAT "list-format" #define CONF_STATUS_FORMAT "status-format" +#define CONF_LIST_WRAP "wrap-around" +#define CONF_FIND_WRAP "find-wrap" +#define CONF_AUDIBLE_BELL "audible-bell" +#define CONF_VISIBLE_BELL "visible-bell" +#define CONF_XTERM_TITLE "xterm-title" /* Deprecated - configuration field names */ #define OLD_CONF_ENABLE_COLORS "enable_colors" @@ -75,13 +80,13 @@ typedef enum { KEY_PARSER_DONE } key_parser_state_t; -static int +static gboolean str2bool(char *str) { - if( !strcasecmp(str,"no") || !strcasecmp(str,"false") || - !strcasecmp(str,"off") || !strcasecmp(str,"0") ) - return 0; - return 1; + if( !strcasecmp(str,"yes") || !strcasecmp(str,"true") || + !strcasecmp(str,"on") || !strcasecmp(str,"1") ) + return TRUE; + return FALSE; } static int @@ -503,14 +508,32 @@ read_rc_file(char *filename, options_t *options) { g_free(options->list_format); options->list_format = get_format(value); - fprintf(stderr, "list-format = \'%s\'\n", options->list_format); } /* status format string */ else if( !strcasecmp(CONF_STATUS_FORMAT, name) ) { g_free(options->status_format); options->status_format = get_format(value); - fprintf(stderr, "status-format = \'%s\'\n", options->status_format); + } + else if( !strcasecmp(CONF_LIST_WRAP, name) ) + { + options->list_wrap = str2bool(value); + } + else if( !strcasecmp(CONF_FIND_WRAP, name) ) + { + options->find_wrap = str2bool(value); + } + else if( !strcasecmp(CONF_AUDIBLE_BELL, name) ) + { + options->audible_bell = str2bool(value); + } + else if( !strcasecmp(CONF_VISIBLE_BELL, name) ) + { + options->visible_bell = str2bool(value); + } + else if( !strcasecmp(CONF_XTERM_TITLE, name) ) + { + options->enable_xterm_title = str2bool(value); } else { diff --git a/src/options.c b/src/options.c index 952f436d5..e958e4b95 100644 --- a/src/options.c +++ b/src/options.c @@ -176,11 +176,10 @@ options_init( void ) options.list_format = NULL; options.status_format = NULL; - options.reconnect = 1; - options.find_wrap = 1; - options.wide_cursor = 1; - options.enable_beep = 1; - + options.reconnect = TRUE; + options.find_wrap = TRUE; + options.wide_cursor = TRUE; + options.audible_bell = TRUE; return &options; } diff --git a/src/options.h b/src/options.h index 4ca1a4561..0034cecb5 100644 --- a/src/options.h +++ b/src/options.h @@ -12,13 +12,16 @@ typedef struct char *list_format; char *status_format; int port; - int reconnect; - int debug; - int find_wrap; - int auto_center; - int wide_cursor; - int enable_colors; - int enable_beep; + gboolean reconnect; + gboolean debug; + gboolean find_wrap; + gboolean list_wrap; + gboolean auto_center; + gboolean wide_cursor; + gboolean enable_colors; + gboolean audible_bell; /* not implemented */ + gboolean visible_bell; /* not implemented */ + gboolean enable_xterm_title; /* not implemented */ } options_t; |