#define Cypher_Init
/*



*/
Dllname = "Resource_DLL.dll";

global.defCypherInit=external_define(Dllname,"OpenResource",dll_stdcall,ty_real,2,ty_string,ty_string);

global.defCypherAddFile=external_define(Dllname,"AddFile",dll_stdcall,ty_real,4,ty_real,ty_string,ty_string,ty_string);
global.defCypherWritePackage=external_define(Dllname,"WritePackage",dll_stdcall,ty_real,3,ty_real,ty_string,ty_string);
global.defCypherExtractFile=external_define(Dllname,"ExtractFile",dll_stdcall,ty_real,4,ty_real,ty_string,ty_string,ty_string);
global.defCypherClosePackage=external_define(Dllname,"ClosePackage",dll_stdcall,ty_real,1,ty_real);
global.defCypherFileCount=external_define(Dllname,"FileCount",dll_stdcall,ty_real,1,ty_real);
global.defCypherGetFname=external_define(Dllname,"GetFname",dll_stdcall,ty_string,2,ty_real,ty_real);
global.defCypherRemoveFile=external_define(Dllname,"RemoveFile",dll_stdcall,ty_real,2,ty_real,ty_string);



#define Cypher_Open
/*
Cypher_Open(Fname, Password);
      Opens a new Resource Package and reurns the ID of the package which is used
      For other functions.

Arguments:
          [0]Fname: The Filename of a resource. If you are creating a new package
                    then leave this argument blank.
          [1]Password: If this package exists, it might have a password on it.
                       Provide a password to access the file or leave blank ("")
                       if you do not need to decrypt it.
Return:
Returns the Package ID which is needed for other functions.



*/


external_call(global.defCypherInit,argument0,argument1);
#define Cypher_AddFile
/*
Cypher_AddFile(PkgID,Fname,Password,InternalFname);
      Adds a new file to a package. You must use Cypher_Write() again after adding
      new files.
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
          [1]Fname: The path of the file you wish to add.
          [2]Password: A password to encrypt this file with. Leave blank ("") for no encryption
          [3]InternalFname: The name of the file inside of the package (Use this
                            name for extracting later)
Return:
Returns 0 if the function failed. Returns 1 on success.



*/


external_call(global.defCypherAddFile,argument0,argument1,argument2,argument3);
#define Cypher_Write
/*
Cypher_Write(PkgID,Fname,Password);
      Writes a resource file such as "Sprites.bin".
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
          [1]Fname: The filename of the package you want to write (eg. "Sprites.bin")
          [2]Password: A Password for the file. Leave blank ("") to have no password

Return:
Returns 0 if the function failed. Returns 1 on success.



*/


external_call(global.defCypherWritePackage,argument0,argument1,argument2);
#define Cypher_Extract
/*
Cypher_Extract(PkgID,File,Password,ExtractLocation);
    Extracts a file from a package.
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
          [1]Fname: The internal Filename of the file you want to extract
          [2]Password: The password of the file (the password used to pack the file)
          [3]ExtractLocation: The location where you want the extracted file to
                              go.
Return:
Returns 0 if the function failed. Returns 1 on success.



*/


external_call(global.defCypherExtractFile,argument0,argument1,argument2,argument3);
#define Cypher_RemoveFile
/*
Cypher_RemoveFile(PkgID,Fname);
    Removes a file from a package
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
          [1]Fname: The internal Filename of the file you want to delete

Return:
Returns 0 if the function failed. Returns 1 on success.



*/


external_call(global.defCypherRemoveFile,argument0,argument1);
#define Cypher_Close
/*
Cypher_Close(PkgID);
      Closes a package and frees the memory used by it.
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
 
Return:
Returns 0 if the function failed. Returns 1 on success.



*/


external_call(global.defCypherClosePackage,argument0);
#define Cypher_FileCount
/*
Cypher_FileCount(PkgID);
      Returns the number of files in an open package
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
 
Return:
The number of files



*/


external_call(global.defCypherFileCount,argument0);
#define Cypher_GetFname
/*
Cypher_GetFname(PkgID, FileID);
     Gets the name of a file. Note that the file ID's are in order of addition.
     The first file is 0.
Arguments:
          [0]PkgID: This is the Resource ID from Cypher_Open().
          [1]FileID: The index of the file
 
Return:
The file name or "" if the file doesnt exist.



*/


external_call(global.defCypherGetFname,argument0,argument1);
