|
◆ _gpak_compressor_none()
GPAK_API uint32_t _gpak_compressor_none |
( |
gpak_t * |
_pak, |
|
|
FILE * |
_infile, |
|
|
FILE * |
_outfile |
|
) |
| |
- Brief Description:\n Performs no compression on the input file.
This function reads data from the input file and writes it directly to the output file without any compression.
- Parameters
-
_pak | A pointer to the gpak_t. |
_infile | A pointer to the input FILE. |
_outfile | A pointer to the output FILE. |
- Returns
- The number of bytes written to the output file.
Definition at line 42 of file gpak_compressors.c.
44 char* _bufferIn = ( char*)malloc(_DEFAULT_BLOCK_SIZE);
45 size_t _readed = 0ull;
46 uint32_t _crc32 = crc32(0L, Z_NULL, 0);
48 fseek(_infile, 0, SEEK_END);
49 size_t _total_size = ftell(_infile);
50 fseek(_infile, 0, SEEK_SET);
52 size_t bytes_readed = 0ull;
55 _readed = _freadb(_bufferIn, 1ull, _DEFAULT_BLOCK_SIZE, _infile);
56 _crc32 = crc32(_crc32, _bufferIn, _readed);
57 bytes_readed += _readed;
59 _fwriteb(_bufferIn, 1ull, _readed, _outfile);
|