51 #define LINE_SIZE 65536
114 FILE *
xfopen(
const char * fname,
const char * mode );
115 FILE *
xfopen(
const std::string &fname,
const char * mode );
118 FILE *
xfreopen(
const char * filename,
const char * mode, FILE * stream );
123 int xfprintf( FILE * out,
const char * fmt, ... );
124 int xfscanf( FILE * in,
const char * fmt, ... );
129 char *
xfgets(
char *s,
int n, FILE *in );
131 int xgetc( FILE * f );
132 int xungetc(
int c, FILE * f );
138 size_t xfread(
void * ptr,
size_t size,
size_t count, FILE * stream );
139 size_t xfwrite(
const void * ptr,
size_t size,
size_t count, FILE * stream );
149 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.
void set_verbosity(int verb)
Enable/Disable XIO debug output for EACH XIO function call.
int xfeof(FILE *f)
Error-handling.
FILE * xfopen(const char *fname, const char *mode)
File access.
static Xio * get_instance()
return instance
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.
XFILEMAP & get_xfile_map()
Get XIO mapping instance.
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)
int get_verbosity()
Get current XIO debug verbosity level.
static void init()
initialize XIO library
XFILEMAP xfiles_map_
mapping instance