home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / fontutils-0.6-base.tgz / fontutils-0.6-base.tar / fsf / fontutils / include / libfile.h < prev    next >
C/C++ Source or Header  |  1992-08-17  |  2KB  |  60 lines

  1. /* libfile.h: read auxiliary data files.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef LIBFILE_H
  20. #define LIBFILE_H
  21.  
  22. #include "types.h"
  23.  
  24.  
  25. /* Open (close) the file `HEAD.SUFFIX' using the library path.  Give a
  26.    fatal error if the file cannot be (has not been) opened.  Only one
  27.    file can be open at a time.  `libfile_start' returns the resulting
  28.    opened FILE structure, although this is commonly ignored by the
  29.    caller, in favor of using `libfile_line' (declared below) to read
  30.    from the file.  */
  31. extern FILE *libfile_start (string head, string suffix);
  32. extern void libfile_close (void);
  33.  
  34.  
  35. /* The name (line number) of the currently open library file, or NULL (0).  */
  36. extern string libfilename (void);
  37. extern unsigned libfile_linenumber (void);
  38.  
  39.  
  40. /* An abbreviation for common error messages.  */
  41. #define LIBFILE_ERROR1(fmt, e1) \
  42.   FATAL3 ("%s:%u: " fmt, libfilename (), libfile_linenumber (), e1);
  43. #define LIBFILE_ERROR2(fmt, e1, e2) \
  44.   FATAL4 ("%s:%u: " fmt, libfilename (), libfile_linenumber (), e1, e2);
  45.  
  46. #define LIBFILE_WARN1(fmt, e1) \
  47.   fprintf (stderr, "%s:%u: " fmt "\n", libfilename (), libfile_linenumber (),\
  48.            e1)
  49. #define LIBFILE_WARN2(fmt, e1, e2) \
  50.   fprintf (stderr, "%s:%u: " fmt "\n", libfilename (), libfile_linenumber (),\
  51.            e1, e2)
  52.  
  53.  
  54. /* Return the next non-blank non-comment line in the currently open
  55.    library file, or NULL if at EOF.  The terminating newline and any
  56.    trailing comment are also removed.  */
  57. extern string libfile_line (void);
  58.  
  59. #endif /* not LIBFILE_H */
  60.