111 #ifndef UPS_UPSCALEDB_H 112 #define UPS_UPSCALEDB_H 121 #define UPS_API_REVISION 4 144 #define UPS_VERSION_MAJ 2 145 #define UPS_VERSION_MIN 2 146 #define UPS_VERSION_REV 1 147 #define UPS_FILE_VERSION 5 217 #define UPS_RECORD_USER_ALLOC 1 225 #define ups_make_record(PTR, SIZE) { SIZE, PTR, 0 } 274 #define ups_make_key(PTR, SIZE) { SIZE, PTR, 0, 0 } 279 #define UPS_KEY_USER_ALLOC 1 314 #define UPS_TYPE_BINARY 0 316 #define UPS_TYPE_CUSTOM 1 318 #define UPS_TYPE_UINT8 3 320 #define UPS_TYPE_UINT16 5 322 #define UPS_TYPE_UINT32 7 324 #define UPS_TYPE_UINT64 9 326 #define UPS_TYPE_REAL32 11 328 #define UPS_TYPE_REAL64 12 341 #define UPS_SUCCESS ( 0) 343 #define UPS_INV_RECORD_SIZE ( -2) 345 #define UPS_INV_KEY_SIZE ( -3) 347 #define UPS_INV_KEYSIZE UPS_INV_KEY_SIZE 349 #define UPS_INV_PAGE_SIZE ( -4) 351 #define UPS_INV_PAGESIZE UPS_INV_PAGE_SIZE 353 #define UPS_OUT_OF_MEMORY ( -6) 355 #define UPS_INV_PARAMETER ( -8) 357 #define UPS_INV_FILE_HEADER ( -9) 359 #define UPS_INV_FILE_VERSION (-10) 361 #define UPS_KEY_NOT_FOUND (-11) 363 #define UPS_DUPLICATE_KEY (-12) 365 #define UPS_INTEGRITY_VIOLATED (-13) 367 #define UPS_INTERNAL_ERROR (-14) 369 #define UPS_WRITE_PROTECTED (-15) 371 #define UPS_BLOB_NOT_FOUND (-16) 373 #define UPS_IO_ERROR (-18) 375 #define UPS_NOT_IMPLEMENTED (-20) 377 #define UPS_FILE_NOT_FOUND (-21) 379 #define UPS_WOULD_BLOCK (-22) 381 #define UPS_NOT_READY (-23) 383 #define UPS_LIMITS_REACHED (-24) 385 #define UPS_ALREADY_INITIALIZED (-27) 387 #define UPS_NEED_RECOVERY (-28) 389 #define UPS_CURSOR_STILL_OPEN (-29) 391 #define UPS_FILTER_NOT_FOUND (-30) 393 #define UPS_TXN_CONFLICT (-31) 395 #define UPS_KEY_ERASED_IN_TXN (-32) 397 #define UPS_TXN_STILL_OPEN (-33) 399 #define UPS_CURSOR_IS_NIL (-100) 401 #define UPS_DATABASE_NOT_FOUND (-200) 403 #define UPS_DATABASE_ALREADY_EXISTS (-201) 405 #define UPS_DATABASE_ALREADY_OPEN (-202) 407 #define UPS_ENVIRONMENT_ALREADY_OPEN (-203) 409 #define UPS_LOG_INV_FILE_HEADER (-300) 411 #define UPS_NETWORK_ERROR (-400) 413 #define UPS_PLUGIN_NOT_FOUND (-500) 415 #define UPS_PARSER_ERROR (-501) 417 #define UPS_PLUGIN_ALREADY_EXISTS (-502) 449 #define UPS_DEBUG_LEVEL_DEBUG 0 452 #define UPS_DEBUG_LEVEL_NORMAL 1 455 #define UPS_DEBUG_LEVEL_FATAL 3 1061 #define UPS_FLUSH_COMMITTED_TRANSACTIONS 1 1082 #define UPS_DONT_LOCK 0xf0000000 1202 #define UPS_TXN_READ_ONLY 1 1205 #define UPS_TXN_TEMPORARY 2 1269 #define UPS_ENABLE_FSYNC 0x00000001 1272 #define UPS_IGNORE_MISSING_CALLBACK 0x00000002 1276 #define UPS_READ_ONLY 0x00000004 1288 #define UPS_IN_MEMORY 0x00000080 1294 #define UPS_DISABLE_MMAP 0x00000200 1297 #define UPS_RECORD_NUMBER UPS_RECORD_NUMBER64 1301 #define UPS_RECORD_NUMBER32 0x00001000 1305 #define UPS_RECORD_NUMBER64 0x00002000 1309 #define UPS_ENABLE_DUPLICATE_KEYS 0x00004000 1311 #define UPS_ENABLE_DUPLICATES UPS_ENABLE_DUPLICATE_KEYS 1314 #define UPS_ENABLE_RECOVERY UPS_ENABLE_TRANSACTIONS 1318 #define UPS_AUTO_RECOVERY 0x00010000 1322 #define UPS_ENABLE_TRANSACTIONS 0x00020000 1326 #define UPS_CACHE_UNLIMITED 0x00040000 1330 #define UPS_DISABLE_RECOVERY 0x00080000 1333 #define UPS_IS_REMOTE_INTERNAL 0x00200000 1336 #define UPS_DISABLE_RECLAIM_INTERNAL 0x00400000 1339 #define UPS_FORCE_RECORDS_INLINE 0x00800000 1343 #define UPS_ENABLE_CRC32 0x02000000 1346 #define UPS_DONT_FLUSH_TRANSACTIONS 0x04000000 1350 #define UPS_FLUSH_TRANSACTIONS_IMMEDIATELY 0x08000000 1563 #define UPS_OVERWRITE 0x0001 1566 #define UPS_DUPLICATE 0x0002 1569 #define UPS_DUPLICATE_INSERT_BEFORE 0x0004 1572 #define UPS_DUPLICATE_INSERT_AFTER 0x0008 1575 #define UPS_DUPLICATE_INSERT_FIRST 0x0010 1578 #define UPS_DUPLICATE_INSERT_LAST 0x0020 1581 #define UPS_DIRECT_ACCESS 0x0040 1584 #define UPS_FORCE_DEEP_COPY 0x0100 1587 #define UPS_HINT_APPEND 0x00080000 1590 #define UPS_HINT_PREPEND 0x00100000 1619 #define UPS_ERASE_ALL_DUPLICATES 1 1687 #define UPS_PARAM_JOURNAL_SWITCH_THRESHOLD 0x00001 1691 #define UPS_PARAM_CACHE_SIZE 0x00000100 1693 #define UPS_PARAM_CACHESIZE UPS_PARAM_CACHE_SIZE 1696 #define UPS_PARAM_PAGE_SIZE 0x00000101 1698 #define UPS_PARAM_PAGESIZE UPS_PARAM_PAGE_SIZE 1701 #define UPS_PARAM_KEY_SIZE 0x00000102 1703 #define UPS_PARAM_KEYSIZE UPS_PARAM_KEY_SIZE 1707 #define UPS_PARAM_MAX_DATABASES 0x00000103 1710 #define UPS_PARAM_KEY_TYPE 0x00000104 1714 #define UPS_PARAM_LOG_DIRECTORY 0x00000105 1718 #define UPS_PARAM_ENCRYPTION_KEY 0x00000106 1722 #define UPS_PARAM_NETWORK_TIMEOUT_SEC 0x00000107 1725 #define UPS_PARAM_RECORD_SIZE 0x00000108 1729 #define UPS_PARAM_FILE_SIZE_LIMIT 0x00000109 1733 #define UPS_PARAM_POSIX_FADVISE 0x00000110 1736 #define UPS_PARAM_CUSTOM_COMPARE_NAME 0x00000111 1739 #define UPS_PARAM_RECORD_TYPE 0x00000112 1742 #define UPS_POSIX_FADVICE_NORMAL 0 1745 #define UPS_POSIX_FADVICE_RANDOM 1 1748 #define UPS_RECORD_SIZE_UNLIMITED ((uint32_t)-1) 1751 #define UPS_KEY_SIZE_UNLIMITED ((uint16_t)-1) 1755 #define UPS_PARAM_FLAGS 0x00000200 1759 #define UPS_PARAM_FILEMODE 0x00000201 1768 #define UPS_PARAM_FILENAME 0x00000202 1774 #define UPS_PARAM_DATABASE_NAME 0x00000203 1781 #define UPS_PARAM_MAX_KEYS_PER_PAGE 0x00000204 1787 #define UPS_PARAM_JOURNAL_COMPRESSION 0x00001000 1794 #define UPS_PARAM_RECORD_COMPRESSION 0x00001001 1801 #define UPS_PARAM_KEY_COMPRESSION 0x00001002 1804 #define UPS_COMPRESSOR_NONE 0 1810 #define UPS_COMPRESSOR_ZLIB 1 1816 #define UPS_COMPRESSOR_SNAPPY 2 1822 #define UPS_COMPRESSOR_LZF 3 1825 #define UPS_COMPRESSOR_UINT32_VARBYTE 5 1826 #define UPS_COMPRESSOR_UINT32_MASKEDVBYTE UPS_COMPRESSOR_UINT32_VARBYTE 1829 #define UPS_COMPRESSOR_UINT32_SIMDCOMP 6 1832 #define UPS_COMPRESSOR_UINT32_GROUPVARINT 7 1835 #define UPS_COMPRESSOR_UINT32_STREAMVBYTE 8 1838 #define UPS_COMPRESSOR_UINT32_FOR 10 1841 #define UPS_COMPRESSOR_UINT32_SIMDFOR 11 1883 #define UPS_AUTO_CLEANUP 1 1886 #define UPS_DONT_CLEAR_LOG 2 1889 #define UPS_TXN_AUTO_ABORT 4 1892 #define UPS_TXN_AUTO_COMMIT 8 2045 #define UPS_CURSOR_FIRST 0x0001 2048 #define UPS_CURSOR_LAST 0x0002 2051 #define UPS_CURSOR_NEXT 0x0004 2054 #define UPS_CURSOR_PREVIOUS 0x0008 2057 #define UPS_SKIP_DUPLICATES 0x0010 2060 #define UPS_ONLY_DUPLICATES 0x0020 2182 #define UPS_FIND_EQ_MATCH 0x4000 2188 #define UPS_FIND_LT_MATCH 0x1000 2194 #define UPS_FIND_GT_MATCH 0x2000 2203 #define UPS_FIND_LEQ_MATCH (UPS_FIND_LT_MATCH | UPS_FIND_EQ_MATCH) 2212 #define UPS_FIND_GEQ_MATCH (UPS_FIND_GT_MATCH | UPS_FIND_EQ_MATCH) 2227 #define UPS_FIND_NEAR_MATCH (UPS_FIND_LT_MATCH | UPS_FIND_GT_MATCH \ 2228 | UPS_FIND_EQ_MATCH) UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_get_parameters(ups_env_t *env, ups_parameter_t *param)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_get_duplicate_count(ups_cursor_t *cursor, uint32_t *count, uint32_t flags)
struct ups_txn_t ups_txn_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_open(ups_env_t **env, const char *filename, uint32_t flags, const ups_parameter_t *param)
UPS_EXPORT const char *UPS_CALLCONV ups_strerror(ups_status_t status)
Portable typedefs for upscaledb.
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_erase(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, 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)
unsigned __int64 uint64_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_clone(ups_cursor_t *src, ups_cursor_t **dest)
int UPS_CALLCONV(* ups_compare_func_t)(ups_db_t *db, const uint8_t *lhs, uint32_t lhs_length, const uint8_t *rhs, uint32_t rhs_length)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_find(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, ups_record_t *record, uint32_t flags)
void UPS_CALLCONV(* ups_error_handler_fun)(int level, const char *message)
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)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_erase_db(ups_env_t *env, uint16_t name, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_rename_db(ups_env_t *env, uint16_t oldname, uint16_t newname, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_get_duplicate_position(ups_cursor_t *cursor, uint32_t *position)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_find(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_count(ups_db_t *db, ups_txn_t *txn, uint32_t flags, uint64_t *count)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_get_parameters(ups_db_t *db, ups_parameter_t *param)
UPS_EXPORT const char * ups_txn_get_name(ups_txn_t *txn)
struct ups_cursor_t ups_cursor_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_flush(ups_env_t *env, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_register_compare(const char *name, ups_compare_func_t func)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_close(ups_cursor_t *cursor)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_overwrite(ups_cursor_t *cursor, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_open_db(ups_env_t *env, ups_db_t **db, uint16_t name, uint32_t flags, const ups_parameter_t *params)
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)
UPS_EXPORT ups_status_t ups_txn_begin(ups_txn_t **txn, ups_env_t *env, const char *name, void *reserved, uint32_t flags)
UPS_EXPORT ups_status_t ups_txn_commit(ups_txn_t *txn, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_insert(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_erase(ups_cursor_t *cursor, uint32_t flags)
UPS_EXPORT ups_status_t ups_txn_abort(ups_txn_t *txn, uint32_t flags)
UPS_EXPORT void UPS_CALLCONV ups_set_error_handler(ups_error_handler_fun f)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_set_compare_func(ups_db_t *db, ups_compare_func_t foo)
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)
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)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_get_database_names(ups_env_t *env, uint16_t *names, uint32_t *length)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_close(ups_db_t *db, uint32_t flags)
UPS_EXPORT ups_env_t *UPS_CALLCONV ups_db_get_env(ups_db_t *db)
UPS_EXPORT void UPS_CALLCONV ups_get_version(uint32_t *major, uint32_t *minor, uint32_t *revision)
struct ups_env_t ups_env_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_get_record_size(ups_cursor_t *cursor, uint32_t *size)