filesys.h revision 1.1.1.1
1/* $NetBSD: filesys.h,v 1.1.1.1 2016/01/14 00:11:29 christos Exp $ */ 2 3/* filesys.h -- external declarations for filesys.c. 4 Id: filesys.h,v 1.3 2004/04/11 17:56:45 karl Exp 5 6 Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2, or (at your option) 11 any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 22 Written by Brian Fox (bfox@ai.mit.edu). */ 23 24#ifndef INFO_FILESYS_H 25#define INFO_FILESYS_H 26 27/* The path on which we look for info files. You can initialize this 28 from the environment variable INFOPATH if there is one, or you can 29 call info_add_path () to add paths to the beginning or end of it. */ 30extern char *infopath; 31 32/* Make INFOPATH have absolutely nothing in it. */ 33extern void zap_infopath (void); 34 35/* Add PATH to the list of paths found in INFOPATH. 2nd argument says 36 whether to put PATH at the front or end of INFOPATH. */ 37extern void info_add_path (char *path, int where); 38 39/* Defines that are passed along with the pathname to info_add_path (). */ 40#define INFOPATH_PREPEND 0 41#define INFOPATH_APPEND 1 42 43/* Expand the filename in PARTIAL to make a real name for this operating 44 system. This looks in INFO_PATHS in order to find the correct file. 45 If it can't find the file, it returns NULL. */ 46extern char *info_find_fullpath (char *partial); 47 48/* Given a chunk of text and its length, convert all CRLF pairs at the 49 EOLs into a single Newline character. Return the length of produced 50 text. */ 51long convert_eols (char *text, long textlen); 52 53/* Read the contents of PATHNAME, returning a buffer with the contents of 54 that file in it, and returning the size of that buffer in FILESIZE. 55 FINFO is a stat struct which has already been filled in by the caller. 56 If the file cannot be read, return a NULL pointer. */ 57extern char *filesys_read_info_file (char *pathname, long int *filesize, 58 struct stat *finfo, int *is_compressed); 59 60extern char *filesys_read_compressed (char *pathname, long int *filesize); 61 62/* Return the command string that would be used to decompress FILENAME. */ 63extern char *filesys_decompressor_for_file (char *filename); 64extern int compressed_filename_p (char *filename); 65 66/* A function which returns a pointer to a static buffer containing 67 an error message for FILENAME and ERROR_NUM. */ 68extern char *filesys_error_string (char *filename, int error_num); 69 70/* The number of the most recent file system error. */ 71extern int filesys_error_number; 72 73/* Given a string containing units of information separated by colons, 74 return the next one pointed to by IDX, or NULL if there are no more. 75 Advance IDX to the character after the colon. */ 76extern char *extract_colon_unit (char *string, int *idx); 77 78/* Return true if FILENAME is `dir', with a possible compression suffix. */ 79extern int is_dir_name (char *filename); 80 81/* The default value of INFOPATH. */ 82#if !defined (DEFAULT_INFOPATH) 83# define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:." 84#endif /* !DEFAULT_INFOPATH */ 85 86#if !defined (S_ISREG) && defined (S_IFREG) 87# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 88#endif /* !S_ISREG && S_IFREG */ 89 90#if !defined (S_ISDIR) && defined (S_IFDIR) 91# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 92#endif /* !S_ISDIR && S_IFDIR */ 93 94#endif /* not INFO_FILESYS_H */ 95