]> git.draconx.ca Git - liblbx.git/blobdiff - src/lbx.h
liblbx: Make lbx_close return the result of fclose.
[liblbx.git] / src / lbx.h
index 4232b9f87c0d818b97e6ff21e0fb7c553d33246a..b2a90efa3f212f6f8594d1968b9e681527b2f5c7 100644 (file)
--- a/src/lbx.h
+++ b/src/lbx.h
@@ -1,10 +1,38 @@
 #ifndef LBX_H_
 #define LBX_H_
 
+#include <stdio.h>
+
+/* 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 *);
+void  *lbx_mmap(LBX *, size_t, size_t *);
+
+/* Misc operations */
+const char *lbx_strerror(void);
 
 #endif