freebsd-nq/contrib/libreadline/tilde.h

79 lines
3.0 KiB
C
Raw Normal View History

1997-01-04 22:09:20 +00:00
/* tilde.h: Externally available variables and function in libtilde.a. */
/* Copyright (C) 1992 Free Software Foundation, Inc.
This file contains the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
for it.
The Library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2000-03-19 21:18:09 +00:00
the Free Software Foundation; either version 2, or (at your option)
1997-01-04 22:09:20 +00:00
any later version.
The Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
2000-03-19 21:18:09 +00:00
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
1997-01-04 22:09:20 +00:00
#if !defined (_TILDE_H_)
# define _TILDE_H_
2000-03-19 21:18:09 +00:00
#ifdef __cplusplus
extern "C" {
#endif
/* A function can be defined using prototypes and compile on both ANSI C
and traditional C compilers with something like this:
2003-08-31 17:55:46 +00:00
extern char *func PARAMS((char *, char *, int)); */
2000-03-19 21:18:09 +00:00
2003-08-31 17:55:46 +00:00
#if !defined (PARAMS)
2000-03-19 21:18:09 +00:00
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
2003-08-31 17:55:46 +00:00
# define PARAMS(protos) protos
2000-03-19 21:18:09 +00:00
# else
2003-08-31 17:55:46 +00:00
# define PARAMS(protos) ()
2000-03-19 21:18:09 +00:00
# endif
#endif
2003-08-31 17:55:46 +00:00
typedef char *tilde_hook_func_t PARAMS((char *));
1997-01-04 22:09:20 +00:00
/* If non-null, this contains the address of a function that the application
wants called before trying the standard tilde expansions. The function
is called with the text sans tilde, and returns a malloc()'ed string
which is the expansion, or a NULL pointer if the expansion fails. */
2001-04-11 02:33:07 +00:00
extern tilde_hook_func_t *tilde_expansion_preexpansion_hook;
1997-01-04 22:09:20 +00:00
/* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called
with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
which is the expansion, or a NULL pointer if there is no expansion. */
2001-04-11 02:33:07 +00:00
extern tilde_hook_func_t *tilde_expansion_failure_hook;
1997-01-04 22:09:20 +00:00
/* When non-null, this is a NULL terminated array of strings which
are duplicates for a tilde prefix. Bash uses this to expand
`=~' and `:~'. */
extern char **tilde_additional_prefixes;
/* When non-null, this is a NULL terminated array of strings which match
the end of a username, instead of just "/". Bash sets this to
`:' and `=~'. */
extern char **tilde_additional_suffixes;
/* Return a new string which is the result of tilde expanding STRING. */
2003-08-31 17:55:46 +00:00
extern char *tilde_expand PARAMS((const char *));
1997-01-04 22:09:20 +00:00
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
2003-08-31 17:55:46 +00:00
extern char *tilde_expand_word PARAMS((const char *));
2000-03-19 21:18:09 +00:00
#ifdef __cplusplus
}
#endif
1997-01-04 22:09:20 +00:00
#endif /* _TILDE_H_ */