Freeciv-3.3
|
Go to the source code of this file.
Typedefs | |
typedef struct fz_FILE_s | fz_FILE |
Enumerations | |
enum | fz_method { FZ_PLAIN = 0 } |
Functions | |
fz_FILE * | fz_from_file (const char *filename, const char *in_mode, enum fz_method method, int compress_level) |
fz_FILE * | fz_from_stream (FILE *stream) |
fz_FILE * | fz_from_memory (char *buffer, int size, bool control) |
int | fz_fclose (fz_FILE *fp) |
char * | fz_fgets (char *buffer, int size, fz_FILE *fp) |
int | fz_fprintf (fz_FILE *fp, const char *format,...) fc__attribute((__format__(__printf__ |
int int | fz_ferror (fz_FILE *fp) |
const char * | fz_strerror (fz_FILE *fp) |
Close file, like fclose(). Returns 0 on success, or non-zero for problems (but don't call fz_ferror() in that case because the struct has already been free'd; wishlist: better interface for errors?) (For FZ_PLAIN returns EOF and could check errno; for FZ_ZLIB: returns zlib error number; see zlib.h.)
Definition at line 571 of file ioz.c.
Referenced by get_token_value(), inf_close_partial(), and secfile_save().
Return non-zero if there is an error status associated with this stream. Check fz_strerror() for details.
Definition at line 1099 of file ioz.c.
Referenced by inf_close_partial(), and secfile_save().
Get a line, like fgets(). Returns nullptr in case of error, or when end-of-file reached and no characters have been read.
Definition at line 655 of file ioz.c.
Referenced by get_token_value(), and read_a_line().
fz_FILE * fz_from_file | ( | const char * | filename, |
const char * | in_mode, | ||
enum fz_method | method, | ||
int | compress_level | ||
) |
Open file for reading/writing, like fopen(). Parameters compress_method and compress_level only apply for writing: for reading try to use the most appropriate available method. Returns nullptr if there was a problem; check errno for details. (If errno is 0, and using FZ_ZLIB, probably had zlib error Z_MEM_ERROR. Wishlist: better interface for errors?)
Definition at line 230 of file ioz.c.
Referenced by get_token_value(), inf_from_file(), and secfile_save().
Open memory buffer for reading as fz_FILE. If control is TRUE, caller gives up control of the buffer so ioz will free it when fz_FILE closed.
Definition at line 207 of file ioz.c.
Referenced by netfile_get_section_file().
Open uncompressed stream for reading/writing.
Definition at line 548 of file ioz.c.
Referenced by fc_querysocket().
Return string (pointer to static memory) containing an error description associated with the file. Should only call this is you know there is an error (eg, from fz_ferror()). Note the error string may be based on errno, so should call this immediately after problem, or possibly something else might overwrite errno.
Definition at line 1157 of file ioz.c.
Referenced by inf_close_partial(), and secfile_save().