]>
git.ipfire.org Git - thirdparty/bash.git/blob - lib/readline/rltypedefs.h
61b81316502c8b37569c0b50c3dfbfe79760d1c5
1 /* rltypedefs.h -- Type declarations for readline functions. */
3 /* Copyright (C) 2000-2023 Free Software Foundation, Inc.
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.
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
11 (at your option) any later version.
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
16 GNU General Public License for more details.
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/>.
22 #ifndef _RL_TYPEDEFS_H_
23 #define _RL_TYPEDEFS_H_
29 /* Old-style, attempt to mark as deprecated in some way people will notice. */
31 #if !defined (_FUNCTION_DEF) && defined (WANT_OBSOLETE_TYPEDEFS)
32 # define _FUNCTION_DEF
34 typedef int Function () __attribute__((deprecated
));
35 typedef void VFunction () __attribute__((deprecated
));
36 typedef char *CPFunction () __attribute__((deprecated
));
37 typedef char **CPPFunction () __attribute__((deprecated
));
39 #endif /* _FUNCTION_DEF && WANT_OBSOLETE_TYPEDEFS */
43 #if !defined (_RL_FUNCTION_TYPEDEF)
44 # define _RL_FUNCTION_TYPEDEF
46 /* Bindable functions */
47 typedef int rl_command_func_t (int, int);
49 /* Typedefs for the completion system */
50 typedef char *rl_compentry_func_t (const char *, int);
51 typedef char **rl_completion_func_t (const char *, int, int);
53 typedef char *rl_quote_func_t (char *, int, char *);
54 typedef char *rl_dequote_func_t (char *, int);
56 typedef int rl_compignore_func_t (char **);
58 typedef void rl_compdisp_func_t (char **, int, int);
60 /* Functions for displaying key bindings. Currently only one. */
61 typedef void rl_macro_print_func_t (const char *, const char *, int, const char *);
63 /* Type for input and pre-read hook functions like rl_event_hook */
64 typedef int rl_hook_func_t (void);
66 /* Input function type */
67 typedef int rl_getc_func_t (FILE *);
69 /* Generic function that takes a character buffer (which could be the readline
70 line buffer) and an index into it (which could be rl_point) and returns
72 typedef int rl_linebuf_func_t (char *, int);
74 /* `Generic' function pointer typedefs */
75 typedef int rl_intfunc_t (int);
76 #define rl_ivoidfunc_t rl_hook_func_t
77 typedef int rl_icpfunc_t (char *);
78 typedef int rl_icppfunc_t (char **);
80 typedef void rl_voidfunc_t (void);
81 typedef void rl_vintfunc_t (int);
82 typedef void rl_vcpfunc_t (char *);
83 typedef void rl_vcppfunc_t (char **);
85 typedef char *rl_cpvfunc_t (void);
86 typedef char *rl_cpifunc_t (int);
87 typedef char *rl_cpcpfunc_t (char *);
88 typedef char *rl_cpcppfunc_t (char **);
90 #endif /* _RL_FUNCTION_TYPEDEF */
96 #endif /* _RL_TYPEDEFS_H_ */