]> git.draconx.ca Git - liblbx.git/blob - src/lbx.h
liblbx: Make lbx_close return the result of fclose.
[liblbx.git] / src / lbx.h
1 #ifndef LBX_H_
2 #define LBX_H_
3
4 #include <stdio.h>
5
6 /* Errors */
7 enum {
8         LBX_ESUCCESS,
9         LBX_EMAGIC,
10         LBX_EEOF,
11         LBX_ERANGE,
12         LBX_EFORMAT,
13 };
14 extern int lbx_errno;
15
16 /* Opaque */
17 typedef struct lbx_state LBX;
18
19 struct lbx_statbuf {
20         const char *name;
21         size_t size;
22 };
23
24 /* Archive operations */
25 LBX   *lbx_fopen(FILE *, const char *);
26 LBX   *lbx_mopen(void *, size_t, const char *);
27 int    lbx_close(LBX *);
28 size_t lbx_numfiles(LBX *);
29
30 /* File operations */
31 int    lbx_stat(LBX *, size_t, struct lbx_statbuf *);
32 size_t lbx_extract(LBX *, size_t, FILE *);
33 void  *lbx_mmap(LBX *, size_t, size_t *);
34
35 /* Misc operations */
36 const char *lbx_strerror(void);
37
38 #endif