xref: /dflybsd-src/contrib/gdb-7/readline/rltypedefs.h (revision 16003dcfd2baa152f5dd24794ec9f36e139eaeb8)
1*6b445a62SJohn Marino /* rltypedefs.h -- Type declarations for readline functions. */
2*6b445a62SJohn Marino 
3*6b445a62SJohn Marino /* Copyright (C) 2000-2009 Free Software Foundation, Inc.
4*6b445a62SJohn Marino 
5*6b445a62SJohn Marino    This file is part of the GNU Readline Library (Readline), a library
6*6b445a62SJohn Marino    for reading lines of text with interactive input and history editing.
7*6b445a62SJohn Marino 
8*6b445a62SJohn Marino    Readline is free software: you can redistribute it and/or modify
9*6b445a62SJohn Marino    it under the terms of the GNU General Public License as published by
10*6b445a62SJohn Marino    the Free Software Foundation, either version 3 of the License, or
11*6b445a62SJohn Marino    (at your option) any later version.
12*6b445a62SJohn Marino 
13*6b445a62SJohn Marino    Readline is distributed in the hope that it will be useful,
14*6b445a62SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
15*6b445a62SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*6b445a62SJohn Marino    GNU General Public License for more details.
17*6b445a62SJohn Marino 
18*6b445a62SJohn Marino    You should have received a copy of the GNU General Public License
19*6b445a62SJohn Marino    along with Readline.  If not, see <http://www.gnu.org/licenses/>.
20*6b445a62SJohn Marino */
21*6b445a62SJohn Marino 
22*6b445a62SJohn Marino #ifndef _RL_TYPEDEFS_H_
23*6b445a62SJohn Marino #define _RL_TYPEDEFS_H_
24*6b445a62SJohn Marino 
25*6b445a62SJohn Marino #ifdef __cplusplus
26*6b445a62SJohn Marino extern "C" {
27*6b445a62SJohn Marino #endif
28*6b445a62SJohn Marino 
29*6b445a62SJohn Marino /* Old-style */
30*6b445a62SJohn Marino 
31*6b445a62SJohn Marino #if !defined (_FUNCTION_DEF)
32*6b445a62SJohn Marino #  define _FUNCTION_DEF
33*6b445a62SJohn Marino 
34*6b445a62SJohn Marino typedef int Function ();
35*6b445a62SJohn Marino typedef void VFunction ();
36*6b445a62SJohn Marino typedef char *CPFunction ();
37*6b445a62SJohn Marino typedef char **CPPFunction ();
38*6b445a62SJohn Marino 
39*6b445a62SJohn Marino #endif /* _FUNCTION_DEF */
40*6b445a62SJohn Marino 
41*6b445a62SJohn Marino /* New style. */
42*6b445a62SJohn Marino 
43*6b445a62SJohn Marino #if !defined (_RL_FUNCTION_TYPEDEF)
44*6b445a62SJohn Marino #  define _RL_FUNCTION_TYPEDEF
45*6b445a62SJohn Marino 
46*6b445a62SJohn Marino /* Bindable functions */
47*6b445a62SJohn Marino typedef int rl_command_func_t PARAMS((int, int));
48*6b445a62SJohn Marino 
49*6b445a62SJohn Marino /* Typedefs for the completion system */
50*6b445a62SJohn Marino typedef char *rl_compentry_func_t PARAMS((const char *, int));
51*6b445a62SJohn Marino typedef char **rl_completion_func_t PARAMS((const char *, int, int));
52*6b445a62SJohn Marino 
53*6b445a62SJohn Marino typedef char *rl_quote_func_t PARAMS((char *, int, char *));
54*6b445a62SJohn Marino typedef char *rl_dequote_func_t PARAMS((char *, int));
55*6b445a62SJohn Marino 
56*6b445a62SJohn Marino typedef int rl_compignore_func_t PARAMS((char **));
57*6b445a62SJohn Marino 
58*6b445a62SJohn Marino typedef void rl_compdisp_func_t PARAMS((char **, int, int));
59*6b445a62SJohn Marino 
60*6b445a62SJohn Marino /* Type for input and pre-read hook functions like rl_event_hook */
61*6b445a62SJohn Marino typedef int rl_hook_func_t PARAMS((void));
62*6b445a62SJohn Marino 
63*6b445a62SJohn Marino /* Input function type */
64*6b445a62SJohn Marino typedef int rl_getc_func_t PARAMS((FILE *));
65*6b445a62SJohn Marino 
66*6b445a62SJohn Marino /* Generic function that takes a character buffer (which could be the readline
67*6b445a62SJohn Marino    line buffer) and an index into it (which could be rl_point) and returns
68*6b445a62SJohn Marino    an int. */
69*6b445a62SJohn Marino typedef int rl_linebuf_func_t PARAMS((char *, int));
70*6b445a62SJohn Marino 
71*6b445a62SJohn Marino /* `Generic' function pointer typedefs */
72*6b445a62SJohn Marino typedef int rl_intfunc_t PARAMS((int));
73*6b445a62SJohn Marino #define rl_ivoidfunc_t rl_hook_func_t
74*6b445a62SJohn Marino typedef int rl_icpfunc_t PARAMS((char *));
75*6b445a62SJohn Marino typedef int rl_icppfunc_t PARAMS((char **));
76*6b445a62SJohn Marino 
77*6b445a62SJohn Marino typedef void rl_voidfunc_t PARAMS((void));
78*6b445a62SJohn Marino typedef void rl_vintfunc_t PARAMS((int));
79*6b445a62SJohn Marino typedef void rl_vcpfunc_t PARAMS((char *));
80*6b445a62SJohn Marino typedef void rl_vcppfunc_t PARAMS((char **));
81*6b445a62SJohn Marino 
82*6b445a62SJohn Marino typedef char *rl_cpvfunc_t PARAMS((void));
83*6b445a62SJohn Marino typedef char *rl_cpifunc_t PARAMS((int));
84*6b445a62SJohn Marino typedef char *rl_cpcpfunc_t PARAMS((char  *));
85*6b445a62SJohn Marino typedef char *rl_cpcppfunc_t PARAMS((char  **));
86*6b445a62SJohn Marino 
87*6b445a62SJohn Marino #endif /* _RL_FUNCTION_TYPEDEF */
88*6b445a62SJohn Marino 
89*6b445a62SJohn Marino #ifdef __cplusplus
90*6b445a62SJohn Marino }
91*6b445a62SJohn Marino #endif
92*6b445a62SJohn Marino 
93*6b445a62SJohn Marino #endif /* _RL_TYPEDEFS_H_ */
94