]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | /* tilde.h: Externally available variables and function in libtilde.a. */ |
2 | ||
ccc6cda3 JA |
3 | /* Copyright (C) 1992 Free Software Foundation, Inc. |
4 | ||
5 | This file contains the Readline Library (the Library), a set of | |
6 | routines for providing Emacs style line input to programs that ask | |
7 | for it. | |
8 | ||
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 | |
bb70624e | 11 | the Free Software Foundation; either version 2, or (at your option) |
ccc6cda3 JA |
12 | any later version. |
13 | ||
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. | |
18 | ||
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, | |
bb70624e | 22 | 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ |
ccc6cda3 JA |
23 | |
24 | #if !defined (_TILDE_H_) | |
25 | # define _TILDE_H_ | |
726f6388 | 26 | |
f73dda09 JA |
27 | #if defined (HAVE_CONFIG_H) |
28 | # include <config.h> | |
29 | #endif | |
30 | ||
bb70624e JA |
31 | #ifdef __cplusplus |
32 | extern "C" { | |
33 | #endif | |
34 | ||
35 | /* A function can be defined using prototypes and compile on both ANSI C | |
36 | and traditional C compilers with something like this: | |
f73dda09 | 37 | extern char *func PARAMS((char *, char *, int)); */ |
bb70624e | 38 | |
f73dda09 | 39 | #if !defined (PARAMS) |
bb70624e | 40 | # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) |
f73dda09 | 41 | # define PARAMS(protos) protos |
bb70624e | 42 | # else |
f73dda09 | 43 | # define PARAMS(protos) () |
bb70624e JA |
44 | # endif |
45 | #endif | |
46 | ||
f73dda09 | 47 | typedef char *tilde_hook_func_t PARAMS((char *)); |
726f6388 | 48 | |
d166f048 JA |
49 | /* If non-null, this contains the address of a function that the application |
50 | wants called before trying the standard tilde expansions. The function | |
51 | is called with the text sans tilde, and returns a malloc()'ed string | |
52 | which is the expansion, or a NULL pointer if the expansion fails. */ | |
28ef6c31 | 53 | extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; |
d166f048 | 54 | |
726f6388 JA |
55 | /* If non-null, this contains the address of a function to call if the |
56 | standard meaning for expanding a tilde fails. The function is called | |
57 | with the text (sans tilde, as in "foo"), and returns a malloc()'ed string | |
58 | which is the expansion, or a NULL pointer if there is no expansion. */ | |
28ef6c31 | 59 | extern tilde_hook_func_t *tilde_expansion_failure_hook; |
726f6388 JA |
60 | |
61 | /* When non-null, this is a NULL terminated array of strings which | |
62 | are duplicates for a tilde prefix. Bash uses this to expand | |
63 | `=~' and `:~'. */ | |
64 | extern char **tilde_additional_prefixes; | |
65 | ||
66 | /* When non-null, this is a NULL terminated array of strings which match | |
67 | the end of a username, instead of just "/". Bash sets this to | |
68 | `:' and `=~'. */ | |
69 | extern char **tilde_additional_suffixes; | |
70 | ||
71 | /* Return a new string which is the result of tilde expanding STRING. */ | |
f73dda09 | 72 | extern char *tilde_expand PARAMS((const char *)); |
726f6388 JA |
73 | |
74 | /* Do the work of tilde expansion on FILENAME. FILENAME starts with a | |
75 | tilde. If there is no expansion, call tilde_expansion_failure_hook. */ | |
f73dda09 | 76 | extern char *tilde_expand_word PARAMS((const char *)); |
bb70624e JA |
77 | |
78 | #ifdef __cplusplus | |
79 | } | |
80 | #endif | |
726f6388 | 81 | |
ccc6cda3 | 82 | #endif /* _TILDE_H_ */ |