home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / include / pathsrch.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-10  |  2.1 KB  |  54 lines

  1. /* pathsrch.h: environment-variable path searching for files, possibly
  2.    in subdirectories.
  3.  
  4. Copyright (C) 1992 Free Software Foundation, Inc.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef PATHSEARCH_H
  21. #define PATHSEARCH_H
  22.  
  23. #include "types.h"
  24.  
  25.  
  26. /* Look for FILENAME in each of the directories given in the DIR_LIST
  27.    array.  (Unless DIR_LIST is null, or FILENAME is absolute or
  28.    explicitly relative, in which case we just look at FILENAME.)  Return
  29.    the complete pathname of the first readable file found, or NULL.  */
  30. extern string find_path_filename P2H(string filename, string *dir_list);
  31.  
  32. /* Return a NULL-terminated array of all the directory names in the
  33.    value of the environment variable ENV_NAME (or DEFAULT_PATH if it is
  34.    not set).  Each directory in the list ends with the directory separator,
  35.    e.g., `/'.
  36.    
  37.    A leading or trailing path separator (e.g., `:') in the value of
  38.    ENV_NAME is replaced by DEFAULT_PATH.
  39.    
  40.    If any element of the path ends with a double directory separator
  41.    (e.g., `foo//'), it is replaced by all its subdirectories.  */
  42. extern string *initialize_path_list P2H(string env_name, string default_path);
  43.  
  44. /* Replace a leading or trailing `:' in ENV_PATH with DEFAULT_PATH.  If
  45.    neither is present, return ENV_PATH if that is non-null, else
  46.    DEFAULT_PATH.  */
  47. extern string expand_default P2H(string env_path, string default_path);
  48.  
  49. /* Replace a leading ~ or ~name in FILENAME with getenv ("HOME") or
  50.    name's home directory.  */
  51. extern string expand_tilde P1H(string filename);
  52.  
  53. #endif /* not PATHSEARCH_H */
  54.