1 #ifndef WREADLN_H
2 #define WREADLN_H
4 /* max size allocated for a line */
5 extern guint wrln_max_line_size;
7 /* max items stored in the history list */
8 extern guint wrln_max_history_length;
10 /* custom wgetch function */
11 typedef int (*wrln_wgetch_fn_t) (WINDOW *w);
12 extern wrln_wgetch_fn_t wrln_wgetch;
14 /* completion callback data */
15 extern void *wrln_completion_callback_data;
17 /* called after TAB is pressed but before g_completion_complete */
18 typedef void (*wrln_gcmp_pre_cb_t) (GCompletion *gcmp, gchar *buf, void *data);
19 extern wrln_gcmp_pre_cb_t wrln_pre_completion_callback;
21 /* post completion callback */
22 typedef void (*wrln_gcmp_post_cb_t) (GCompletion *gcmp, gchar *s, GList *l,
23 void *data);
24 extern wrln_gcmp_post_cb_t wrln_post_completion_callback;
26 /* Note, wreadln calls curs_set() and noecho(), to enable cursor and
27 * disable echo. wreadln will not restore these settings when exiting! */
28 gchar *wreadln(WINDOW *w, /* the curses window to use */
29 const gchar *prompt, /* the prompt string or NULL */
30 const gchar *initial_value, /* initial value or NULL for a empty line
31 * (char *) -1 = get value from history */
32 gint x1, /* the maximum x position or 0 */
33 GList **history, /* a pointer to a history list or NULL */
34 GCompletion *gcmp /* a GCompletion structure or NULL */
35 );
38 #endif