OpenCPN Partial API docs
Loading...
Searching...
No Matches
zu_file.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
***********************************************************************/
18
42
#ifndef ZU_FILE_H
43
#define ZU_FILE_H
44
45
#define ZU_COMPRESS_AUTO (-1)
46
#define ZU_COMPRESS_NONE 0
47
#define ZU_COMPRESS_GZIP 1
48
#define ZU_COMPRESS_BZIP 2
49
50
#define ZU_BUFREADSIZE 256000
51
52
#ifdef __cplusplus
53
extern
"C"
{
54
#endif
55
56
// zuFile : uniform interface for READING uncompressed, gziped and bziped files
57
// (with fseek ftell not so bugged as in ... library)
58
#include <stdio.h>
59
#include <string.h>
60
#include <stdlib.h>
61
#include <ctype.h>
62
63
#include <zlib.h>
64
#include <bzlib.h>
65
66
typedef
struct
{
67
int
type;
68
int
ok;
69
char
*fname;
70
long
pos;
71
72
void
*zfile;
// exact file type depends of compress type
73
74
FILE *faux;
// auxiliary file for bzip
75
}
ZUFILE
;
76
77
ZUFILE
*zu_open(
const
char
*fname,
const
char
*mode,
78
int
type = ZU_COMPRESS_AUTO);
79
int
zu_close(
ZUFILE
*f);
80
81
int
zu_can_read_file(
const
char
*fname);
82
83
int
zu_read(
ZUFILE
*f,
void
*buf,
long
len);
84
85
long
zu_tell(
ZUFILE
*f);
86
87
int
zu_seek(
ZUFILE
*f,
long
offset,
int
whence);
// TODO: whence=SEEK_END
88
89
void
zu_rewind(
ZUFILE
*f);
90
91
long
zu_filesize(
ZUFILE
*f);
92
93
// for internal use :
94
int
zu_bzSeekForward(
ZUFILE
*f,
unsigned
long
nbytes);
95
96
#ifdef __cplusplus
97
}
98
#endif
99
100
#endif
ZUFILE
Definition
zu_file.h:66
plugins
grib_pi
src
zu_file.h
Generated on Tue Aug 11 2026 03:08:42 for OpenCPN Partial API docs by
1.9.8