37 #define LINE_SIZE 65536 61 static Xio *get_instance();
66 void set_verbosity(
int verb);
70 XFILEMAP &get_xfile_map();
100 FILE *
xfopen(
const char * fname,
const char *
mode );
101 FILE *
xfopen(
const std::string &fname,
const char *
mode );
110 int xfscanf( FILE * in,
const char *
fmt, ... );
115 char *
xfgets(
char *s,
int n, FILE *in );
117 int xgetc( FILE * f );
118 int xungetc(
int c, FILE * f );
124 size_t xfread(
void * ptr,
size_t size,
size_t count, FILE * stream );
125 size_t xfwrite(
const void * ptr,
size_t size,
size_t count, FILE * stream );
135 int xfeof ( FILE * f );
int verbosity_
internal XIO debug: print info at each XIO function
size_t xfread(void *ptr, size_t size, size_t count, FILE *stream)
Direct input/output.
int xfeof(FILE *f)
Error-handling.
FILE * xfopen(const char *fname, const char *mode)
File access.
FILE * xfreopen(const char *filename, const char *mode, FILE *stream)
Reopen stream with different file or mode.
struct xfile XFILE
XFILE structure holds additional info to generic FILE.
int xgetc(FILE *f)
Get character from stream (function)
char * xio_getfulldescription(FILE *f)
Get pointer to string with full file description.
int xfgetc(FILE *f)
Get character from stream (function)
void xrewind(FILE *f)
File positioning.
char * xfgets(char *s, int n, FILE *in)
Character input/output.
size_t xfwrite(const void *ptr, size_t size, size_t count, FILE *stream)
Write block of data to stream, handle errors.
int xungetc(int c, FILE *f)
Unget character from stream (function)
int xfprintf(FILE *out, const char *fmt,...)
Formatted input/output.
Global macros to enhance readability and debugging, general constants.
XFILE structure holds additional info to generic FILE.
int xfclose(FILE *stream)
Close file (function)
char * xio_getfname(FILE *f)
XIO library extensions.
int xfscanf(FILE *in, const char *fmt,...)
FSCANF WITH ERROR HANDLING.
char * xio_getfmode(FILE *f)
Get file mode from file stream.
int lineno
last read line (only for text files)
int xio_getlinesread(FILE *f)
Get number of read lines from stream.
map< FILE *, XFILE * > XFILEMAP
mapping of ptr to regular file structure to extended structure
char * filename
file name in the time of opening
int xfflush(FILE *f)
Flush stream (function)
XFILEMAP xfiles_map_
mapping instance