hamsterdb Embedded Database
2.1.7
|
Go to the source code of this file.
Functions | |
void | error (const char *foo, ham_status_t st) |
void | usage () |
void | copy_db (ham_db_t *source, ham_db_t *dest) |
int | main (int argc, char **argv) |
Definition at line 41 of file db2.c.
References error(), ham_cursor_close(), ham_cursor_create(), HAM_CURSOR_FIRST, ham_cursor_move(), HAM_CURSOR_NEXT, ham_db_insert(), HAM_DUPLICATE, and HAM_KEY_NOT_FOUND.
Referenced by main().
void error | ( | const char * | foo, |
ham_status_t | st | ||
) |
This example opens an Environment and copies one Database into another. With small modifications this sample would also be able to copy In Memory-Environments to On Disk-Environments and vice versa.
Definition at line 29 of file db2.c.
References ham_strerror().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 86 of file db2.c.
References copy_db(), error(), HAM_AUTO_CLEANUP, HAM_ENABLE_DUPLICATE_KEYS, ham_env_close(), ham_env_create_db(), ham_env_open(), ham_env_open_db(), and usage().