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