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