@kv  0.0.4
Library for graph problems in C and Python
znzfile.h
1 
18 #if !defined(AT_CORE_H_INSIDE)
19 #error "Only <at/core.h> can be included directly."
20 #endif
21 #ifndef AT_ZNZFILE_H
22 #define AT_ZNZFILE_H
23 #include <at/core.h>
24 #include <stdint.h>
25 #include <stdio.h>
26 #include <zlib.h>
27 #include <stdarg.h>
28 AT_BEGIN_DECLS
29 
30 typedef struct AtZnzFile{
31  FILE* nzfptr; /*00+8*/
32 #ifdef HAVE_ZLIB
33  gzFile zfptr; /*08+8*/
34 #endif
35  uint8_t withz;/*16+1*/
36  uint8_t pd[7];/*17+7*/
37  // Total: 24 bytes (or 16 without zlib)
38 }AtZnzFile;
39 
47 AtZnzFile*
48 at_znzfile_open(const char* path, const char* mode, uint8_t withz);
54 int
55 at_znzfile_close(AtZnzFile* fp);
64 size_t
65 at_znzfile_read(AtZnzFile* fp,void* buf, size_t size, size_t nmemb);
74 size_t
75 at_znzfile_write(AtZnzFile* fp,const void* buf, size_t size, size_t nmemb);
83 long
84 at_znzfile_seek(AtZnzFile* file, long offset, int whence);
90 long
91 at_znzfile_tell(AtZnzFile* file);
98 int
99 at_znzfile_puts(const char * str, AtZnzFile* file);
105 int
106 at_znzfile_rewind(AtZnzFile* stream);
107 
115 char *
116 at_znzfile_gets(char* str, int size, AtZnzFile* file);
122 int
123 at_znzfile_flush(AtZnzFile* file);
129 int
130 at_znzfile_eof(AtZnzFile* file);
137 int
138 at_znzfile_putc(int c, AtZnzFile* file);
144 int
145 at_znzfile_getc(AtZnzFile* file);
152 int
153 at_znzfile_printf(AtZnzFile* stream, const char* format, ...);
154 
155 
156 AT_END_DECLS
157 #endif
Definition: znzfile.h:30
uint8_t pd[7]
Definition: znzfile.h:36
uint8_t withz
Definition: znzfile.h:35