29 #define DATABASE_NAME 1 32 main(
int argc,
char **argv) {
41 memset(&key, 0,
sizeof(key));
42 memset(&record, 0,
sizeof(record));
44 printf(
"This sample uses upscaledb to list all words in the " 46 printf(
"Reading from stdin...\n");
54 printf(
"ups_env_create() failed with error %d\n", st);
60 printf(
"ups_env_create_db() failed with error %d\n", st);
68 while (fgets(line,
sizeof(line), stdin)) {
69 char *start = line, *p;
75 while ((p = strtok(start,
" \t\r\n"))) {
80 key.
size =
sizeof(recno);
88 printf(
"ups_db_insert() failed with error %d\n", st);
100 printf(
"ups_cursor_create() failed with error %d\n", st);
104 memset(&key, 0,
sizeof(key));
114 printf(
"ups_cursor_next() failed with error %d\n", st);
130 printf(
"ups_env_close() failed with error %d\n", st);
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_close(ups_env_t *env, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_insert(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_move(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
Include file for upscaledb embedded database.
#define UPS_DUPLICATE_KEY
struct ups_cursor_t ups_cursor_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_create(ups_env_t **env, const char *filename, uint32_t flags, uint32_t mode, const ups_parameter_t *param)
#define UPS_RECORD_NUMBER32
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_create_db(ups_env_t *env, ups_db_t **db, uint16_t name, uint32_t flags, const ups_parameter_t *params)
#define UPS_KEY_USER_ALLOC
int main(int argc, char **argv)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_create(ups_cursor_t **cursor, ups_db_t *db, ups_txn_t *txn, uint32_t flags)
#define UPS_KEY_NOT_FOUND
struct ups_env_t ups_env_t