static void sparkey_create(int n, sparkey_compression_type compression_type, int block_size) { sparkey_logwriter *mywriter; sparkey_assert(sparkey_logwriter_create(&mywriter, "test.spl", compression_type, block_size)); for (int i = 0; i < n; i++) { char mykey[100]; char myvalue[100]; sprintf(mykey, "key_%d", i); sprintf(myvalue, "value_%d", i); sparkey_assert(sparkey_logwriter_put(mywriter, strlen(mykey), (uint8_t*)mykey, strlen(myvalue), (uint8_t*)myvalue)); } sparkey_assert(sparkey_logwriter_close(&mywriter)); sparkey_assert(sparkey_hash_write("test.spi", "test.spl", 0)); }
int writehash(const char *indexfile, const char *logfile) { assert(sparkey_hash_write(indexfile, logfile, 0)); return 0; }