summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38f981d)
raw | patch | inline | side by side (parent: 38f981d)
author | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 17:07:37 +0000 (17:07 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 17:07:37 +0000 (17:07 +0000) |
ChangeLog | patch | blob | history | |
src/conf.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 9e56ec81cc082819390d27e212092d9062b2a705..31d6508e849844acbb7dd4e3c25272e61fae6baf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2004-07-12 Kalle Wallin <kaw@linux.se>
* options.c: fixed short option handling for multiple short options
at once (-abcde)
+ * conf.c: removed support for the old configuration syntax
2004-07-09 Kalle Wallin <kaw@linux.se>
* ncmpc-0.11.0 released (r1820)
diff --git a/src/conf.c b/src/conf.c
index 4def2c839fadd91126049668e8ced12ccebe89e8..9dacbfbee9bac75dda8f50bc45f7c69ce79b77d5 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#include "colors.h"
#include "conf.h"
-#define ENABLE_OLD_SYNTAX
-
#define MAX_LINE_LENGTH 1024
#define COMMENT_TOKEN '#'
#define CONF_VISIBLE_BELL "visible-bell"
#define CONF_XTERM_TITLE "set-xterm-title"
-
-/* Deprecated - configuration field names */
-#define OLD_CONF_ENABLE_COLORS "enable_colors"
-#define OLD_CONF_AUTO_CENTER "auto_center"
-#define OLD_CONF_WIDE_CURSOR "wide_cursor"
-#define CONF_COLOR_BACKGROUND "background_color"
-#define CONF_COLOR_TITLE "title_color"
-#define CONF_COLOR_LINE "line_color"
-#define CONF_COLOR_LIST "list_color"
-#define CONF_COLOR_PROGRESS "progress_color"
-#define CONF_COLOR_STATUS "status_color"
-#define CONF_COLOR_ALERT "alert_color"
-
-
typedef enum {
KEY_PARSER_UNKNOWN,
KEY_PARSER_CHAR,
/* get the value part */
memset(buf, 0, MAX_LINE_LENGTH);
- strncpy(buf, str+i, len-i);
+ g_strlcpy(buf, str+i, MAX_LINE_LENGTH);
len = strlen(buf);
if( len==0 )
{
/* get the value part */
memset(buf, 0, MAX_LINE_LENGTH);
- strncpy(buf, str+i, len-i);
+ g_strlcpy(buf, str+i, MAX_LINE_LENGTH);
len = strlen(buf);
if( len==0 )
{
{
parse_color(value);
}
-#ifdef ENABLE_OLD_SYNTAX
- /* background color */
- else if( !strcasecmp(CONF_COLOR_BACKGROUND, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("background", value);
- }
- /* color - top (title) window */
- else if( !strcasecmp(CONF_COLOR_TITLE, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("title", value);
- colors_assign("title2", value);
- }
- /* color - line (title) window */
- else if( !strcasecmp(CONF_COLOR_LINE, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("line", value);
- colors_assign("line2", value);
- }
- /* color - list window */
- else if( !strcasecmp(CONF_COLOR_LIST, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("list", value);
- }
- /* color - progress bar */
- else if( !strcasecmp(CONF_COLOR_PROGRESS, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("progressbar", value);
- }
- /* color - status window */
- else if( !strcasecmp(CONF_COLOR_STATUS, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("status", value);
- colors_assign("status2", value);
- }
- /* color - alerts */
- else if( !strcasecmp(CONF_COLOR_ALERT, name) )
- {
- fprintf(stderr,"%s: %s deprecated!\n", filename,name);
- colors_assign("alert", value);
- }
- /* enable colors */
- else if( !strcasecmp(OLD_CONF_ENABLE_COLORS, name) )
- {
- fprintf(stderr,"%s: %s deprecated - use %s!\n", filename, name, CONF_ENABLE_COLORS);
- options->enable_colors = str2bool(value);
- }
- /* auto center */
- else if( !strcasecmp(OLD_CONF_AUTO_CENTER, name) )
- {
- fprintf(stderr,"%s: %s deprecated - use %s!\n", filename, name, CONF_AUTO_CENTER);
- options->auto_center = str2bool(value);
- }
- /* wide cursor */
- else if( !strcasecmp(OLD_CONF_WIDE_CURSOR, name) )
- {
- fprintf(stderr,"%s: %s deprecated - use %s!\n", filename, name, CONF_WIDE_CURSOR);
- options->wide_cursor = str2bool(value);
- }
-#endif
/* wide cursor */
else if( !strcasecmp(CONF_WIDE_CURSOR, name) )
{