]> git.draconx.ca Git - upkg.git/blobdiff - src/upkg.h
Export the decode_index function from the upkg library.
[upkg.git] / src / upkg.h
index 50793c5ef407d1be1b172bf3b23af28486e47650..ab2dacbb261bf02b41908d5f1a7cfce1e0cf2240 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef UPKG_H_
 #define UPKG_H_
 
+#include <stddef.h>
+
 #define UPKG_FLAG_ALLOW_DOWNLOAD  0x0001
 #define UPKG_FLAG_CLIENT_OPTIONAL 0x0002
 #define UPKG_FLAG_SERVER_ONLY     0x0004
@@ -49,8 +51,20 @@ struct upkg {
        struct upkg_private *priv;
 };
 
+struct upkg_file {
+       struct upkg *pkg;
+       unsigned long base, offset, len;
+};
+
 struct upkg *upkg_fopen(const char *path);
 int upkg_close(struct upkg *pkg);
+
 const char *upkg_get_name(struct upkg *pkg, unsigned long idx);
 
+struct upkg_file *upkg_export_open(struct upkg *pkg, unsigned long idx);
+size_t upkg_export_read(struct upkg_file *f, void *buf, size_t n);
+void upkg_export_close(struct upkg_file *f);
+
+size_t upkg_decode_index(long *val, unsigned char *bytes, size_t n);
+
 #endif