contrib/lar:
[project/luci.git] / contrib / lar / lar.h
index a4379f1..04245ce 100644 (file)
@@ -1,17 +1,19 @@
+#ifndef __LAR_H
+#define __LAR_H
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdint.h>
 #include <fcntl.h>
 #include <string.h>
+#include <errno.h>
 #include <arpa/inet.h>
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 
 
-int errno;
-
 #define LAR_DIE(s) \
        do { \
                fprintf(stderr, "%s(%i): %s(): %s\n", \
@@ -25,6 +27,12 @@ int errno;
 #define LAR_FNAME_BUFFER 1024
 #define LAR_FNAME(s) char s[LAR_FNAME_BUFFER]
 
+#ifdef __WIN32__
+#define LAR_DIRSEP     '\\'
+#else
+#define LAR_DIRSEP     '/'
+#endif
+
 
 struct lar_index_item {
        uint32_t noffset;
@@ -73,4 +81,8 @@ lar_archive * lar_open( const char *filename );
 
 int lar_close( lar_archive *ar );
 
+lar_archive * lar_find_archive( const char *package, const char *path );
+
+lar_member * lar_find_member( lar_archive *ar, const char *package );
 
+#endif