Freeciv-3.2
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#include "shared.h" /* fc__attribute */
31
32struct fz_FILE_s; /* opaque */
33typedef struct fz_FILE_s fz_FILE;
34
35/* (Possibly) supported methods (depending on freeciv_config.h). */
38#ifdef FREECIV_HAVE_LIBZ
39 FZ_ZLIB,
40#endif
41#ifdef FREECIV_HAVE_LIBLZMA
42 FZ_XZ,
43#endif
44#ifdef FREECIV_HAVE_LIBZSTD
45 FZ_ZSTD,
46#endif
47 /* Deprecated FZ_BZIP2 moved last, so getting NULL setting name for it
48 * won't terminate some iterations in the middle of the valid values. */
49#ifdef FREECIV_HAVE_LIBBZ2
51#endif
52};
53
54fz_FILE *fz_from_file(const char *filename, const char *in_mode,
57fz_FILE *fz_from_memory(char *buffer, int size, bool control);
58int fz_fclose(fz_FILE *fp);
59char *fz_fgets(char *buffer, int size, fz_FILE *fp);
60int fz_fprintf(fz_FILE *fp, const char *format, ...)
62
63int fz_ferror(fz_FILE *fp);
64const char *fz_strerror(fz_FILE *fp);
65
66#ifdef __cplusplus
67}
68#endif /* __cplusplus */
69
70#endif /* FC__IOZ_H */
char * incite_cost
Definition comments.c:75
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:36
@ FZ_PLAIN
Definition ioz.h:37
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