121308Sache/* tilde.h: Externally available variables and function in libtilde.a. */ 221308Sache 321308Sache/* Copyright (C) 1992 Free Software Foundation, Inc. 421308Sache 521308Sache This file contains the Readline Library (the Library), a set of 621308Sache routines for providing Emacs style line input to programs that ask 721308Sache for it. 821308Sache 921308Sache The Library is free software; you can redistribute it and/or modify 1021308Sache it under the terms of the GNU General Public License as published by 1158310Sache the Free Software Foundation; either version 2, or (at your option) 1221308Sache any later version. 1321308Sache 1421308Sache The Library is distributed in the hope that it will be useful, but 1521308Sache WITHOUT ANY WARRANTY; without even the implied warranty of 1621308Sache MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1721308Sache General Public License for more details. 1821308Sache 1921308Sache The GNU General Public License is often shipped with GNU software, and 2021308Sache is generally kept in a file called COPYING or LICENSE. If you do not 2121308Sache have a copy of the license, write to the Free Software Foundation, 2258310Sache 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ 2321308Sache 2421308Sache#if !defined (_TILDE_H_) 2521308Sache# define _TILDE_H_ 2621308Sache 2758310Sache#ifdef __cplusplus 2858310Sacheextern "C" { 2958310Sache#endif 3058310Sache 3158310Sache/* A function can be defined using prototypes and compile on both ANSI C 3258310Sache and traditional C compilers with something like this: 33119610Sache extern char *func PARAMS((char *, char *, int)); */ 3458310Sache 35119610Sache#if !defined (PARAMS) 3658310Sache# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) 37119610Sache# define PARAMS(protos) protos 3858310Sache# else 39119610Sache# define PARAMS(protos) () 4058310Sache# endif 4158310Sache#endif 4258310Sache 43119610Sachetypedef char *tilde_hook_func_t PARAMS((char *)); 4421308Sache 4526497Sache/* If non-null, this contains the address of a function that the application 4626497Sache wants called before trying the standard tilde expansions. The function 4726497Sache is called with the text sans tilde, and returns a malloc()'ed string 4826497Sache which is the expansion, or a NULL pointer if the expansion fails. */ 4975406Sacheextern tilde_hook_func_t *tilde_expansion_preexpansion_hook; 5026497Sache 5121308Sache/* If non-null, this contains the address of a function to call if the 5221308Sache standard meaning for expanding a tilde fails. The function is called 5321308Sache with the text (sans tilde, as in "foo"), and returns a malloc()'ed string 5421308Sache which is the expansion, or a NULL pointer if there is no expansion. */ 5575406Sacheextern tilde_hook_func_t *tilde_expansion_failure_hook; 5621308Sache 5721308Sache/* When non-null, this is a NULL terminated array of strings which 5821308Sache are duplicates for a tilde prefix. Bash uses this to expand 5921308Sache `=~' and `:~'. */ 6021308Sacheextern char **tilde_additional_prefixes; 6121308Sache 6221308Sache/* When non-null, this is a NULL terminated array of strings which match 6321308Sache the end of a username, instead of just "/". Bash sets this to 6421308Sache `:' and `=~'. */ 6521308Sacheextern char **tilde_additional_suffixes; 6621308Sache 6721308Sache/* Return a new string which is the result of tilde expanding STRING. */ 68119610Sacheextern char *tilde_expand PARAMS((const char *)); 6921308Sache 7021308Sache/* Do the work of tilde expansion on FILENAME. FILENAME starts with a 7121308Sache tilde. If there is no expansion, call tilde_expansion_failure_hook. */ 72119610Sacheextern char *tilde_expand_word PARAMS((const char *)); 7321308Sache 74157184Sache/* Find the portion of the string beginning with ~ that should be expanded. */ 75157184Sacheextern char *tilde_find_word PARAMS((const char *, int, int *)); 76157184Sache 7758310Sache#ifdef __cplusplus 7858310Sache} 7958310Sache#endif 8058310Sache 8121308Sache#endif /* _TILDE_H_ */ 82