[ Home ]

pak.c File Reference

Creates PAK files for Wolfenstein 3-D Redux. More...

#include <string.h>
#include "../memory/memory.h"
#include "../common/platform.h"
#include "../common/common_utils.h"
#include "../string/wtstring.h"
#include "../common/linklist.h"
#include "../filesys/file.h"
#include "../zip/zip.h"
#include "../zlib/zlib.h"
#include "../wolf/wolfcore_decoder.h"

Include dependency graph for pak.c:


Defines

#define SCRIPTNAME   "DEFAULT.CFG"
#define SCRIPT_DIR   "script"

Functions

PRIVATE zipHead_t * Pak_WriteLocalFileChunk (const char *filename, FILE *fout)
 Writes the Local file chunk for a Zip file.
PRIVATE wtBoolean Pak_WriteCentralChunk (linkList_t *zipList, FILE *fout)
 Write central headers for Zip file.
PRIVATE wtBoolean Pak_addDirectoryToZipFile (const char *path, FILE *f)
 Add directory to zip file.
PRIVATE zipHead_t * Pak_addScriptToZipFile (FILE *fout, W8 version)
 Add script file to zip file.
PRIVATE void Pak_DeleteZipFileList (linkList_t *in, wtBoolean deletefile)
 Delete zip file chain.
PUBLIC wtBoolean PAK_builder (const char *packname, W8 version)
 Builds a PAK file for Wolfenstein 3-D Redux.

Variables

PRIVATE char defaultscript []
W32 _gameVersion
PRIVATE linkList_t * zipChain = NULL
PRIVATE linkList_t * zipChainLast = NULL

Detailed Description

Creates PAK files for Wolfenstein 3-D Redux.

Author:
Michael Liebscher
Date:
2004-2007

Function Documentation

PRIVATE wtBoolean Pak_addDirectoryToZipFile ( const char *  path,
FILE *  f 
)

Add directory to zip file.

Parameters:
[in] path Directory path that will be added to zip file.
[in,out] f File stream to write compressed files to.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

PRIVATE zipHead_t* Pak_addScriptToZipFile ( FILE *  fout,
W8  version 
)

Add script file to zip file.

Parameters:
[in,out] fout File stream to write compressed files to.
[in] version Version to write into script file.
Returns:
On success pointer to zlist structure, otherwise NULL.

Here is the call graph for this function:

Here is the caller graph for this function:

PUBLIC wtBoolean PAK_builder ( const char *  packname,
W8  version 
)

Builds a PAK file for Wolfenstein 3-D Redux.

Parameters:
[in] packname Name of PAK file to create.
[in] version Game version to write to default config file.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

PRIVATE void Pak_DeleteZipFileList ( linkList_t *  in,
wtBoolean  deletefile 
)

Delete zip file chain.

Parameters:
[in] in zlist structure chain to delete.
[in] deletefile Delete the file?
Returns:
Nothing.

Here is the call graph for this function:

Here is the caller graph for this function:

PRIVATE wtBoolean Pak_WriteCentralChunk ( linkList_t *  zipList,
FILE *  fout 
)

Write central headers for Zip file.

Parameters:
[in] zipList Chain of zlist structures.
[in,out] fout File stream to write central header to.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

PRIVATE zipHead_t* Pak_WriteLocalFileChunk ( const char *  filename,
FILE *  fout 
)

Writes the Local file chunk for a Zip file.

Parameters:
[in] filename Pointer to a NUL-terminated string that specifies the path of the file to zip.
[in,out] fout File stream to add compressed file to.
Returns:
On success pointer to zipHead_t structure, otherwise NULL..

Here is the call graph for this function:

Here is the caller graph for this function: