home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / POSTSCRI / PSFIX.ZIP / FILEIO.H < prev    next >
C/C++ Source or Header  |  1991-03-28  |  3KB  |  95 lines

  1. /* 
  2.  *
  3.  *  header for fileio.c
  4.  *
  5.  */
  6.  
  7. /*
  8.  * This software may be freely distributed under the following conditions:
  9.  *         1. It is distributed in its current form, without alterations.
  10.  *         2. No monetary profit is made, under any circumstances.
  11.  *
  12.  *             Marc A. Murison
  13.  *             Smithsonian Astrophysical Observatory
  14.  *             60 Garden Street, MS 63
  15.  *             Cambridge, MA  02138
  16.  *
  17.  *             (617) 495-7079      murison@cfacx2.harvard.edu
  18.  */
  19.  
  20.  
  21.  
  22. #ifndef    FILEIO_H
  23. #define    FILEIO_H
  24.  
  25. #define        FILES
  26. #include    "mydefs.h"
  27.  
  28. #ifdef    FILEIO_C            /* stuff specific to fileio.c */
  29.  
  30. #ifndef        STRING_H
  31. #define        STRING_H
  32. #include    <string.h>
  33. #endif
  34.  
  35. #ifndef        CTYPE_H
  36. #define        CTYPE_H
  37. #include    <ctype.h>
  38. #endif
  39.  
  40. #include    "vectdef.h"
  41. #include    "strlib.h"
  42.  
  43.  
  44. /* macro for fnext_word */
  45. #define  WORD_CHAR( c )      ( isalnum(c)   ||  (c) == '_' )
  46.  
  47. #endif        /* specific to fileio.c */
  48.  
  49.  
  50.  
  51. /* function prototypes */
  52.  
  53. Boolean        fnext_word( FILE *fp, char *word, int *n, char *cp );
  54.  
  55. Boolean        fnext_line( FILE *file_ptr );
  56.  
  57. int          fget_line( FILE *file_ptr, char *buffer );
  58.  
  59. Boolean        openfile( File_Def *file, File_Type ftype, File_Mode mode);
  60.  
  61. Boolean        cl_in_out( int min_args, char *usage, char *help, 
  62.                        File_Mode mode, int argc, char *argv[], 
  63.                        File_Def *infile, File_Def *outfile );
  64.  
  65. Boolean        cl_dir_in_out( int  nargs,            char *argv[],
  66.                            int  min_args,         char *usage,
  67.                            char *help,            File_Mode mode,
  68.                            char default_in_ext[], char default_out_ext[],
  69.                            char in_name[],           char in_ext[],
  70.                            char out_name[],       char out_ext[],
  71.                            File_Def    *infile,      File_Def *outfile,
  72.                            File_Def *dirfile,     int  *dirflag );
  73.  
  74. Boolean        get_next_file( File_Def *dirfile, File_Def *infile, 
  75.                            File_Def *outfile, File_Mode mode, 
  76.                            char default_in_ext[], char in_name[], 
  77.                            char in_ext[], char out_name[], char out_ext[] );
  78.  
  79. Boolean        get_filename( File_Def *dirfile, char default_ext[],
  80.                           char infile_name[], char in_name[], char in_ext[] );
  81.  
  82. ulong          fill_file_buff( FILE *infile, File_Type ftype, ulong Nmax,
  83.                             char *buff_ptr, int *EOF_ptr );
  84.  
  85. ulong         append_buff( char *source_buff, ulong N, char *dest_buff );
  86.  
  87. uint          fill_line_buff( FILE *infile, File_Type ftype, 
  88.                             char file_buffer[], char **file_buff_ptr_ptr, 
  89.                             ulong Fbytes, uint Lbytes, char *line_buff_ptr, 
  90.                             int msg_flag, int *EOF_ptr );
  91.  
  92. void        ferrout( Boolean bell, FILE *device, char *errstring );
  93.  
  94. #endif
  95.