| 1 | /*************** FilAmGz H Declares Source Code File (.H) **************/cxx . . $ `<file>/storage/connect/filamgz.h`/ |
| 2 | /* Name: FILAMGZ.H Version 1.3 */ |
| 3 | /* */ |
| 4 | /* (C) Copyright to the author Olivier BERTRAND 2005-2016 */ |
| 5 | /* */ |
| 6 | /* This file contains the GZIP access method classes declares. */ |
| 7 | /***********************************************************************/ |
| 8 | #ifndef __FILAMGZ_H |
| 9 | #define __FILAMGZ_Hcxx . . $ `storage/connect/filamgz.h:9:9`! |
| 10 | |
| 11 | #include "zlib.h" |
| 12 | |
| 13 | typedef class GZFAMcxx . . $ GZFAM# *PGZFAMcxx . . $ PGZFAM#; |
| 14 | typedef class ZBKFAMcxx . . $ ZBKFAM# *PZBKFAMcxx . . $ PZBKFAM#; |
| 15 | typedef class GZXFAMcxx . . $ GZXFAM# *PZIXFAMcxx . . $ PZIXFAM#; |
| 16 | typedef class ZLBFAMcxx . . $ ZLBFAM# *PZLBFAMcxx . . $ PZLBFAM#; |
| 17 | |
| 18 | /***********************************************************************/ |
| 19 | /* This is the access method class declaration for not optimized */ |
| 20 | /* variable record length files compressed using the gzip library */ |
| 21 | /* functions. File is accessed record by record (row). */ |
| 22 | /***********************************************************************/ |
| 23 | class DllExportcxx . . $ `storage/connect/block.h:30:9`! GZFAMcxx . . $ GZFAM# : public TXTFAMcxx . . $ TXTFAM# { |
| 24 | // friend class DOSCOL; |
| 25 | public: |
| 26 | // Constructor |
| 27 | GZFAMcxx . . $ GZFAM#GZFAM(446d362a79041e39).(PDOSDEFcxx . . $ PDOSDEF# tdp) : TXTFAMcxx . . $ TXTFAM#TXTFAM(446d362a79041e39).(tdp) {Zfilecxx . . $ GZFAM#Zfile. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; Zposcxx . . $ GZFAM#Zpos. = 0;} |
| 28 | GZFAMcxx . . $ GZFAM#GZFAM(8f3ca4d555ddf2f2).(PGZFAMcxx . . $ PGZFAM# txfp); |
| 29 | |
| 30 | // Implementation |
| 31 | AMTcxx . . $ AMT# GetAmTypecxx . . $ GZFAM#GetAmType(9db94b1f9a8d7a79).(void) override {return TYPE_AM_GZcxx . . $ TYPE_AM_GZ.;} |
| 32 | int GetPoscxx . . $ GZFAM#GetPos(b126dc7c1de90089).(void) override; |
| 33 | int GetNextPoscxx . . $ GZFAM#GetNextPos(b126dc7c1de90089).(void) override; |
| 34 | PTXFcxx . . $ PTXF# Duplicatecxx . . $ GZFAM#Duplicate(4263347f72351b4a).(PGLOBAL g) override |
| 35 | {return (PTXFcxx . . $ PTXF#)new(g) GZFAMcxx . . $ GZFAM#GZFAM(8f3ca4d555ddf2f2).(this);} |
| 36 | |
| 37 | // Methods |
| 38 | void Resetcxx . . $ GZFAM#Reset(49f6e7a06ebc5aa8).(void) override; |
| 39 | int GetFileLengthcxx . . $ GZFAM#GetFileLength(7bccf160c61251e2).(PGLOBAL g) override; |
| 40 | int Cardinalitycxx . . $ GZFAM#Cardinality(7bccf160c61251e2).(PGLOBAL g) override {return (g) ? -1 : 0;} |
| 41 | int MaxBlkSizecxx . . $ GZFAM#MaxBlkSize(25a4a41e78aa2f29).(PGLOBAL g, int s) override {return s;} |
| 42 | bool AllocateBuffercxx . . $ GZFAM#AllocateBuffer(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 43 | int GetRowIDcxx . . $ GZFAM#GetRowID(b126dc7c1de90089).(void) override; |
| 44 | bool RecordPoscxx . . $ GZFAM#RecordPos(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 45 | bool SetPoscxx . . $ GZFAM#SetPos(500768cbd777668d).(PGLOBAL g, int recpos) override; |
| 46 | int SkipRecordcxx . . $ GZFAM#SkipRecord(94d10f3f9c4f42f8).(PGLOBAL g, bool header) override; |
| 47 | bool OpenTableFilecxx . . $ GZFAM#OpenTableFile(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 48 | int ReadBuffercxx . . $ GZFAM#ReadBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 49 | int WriteBuffercxx . . $ GZFAM#WriteBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 50 | int DeleteRecordscxx . . $ GZFAM#DeleteRecords(25a4a41e78aa2f29).(PGLOBAL g, int irc) override; |
| 51 | void CloseTableFilecxx . . $ GZFAM#CloseTableFile(40330b902e6ea410).(PGLOBAL g, bool abort) override; |
| 52 | void Rewindcxx . . $ GZFAM#Rewind(49f6e7a06ebc5aa8).(void) override; |
| 53 | |
| 54 | protected: |
| 55 | int Zerrorcxx . . $ GZFAM#Zerror(7bccf160c61251e2).(PGLOBAL g); // GZ error function |
| 56 | |
| 57 | // Members |
| 58 | gzFile Zfilecxx . . $ GZFAM#Zfile.; // Points to GZ file structure |
| 59 | z_off_tcxx . . $ `<external>/116306602880328527/zconf.h:495:15`! Zposcxx . . $ GZFAM#Zpos.; // Uncompressed file position |
| 60 | }; // end of class GZFAM |
| 61 | |
| 62 | /***********************************************************************/ |
| 63 | /* This is the access method class declaration for optimized variable */ |
| 64 | /* record length files compressed using the gzip library functions. */ |
| 65 | /* The File is accessed by block (requires an opt file). */ |
| 66 | /***********************************************************************/ |
| 67 | class DllExportcxx . . $ `storage/connect/block.h:30:9`! ZBKFAMcxx . . $ ZBKFAM# : public GZFAMcxx . . $ GZFAM# { |
| 68 | public: |
| 69 | // Constructor |
| 70 | ZBKFAMcxx . . $ ZBKFAM#ZBKFAM(446d362a79041e39).(PDOSDEFcxx . . $ PDOSDEF# tdp); |
| 71 | ZBKFAMcxx . . $ ZBKFAM#ZBKFAM(b548d59806c15c4c).(PZBKFAMcxx . . $ PZBKFAM# txfp); |
| 72 | |
| 73 | // Implementation |
| 74 | int GetPoscxx . . $ ZBKFAM#GetPos(b126dc7c1de90089).(void) override; |
| 75 | int GetNextPoscxx . . $ ZBKFAM#GetNextPos(b126dc7c1de90089).(void) override {return 0;} |
| 76 | PTXFcxx . . $ PTXF# Duplicatecxx . . $ ZBKFAM#Duplicate(4263347f72351b4a).(PGLOBAL g) override |
| 77 | {return (PTXFcxx . . $ PTXF#)new(g) ZBKFAMcxx . . $ ZBKFAM#ZBKFAM(b548d59806c15c4c).(this);} |
| 78 | |
| 79 | // Methods |
| 80 | int Cardinalitycxx . . $ ZBKFAM#Cardinality(7bccf160c61251e2).(PGLOBAL g) override; |
| 81 | int MaxBlkSizecxx . . $ ZBKFAM#MaxBlkSize(25a4a41e78aa2f29).(PGLOBAL g, int s) override; |
| 82 | bool AllocateBuffercxx . . $ ZBKFAM#AllocateBuffer(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 83 | int GetRowIDcxx . . $ ZBKFAM#GetRowID(b126dc7c1de90089).(void) override; |
| 84 | bool RecordPoscxx . . $ ZBKFAM#RecordPos(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 85 | int SkipRecordcxx . . $ ZBKFAM#SkipRecord(94d10f3f9c4f42f8).(PGLOBAL g, bool header) override; |
| 86 | int ReadBuffercxx . . $ ZBKFAM#ReadBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 87 | int WriteBuffercxx . . $ ZBKFAM#WriteBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 88 | int DeleteRecordscxx . . $ ZBKFAM#DeleteRecords(25a4a41e78aa2f29).(PGLOBAL g, int irc) override; |
| 89 | void CloseTableFilecxx . . $ ZBKFAM#CloseTableFile(40330b902e6ea410).(PGLOBAL g, bool abort) override; |
| 90 | void Rewindcxx . . $ ZBKFAM#Rewind(49f6e7a06ebc5aa8).(void) override; |
| 91 | |
| 92 | protected: |
| 93 | // Members |
| 94 | char *CurLinecxx . . $ ZBKFAM#CurLine.; // Position of current line in buffer |
| 95 | char *NxtLinecxx . . $ ZBKFAM#NxtLine.; // Position of Next line in buffer |
| 96 | bool Closingcxx . . $ ZBKFAM#Closing.; // True when closing on Insert |
| 97 | }; // end of class ZBKFAM |
| 98 | |
| 99 | /***********************************************************************/ |
| 100 | /* This is the access method class declaration for fixed record */ |
| 101 | /* length files compressed using the gzip library functions. */ |
| 102 | /* The file is always accessed by block. */ |
| 103 | /***********************************************************************/ |
| 104 | class DllExportcxx . . $ `storage/connect/block.h:30:9`! GZXFAMcxx . . $ GZXFAM# : public ZBKFAMcxx . . $ ZBKFAM# { |
| 105 | public: |
| 106 | // Constructor |
| 107 | GZXFAMcxx . . $ GZXFAM#GZXFAM(446d362a79041e39).(PDOSDEFcxx . . $ PDOSDEF# tdp); |
| 108 | GZXFAMcxx . . $ GZXFAM#GZXFAM(98815bc34e36bc8a).(PZIXFAMcxx . . $ PZIXFAM# txfp) : ZBKFAMcxx . . $ ZBKFAM#ZBKFAM(b548d59806c15c4c).(txfp) {} |
| 109 | |
| 110 | // Implementation |
| 111 | int GetNextPoscxx . . $ GZXFAM#GetNextPos(b126dc7c1de90089).(void) override {return 0;} |
| 112 | PTXFcxx . . $ PTXF# Duplicatecxx . . $ GZXFAM#Duplicate(4263347f72351b4a).(PGLOBAL g) override |
| 113 | {return (PTXFcxx . . $ PTXF#)new(g) GZXFAMcxx . . $ GZXFAM#GZXFAM(98815bc34e36bc8a).(this);} |
| 114 | |
| 115 | // Methods |
| 116 | int Cardinalitycxx . . $ GZXFAM#Cardinality(7bccf160c61251e2).(PGLOBAL g) override; |
| 117 | bool AllocateBuffercxx . . $ GZXFAM#AllocateBuffer(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 118 | int ReadBuffercxx . . $ GZXFAM#ReadBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 119 | int WriteBuffercxx . . $ GZXFAM#WriteBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 120 | |
| 121 | protected: |
| 122 | // No additional Members |
| 123 | }; // end of class GZXFAM |
| 124 | |
| 125 | /***********************************************************************/ |
| 126 | /* This is the DOS/UNIX Access Method class declaration for PlugDB */ |
| 127 | /* fixed/variable files compressed using the zlib library functions. */ |
| 128 | /* Physically these are written and read using the same technique */ |
| 129 | /* than blocked variable files, only the contain of each block is */ |
| 130 | /* compressed using the deflate zlib function. The purpose of this */ |
| 131 | /* specific format is to have a fast mechanism for direct access of */ |
| 132 | /* records so blocked optimization is fast and direct access (joins) */ |
| 133 | /* is allowed. Note that the block length is written ahead of each */ |
| 134 | /* block to enable reading when optimization file is not available. */ |
| 135 | /***********************************************************************/ |
| 136 | class DllExportcxx . . $ `storage/connect/block.h:30:9`! ZLBFAMcxx . . $ ZLBFAM# : public BLKFAMcxx . . $ BLKFAM# { |
| 137 | public: |
| 138 | // Constructor |
| 139 | ZLBFAMcxx . . $ ZLBFAM#ZLBFAM(446d362a79041e39).(PDOSDEFcxx . . $ PDOSDEF# tdp); |
| 140 | ZLBFAMcxx . . $ ZLBFAM#ZLBFAM(aca99fe9019e91c4).(PZLBFAMcxx . . $ PZLBFAM# txfp); |
| 141 | |
| 142 | // Implementation |
| 143 | AMTcxx . . $ AMT# GetAmTypecxx . . $ ZLBFAM#GetAmType(9db94b1f9a8d7a79).(void) override {return TYPE_AM_ZLIBcxx . . $ TYPE_AM_ZLIB.;} |
| 144 | int GetPoscxx . . $ ZLBFAM#GetPos(b126dc7c1de90089).(void) override; |
| 145 | int GetNextPoscxx . . $ ZLBFAM#GetNextPos(b126dc7c1de90089).(void) override; |
| 146 | PTXFcxx . . $ PTXF# Duplicatecxx . . $ ZLBFAM#Duplicate(4263347f72351b4a).(PGLOBAL g) override |
| 147 | {return (PTXFcxx . . $ PTXF#)new(g) ZLBFAMcxx . . $ ZLBFAM#ZLBFAM(aca99fe9019e91c4).(this);} |
| 148 | inline void SetOptimizedcxx . . $ ZLBFAM#SetOptimized(b45ddcbc8423892c).(bool b) {Optimizedcxx . . $ ZLBFAM#Optimized. = b;} |
| 149 | |
| 150 | // Methods |
| 151 | int GetFileLengthcxx . . $ ZLBFAM#GetFileLength(7bccf160c61251e2).(PGLOBAL g) override; |
| 152 | bool SetPoscxx . . $ ZLBFAM#SetPos(500768cbd777668d).(PGLOBAL g, int recpos) override; |
| 153 | bool AllocateBuffercxx . . $ ZLBFAM#AllocateBuffer(1f3dbd0b0227397d).(PGLOBAL g) override; |
| 154 | int ReadBuffercxx . . $ ZLBFAM#ReadBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 155 | int WriteBuffercxx . . $ ZLBFAM#WriteBuffer(7bccf160c61251e2).(PGLOBAL g) override; |
| 156 | void CloseTableFilecxx . . $ ZLBFAM#CloseTableFile(40330b902e6ea410).(PGLOBAL g, bool abort) override; |
| 157 | void Rewindcxx . . $ ZLBFAM#Rewind(49f6e7a06ebc5aa8).(void) override; |
| 158 | |
| 159 | protected: |
| 160 | bool WriteCompressedBuffercxx . . $ ZLBFAM#WriteCompressedBuffer(1f3dbd0b0227397d).(PGLOBAL g); |
| 161 | int ReadCompressedBuffercxx . . $ ZLBFAM#ReadCompressedBuffer(a554006aee8d8246).(PGLOBAL g, void *rdbuf); |
| 162 | |
| 163 | // Members |
| 164 | z_streamp Zstreamcxx . . $ ZLBFAM#Zstream.; // Compression/decompression stream |
| 165 | Bytecxx . . $ Byte# *Zbuffercxx . . $ ZLBFAM#Zbuffer.; // Compressed block buffer |
| 166 | int *Zlenpcxx . . $ ZLBFAM#Zlenp.; // Pointer to block length |
| 167 | bool Optimizedcxx . . $ ZLBFAM#Optimized.; // true when opt file is available |
| 168 | }; // end of class ZLBFAM |
| 169 | |
| 170 | #endif // __FILAMGZ_H |