summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3813e22)
raw | patch | inline | side by side (parent: 3813e22)
author | Kalle Wallin <kaw@linux.se> | |
Tue, 22 Jun 2004 13:25:22 +0000 (13:25 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Tue, 22 Jun 2004 13:25:22 +0000 (13:25 +0000) |
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index a40c90ad7a4354b5a4ad46dc4d4d4e1a45a804ee..343a8a4c547084c7cee4a057cfc6a1e1e4850092 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#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"
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
{
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 952f436d541c07d5d5a6befd39207ae3cba9ae89..e958e4b957531a96cfcc2c39161b84d8569fc6b5 100644 (file)
--- a/src/options.c
+++ b/src/options.c
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 4ca1a4561bbb37b06575bc38f63bf6b9df4ba492..0034cecb5d3a2be0b96f8c91e7de1de14c9117c4 100644 (file)
--- a/src/options.h
+++ b/src/options.h
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;