hamsterdb Embedded Database 1.1.13
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ham/hamsterdb.h>
Go to the source code of this file.
Data Structures | |
struct | customer_t |
struct | order_t |
Defines | |
#define | MAX_DBS 3 |
#define | DBNAME_CUSTOMER 1 |
#define | DBNAME_ORDER 2 |
#define | DBNAME_C2O 3 |
#define | DBIDX_CUSTOMER 0 |
#define | DBIDX_ORDER 1 |
#define | DBIDX_C2O 2 |
#define | MAX_CUSTOMERS 4 |
#define | MAX_ORDERS 8 |
Functions | |
void | error (const char *foo, ham_status_t st) |
int | main (int argc, char **argv) |
void error | ( | const char * | foo, |
ham_status_t | st | ||
) |
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.
Similar to env1, an environment with a customer- and an order-database is created; a third database is created which manages the 1:n relationship between the other two.
Definition at line 26 of file env2.c.
References ham_strerror().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 80 of file env2.c.
References order_t::assignee, order_t::customer_id, ham_record_t::data, ham_key_t::data, DBIDX_C2O, DBIDX_CUSTOMER, DBIDX_ORDER, DBNAME_C2O, DBNAME_CUSTOMER, DBNAME_ORDER, error(), HAM_AUTO_CLEANUP, ham_cursor_create(), ham_cursor_find(), ham_cursor_move(), HAM_CURSOR_NEXT, ham_delete(), HAM_DUPLICATE, HAM_ENABLE_DUPLICATES, ham_env_close(), ham_env_create_db(), ham_env_create_ex(), ham_env_delete(), ham_env_new(), ham_find(), ham_insert(), HAM_KEY_NOT_FOUND, ham_new(), HAM_ONLY_DUPLICATES, HAM_SUCCESS, order_t::id, customer_t::id, MAX_CUSTOMERS, MAX_DBS, MAX_ORDERS, customer_t::name, ham_record_t::size, and ham_key_t::size.