#include <stdio.h>
#include <string.h>
#include <ham/hamsterdb.h>
Go to the source code of this file.
This sample uses hamsterdb to sort data from stdin. Every word is inserted into the database (duplicate words are ignored). Then a cursor is used to print all words in sorted order.
Definition at line 26 of file db3.c.
Referenced by main().
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 41 of file db3.c.
References ham_key_t::data, DATABASE_NAME, HAM_AUTO_CLEANUP, ham_cursor_create(), ham_cursor_move(), HAM_CURSOR_NEXT, ham_db_insert(), ham_db_set_compare_func(), HAM_DUPLICATE_KEY, HAM_ENABLE_DUPLICATE_KEYS, ham_env_close(), ham_env_create(), ham_env_create_db(), HAM_KEY_NOT_FOUND, HAM_PARAM_KEY_TYPE, HAM_PARAM_RECORD_SIZE, HAM_SUCCESS, HAM_TYPE_CUSTOM, my_string_compare(), and ham_key_t::size.