Back to index

tetex-bin  3.0
filesys.h
Go to the documentation of this file.
00001 /* filesys.h -- external declarations for filesys.c.
00002    $Id: filesys.h,v 1.3 2004/04/11 17:56:45 karl Exp $
00003 
00004    Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019 
00020    Written by Brian Fox (bfox@ai.mit.edu). */
00021 
00022 #ifndef INFO_FILESYS_H
00023 #define INFO_FILESYS_H
00024 
00025 /* The path on which we look for info files.  You can initialize this
00026    from the environment variable INFOPATH if there is one, or you can
00027    call info_add_path () to add paths to the beginning or end of it. */
00028 extern char *infopath;
00029 
00030 /* Make INFOPATH have absolutely nothing in it. */
00031 extern void zap_infopath (void);
00032 
00033 /* Add PATH to the list of paths found in INFOPATH.  2nd argument says
00034    whether to put PATH at the front or end of INFOPATH. */
00035 extern void info_add_path (char *path, int where);
00036 
00037 /* Defines that are passed along with the pathname to info_add_path (). */
00038 #define INFOPATH_PREPEND 0
00039 #define INFOPATH_APPEND  1
00040 
00041 /* Expand the filename in PARTIAL to make a real name for this operating
00042    system.  This looks in INFO_PATHS in order to find the correct file.
00043    If it can't find the file, it returns NULL. */
00044 extern char *info_find_fullpath (char *partial);
00045 
00046 /* Given a chunk of text and its length, convert all CRLF pairs at the
00047    EOLs into a single Newline character.  Return the length of produced
00048    text.  */
00049 long convert_eols (char *text, long textlen);
00050 
00051 /* Read the contents of PATHNAME, returning a buffer with the contents of
00052    that file in it, and returning the size of that buffer in FILESIZE.
00053    FINFO is a stat struct which has already been filled in by the caller.
00054    If the file cannot be read, return a NULL pointer. */
00055 extern char *filesys_read_info_file (char *pathname, long int *filesize,
00056     struct stat *finfo, int *is_compressed);
00057 
00058 extern char *filesys_read_compressed (char *pathname, long int *filesize);
00059 
00060 /* Return the command string that would be used to decompress FILENAME. */
00061 extern char *filesys_decompressor_for_file (char *filename);
00062 extern int compressed_filename_p (char *filename);
00063 
00064 /* A function which returns a pointer to a static buffer containing
00065    an error message for FILENAME and ERROR_NUM. */
00066 extern char *filesys_error_string (char *filename, int error_num);
00067 
00068 /* The number of the most recent file system error. */
00069 extern int filesys_error_number;
00070 
00071 /* Given a string containing units of information separated by colons,
00072    return the next one pointed to by IDX, or NULL if there are no more.
00073    Advance IDX to the character after the colon. */
00074 extern char *extract_colon_unit (char *string, int *idx);
00075 
00076 /* Return true if FILENAME is `dir', with a possible compression suffix.  */
00077 extern int is_dir_name (char *filename);
00078 
00079 /* The default value of INFOPATH. */
00080 #if !defined (DEFAULT_INFOPATH)
00081 #  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:."
00082 #endif /* !DEFAULT_INFOPATH */
00083 
00084 #if !defined (S_ISREG) && defined (S_IFREG)
00085 #  define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
00086 #endif /* !S_ISREG && S_IFREG */
00087 
00088 #if !defined (S_ISDIR) && defined (S_IFDIR)
00089 #  define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
00090 #endif /* !S_ISDIR && S_IFDIR */
00091 
00092 #endif /* not INFO_FILESYS_H */