G:/ScriptBasic/source/extensions/zlib/interface.c File Reference

#include <stdio.h>
#include "../../basext.h"
#include "zlib.h"

Go to the source code of this file.

Defines

#define ZLIB_ERROR_INTERNAL001   0x00080001
#define ZLIB_ERROR_INTERNAL002   0x00080002
#define ZLIB_ERROR_INTERNAL003   0x00080003
#define ZLIB_ERROR_INTERNAL004   0x00080004
#define ZLIB_ERROR_INTERNAL005   0x00080005
#define ZLIB_ERROR_INTERNAL006   0x00080006
#define ZLIB_ERROR_INTERNAL007   0x00080007
#define ZLIB_ERROR_NOCOMPRESS   0x00080100
#define ZLIB_ERROR_ARGUMENT   0x00080101
#define ZLIB_ERROR_DATA   0x00080102
#define ZLIB_ERROR_DATA1   0x00080103
#define ZLIB_ERROR_FILE_READ   0x00080104
#define ZLIB_ERROR_FILE_WRITE   0x00080105
#define ZBUFFER_INCREASE   1024
#define ZBUFFER_SIZE   1024
#define GZ_SUFFIX   ".gz"

Functions

besVERSION_NEGOTIATE return (int)
static void zlibfree_interface (void *opaque, voidpf address)
 besFUNCTION (zlbcmprs)
 if (iZError!=Z_STREAM_END)
 if ()
 if (besARGNR >=2)
 if (Argument==NULL)
 if (!(FileAccess &2))
 if (fin==NULL)
 besFREE (pszOutputFileName)
 if (out==NULL)
 if (buf==NULL)
 for (;;)
 besFREE (buf)
 gzclose (out)
 besHOOK_FCLOSE (fin)
 if (int iRemoveOriginal)
 if (!(FileAccess &1))
 if (fp!=NULL)
 gzclose (fin)
 besHOOK_FCLOSE (out)

Variables

 besRETURNVALUE = NULL
else iRemoveOriginal = 1
else Argument = NULL
 fin = besHOOK_FOPEN(pszInputFileName,"rb")
 out = gzopen(pszOutputFileName,mode)
 buf = besALLOC(ZBUFFER_SIZE)
 besRETURNVALUE = NULL
else iRemoveOriginal = 1
else Argument = NULL
 gzHeaderOK = 1
 fp = fopen(pszInputFileName,"rb")
else gzHeaderOK = 0
 fin = gzHeaderOK ? gzopen(pszInputFileName,"rb") : NULL
 out = besHOOK_FOPEN(pszOutputFileName,"wb")
 buf = besALLOC(ZBUFFER_SIZE)


Define Documentation

#define GZ_SUFFIX   ".gz"
 

Referenced by if().

#define ZBUFFER_INCREASE   1024
 

Definition at line 33 of file interface.c.

Referenced by besFUNCTION().

#define ZBUFFER_SIZE   1024
 

Definition at line 37 of file interface.c.

#define ZLIB_ERROR_ARGUMENT   0x00080101
 

Definition at line 24 of file interface.c.

#define ZLIB_ERROR_DATA   0x00080102
 

Definition at line 25 of file interface.c.

Referenced by besFUNCTION().

#define ZLIB_ERROR_DATA1   0x00080103
 

Definition at line 26 of file interface.c.

Referenced by besFUNCTION().

#define ZLIB_ERROR_FILE_READ   0x00080104
 

Definition at line 27 of file interface.c.

#define ZLIB_ERROR_FILE_WRITE   0x00080105
 

Definition at line 28 of file interface.c.

#define ZLIB_ERROR_INTERNAL001   0x00080001
 

Definition at line 15 of file interface.c.

#define ZLIB_ERROR_INTERNAL002   0x00080002
 

Definition at line 16 of file interface.c.

#define ZLIB_ERROR_INTERNAL003   0x00080003
 

Definition at line 17 of file interface.c.

#define ZLIB_ERROR_INTERNAL004   0x00080004
 

Definition at line 18 of file interface.c.

#define ZLIB_ERROR_INTERNAL005   0x00080005
 

Definition at line 19 of file interface.c.

Referenced by besFUNCTION().

#define ZLIB_ERROR_INTERNAL006   0x00080006
 

Definition at line 20 of file interface.c.

Referenced by besFUNCTION().

#define ZLIB_ERROR_INTERNAL007   0x00080007
 

Definition at line 21 of file interface.c.

Referenced by besFUNCTION().

#define ZLIB_ERROR_NOCOMPRESS   0x00080100
 

Definition at line 23 of file interface.c.


Function Documentation

besFREE buf   ) 
 

besFREE pszOutputFileName   ) 
 

besFUNCTION zlbcmprs   ) 
 

=section compress =H Compress a string =verbatim CompressedString = zlib::Compress(UncompressedString) =noverbatim This function implements a simple compression interface.

Definition at line 92 of file interface.c.

References besFREE(), memcpy(), Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NEED_DICT, Z_OK, Z_STREAM_ERROR, ZBUFFER_INCREASE, ZLIB_ERROR_DATA, ZLIB_ERROR_DATA1, ZLIB_ERROR_INTERNAL005, ZLIB_ERROR_INTERNAL006, and ZLIB_ERROR_INTERNAL007.

besHOOK_FCLOSE out   ) 
 

besHOOK_FCLOSE fin   ) 
 

for ;;   ) 
 

Definition at line 394 of file interface.c.

gzclose fin   ) 
 

gzclose out   ) 
 

Referenced by if(), and MyFiles().

if fp = NULL  ) 
 

Definition at line 515 of file interface.c.

References ch, fp, and gzHeaderOK.

if (FileAccess &1)  ) 
 

Definition at line 507 of file interface.c.

References besFREE(), and COMMAND_ERROR_FILE_CANNOT_BE_OPENED.

if int  iRemoveOriginal  ) 
 

Definition at line 417 of file interface.c.

if buf  = NULL  ) 
 

Definition at line 388 of file interface.c.

References besFREE(), besHOOK_FCLOSE(), COMMAND_ERROR_MEMORY_LOW, fin, gzclose(), and out.

if out  = NULL  ) 
 

Definition at line 381 of file interface.c.

References besFREE(), besHOOK_FCLOSE(), COMMAND_ERROR_FILE_CANNOT_BE_OPENED, and fin.

if fin  = NULL  ) 
 

Definition at line 375 of file interface.c.

References besFREE(), and COMMAND_ERROR_FILE_CANNOT_BE_OPENED.

if (FileAccess &2)  ) 
 

Definition at line 368 of file interface.c.

References besFREE(), and COMMAND_ERROR_FILE_CANNOT_BE_OPENED.

if Argument  = NULL  ) 
 

Definition at line 351 of file interface.c.

References GZ_SUFFIX, and strcpy().

if besARGNR >=  2  ) 
 

Definition at line 346 of file interface.c.

References Argument, and besDEREFERENCE().

if  ) 
 

Definition at line 327 of file interface.c.

if iZError!  = Z_STREAM_END  ) 
 

Definition at line 284 of file interface.c.

besVERSION_NEGOTIATE return int   ) 
 

Definition at line 41 of file interface.c.

References pSt, and Z_NULL.

static void zlibfree_interface void *  opaque,
voidpf  address
[static]
 

Definition at line 63 of file interface.c.

References besFREE(), and pSt.


Variable Documentation

else Argument = NULL
 

Definition at line 467 of file interface.c.

else Argument = NULL
 

Definition at line 349 of file interface.c.

besRETURNVALUE = NULL
 

Definition at line 443 of file interface.c.

besRETURNVALUE = NULL
 

Definition at line 325 of file interface.c.

buf = besALLOC(ZBUFFER_SIZE)
 

Definition at line 536 of file interface.c.

buf = besALLOC(ZBUFFER_SIZE)
 

Definition at line 387 of file interface.c.

fin = gzHeaderOK ? gzopen(pszInputFileName,"rb") : NULL
 

Definition at line 523 of file interface.c.

fin = besHOOK_FOPEN(pszInputFileName,"rb")
 

Definition at line 374 of file interface.c.

Referenced by if().

fp = fopen(pszInputFileName,"rb")
 

Definition at line 514 of file interface.c.

else gzHeaderOK = 0
 

Definition at line 521 of file interface.c.

gzHeaderOK = 1
 

Definition at line 513 of file interface.c.

Referenced by if().

else iRemoveOriginal = 1
 

Definition at line 462 of file interface.c.

else iRemoveOriginal = 1
 

Definition at line 344 of file interface.c.

out = besHOOK_FOPEN(pszOutputFileName,"wb")
 

Definition at line 528 of file interface.c.

out = gzopen(pszOutputFileName,mode)
 

Definition at line 379 of file interface.c.

Referenced by if().


Generated on Sun Mar 12 23:56:36 2006 for ScriptBasic by  doxygen 1.4.6-NO