This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Uses vectors for both input and output... Just a reminder to myself of how to use zlib properly in the future. | |
| */ | |
| static inline long int decompress(std::vector<uint8_t>& in, std::vector<uint8_t> &out) | |
| { | |
| auto ret = Z_OK; | |
| const size_t BUFSIZE = 1024 * 64; | |
| uint8_t chunk[BUFSIZE]; | |
| z_stream zs = {Z_NULL}; | |
| zs.next_in = in.data(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| // Our array entry structure | |
| typedef struct arraymap_entry_t { | |
| char *key; | |
| char *value; | |
| uint_fast32_t key_hash; |