+// 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;
u32 ArchiveMD5SectionSize;
u32 OtherMD5SectionSize;
u32 SignatureSectionSize;
-}
-VPKHeader;
+};
-typedef struct
+struct VPKDirectoryEntry
{
u32 CRC;
u16 PreloadBytes;
u32 EntryOffset;
u32 EntryLength;
u16 Terminator;
-}
-VPKDirectoryEntry;
+};
#pragma pack(pop)
+#ifdef VALVE_IMPLEMENTATION
+
void vpk_free( VPKHeader *self )
{
free( self );
return NULL;
}
+
+#endif