X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/b42e3c4eadf05be2506e1a1f8deb2cf24064c18b..cc58652bf808568b935ca755d4360aa0f1aedfed:/src/lbx.h diff --git a/src/lbx.h b/src/lbx.h index 4232b9f..89d4bb4 100644 --- a/src/lbx.h +++ b/src/lbx.h @@ -1,10 +1,37 @@ #ifndef LBX_H_ #define LBX_H_ +#include + +/* Errors */ +enum { + LBX_ESUCCESS, + LBX_EMAGIC, + LBX_EEOF, + LBX_ERANGE, + LBX_EFORMAT, +}; +extern int lbx_errno; + +/* Opaque */ typedef struct lbx_state LBX; -LBX *lbx_fopen(FILE *); -LBX *lbx_open(const char *); -void lbx_close(LBX *); +struct lbx_statbuf { + const char *name; + size_t size; +}; + +/* Archive operations */ +LBX *lbx_fopen(FILE *, const char *); +LBX *lbx_mopen(void *, size_t, const char *); +int lbx_close(LBX *); +size_t lbx_numfiles(LBX *); + +/* File operations */ +int lbx_stat(LBX *, size_t, struct lbx_statbuf *); +size_t lbx_extract(LBX *, size_t, FILE *); + +/* Misc operations */ +const char *lbx_strerror(void); #endif