1 /* tilde.h: Externally available variables and function in libtilde.a. */
3 /* Copyright (C) 1992 Free Software Foundation, Inc.
5 This file contains the Readline Library (the Library), a set of
6 routines for providing Emacs style line input to programs that ask
9 The Library is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 The Library is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 The GNU General Public License is often shipped with GNU software, and
20 is generally kept in a file called COPYING or LICENSE. If you do not
21 have a copy of the license, write to the Free Software Foundation,
22 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
24 #if !defined (_TILDE_H_)
31 /* A function can be defined using prototypes and compile on both ANSI C
32 and traditional C compilers with something like this:
33 extern char *func __P((char *, char *, int)); */
36 # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
37 # define __P(protos) protos
39 # define __P(protos) ()
43 /* Function pointers can be declared as (Function *)foo. */
44 #if !defined (_FUNCTION_DEF)
45 # define _FUNCTION_DEF
46 typedef int Function ();
47 typedef void VFunction ();
48 typedef char *CPFunction ();
49 typedef char **CPPFunction ();
50 #endif /* _FUNCTION_DEF */
52 /* If non-null, this contains the address of a function that the application
53 wants called before trying the standard tilde expansions. The function
54 is called with the text sans tilde, and returns a malloc()'ed string
55 which is the expansion, or a NULL pointer if the expansion fails. */
56 extern CPFunction
*tilde_expansion_preexpansion_hook
;
58 /* If non-null, this contains the address of a function to call if the
59 standard meaning for expanding a tilde fails. The function is called
60 with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
61 which is the expansion, or a NULL pointer if there is no expansion. */
62 extern CPFunction
*tilde_expansion_failure_hook
;
64 /* When non-null, this is a NULL terminated array of strings which
65 are duplicates for a tilde prefix. Bash uses this to expand
67 extern char **tilde_additional_prefixes
;
69 /* When non-null, this is a NULL terminated array of strings which match
70 the end of a username, instead of just "/". Bash sets this to
72 extern char **tilde_additional_suffixes
;
74 /* Return a new string which is the result of tilde expanding STRING. */
75 extern char *tilde_expand
__P((char *));
77 /* Do the work of tilde expansion on FILENAME. FILENAME starts with a
78 tilde. If there is no expansion, call tilde_expansion_failure_hook. */
79 extern char *tilde_expand_word
__P((char *));
85 #endif /* _TILDE_H_ */