jpayne@69: /* tilde.h: Externally available variables and function in libtilde.a. */ jpayne@69: jpayne@69: /* Copyright (C) 1992-2009,2021 Free Software Foundation, Inc. jpayne@69: jpayne@69: This file contains the Readline Library (Readline), a set of jpayne@69: routines for providing Emacs style line input to programs that ask jpayne@69: for it. jpayne@69: jpayne@69: Readline is free software: you can redistribute it and/or modify jpayne@69: it under the terms of the GNU General Public License as published by jpayne@69: the Free Software Foundation, either version 3 of the License, or jpayne@69: (at your option) any later version. jpayne@69: jpayne@69: Readline is distributed in the hope that it will be useful, jpayne@69: but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@69: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@69: GNU General Public License for more details. jpayne@69: jpayne@69: You should have received a copy of the GNU General Public License jpayne@69: along with Readline. If not, see . jpayne@69: */ jpayne@69: jpayne@69: #if !defined (_TILDE_H_) jpayne@69: # define _TILDE_H_ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: typedef char *tilde_hook_func_t (char *); jpayne@69: jpayne@69: /* If non-null, this contains the address of a function that the application jpayne@69: wants called before trying the standard tilde expansions. The function jpayne@69: is called with the text sans tilde, and returns a malloc()'ed string jpayne@69: which is the expansion, or a NULL pointer if the expansion fails. */ jpayne@69: extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; jpayne@69: jpayne@69: /* If non-null, this contains the address of a function to call if the jpayne@69: standard meaning for expanding a tilde fails. The function is called jpayne@69: with the text (sans tilde, as in "foo"), and returns a malloc()'ed string jpayne@69: which is the expansion, or a NULL pointer if there is no expansion. */ jpayne@69: extern tilde_hook_func_t *tilde_expansion_failure_hook; jpayne@69: jpayne@69: /* When non-null, this is a NULL terminated array of strings which jpayne@69: are duplicates for a tilde prefix. Bash uses this to expand jpayne@69: `=~' and `:~'. */ jpayne@69: extern char **tilde_additional_prefixes; jpayne@69: jpayne@69: /* When non-null, this is a NULL terminated array of strings which match jpayne@69: the end of a username, instead of just "/". Bash sets this to jpayne@69: `:' and `=~'. */ jpayne@69: extern char **tilde_additional_suffixes; jpayne@69: jpayne@69: /* Return a new string which is the result of tilde expanding STRING. */ jpayne@69: extern char *tilde_expand (const char *); jpayne@69: jpayne@69: /* Do the work of tilde expansion on FILENAME. FILENAME starts with a jpayne@69: tilde. If there is no expansion, call tilde_expansion_failure_hook. */ jpayne@69: extern char *tilde_expand_word (const char *); jpayne@69: jpayne@69: /* Find the portion of the string beginning with ~ that should be expanded. */ jpayne@69: extern char *tilde_find_word (const char *, int, int *); jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #endif /* _TILDE_H_ */