aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-06 14:36:29 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 14:36:29 +0200
commit109a63c4d0375f12456d32e5bd58bc92748adad0 (patch)
tree5bd23f794b33aa475ca60b6b0426facafd550300
parent4966421e402395e12bf22f75d438504937432e3e (diff)
downloadmpd-109a63c4d0375f12456d32e5bd58bc92748adad0.tar.gz
mpd-109a63c4d0375f12456d32e5bd58bc92748adad0.tar.xz
mpd-109a63c4d0375f12456d32e5bd58bc92748adad0.zip
wreadln: convert public globals to local constants
Convert wrln_max_line_size and wrln_max_history_length to local constants. They have no real use outside of wreadln.c.
-rw-r--r--src/screen.c4
-rw-r--r--src/wreadln.c11
-rw-r--r--src/wreadln.h6
3 files changed, 6 insertions, 15 deletions
diff --git a/src/screen.c b/src/screen.c
index aed9d9af9..648d07a86 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -28,7 +28,6 @@
#include "options.h"
#include "colors.h"
#include "strfsong.h"
-#include "wreadln.h"
#include <stdlib.h>
#include <unistd.h>
@@ -522,9 +521,6 @@ screen_init(mpdclient_t *c)
if (mode_fn->open != NULL)
mode_fn->open(c);
-
- /* initialize wreadln */
- wrln_max_history_length = 16;
}
void
diff --git a/src/wreadln.c b/src/wreadln.c
index edf4f702f..f6773a7f9 100644
--- a/src/wreadln.c
+++ b/src/wreadln.c
@@ -40,11 +40,12 @@
#define KEY_BCKSPC 8
#define TAB 9
-#define WRLN_MAX_LINE_SIZE 1024
-#define WRLN_MAX_HISTORY_LENGTH 32
-
-guint wrln_max_line_size = WRLN_MAX_LINE_SIZE;
-guint wrln_max_history_length = WRLN_MAX_HISTORY_LENGTH;
+/** max size allocated for a line */
+static const size_t wrln_max_line_size = 1024;
+
+/** max items stored in the history list */
+static const guint wrln_max_history_length = 32;
+
void *wrln_completion_callback_data = NULL;
wrln_gcmp_pre_cb_t wrln_pre_completion_callback = NULL;
wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL;
diff --git a/src/wreadln.h b/src/wreadln.h
index fa52d4986..692f4fd69 100644
--- a/src/wreadln.h
+++ b/src/wreadln.h
@@ -4,12 +4,6 @@
#include <glib.h>
#include <ncurses.h>
-/* max size allocated for a line */
-extern guint wrln_max_line_size;
-
-/* max items stored in the history list */
-extern guint wrln_max_history_length;
-
/* completion callback data */
extern void *wrln_completion_callback_data;