home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / readline.zip / readline-2.1 / tilde.h < prev    next >
C/C++ Source or Header  |  1997-04-08  |  3KB  |  66 lines

  1. /* tilde.h: Externally available variables and function in libtilde.a. */
  2.  
  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
  11.    the Free Software Foundation; either version 1, or (at your option)
  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,
  22.    675 Mass Ave, Cambridge, MA 02139, USA. */
  23.  
  24. #if !defined (_TILDE_H_)
  25. #  define _TILDE_H_
  26.  
  27. /* Function pointers can be declared as (Function *)foo. */
  28. #if !defined (_FUNCTION_DEF)
  29. #  define _FUNCTION_DEF
  30. typedef int Function ();
  31. typedef void VFunction ();
  32. typedef char *CPFunction ();
  33. typedef char **CPPFunction ();
  34. #endif /* _FUNCTION_DEF */
  35.  
  36. /* If non-null, this contains the address of a function that the application
  37.    wants called before trying the standard tilde expansions.  The function
  38.    is called with the text sans tilde, and returns a malloc()'ed string
  39.    which is the expansion, or a NULL pointer if the expansion fails. */
  40. extern CPFunction *tilde_expansion_preexpansion_hook;
  41.  
  42. /* If non-null, this contains the address of a function to call if the
  43.    standard meaning for expanding a tilde fails.  The function is called
  44.    with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
  45.    which is the expansion, or a NULL pointer if there is no expansion. */
  46. extern CPFunction *tilde_expansion_failure_hook;
  47.  
  48. /* When non-null, this is a NULL terminated array of strings which
  49.    are duplicates for a tilde prefix.  Bash uses this to expand
  50.    `=~' and `:~'. */
  51. extern char **tilde_additional_prefixes;
  52.  
  53. /* When non-null, this is a NULL terminated array of strings which match
  54.    the end of a username, instead of just "/".  Bash sets this to
  55.    `:' and `=~'. */
  56. extern char **tilde_additional_suffixes;
  57.  
  58. /* Return a new string which is the result of tilde expanding STRING. */
  59. extern char *tilde_expand ();
  60.  
  61. /* Do the work of tilde expansion on FILENAME.  FILENAME starts with a
  62.    tilde.  If there is no expansion, call tilde_expansion_failure_hook. */
  63. extern char *tilde_expand_word ();
  64.  
  65. #endif /* _TILDE_H_ */
  66.