hamsterdb Embedded Database 1.1.14
|
#include <stdio.h>
#include <string.h>
#include <ham/hamsterdb.h>
Go to the source code of this file.
Functions | |
static int | my_string_compare (ham_db_t *db, const ham_u8_t *lhs, ham_size_t lhs_length, const ham_u8_t *rhs, ham_size_t rhs_length) |
int | main (int argc, char **argv) |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 32 of file db3.c.
References ham_key_t::data, HAM_AUTO_CLEANUP, ham_close(), ham_create_ex(), ham_cursor_create(), ham_cursor_move(), HAM_CURSOR_NEXT, ham_delete(), HAM_DUPLICATE_KEY, ham_insert(), HAM_KEY_NOT_FOUND, ham_new(), ham_set_compare_func(), HAM_SUCCESS, my_string_compare(), and ham_key_t::size.
static int my_string_compare | ( | ham_db_t * | db, |
const ham_u8_t * | lhs, | ||
ham_size_t | lhs_length, | ||
const ham_u8_t * | rhs, | ||
ham_size_t | rhs_length | ||
) | [static] |
Copyright (C) 2005-2008 Christoph Rupp (chris@crupp.de).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
See files COPYING.* for License information.
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 22 of file db3.c.
Referenced by main().