OpenCPN Partial API docs
Loading...
Searching...
No Matches
zuFile.h
Go to the documentation of this file.
1
/**********************************************************************
2
zyGrib: meteorological GRIB file viewer
3
Copyright (C) 2008 - Jacques Zaninetti - http://www.zygrib.org
4
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
***********************************************************************/
39
#ifndef ZU_FILE_H
40
#define ZU_FILE_H
41
42
#ifdef __cplusplus
43
extern
"C"
{
44
#endif
45
46
// zuFile : uniform interface for READING uncompressed, gziped and bziped files
47
// (with fseek ftell not so bugged as in ... library)
48
#include <stdio.h>
49
#include <string.h>
50
#include <stdlib.h>
51
#include <ctype.h>
52
53
#include <zlib.h>
54
#include <bzlib.h>
55
56
#define ZU_COMPRESS_AUTO -1
57
#define ZU_COMPRESS_NONE 0
58
#define ZU_COMPRESS_GZIP 1
59
#define ZU_COMPRESS_BZIP 2
60
61
#define ZU_BUFREADSIZE 256000
62
63
typedef
struct
{
64
int
type;
65
int
ok;
66
char
*fname;
67
long
pos;
68
69
void
*zfile;
// exact file type depends of compress type
70
71
FILE *faux;
// auxiliary file for bzip
72
}
ZUFILE
;
73
74
ZUFILE
*zu_open(
const
char
*fname,
const
char
*mode,
75
int
type = ZU_COMPRESS_AUTO);
76
int
zu_close(
ZUFILE
*f);
77
78
int
zu_can_read_file(
const
char
*fname);
79
80
int
zu_read(
ZUFILE
*f,
void
*buf,
long
len);
81
82
long
zu_tell(
ZUFILE
*f);
83
84
int
zu_seek(
ZUFILE
*f,
long
offset,
int
whence);
// TODO: whence=SEEK_END
85
86
void
zu_rewind(
ZUFILE
*f);
87
88
long
zu_filesize(
ZUFILE
*f);
89
90
// for internal use :
91
int
zu_bzSeekForward(
ZUFILE
*f,
unsigned
long
nbytes);
92
93
#ifdef __cplusplus
94
}
95
#endif
96
97
#endif
ZUFILE
Definition
zuFile.h:63
plugins
grib_pi
src
zuFile.h
Generated on Sat Mar 1 2025 02:28:52 for OpenCPN Partial API docs by
1.9.8