finish up plugin architecture
[csRadar.git] / vpk.h
diff --git a/vpk.h b/vpk.h
index b6bd69daf272e69cf8997e18c1330a8b9e54bde7..436994d0f9c493299d02382b71ec5c65874830ce 100644 (file)
--- a/vpk.h
+++ b/vpk.h
@@ -1,8 +1,26 @@
+// This software is not affiliated with Valve Corporation
+//   We are not affiliated, associated, authorized, endorsed by, or in any way officially 
+//   connected with Valve Corporation, or any of its subsidiaries or its affiliates. 
+// 
+//   All trademarks are property of their respective owners
+
+// Valve pak file directory reader
+
 // VPK
 //=======================================================================================================================
 
+typedef struct VPKHeader VPKHeader;
+typedef struct VPKDirectoryEntry VPKDirectoryEntry;
+
+// API
+// ---
+
+// There is no load function, reading the header file as binary is enough.
+VPKDirectoryEntry *vpk_find( VPKHeader *self, const char *asset );
+void vpk_free( VPKHeader *self );
+
 #pragma pack(push, 1)
-typedef struct
+struct VPKHeader
 {
        u32 Signature;
        u32 Version;
@@ -11,10 +29,9 @@ typedef struct
        u32 ArchiveMD5SectionSize;
        u32 OtherMD5SectionSize;
        u32 SignatureSectionSize;
-} 
-VPKHeader;
+};
 
-typedef struct
+struct VPKDirectoryEntry
 {
        u32 CRC;
        u16 PreloadBytes; 
@@ -22,10 +39,11 @@ typedef struct
        u32 EntryOffset;
        u32 EntryLength;
        u16 Terminator;
-} 
-VPKDirectoryEntry;
+};
 #pragma pack(pop)
 
+#ifdef VALVE_IMPLEMENTATION
+
 void vpk_free( VPKHeader *self )
 {
        free( self );
@@ -86,3 +104,5 @@ VPKDirectoryEntry *vpk_find( VPKHeader *self, const char *asset )
        
        return NULL;
 }
+
+#endif