File: tool-input.h

package info (click to toggle)
libgda5 5.2.10-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 76,168 kB
  • sloc: ansic: 495,319; xml: 10,486; yacc: 5,165; sh: 4,451; makefile: 4,095; php: 1,416; java: 1,300; javascript: 1,298; python: 896; sql: 879; perl: 116
file content (47 lines) | stat: -rw-r--r-- 1,898 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Copyright (C) 2000 - 2001 Rodrigo Moya <rodrigo@src.gnome.org>
 * Copyright (C) 2001 Reinhard Müller <reinhard@src.gnome.org>
 * Copyright (C) 2002 - 2003 Gonzalo Paniagua Javier <gonzalo@src.gnome.org>
 * Copyright (C) 2007 Baris Cicek <bcicek@src.gnome.org>
 * Copyright (C) 2007 - 2011 Vivien Malerba <malerba@gnome-db.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef __TOOLS_INPUT__
#define __TOOLS_INPUT__

#include <stdio.h>
#include <glib.h>
#ifdef HAVE_READLINE
#include <readline/readline.h>
#endif
#include "tool-decl.h"

typedef char       **(*CompletionFunc) (const char *match, const char *line, int start, int end);
typedef gboolean     (*TreatLineFunc) (const gchar *, gpointer);
typedef const  char *(*ComputePromptFunc) (void);

gchar   *input_from_stream  (FILE *stream);

void     init_input (TreatLineFunc treat_line_func, ComputePromptFunc prompt_func, gpointer data);
void     input_get_size (gint *width, gint *height);
void     end_input (void);

void     add_to_history (const gchar *txt);
gboolean save_history (const gchar *file, GError **error);
void     tool_input_set_completion_func (ToolCommandGroup *group, CompletionFunc func, gchar *start_chars_to_ignore);

#endif