Back to index

texmacs  1.0.7.15
mfileio.h
Go to the documentation of this file.
00001 /*  $Header: /home/cvsroot/dvipdfmx/src/mfileio.h,v 1.3 2002/10/30 02:27:12 chofchof Exp $
00002 
00003     This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
00004 
00005     Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
00006     the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
00007     
00008     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014     
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU General Public License for more details.
00019     
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00023 */
00024 
00025 #ifndef _MFILEIO_H_
00026 #define _MFILEIO_H_
00027 
00028 #include <stdio.h>
00029 #include "numbers.h"
00030 
00031 /* How to open a binary file for reading:  */
00032 #ifndef FOPEN_RBIN_MODE
00033 #define FOPEN_RBIN_MODE "rb"
00034 #endif /* not FOPEN_RBIN_MODE */
00035 
00036 /* How to open a binary file for writing:  */
00037 #ifndef FOPEN_WBIN_MODE
00038 #define FOPEN_WBIN_MODE "wb"
00039 #endif /* not FOPEN_WBIN_MODE */
00040 
00041 #ifdef IODEBUG
00042 FILE *mfopen (const char *name, const char *mode,
00043              const char *function, int line);
00044 int mfclose (FILE *file, const char *function, int line);
00045 #define MFOPEN(name,mode) \
00046    mfopen((name),(mode),__FUNCTION__,__LINE__)
00047 #define MFCLOSE(file) \
00048    mfclose((file),__FUNCTION__,__LINE__)
00049 #else
00050 #define MFOPEN(name,mode) fopen((name),(mode))
00051 #define MFCLOSE(file) fclose(file)
00052 #endif
00053 
00054 extern UNSIGNED_BYTE read_byte (FILE *);
00055 
00056 extern void seek_absolute (FILE *file, long pos);
00057 extern void seek_relative (FILE *file, long pos);
00058 
00059 extern void seek_end (FILE *file);
00060 
00061 extern long tell_position (FILE *file);
00062 
00063 extern long file_size (FILE *file);
00064 
00065 extern char *mfgets (char *buffer, unsigned long size, FILE *file);
00066 
00067 extern char work_buffer[];
00068 
00069 #define WORK_BUFFER_SIZE 1024
00070 
00071 #endif /* _MFILEIO_H_ */