"Fossies" - the Fresh Open Source Software Archive

Member "sfk-1.9.6/sfkpackio.hpp" (22 Feb 2020, 3704 Bytes) of package /linux/misc/sfk-1.9.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "sfkpackio.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef SFKPACKIO_HPP
    2 #define SFKPACKIO_HPP
    3 
    4 #ifndef uint
    5  typedef unsigned int  uint;
    6  typedef unsigned long ulong;
    7 #endif
    8 #ifndef uchar
    9  typedef unsigned char uchar;
   10 #endif
   11 #if defined(_MSC_VER) || defined(__BORLANDC__)
   12  typedef unsigned __int64 sfkuint64;
   13 #else
   14  typedef unsigned long long int sfkuint64;
   15 #endif
   16 
   17 struct SFKPackStream
   18 {
   19    int    bPack;
   20    int    bFast;
   21 
   22    uchar *pin;
   23    int    nin;
   24    uchar *pout;
   25    int    nout;
   26 
   27    void  *pstream;
   28 
   29    char   szerr[80];
   30 };
   31 
   32 int sfkPackStart(SFKPackStream *p);
   33 int sfkPackProc(SFKPackStream *p, int bLastBlock, int *bReloop);
   34 int sfkPackEnd(SFKPackStream *p);
   35 uint sfkPackSum(uchar *buf, uint len, uint crc);
   36 
   37 // ----------- zip support ----------------
   38 
   39 #ifdef FOR_SFK_INCLUDE
   40 
   41 #define UNZ_OK                   (0)
   42 #define UNZ_END_OF_LIST_OF_FILE  (-100)
   43 #define UNZ_ERRNO                (Z_ERRNO)
   44 #define UNZ_EOF                  (0)
   45 #define UNZ_PARAMERROR           (-102)
   46 #define UNZ_BADZIPFILE           (-103)
   47 #define UNZ_INTERNALERROR        (-104)
   48 #define UNZ_CRCERROR             (-105)
   49 #define Z_ERRNO                  (-1)
   50 #define Z_DEFLATED               8
   51 #define Z_BZIP2ED                12
   52 #define Z_DEFAULT_COMPRESSION    (-1)
   53 #define Z_BEST_COMPRESSION       9
   54 #define Z_DEFAULT_STRATEGY       0
   55 
   56 typedef unsigned int  uInt;
   57 typedef unsigned long uLong;
   58 typedef void         *unzFile;
   59 
   60 #if defined(_MSC_VER) || defined(__BORLANDC__)
   61  typedef unsigned __int64 ZPOS64_T;
   62 #else
   63  typedef unsigned long long int ZPOS64_T;
   64 #endif
   65 
   66 extern "C"
   67 {
   68 
   69 typedef struct tm_unz_s
   70 {
   71     uInt tm_sec;
   72     uInt tm_min;
   73     uInt tm_hour;
   74     uInt tm_mday;
   75     uInt tm_mon;
   76     uInt tm_year;
   77 } tm_unz;
   78 
   79 typedef struct unz_global_info64_s
   80 {
   81     ZPOS64_T number_entry;
   82     uLong size_comment;
   83 } unz_global_info64;
   84 
   85 typedef struct unz_global_info_s
   86 {
   87     uLong number_entry;
   88     uLong size_comment;
   89 } unz_global_info;
   90 
   91 typedef struct unz_file_info64_s
   92 {
   93     uLong version;
   94     uLong version_needed;
   95     uLong flag;
   96     uLong compression_method;
   97     uLong dosDate;
   98     uLong crc;
   99     ZPOS64_T compressed_size;
  100     ZPOS64_T uncompressed_size;
  101     uLong size_filename;
  102     uLong size_file_extra;
  103     uLong size_file_comment;
  104     uLong disk_num_start;
  105     uLong internal_fa;
  106     uLong external_fa;
  107     tm_unz tmu_date;
  108 } unz_file_info64;
  109 
  110 typedef struct unz_file_info_s
  111 {
  112     uLong version;
  113     uLong version_needed;
  114     uLong flag;
  115     uLong compression_method;
  116     uLong dosDate;
  117     uLong crc;
  118     uLong compressed_size;
  119     uLong uncompressed_size;
  120     uLong size_filename;
  121     uLong size_file_extra;
  122     uLong size_file_comment;
  123     uLong disk_num_start;
  124     uLong internal_fa;
  125     uLong external_fa;
  126     tm_unz tmu_date;
  127 } unz_file_info;
  128 
  129 void *zipOpen64(const void* pathname, int append);
  130 int zipClose(void *file, const char* global_comment);
  131 
  132 int unzGetCurrentFileInfo64 (unzFile file,
  133    unz_file_info64 * pfile_info,
  134    char * szFileName, uLong fileNameBufferSize,
  135    void *extraField, uLong extraFieldBufferSize,
  136    char* szComment,  uLong commentBufferSize);
  137 
  138 int unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf);
  139 
  140 int unzOpenCurrentFilePassword (unzFile file, const char*  password);
  141 int unzReadCurrentFile  (unzFile file, void *buf, unsigned len);
  142 int unzCloseCurrentFile (unzFile file);
  143 unzFile unzOpen64 (const void *path);
  144 
  145 int unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info);
  146 int unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32);
  147 
  148 int unzGoToNextFile (unzFile  file);
  149 int unzClose (unzFile file);
  150 }
  151 
  152 #endif // FOR_SFK_INCLUDE
  153 
  154 #endif