Freeciv-3.3
Loading...
Searching...
No Matches
ioz.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__IOZ_H
15#define FC__IOZ_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/***********************************************************************
22 An IO layer to support transparent compression/uncompression.
23 (Currently only "required" functionality is supported.)
24***********************************************************************/
25
26#include <stdio.h> /* FILE */
27
28#include <freeciv_config.h>
29
30/* utility */
31#include "shared.h" /* fc__attribute */
32
33struct fz_FILE_s; /* opaque */
34typedef struct fz_FILE_s fz_FILE;
35
36/* (Possibly) supported methods (depending on freeciv_config.h). */
39#ifdef FREECIV_HAVE_LIBZ
40 FZ_ZLIB,
41#endif
42#ifdef FREECIV_HAVE_LIBLZMA
43 FZ_XZ,
44#endif
45#ifdef FREECIV_HAVE_LIBZSTD
46 FZ_ZSTD,
47#endif
48 /* Deprecated FZ_BZIP2 moved last, so getting nullptr setting name for it
49 * won't terminate some iterations in the middle of the valid values. */
50#ifdef FREECIV_HAVE_LIBBZ2
52#endif
53};
54
55fz_FILE *fz_from_file(const char *filename, const char *in_mode,
58fz_FILE *fz_from_memory(char *buffer, int size, bool control);
59int fz_fclose(fz_FILE *fp);
60char *fz_fgets(char *buffer, int size, fz_FILE *fp);
61int fz_fprintf(fz_FILE *fp, const char *format, ...)
63
64int fz_ferror(fz_FILE *fp);
65const char *fz_strerror(fz_FILE *fp);
66
67#ifdef __cplusplus
68}
69#endif /* __cplusplus */
70
71#endif /* FC__IOZ_H */
char * incite_cost
Definition comments.c:76
char * fz_fgets(char *buffer, int size, fz_FILE *fp)
Definition ioz.c:655
int fz_fprintf(fz_FILE *fp, const char *format,...) fc__attribute((__format__(__printf__
fz_method
Definition ioz.h:37
@ FZ_PLAIN
Definition ioz.h:38
fz_FILE * fz_from_stream(FILE *stream)
Definition ioz.c:548
int int fz_ferror(fz_FILE *fp)
Definition ioz.c:1099
fz_FILE * fz_from_memory(char *buffer, int size, bool control)
Definition ioz.c:207
fz_FILE * fz_from_file(const char *filename, const char *in_mode, enum fz_method method, int compress_level)
Definition ioz.c:230
const char * fz_strerror(fz_FILE *fp)
Definition ioz.c:1157
int fz_fclose(fz_FILE *fp)
Definition ioz.c:571
size_t size
Definition specvec.h:72
enum fz_method method
Definition ioz.c:150
#define fc__attribute(x)
Definition support.h:99