Code

wreadln: convert public globals to local constants
[ncmpc.git] / src / wreadln.h
1 #ifndef WREADLN_H
2 #define WREADLN_H
4 #include <glib.h>
5 #include <ncurses.h>
7 /* completion callback data */
8 extern void *wrln_completion_callback_data;
10 /* called after TAB is pressed but before g_completion_complete */
11 typedef void (*wrln_gcmp_pre_cb_t) (GCompletion *gcmp, gchar *buf, void *data);
12 extern wrln_gcmp_pre_cb_t wrln_pre_completion_callback;
14 /* post completion callback */
15 typedef void (*wrln_gcmp_post_cb_t) (GCompletion *gcmp, gchar *s, GList *l,
16                                      void *data);
17 extern wrln_gcmp_post_cb_t wrln_post_completion_callback;
19 /* Note, wreadln calls curs_set() and noecho(), to enable cursor and
20  * disable echo. wreadln will not restore these settings when exiting! */
21 gchar *wreadln(WINDOW *w,            /* the curses window to use */
22                const gchar *prompt, /* the prompt string or NULL */
23                const gchar *initial_value, /* initial value or NULL for a empty line
24                                             * (char *) -1 = get value from history */
25                gint x1,              /* the maximum x position or 0 */
26                GList **history,     /* a pointer to a history list or NULL */
27                GCompletion *gcmp    /* a GCompletion structure or NULL */
28                );
30 gchar *
31 wreadln_masked(WINDOW *w,
32                const gchar *prompt,
33                const gchar *initial_value,
34                gint x1,
35                GList **history,
36                GCompletion *gcmp);
38 #endif