Back to index

tetex-bin  3.0
mfileio.h
Go to the documentation of this file.
00001 /*  $Header$
00002 
00003     This is dvipdfm, a DVI to PDF translator.
00004     Copyright (C) 1998, 1999 by Mark A. Wicks
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 of the License, or
00009     (at your option) 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     The author may be contacted via the e-mail address
00021 
00022        mwicks@kettering.edu
00023 */
00024 
00025        
00026 #include <stdio.h>
00027 #include "numbers.h"
00028 #define IODEBUG
00029 #undef IODEBUG
00030 
00031 #ifdef IODEBUG
00032 FILE *mfopen (const char *name, const char *mode,
00033              const char *function, int line);
00034 int mfclose (FILE *file, const char *function, int line);
00035 #define MFOPEN(name,mode) \
00036    mfopen((name),(mode),__FUNCTION__,__LINE__)
00037 #define MFCLOSE(file) \
00038    mfclose((file),__FUNCTION__,__LINE__)
00039 #else
00040 #define MFOPEN(name,mode) fopen((name),(mode))
00041 #define MFCLOSE(file) fclose(file)
00042 #endif
00043 
00044 extern UNSIGNED_BYTE read_byte (FILE *);
00045 
00046 extern void seek_absolute (FILE *file, long pos);
00047 extern void seek_relative (FILE *file, long pos);
00048 
00049 extern void seek_end (FILE *file);
00050 
00051 extern long tell_position (FILE *file);
00052 
00053 extern long file_size (FILE *file);
00054 
00055 extern char *mfgets (char *buffer, unsigned long size, FILE *file);
00056 
00057 extern char work_buffer[];
00058 
00059 #define WORK_BUFFER_SIZE 1024