btrieveCpp.h
Go to the documentation of this file.
1 //
3 // Copyright (C) 2016 - Actian Corp.
4 //
6 
7 // This file exists in both project "zen.core" and "zen.docs".
8 // Make sure that both files are kept in sync.
9 //
10 // When updating this file make the corresponding changes to "btrieveC.h".
11 
12 #ifndef _BTRIEVECPP_H
13 #define _BTRIEVECPP_H
14 
15 #include <cstddef>
16 #include <set>
17 
18 #include "btrieveC.h"
19 
20 class BtrieveClient;
22 class BtrieveCollection;
23 class BtrieveDocumentSet;
25 class BtrieveFile;
28 class BtrieveFilter;
34 class BtrieveKeySegment;
35 class BtrieveVersion;
36 
38 class LINKAGE Btrieve
39 {
40 public:
42  static const int MAXIMUM_RECORD_LENGTH = BTRIEVE_MAXIMUM_RECORD_LENGTH;
43 
45  static const int MAXIMUM_KEY_LENGTH = BTRIEVE_MAXIMUM_KEY_LENGTH;
46 
49  enum ACSMode {
51  ACS_MODE_NONE = 0,
53  ACS_MODE_NAMED = 1,
55  ACS_MODE_NUMBERED = 2,
57  ACS_MODE_CASE_INSENSITIVE = 3,
59  ACS_MODE_DEFAULT = 4,
61  ACS_MODE_UNKNOWN = -7
62  };
63 
67  enum CreateMode {
69  CREATE_MODE_OVERWRITE = 0,
71  CREATE_MODE_NO_OVERWRITE = 1,
73  CREATE_MODE_UNKNOWN = -7
74  };
75 
79  enum Comparison {
81  COMPARISON_NONE = 0,
83  COMPARISON_EQUAL = 1,
85  COMPARISON_GREATER_THAN = 2,
87  COMPARISON_LESS_THAN = 3,
89  COMPARISON_NOT_EQUAL = 4,
91  COMPARISON_GREATER_THAN_OR_EQUAL = 5,
93  COMPARISON_LESS_THAN_OR_EQUAL = 6,
95  COMPARISON_LIKE = 7,
97  COMPARISON_NOT_LIKE = 8,
99  COMPARISON_JSON_QUERY_MATCH = 9,
101  COMPARISON_UNKNOWN = -7
102  };
103 
107  enum Connector {
109  CONNECTOR_LAST = 0,
111  CONNECTOR_AND = 1,
113  CONNECTOR_OR = 2,
115  CONNECTOR_UNKNOWN = -7
116  };
117 
118 
120  enum DiskDrive {
122  DISK_DRIVE_A = 0,
124  DISK_DRIVE_B = 1,
126  DISK_DRIVE_C = 2,
128  DISK_DRIVE_D = 3,
130  DISK_DRIVE_E = 4,
132  DISK_DRIVE_F = 5,
134  DISK_DRIVE_G = 6,
136  DISK_DRIVE_H = 7,
138  DISK_DRIVE_I = 8,
140  DISK_DRIVE_J = 9,
142  DISK_DRIVE_K = 10,
144  DISK_DRIVE_L = 11,
146  DISK_DRIVE_M = 12,
148  DISK_DRIVE_N = 13,
150  DISK_DRIVE_O = 14,
152  DISK_DRIVE_P = 15,
154  DISK_DRIVE_Q = 16,
156  DISK_DRIVE_R = 17,
158  DISK_DRIVE_S = 18,
160  DISK_DRIVE_T = 19,
162  DISK_DRIVE_U = 20,
164  DISK_DRIVE_V = 21,
166  DISK_DRIVE_W = 22,
168  DISK_DRIVE_X = 23,
170  DISK_DRIVE_Y = 24,
172  DISK_DRIVE_Z = 25,
174  DISK_DRIVE_DEFAULT = 26,
176  DISK_DRIVE_UNKNOWN = -7
177  };
178 
185  DUPLICATE_MODE_NOT_ALLOWED = 0,
187  DUPLICATE_MODE_ALLOWED_NONREPEATING = 1,
189  DUPLICATE_MODE_ALLOWED_REPEATING = 2,
191  DUPLICATE_MODE_UNKNOWN = -7
192  };
193 
198  enum DataType {
200  DATA_TYPE_CHAR = 0,
202  DATA_TYPE_ZSTRING = 1,
204  DATA_TYPE_INTEGER = 2,
206  DATA_TYPE_UNSIGNED_BINARY = 3,
208  DATA_TYPE_FLOAT = 4,
210  DATA_TYPE_AUTOINCREMENT = 5,
212  DATA_TYPE_DATE = 6,
214  DATA_TYPE_NUMERICSTS = 7,
216  DATA_TYPE_TIME = 8,
218  DATA_TYPE_NUMERICSA = 9,
220  DATA_TYPE_DECIMAL = 10,
222  DATA_TYPE_CURRENCY = 11,
224  DATA_TYPE_MONEY = 12,
226  DATA_TYPE_TIMESTAMP = 13,
228  DATA_TYPE_LOGICAL = 14,
230  DATA_TYPE_WSTRING = 15,
232  DATA_TYPE_NUMERIC = 16,
234  DATA_TYPE_WZSTRING = 17,
236  DATA_TYPE_BFLOAT = 18,
238  DATA_TYPE_GUID = 19,
240  DATA_TYPE_LSTRING = 20,
242  DATA_TYPE_NULL_INDICATOR_SEGMENT = 21,
244  DATA_TYPE_LEGACY_STRING = 22,
246  DATA_TYPE_LEGACY_BINARY = 23,
248  DATA_TYPE_AUTOTIMESTAMP = 24,
250  DATA_TYPE_CLOB = 25,
252  DATA_TYPE_TIMESTAMP2 = 26,
254  DATA_TYPE_UNKNOWN = -7
255  };
256 
261  enum FileVersion {
263  FILE_VERSION_6_0 = 0,
265  FILE_VERSION_6_1 = 1,
267  FILE_VERSION_7_0 = 2,
269  FILE_VERSION_8_0 = 3,
271  FILE_VERSION_9_0 = 4,
273  FILE_VERSION_9_5 = 5,
275  FILE_VERSION_13_0 = 7,
277  FILE_VERSION_DEFAULT = 6,
279  FILE_VERSION_UNKNOWN = -7
280  };
281 
288  FREE_SPACE_THRESHOLD_10_PERCENT = 0,
290  FREE_SPACE_THRESHOLD_20_PERCENT = 1,
292  FREE_SPACE_THRESHOLD_30_PERCENT = 2,
294  FREE_SPACE_THRESHOLD_DEFAULT = 3,
296  FREE_SPACE_THRESHOLD_UNKNOWN = -7
297  };
298 
303  enum Index {
305  INDEX_1 = 0,
307  INDEX_2 = 1,
309  INDEX_3 = 2,
311  INDEX_4 = 3,
313  INDEX_5 = 4,
315  INDEX_6 = 5,
317  INDEX_7 = 6,
319  INDEX_8 = 7,
321  INDEX_9 = 8,
323  INDEX_10 = 9,
325  INDEX_11 = 10,
327  INDEX_12 = 11,
329  INDEX_13 = 12,
331  INDEX_14 = 13,
333  INDEX_15 = 14,
335  INDEX_16 = 15,
337  INDEX_17 = 16,
339  INDEX_18 = 17,
341  INDEX_19 = 18,
343  INDEX_20 = 19,
345  INDEX_21 = 20,
347  INDEX_22 = 21,
349  INDEX_23 = 22,
351  INDEX_24 = 23,
353  INDEX_25 = 24,
355  INDEX_26 = 25,
357  INDEX_27 = 26,
359  INDEX_28 = 27,
361  INDEX_29 = 28,
363  INDEX_30 = 29,
365  INDEX_31 = 30,
367  INDEX_32 = 31,
369  INDEX_33 = 32,
371  INDEX_34 = 33,
373  INDEX_35 = 34,
375  INDEX_36 = 35,
377  INDEX_37 = 36,
379  INDEX_38 = 37,
381  INDEX_39 = 38,
383  INDEX_40 = 39,
385  INDEX_41 = 40,
387  INDEX_42 = 41,
389  INDEX_43 = 42,
391  INDEX_44 = 43,
393  INDEX_45 = 44,
395  INDEX_46 = 45,
397  INDEX_47 = 46,
399  INDEX_48 = 47,
401  INDEX_49 = 48,
403  INDEX_50 = 49,
405  INDEX_51 = 50,
407  INDEX_52 = 51,
409  INDEX_53 = 52,
411  INDEX_54 = 53,
413  INDEX_55 = 54,
415  INDEX_56 = 55,
417  INDEX_57 = 56,
419  INDEX_58 = 57,
421  INDEX_59 = 58,
423  INDEX_60 = 59,
425  INDEX_61 = 60,
427  INDEX_62 = 61,
429  INDEX_63 = 62,
431  INDEX_64 = 63,
433  INDEX_65 = 64,
435  INDEX_66 = 65,
437  INDEX_67 = 66,
439  INDEX_68 = 67,
441  INDEX_69 = 68,
443  INDEX_70 = 69,
445  INDEX_71 = 70,
447  INDEX_72 = 71,
449  INDEX_73 = 72,
451  INDEX_74 = 73,
453  INDEX_75 = 74,
455  INDEX_76 = 75,
457  INDEX_77 = 76,
459  INDEX_78 = 77,
461  INDEX_79 = 78,
463  INDEX_80 = 79,
465  INDEX_81 = 80,
467  INDEX_82 = 81,
469  INDEX_83 = 82,
471  INDEX_84 = 83,
473  INDEX_85 = 84,
475  INDEX_86 = 85,
477  INDEX_87 = 86,
479  INDEX_88 = 87,
481  INDEX_89 = 88,
483  INDEX_90 = 89,
485  INDEX_91 = 90,
487  INDEX_92 = 91,
489  INDEX_93 = 92,
491  INDEX_94 = 93,
493  INDEX_95 = 94,
495  INDEX_96 = 95,
497  INDEX_97 = 96,
499  INDEX_98 = 97,
501  INDEX_99 = 98,
503  INDEX_100 = 99,
505  INDEX_101 = 100,
507  INDEX_102 = 101,
509  INDEX_103 = 102,
511  INDEX_104 = 103,
513  INDEX_105 = 104,
515  INDEX_106 = 105,
517  INDEX_107 = 106,
519  INDEX_108 = 107,
521  INDEX_109 = 108,
523  INDEX_110 = 109,
525  INDEX_111 = 110,
527  INDEX_112 = 111,
529  INDEX_113 = 112,
531  INDEX_114 = 113,
533  INDEX_115 = 114,
535  INDEX_116 = 115,
537  INDEX_117 = 116,
539  INDEX_118 = 117,
541  INDEX_119 = 118,
543  INDEX_SYSTEM = 125,
545  INDEX_NONE = -1,
547  INDEX_UNKNOWN = -7
548  };
549 
553  LOCATION_MODE_NO_PREFERENCE = 0,
555  LOCATION_MODE_FORCE_LOCAL = 1,
557  LOCATION_MODE_FORCE_REMOTE = 2,
559  LOCATION_MODE_UNKNOWN = -7
560  };
561 
566  enum LockMode {
568  LOCK_MODE_NONE = 0,
570  LOCK_MODE_SINGLE_WAIT = 1,
572  LOCK_MODE_SINGLE_NO_WAIT = 2,
574  LOCK_MODE_MULTIPLE_WAIT = 3,
576  LOCK_MODE_MULTIPLE_NO_WAIT = 4,
578  LOCK_MODE_UNKNOWN = -7
579  };
580 
583  enum NullKeyMode {
585  NULL_KEY_MODE_ALL_SEGMENTS = 0,
587  NULL_KEY_MODE_ANY_SEGMENTS = 1,
589  NULL_KEY_MODE_NONE = 2,
591  NULL_KEY_MODE_UNKNOWN = -7
592  };
593 
597  enum OpenMode {
599  OPEN_MODE_NORMAL = 0,
601  OPEN_MODE_ACCELERATED = 1,
603  OPEN_MODE_READ_ONLY = 2,
605  OPEN_MODE_EXCLUSIVE = 3,
607  OPEN_MODE_WRITABLE = 4,
609  OPEN_MODE_UNKNOWN = -7
610  };
611 
614  enum OwnerMode {
616  OWNER_MODE_NONE = 0,
618  OWNER_MODE_NO_ENCRYPTION_NO_READ_ALLOWED = 1,
620  OWNER_MODE_NO_ENCRYPTION_READ_ALLOWED = 2,
622  OWNER_MODE_ENCRYPTION_NO_READ_ALLOWED = 3,
624  OWNER_MODE_ENCRYPTION_READ_ALLOWED = 4,
626  OWNER_MODE_UNKNOWN = -7
627  };
628 
631  enum EncryptType {
633  ENCRYPT_TYPE_NONE = 0,
635  ENCRYPT_TYPE_TRADITIONAL = 1,
637  ENCRYPT_TYPE_128_BIT = 2,
639  ENCRYPT_TYPE_AES_192 = 3,
641  ENCRYPT_TYPE_AES_256 = 4,
643  ENCRYPT_TYPE_UNKNOWN = -7
644  };
645 
650  PAGE_LOCK_TYPE_NONE = 0,
652  PAGE_LOCK_TYPE_DATA_PAGE = 1,
654  PAGE_LOCK_TYPE_INDEX_PAGE = 2,
656  PAGE_LOCK_TYPE_VARIABLE_PAGE = 3,
658  PAGE_LOCK_TYPE_UNKNOWN = -7
659  };
660 
665  enum PageSize {
667  PAGE_SIZE_512 = 0,
669  PAGE_SIZE_1024 = 1,
671  PAGE_SIZE_1536 = 2,
673  PAGE_SIZE_2048 = 3,
675  PAGE_SIZE_3072 = 4,
677  PAGE_SIZE_3584 = 5,
679  PAGE_SIZE_4096 = 6,
681  PAGE_SIZE_8192 = 7,
683  PAGE_SIZE_16384 = 8,
685  PAGE_SIZE_DEFAULT = 9,
687  PAGE_SIZE_UNKNOWN = -7
688  };
689 
696  RECORD_COMPRESSION_MODE_NONE = 0,
698  RECORD_COMPRESSION_MODE_BLANK_TRUNCATION = 1,
700  RECORD_COMPRESSION_MODE_RUN_LENGTH_ENCODING = 2,
702  RECORD_COMPRESSION_MODE_UNKNOWN = -7
703  };
704 
709  enum StatusCode {
711  STATUS_CODE_NO_ERROR = 0,
713  STATUS_CODE_INVALID_FUNCTION = 1,
715  STATUS_CODE_IO_ERROR = 2,
717  STATUS_CODE_FILE_NOT_OPEN = 3,
719  STATUS_CODE_KEY_VALUE_NOT_FOUND = 4,
721  STATUS_CODE_DUPLICATE_KEY_VALUE = 5,
723  STATUS_CODE_INVALID_INDEX_NUMBER = 6,
725  STATUS_CODE_DIFFERENT_INDEX_NUMBER = 7,
727  STATUS_CODE_POSITION_NOT_SET = 8,
729  STATUS_CODE_END_OF_FILE = 9,
731  STATUS_CODE_MODIFIABLE_KEYVALUE_ERROR = 10,
733  STATUS_CODE_FILENAME_BAD = 11,
735  STATUS_CODE_FILE_NOT_FOUND = 12,
737  STATUS_CODE_EXTENDED_FILE_ERROR = 13,
739  STATUS_CODE_PREIMAGE_OPEN_ERROR = 14,
741  STATUS_CODE_PREIMAGE_IO_ERROR = 15,
743  STATUS_CODE_EXPANSION_ERROR = 16,
745  STATUS_CODE_CLOSE_ERROR = 17,
747  STATUS_CODE_DISKFULL = 18,
749  STATUS_CODE_UNRECOVERABLE_ERROR = 19,
751  STATUS_CODE_RECORD_MANAGER_INACTIVE = 20,
753  STATUS_CODE_KEYBUFFER_TOO_SHORT = 21,
755  STATUS_CODE_DATALENGTH_ERROR = 22,
757  STATUS_CODE_POSITIONBLOCK_LENGTH = 23,
759  STATUS_CODE_PAGE_SIZE_ERROR = 24,
761  STATUS_CODE_CREATE_IO_ERROR = 25,
763  STATUS_CODE_NUMBER_OF_INDEXES = 26,
765  STATUS_CODE_INVALID_KEY_POSITION = 27,
767  STATUS_CODE_INVALID_RECORD_LENGTH = 28,
769  STATUS_CODE_INVALID_KEYLENGTH = 29,
771  STATUS_CODE_NOT_A_BTRIEVE_FILE = 30,
773  STATUS_CODE_FILE_ALREADY_EXTENDED = 31,
775  STATUS_CODE_EXTEND_IO_ERROR = 32,
777  STATUS_CODE_BTR_CANNOT_UNLOAD = 33,
779  STATUS_CODE_INVALID_EXTENSION_NAME = 34,
781  STATUS_CODE_DIRECTORY_ERROR = 35,
783  STATUS_CODE_TRANSACTION_ERROR = 36,
785  STATUS_CODE_TRANSACTION_IS_ACTIVE = 37,
787  STATUS_CODE_TRANSACTION_FILE_IO_ERROR = 38,
789  STATUS_CODE_END_TRANSACTION_ERROR = 39,
791  STATUS_CODE_TRANSACTION_MAX_FILES = 40,
793  STATUS_CODE_OPERATION_NOT_ALLOWED = 41,
795  STATUS_CODE_INCOMPLETE_ACCEL_ACCESS = 42,
797  STATUS_CODE_INVALID_RECORD_ADDRESS = 43,
799  STATUS_CODE_NULL_KEYPATH = 44,
801  STATUS_CODE_INCONSISTENT_KEY_FLAGS = 45,
803  STATUS_CODE_ACCESS_TO_FILE_DENIED = 46,
805  STATUS_CODE_MAXIMUM_OPEN_FILES = 47,
807  STATUS_CODE_INVALID_ALT_SEQUENCE_DEF = 48,
809  STATUS_CODE_KEY_TYPE_ERROR = 49,
811  STATUS_CODE_OWNER_ALREADY_SET = 50,
813  STATUS_CODE_INVALID_OWNER = 51,
815  STATUS_CODE_ERROR_WRITING_CACHE = 52,
817  STATUS_CODE_INVALID_INTERFACE = 53,
819  STATUS_CODE_VARIABLE_PAGE_ERROR = 54,
821  STATUS_CODE_AUTOINCREMENT_ERROR = 55,
823  STATUS_CODE_INCOMPLETE_INDEX = 56,
825  STATUS_CODE_EXPANED_MEM_ERROR = 57,
827  STATUS_CODE_COMPRESS_BUFFER_TOO_SHORT = 58,
829  STATUS_CODE_FILE_ALREADY_EXISTS = 59,
831  STATUS_CODE_REJECT_COUNT_REACHED = 60,
833  STATUS_CODE_SMALL_EX_GET_BUFFER_ERROR = 61,
835  STATUS_CODE_INVALID_GET_EXPRESSION = 62,
837  STATUS_CODE_INVALID_EXT_INSERT_BUFF = 63,
839  STATUS_CODE_OPTIMIZE_LIMIT_REACHED = 64,
841  STATUS_CODE_INVALID_EXTRACTOR = 65,
843  STATUS_CODE_RI_TOO_MANY_DATABASES = 66,
845  STATUS_CODE_RIDDF_CANNOT_OPEN = 67,
847  STATUS_CODE_RI_CASCADE_TOO_DEEP = 68,
849  STATUS_CODE_RI_CASCADE_ERROR = 69,
851  STATUS_CODE_RI_VIOLATION = 71,
853  STATUS_CODE_RI_REFERENCED_FILE_CANNOT_OPEN = 72,
855  STATUS_CODE_RI_OUT_OF_SYNC = 73,
857  STATUS_CODE_END_CHANGED_TO_ABORT = 74,
859  STATUS_CODE_RI_CONFLICT = 76,
861  STATUS_CODE_CANT_LOOP_IN_SERVER = 77,
863  STATUS_CODE_DEAD_LOCK = 78,
865  STATUS_CODE_PROGRAMMING_ERROR = 79,
867  STATUS_CODE_CONFLICT = 80,
869  STATUS_CODE_LOCKERROR = 81,
871  STATUS_CODE_LOST_POSITION = 82,
873  STATUS_CODE_READ_OUTSIDE_TRANSACTION = 83,
875  STATUS_CODE_RECORD_INUSE = 84,
877  STATUS_CODE_FILE_INUSE = 85,
879  STATUS_CODE_FILE_TABLE_FULL = 86,
881  STATUS_CODE_NOHANDLES_AVAILABLE = 87,
883  STATUS_CODE_INCOMPATIBLE_MODE_ERROR = 88,
885  STATUS_CODE_DEVICE_TABLE_FULL = 90,
887  STATUS_CODE_SERVER_ERROR = 91,
889  STATUS_CODE_TRANSACTION_TABLE_FULL = 92,
891  STATUS_CODE_INCOMPATIBLE_LOCK_TYPE = 93,
893  STATUS_CODE_PERMISSION_ERROR = 94,
895  STATUS_CODE_SESSION_NO_LONGER_VALID = 95,
897  STATUS_CODE_COMMUNICATIONS_ERROR = 96,
899  STATUS_CODE_DATA_MESSAGE_TOO_SMALL = 97,
901  STATUS_CODE_INTERNAL_TRANSACTION_ERROR = 98,
903  STATUS_CODE_REQUESTER_CANT_ACCESS_RUNTIME = 99,
905  STATUS_CODE_NO_CACHE_BUFFERS_AVAIL = 100,
907  STATUS_CODE_NO_OS_MEMORY_AVAIL = 101,
909  STATUS_CODE_NO_STACK_AVAIL = 102,
911  STATUS_CODE_CHUNK_OFFSET_TOO_LONG = 103,
913  STATUS_CODE_LOCALE_ERROR = 104,
915  STATUS_CODE_CANNOT_CREATE_WITH_VAT = 105,
917  STATUS_CODE_CHUNK_CANNOT_GET_NEXT = 106,
919  STATUS_CODE_CHUNK_INCOMPATIBLE_FILE = 107,
921  STATUS_CODE_TRANSACTION_TOO_COMPLEX = 109,
923  STATUS_CODE_ARCH_BLOG_OPEN_ERROR = 110,
925  STATUS_CODE_ARCH_FILE_NOT_LOGGED = 111,
927  STATUS_CODE_ARCH_FILE_IN_USE = 112,
929  STATUS_CODE_ARCH_LOGFILE_NOT_FOUND = 113,
931  STATUS_CODE_ARCH_LOGFILE_INVALID = 114,
933  STATUS_CODE_ARCH_DUMPFILE_ACCESS_ERROR = 115,
935  STATUS_CODE_LOCATOR_FILE_INDICATOR = 116,
937  STATUS_CODE_NO_SYSTEM_LOCKS_AVAILABLE = 130,
939  STATUS_CODE_FILE_FULL = 132,
941  STATUS_CODE_MORE_THAN_5_CONCURRENT_USERS = 133,
943  STATUS_CODE_ISR_NOT_FOUND = 134,
945  STATUS_CODE_ISR_INVALID = 135,
947  STATUS_CODE_ACS_NOT_FOUND = 136,
949  STATUS_CODE_CANNOT_CONVERT_RP = 137,
951  STATUS_CODE_INVALID_NULL_INDICATOR = 138,
953  STATUS_CODE_INVALID_KEY_OPTION = 139,
955  STATUS_CODE_INCOMPATIBLE_CLOSE = 140,
957  STATUS_CODE_INVALID_USERNAME = 141,
959  STATUS_CODE_INVALID_DATABASE = 142,
961  STATUS_CODE_NO_SSQL_RIGHTS = 143,
963  STATUS_CODE_ALREADY_LOGGED_IN = 144,
965  STATUS_CODE_NO_DATABASE_SERVICES = 145,
967  STATUS_CODE_DUPLICATE_SYSTEM_KEY = 146,
969  STATUS_CODE_LOG_SEGMENT_MISSING = 147,
971  STATUS_CODE_ROLL_FORWARD_ERROR = 148,
973  STATUS_CODE_SYSTEM_KEY_INTERNAL = 149,
975  STATUS_CODE_DBS_INTERNAL_ERROR = 150,
977  STATUS_CODE_NESTING_DEPTH_ERROR = 151,
979  STATUS_CODE_INVALID_PARAMETER_TO_MKDE = 160,
981  STATUS_CODE_USER_COUNT_LIMIT_EXCEEDED = 161,
983  STATUS_CODE_CLIENT_TABLE_FULL = 162,
985  STATUS_CODE_LAST_SEGMENT_ERROR = 163,
987  STATUS_CODE_LOGIN_FAILED_BAD_USERNAME = 170,
989  STATUS_CODE_LOGIN_FAILED_BAD_PASSWORD = 171,
991  STATUS_CODE_LOGIN_FAILED_BAD_DATABASE = 172,
993  STATUS_CODE_LOGIN_ALREADY_LOGGED_IN = 173,
995  STATUS_CODE_LOGIN_LOGOUT_FAILED = 174,
997  STATUS_CODE_LOGIN_WRONG_URI_FORMAT = 175,
999  STATUS_CODE_LOGIN_FILE_AND_TABLE_NOT_FOUND = 176,
1001  STATUS_CODE_LOGIN_TABLE_NOT_IN_DATABASE = 177,
1003  STATUS_CODE_LOGIN_DIRECTORY_NOT_IN_DATABASE = 178,
1005  STATUS_CODE_LOCK_PARM_OUTOFRANGE = 1001,
1007  STATUS_CODE_MEM_ALLOCATION_ERR = 1002,
1009  STATUS_CODE_MEM_PARM_TOO_SMALL = 1003,
1011  STATUS_CODE_PAGE_SIZE_PARM_OUTOFRANGE = 1004,
1013  STATUS_CODE_INVALID_PREIMAGE_PARM = 1005,
1015  STATUS_CODE_PREIMAGE_BUF_PARM_OUTOFRANGE = 1006,
1017  STATUS_CODE_FILES_PARM_OUTOFRANGE = 1007,
1019  STATUS_CODE_INVALID_INIT_PARM = 1008,
1021  STATUS_CODE_INVALID_TRANS_PARM = 1009,
1023  STATUS_CODE_ERROR_ACC_TRANS_CONTROL_FILE = 1010,
1025  STATUS_CODE_COMPRESSION_BUF_PARM_OUTOFRANGE = 1011,
1027  STATUS_CODE_INV_N_OPTION = 1012,
1029  STATUS_CODE_TASK_LIST_FULL = 1013,
1031  STATUS_CODE_STOP_WARNING = 1014,
1033  STATUS_CODE_POINTER_PARM_INVALID = 1015,
1035  STATUS_CODE_ALREADY_INITIALIZED = 1016,
1037  STATUS_CODE_REQ_CANT_FIND_RES_DLL = 1017,
1039  STATUS_CODE_ALREADY_INSIDE_BTR_FUNCTION = 1018,
1041  STATUS_CODE_CALLBACK_ABORT = 1019,
1043  STATUS_CODE_INTF_COMM_ERROR = 1020,
1045  STATUS_CODE_FAILED_TO_INITIALIZE = 1021,
1047  STATUS_CODE_MKDE_SHUTTING_DOWN = 1022,
1049  STATUS_CODE_INTERNAL_ERROR = 2000,
1051  STATUS_CODE_INSUFFICIENT_MEM_ALLOC = 2001,
1053  STATUS_CODE_INVALID_OPTION = 2002,
1055  STATUS_CODE_NO_LOCAL_ACCESS_ALLOWED = 2003,
1057  STATUS_CODE_SPX_NOT_INSTALLED = 2004,
1059  STATUS_CODE_INCORRECT_SPX_VERSION = 2005,
1061  STATUS_CODE_NO_AVAIL_SPX_CONNECTION = 2006,
1063  STATUS_CODE_INVALID_PTR_PARM = 2007,
1065  STATUS_CODE_CANT_CONNECT_TO_615 = 2008,
1067  STATUS_CODE_CANT_LOAD_MKDE_ROUTER = 2009,
1069  STATUS_CODE_UT_THUNK_NOT_LOADED = 2010,
1071  STATUS_CODE_NO_RESOURCE_DLL = 2011,
1073  STATUS_CODE_OS_ERROR = 2012,
1075  STATUS_CODE_MK_ROUTER_MEM_ERROR = 3000,
1077  STATUS_CODE_MK_NO_LOCAL_ACCESS_ALLOWED = 3001,
1079  STATUS_CODE_MK_NO_RESOURCE_DLL = 3002,
1081  STATUS_CODE_MK_INCOMPAT_COMPONENT = 3003,
1083  STATUS_CODE_MK_TIMEOUT_ERROR = 3004,
1085  STATUS_CODE_MK_OS_ERROR = 3005,
1087  STATUS_CODE_MK_INVALID_SESSION = 3006,
1089  STATUS_CODE_MK_SERVER_NOT_FOUND = 3007,
1091  STATUS_CODE_MK_INVALID_CONFIG = 3008,
1093  STATUS_CODE_MK_NETAPI_NOT_LOADED = 3009,
1095  STATUS_CODE_MK_NWAPI_NOT_LOADED = 3010,
1097  STATUS_CODE_MK_THUNK_NOT_LOADED = 3011,
1099  STATUS_CODE_MK_LOCAL_NOT_LOADED = 3012,
1101  STATUS_CODE_MK_PNSL_NOT_LOADED = 3013,
1103  STATUS_CODE_MK_CANT_FIND_ENGINE = 3014,
1105  STATUS_CODE_MK_INIT_ERROR = 3015,
1107  STATUS_CODE_MK_INTERNAL_ERROR = 3016,
1109  STATUS_CODE_MK_LOCAL_MKDE_DATABUF_TOO_SMALL = 3017,
1111  STATUS_CODE_MK_CLOSED_ERROR = 3018,
1113  STATUS_CODE_MK_SEMAPHORE_ERROR = 3019,
1115  STATUS_CODE_MK_LOADING_ERROR = 3020,
1117  STATUS_CODE_MK_BAD_SRB_FORMAT = 3021,
1119  STATUS_CODE_MK_DATABUF_LEN_TOO_LARGE = 3022,
1121  STATUS_CODE_MK_TASK_TABLE_FULL = 3023,
1123  STATUS_CODE_MK_INVALID_OP_ON_REMOTE = 3024,
1125  STATUS_CODE_MK_PIDS_NOT_LOADED = 3025,
1127  STATUS_CODE_MK_BAD_PIDS = 3026,
1129  STATUS_CODE_MK_IDS_CONNECT_FAILURE = 3027,
1131  STATUS_CODE_MK_IDS_LOGIN_FAILURE = 3028,
1133  STATUS_CODE_NL_FAILURE = 3101,
1135  STATUS_CODE_NL_NOT_INITIALIZED = 3102,
1137  STATUS_CODE_NL_NAME_NOT_FOUND = 3103,
1139  STATUS_CODE_NL_PERMISSION_ERROR = 3104,
1141  STATUS_CODE_NL_NO_AVAILABLE_TRANSPORT = 3105,
1143  STATUS_CODE_NL_CONNECTION_FAILURE = 3106,
1145  STATUS_CODE_NL_OUT_OF_MEMORY = 3107,
1147  STATUS_CODE_NL_INVALID_SESSION = 3108,
1149  STATUS_CODE_NL_MORE_DATA = 3109,
1151  STATUS_CODE_NL_NOT_CONNECTED = 3110,
1153  STATUS_CODE_NL_SEND_FAILURE = 3111,
1155  STATUS_CODE_NL_RECEIVE_FAILURE = 3112,
1157  STATUS_CODE_NL_INVALID_SERVER_TYPE = 3113,
1159  STATUS_CODE_NL_SRT_FULL = 3114,
1161  STATUS_CODE_NL_TRANSPORT_FAILURE = 3115,
1163  STATUS_CODE_NL_RCV_DATA_OVERFLOW = 3116,
1165  STATUS_CODE_NL_CST_FULL = 3117,
1167  STATUS_CODE_NL_INVALID_ADDRESS_FAMILY = 3118,
1169  STATUS_CODE_NL_NO_AUTH_CONTEXT_AVAILABLE = 3119,
1171  STATUS_CODE_NL_INVALID_AUTH_TYPE = 3120,
1173  STATUS_CODE_NL_INVALID_AUTH_OBJECT = 3121,
1175  STATUS_CODE_NL_AUTH_LEN_TOO_SMALL = 3122,
1177  STATUS_CODE_NL_INVALID_SESSION_LEVEL_PARM = 3123,
1179  STATUS_CODE_NL_TASK_TABLE_FULL = 3124,
1181  STATUS_CODE_NL_NDS_NAME_RESOLUTION_ERROR = 3125,
1183  STATUS_CODE_NL_FILE_NAME_RESOLUTION_ERROR = 3126,
1185  STATUS_CODE_NL_IDS_SEND_FAILURE = 3127,
1187  STATUS_CODE_NL_IDS_RCV_FAILURE = 3128,
1189  STATUS_CODE_UNKNOWN = -7,
1190  };
1191 
1198  SYSTEM_DATA_MODE_YES = 0,
1200  SYSTEM_DATA_MODE_NO = 1,
1202  SYSTEM_DATA_MODE_DEFAULT = 2,
1204  SYSTEM_DATA_MODE_UNKNOWN = -7
1205  };
1206 
1210  TRANSACTION_MODE_EXCLUSIVE = 0,
1212  TRANSACTION_MODE_CONCURRENT_WRITE_WAIT = 1,
1214  TRANSACTION_MODE_CONCURRENT_NO_WRITE_WAIT = 2,
1216  TRANSACTION_MODE_UNKNOWN = -7
1217  };
1218 
1222  enum UnlockMode {
1224  UNLOCK_MODE_SINGLE = 0,
1226  UNLOCK_MODE_MULTIPLE = 1,
1228  UNLOCK_MODE_UNKNOWN = -7
1229  };
1230 
1237  VARIABLE_LENGTH_RECORDS_MODE_NO = 0,
1239  VARIABLE_LENGTH_RECORDS_MODE_YES = 1,
1241  VARIABLE_LENGTH_RECORDS_MODE_YES_VARIABLE_ALLOCATION_TAILS = 2,
1243  VARIABLE_LENGTH_RECORDS_MODE_UNKNOWN = -7
1244  };
1245 
1250  VERSION_TYPE_NONE = 0,
1252  VERSION_TYPE_BTRIEVE_ENGINE = 1,
1254  VERSION_TYPE_WORKGROUP_ENGINE = 2,
1256  VERSION_TYPE_DOS_WORKSTATION = 3,
1258  VERSION_TYPE_CLIENT_REQUESTOR = 4,
1260  VERSION_TYPE_WINDOWS_SERVER_ENGINE = 5,
1262  VERSION_TYPE_UNIX = 6,
1264  VERSION_TYPE_CLIENT_ENGINE = 7,
1266  VERSION_TYPE_UNKNOWN = -7
1267  };
1268 
1274  static const char *ACSModeToString(ACSMode ACSMode);
1280  static const char *DuplicateModeToString(DuplicateMode duplicateMode);
1286  static const char *DataTypeToString(DataType dataType);
1292  static const char *FileVersionToString(FileVersion fileVersion);
1298  static const char *FreeSpaceThresholdToString(FreeSpaceThreshold freeSpaceThreshold);
1304  static const char *IndexToString(Index index);
1310  static const char *NullKeyModeToString(NullKeyMode nullKeyMode);
1316  static const char *PageSizeToString(PageSize pageSize);
1322  static const char *RecordCompressionModeToString(RecordCompressionMode recordCompressionMode);
1328  static const char *StatusCodeToString(StatusCode statusCode);
1334  static const char *SystemDataModeToString(SystemDataMode systemDataMode);
1340  static const char *VersionTypeToString(VersionType versionType);
1346  static const char *PageLockTypeToString(PageLockType pageLockType);
1352  static const char *LockModeToString(LockMode lockMode);
1358  static const char *OwnerModeToString(OwnerMode ownerMode);
1362  static const char *EncryptTypeToString(EncryptType encryptType);
1368  static const char *VariableLengthRecordsModeToString(VariableLengthRecordsMode variableLengthRecordsMode);
1372  static long long UnixEpochMicrosecondsToTimestamp(long long microseconds);
1376  static long long TimestampToUnixEpochMicroseconds(long long timestamp);
1377 
1378 private:
1379  Btrieve();
1380  ~Btrieve();
1381 };
1382 
1384 class LINKAGE BtrieveClient
1385 {
1386 public:
1388  BtrieveClient();
1393  BtrieveClient(int serviceAgentIdentifier, int clientIdentifier);
1394  ~BtrieveClient();
1395 
1404  Btrieve::StatusCode GetVersion(BtrieveVersion *btrieveVersion, BtrieveFile *btrieveFile = NULL);
1416  Btrieve::StatusCode FileOpen(BtrieveFile *btrieveFile, const char *fileName, const char *ownerName, Btrieve::OpenMode openMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1426  Btrieve::StatusCode FileOpen(BtrieveFile *btrieveFile, const wchar_t *fileName, const char *ownerName, Btrieve::OpenMode openMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1427 
1428 // Avoid Windows renaming of GetCurrentDirectory.
1429 #ifdef GetCurrentDirectory
1430  #undef GetCurrentDirectory
1431 #endif
1432 
1439  const char *GetCurrentDirectory(Btrieve::DiskDrive diskDrive);
1440  #ifndef SWIG
1441  Btrieve::StatusCode GetCurrentDirectory(Btrieve::DiskDrive diskDrive, char *currentDirectory, int currentDirectorySize);
1450  #endif
1451  Btrieve::StatusCode GetCurrentDirectory(Btrieve::DiskDrive diskDrive, wchar_t *currentDirectory, int currentDirectorySize);
1464  Btrieve::StatusCode ContinuousOperationBegin(const char *pathNames);
1470  Btrieve::StatusCode ContinuousOperationBegin(const wchar_t *pathNames);
1476  Btrieve::StatusCode ContinuousOperationEnd(const char *pathNames);
1482  Btrieve::StatusCode ContinuousOperationEnd(const wchar_t *pathNames);
1490  Btrieve::StatusCode FileClose(BtrieveFile *btrieveFile);
1501  Btrieve::StatusCode FileCreate(BtrieveFileAttributes *btrieveFileAttributes, const char *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1513  Btrieve::StatusCode FileCreate(BtrieveFileAttributes *btrieveFileAttributes, BtrieveIndexAttributes *btrieveIndexAttributes, const char *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1524  Btrieve::StatusCode FileCreate(BtrieveFileAttributes *btrieveFileAttributes, const wchar_t *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1536  Btrieve::StatusCode FileCreate(BtrieveFileAttributes *btrieveFileAttributes, BtrieveIndexAttributes *btrieveIndexAttributes, const wchar_t *fileName, Btrieve::CreateMode createMode, Btrieve::LocationMode locationMode = Btrieve::LOCATION_MODE_NO_PREFERENCE);
1544  Btrieve::StatusCode FileDelete(const char *fileName);
1552  Btrieve::StatusCode FileDelete(const wchar_t *fileName);
1559  Btrieve::StatusCode FileRename(const char *existingFileName, const char *newFileName);
1566  Btrieve::StatusCode FileRename(const wchar_t *existingFileName, const wchar_t *newFileName);
1572  Btrieve::StatusCode GetLastStatusCode();
1580  Btrieve::StatusCode Login(const char *databaseURI);
1586  Btrieve::StatusCode Login(const wchar_t *databaseURI);
1594  Btrieve::StatusCode Logout(const char *databaseURI);
1600  Btrieve::StatusCode Logout(const wchar_t *databaseURI);
1605  Btrieve::StatusCode Reset();
1606 
1607 // Avoid Windows renaming of SetCurrentDirectory.
1608 #ifdef SetCurrentDirectory
1609  #undef SetCurrentDirectory
1610 #endif
1611 
1619  Btrieve::StatusCode SetCurrentDirectory(const char *currentDirectory);
1627  Btrieve::StatusCode SetCurrentDirectory(const wchar_t *currentDirectory);
1632  Btrieve::StatusCode Stop();
1637  Btrieve::StatusCode TransactionAbort();
1644  Btrieve::StatusCode TransactionBegin(Btrieve::TransactionMode transactionMode, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1649  Btrieve::StatusCode TransactionEnd();
1654  int GetServiceAgentIdentifier();
1659  int GetClientIdentifier();
1666  Btrieve::StatusCode CollectionCreate(const char *collectionName);
1672  Btrieve::StatusCode CollectionDelete(const char *collectionName);
1679  Btrieve::StatusCode CollectionRename(const char *existingCollectionName, const char *newCollectionName);
1687  Btrieve::StatusCode CollectionOpen(BtrieveCollection *btrieveCollection, const char *collectionName, const char *password = NULL);
1693  Btrieve::StatusCode CollectionClose(BtrieveCollection *btrieveCollection);
1695 
1696 private:
1697  btrieve_client_t btrieveClient;
1698 };
1699 
1712 class LINKAGE BtrieveFile
1713 {
1714  friend class BtrieveClient;
1715 
1716 protected:
1717  btrieve_file_t GetBtrieveFile();
1718  btrieve_file_t *GetBtrieveFilePtr();
1719  BtrieveFile(btrieve_file_t btrieveFileIn);
1720 
1721 public:
1725  BtrieveFile();
1727  ~BtrieveFile();
1728 
1739  Btrieve::StatusCode RecordDelete();
1757  int RecordRetrieveByFraction(Btrieve::Index index, int numerator, int denominator, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1774  int RecordRetrieveByPercentage(Btrieve::Index index, int percentage, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1792  int RecordRetrieveByCursorPosition(Btrieve::Index index, long long cursorPosition, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1811  int RecordRetrieve(Btrieve::Comparison comparison, Btrieve::Index index, const char *key, int keyLength, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1826  Btrieve::StatusCode KeyRetrieve(Btrieve::Comparison comparison, Btrieve::Index index, const char *key, int keyLength);
1840  Btrieve::StatusCode BulkRetrieveNext(BtrieveBulkRetrieveAttributes *bulkRetrieveAttributes, BtrieveBulkRetrieveResult *bulkRetrieveResult, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1852  Btrieve::StatusCode BulkRetrievePrevious(BtrieveBulkRetrieveAttributes *bulkRetrieveAttributes, BtrieveBulkRetrieveResult *bulkRetrieveResult, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1864  Btrieve::StatusCode GetInformation(BtrieveFileInformation *btrieveFileInformation);
1880  int RecordRetrieveFirst(Btrieve::Index index, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1892  Btrieve::StatusCode KeyRetrieveFirst(Btrieve::Index index, char *key, int keySize);
1906  int GetNumerator(long long cursorPosition, int denominator);
1921  int GetNumerator(Btrieve::Index index, const char *key, int keyLength, int denominator);
1937  int RecordRetrieveLast(Btrieve::Index index, char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
1949  Btrieve::StatusCode KeyRetrieveLast(Btrieve::Index index, char *key, int keySize);
1972  Btrieve::StatusCode KeyRetrieveNext(char *key, int keySize);
1987  int RecordRetrieveNext(char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
2000  int GetPercentage(long long cursorPosition);
2014  int GetPercentage(Btrieve::Index index, const char *key, int keyLength);
2026  long long GetCursorPosition();
2037  Btrieve::StatusCode KeyRetrievePrevious(char *key, int keySize);
2050  int RecordRetrievePrevious(char *record, int recordSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
2067  int RecordRetrieveChunk(int offset, int length, char *chunk, int chunkSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
2083  int RecordRetrieveChunk(int length, char *chunk, int chunkSize, Btrieve::LockMode lockMode = Btrieve::LOCK_MODE_NONE);
2095  Btrieve::StatusCode IndexCreate(BtrieveIndexAttributes *btrieveIndexAttributes);
2105  Btrieve::StatusCode IndexDrop(Btrieve::Index index);
2119  Btrieve::StatusCode RecordCreate(char *record, int recordLength);
2132  Btrieve::StatusCode BulkCreate(BtrieveBulkCreatePayload *btrieveBulkCreatePayload, BtrieveBulkCreateResult *btrieveBulkCreateResult);
2147  Btrieve::StatusCode SetOwner(Btrieve::OwnerMode ownerMode, const char *ownerName = NULL, const char *ownerNameAgain = NULL, bool useLongOwnerName = true);
2156  Btrieve::StatusCode RecordTruncate(int offset);
2164  Btrieve::StatusCode RecordTruncate();
2176  Btrieve::StatusCode RecordUnlock(Btrieve::UnlockMode unlockMode);
2187  Btrieve::StatusCode UnlockCursorPosition(long long cursorPosition);
2200  Btrieve::StatusCode RecordUpdate(const char *record, int recordLength);
2213  Btrieve::StatusCode RecordAppendChunk(const char *chunk, int chunkLength);
2226  Btrieve::StatusCode RecordUpdateChunk(int offset, const char *chunk, int chunkLength);
2238  Btrieve::StatusCode RecordUpdateChunk(const char *chunk, int chunkLength);
2239 
2240 private:
2241  btrieve_file_t btrieveFile;
2242 };
2243 
2246 {
2247  friend class BtrieveClient;
2248 
2249 protected:
2250  btrieve_file_attributes_t GetBtrieveFileAttributes();
2251 
2252 public:
2257 
2267  Btrieve::StatusCode SetBalancedIndexes(bool enableBalancedIndexes);
2278  Btrieve::StatusCode SetRecordCompressionMode(Btrieve::RecordCompressionMode recordCompressionMode);
2290  Btrieve::StatusCode SetReservedDuplicatePointerCount(int reservedDuplicatePointerCount);
2301  Btrieve::StatusCode SetFileVersion(Btrieve::FileVersion fileVersion);
2312  Btrieve::StatusCode SetFreeSpaceThreshold(Btrieve::FreeSpaceThreshold freeSpaceThreshold);
2327  Btrieve::StatusCode SetPageSize(Btrieve::PageSize pageSize, bool enablePageCompression = false);
2337  Btrieve::StatusCode SetFixedRecordLength(int fixedRecordLength);
2347  Btrieve::StatusCode SetPreallocatedPageCount(int preallocatedPageCount);
2357  Btrieve::StatusCode SetSystemDataMode(Btrieve::SystemDataMode systemDataMode);
2367  Btrieve::StatusCode SetVariableLengthRecordsMode(Btrieve::VariableLengthRecordsMode variableLengthRecordsMode);
2378  Btrieve::StatusCode SetKeyOnly(bool enableKeyOnly);
2379 
2380 private:
2381  btrieve_file_attributes_t btrieveFileAttributes;
2382 };
2383 
2386 {
2387  friend class BtrieveFile;
2388 
2389 protected:
2390  btrieve_file_information_t GetBtrieveFileInformation();
2391 
2392 public:
2398 
2414  Btrieve::FileVersion GetFileVersion();
2422  Btrieve::FreeSpaceThreshold GetFreeSpaceThreshold();
2430  Btrieve::PageSize GetPageSize();
2438  Btrieve::SystemDataMode GetSystemDataMode();
2447  Btrieve::StatusCode GetKeySegment(BtrieveKeySegment *btrieveKeySegment, int keySegmentNumber);
2455  int GetBalancedIndexes();
2463  Btrieve::RecordCompressionMode GetRecordCompressionMode();
2471  int GetKeyOnly();
2479  int GetPageCompression();
2487  int GetPagePreallocation();
2495  Btrieve::VariableLengthRecordsMode GetVariableLengthRecordsMode();
2502  int GetUnusedDuplicatePointerCount();
2509  int GetIndexCount();
2516  int GetFixedRecordLength();
2524  long long GetRecordCount();
2532  int GetSegmented();
2539  int GetUnusedPageCount();
2547  Btrieve::Index GetLogIndex();
2555  int GetLoggable();
2563  int GetSystemIndexPresent();
2570  int GetSystemIndexSize();
2578  int GetSystemIndexUsed();
2585  int GetSystemIndexVersion();
2593  long long GetDuplicateRecordConflictCursorPosition();
2601  Btrieve::Index GetDuplicateRecordConflictIndex();
2608  int GetIdentifier();
2615  int GetHandleCount();
2622  int GetOpenTimestamp();
2629  int GetUsageCount();
2637  int GetExplicitLocks();
2645  int GetClientTransactions();
2653  int GetReadOnly();
2661  int GetContinuousOperation();
2669  int GetReferentialIntegrityConstraints();
2677  Btrieve::OwnerMode GetOwnerMode();
2683  Btrieve::EncryptType GetEncryptionType();
2691  int GetWrongOwner();
2698  int GetGatewayMajorVersion();
2705  int GetGatewayMinorVersion();
2712  int GetGatewayPatchLevel();
2719  int GetGatewayPlatform();
2726  const char *GetGatewayName();
2727  #ifndef SWIG
2728  Btrieve::StatusCode GetGatewayName(char *name, int nameSize);
2736  #endif
2737  int GetLockOwnerImplicitLock();
2752  int GetLockOwnerFileLock();
2760  int GetLockOwnerRecordLock();
2768  int GetLockOwnerSameProcess();
2776  int GetLockOwnerWriteNoWait();
2784  int GetLockOwnerWriteHold();
2791  int GetLockOwnerTimeInTransaction();
2798  int GetLockOwnerTransactionLevel();
2805  const char *GetLockOwnerName();
2806  #ifndef SWIG
2807  Btrieve::StatusCode GetLockOwnerName(char *name, int nameSize);
2815  #endif
2816  int GetLockOwnerServiceAgentIdentifier();
2829  int GetLockOwnerClientIdentifier();
2837  Btrieve::LockMode GetLockOwnerExplicitLockMode();
2845  Btrieve::PageLockType GetLockOwnerPageLockType();
2853  Btrieve::Index GetLockOwnerIndex();
2860  const char *GetReferentialIntegrityFileName();
2861  #ifndef SWIG
2862  Btrieve::StatusCode GetReferentialIntegrityFileName(char *name, int nameSize);
2870  #endif
2871  int GetReferentialIntegrityOperationCode();
2885  long long GetReferentialIntegrityCursorPosition();
2892  int GetSegmentCount();
2900  const char *GetSegmentFileName(int segmentFileNumber);
2901  #ifndef SWIG
2902  Btrieve::StatusCode GetSegmentFileName(int segmentFileNumber, char *name, int nameSize);
2911  #endif
2912 
2913  // TODO: Coalesce some of the following.
2921  int GetSecurityHandleTrusted();
2929  int GetSecurityHandleImplicit();
2937  int GetSecurityHandleExplicit();
2945  int GetSecurityHandleAuthenticationByDatabase();
2953  int GetSecurityHandleAuthorizationByDatabase();
2961  int GetSecurityHandleWindowsNamedPipe();
2969  int GetSecurityHandleWorkgroup();
2977  int GetSecurityHandleBtpasswd();
2985  int GetSecurityHandlePAM();
2993  int GetSecurityHandleRTSSComplete();
3001  int GetSecurityHandleRTSSPreauthorized();
3009  int GetSecurityHandleRTSSDisabled();
3017  int GetSecurityCurrentDatabaseTrusted();
3025  int GetSecurityCurrentDatabaseImplicit();
3033  int GetSecurityCurrentDatabaseExplicit();
3041  int GetSecurityCurrentDatabaseAuthenticationByDatabase();
3049  int GetSecurityCurrentDatabaseAuthorizationByDatabase();
3057  int GetSecurityCurrentDatabaseWindowsNamedPipe();
3065  int GetSecurityCurrentDatabaseWorkgroup();
3073  int GetSecurityCurrentDatabaseBtpasswd();
3081  int GetSecurityCurrentDatabasePAM();
3089  int GetSecurityCurrentDatabaseRTSSComplete();
3097  int GetSecurityCurrentDatabaseRTSSPreauthorized();
3105  int GetSecurityCurrentDatabaseRTSSDisabled();
3113  int GetSecurityPermissionNoRights();
3121  int GetSecurityPermissionOpen();
3129  int GetSecurityPermissionRead();
3137  int GetSecurityPermissionCreateFile();
3145  int GetSecurityPermissionUpdate();
3153  int GetSecurityPermissionCreateRecord();
3161  int GetSecurityPermissionDelete();
3169  int GetSecurityPermissionExecute();
3177  int GetSecurityPermissionAlter();
3185  int GetSecurityPermissionRefer();
3193  int GetSecurityPermissionCreateView();
3201  int GetSecurityPermissionCreateStoredProcedure();
3209  const char *GetSecurityHandleDatabaseName();
3210  #ifndef SWIG
3211  Btrieve::StatusCode GetSecurityHandleDatabaseName(char *name, int nameSize);
3219  #endif
3220  const char *GetSecurityHandleTableName();
3228  #ifndef SWIG
3229  Btrieve::StatusCode GetSecurityHandleTableName(char *name, int nameSize);
3237  #endif
3238  const char *GetSecurityHandleUserName();
3246  #ifndef SWIG
3247  Btrieve::StatusCode GetSecurityHandleUserName(char *name, int nameSize);
3255  #endif
3256  const char *GetSecurityCurrentDatabaseName();
3264  #ifndef SWIG
3265  Btrieve::StatusCode GetSecurityCurrentDatabaseName(char *name, int nameSize);
3273  #endif
3274  const char *GetSecurityCurrentUserName();
3282  #ifndef SWIG
3283  Btrieve::StatusCode GetSecurityCurrentUserName(char *name, int nameSize);
3291  #endif
3292 
3293 private:
3294  btrieve_file_information_t btrieveFileInformation;
3295 };
3296 
3298 class LINKAGE BtrieveFilter
3299 {
3301 
3302 protected:
3303  btrieve_filter_t GetBtrieveFilter();
3304 
3305 public:
3308  BtrieveFilter();
3309  ~BtrieveFilter();
3310 
3320  Btrieve::StatusCode SetComparison(Btrieve::Comparison comparison);
3331  Btrieve::StatusCode SetComparisonConstant(const char *constant, int constantLength);
3341  Btrieve::StatusCode SetComparisonField(int offset);
3354  Btrieve::StatusCode SetField(int offset, int length, Btrieve::DataType dataType);
3362  Btrieve::StatusCode SetLikeCodePageName(const char *name);
3370  Btrieve::StatusCode SetConnector(Btrieve::Connector connector);
3381  Btrieve::StatusCode SetACSMode(Btrieve::ACSMode ACSMode);
3389  Btrieve::StatusCode SetACSUserDefined(const char *name);
3399  Btrieve::StatusCode SetACSName(const char *name);
3400 
3401 private:
3402  btrieve_filter_t btrieveFilter;
3403 };
3404 
3407 {
3408  friend class BtrieveFile;
3409 
3410 protected:
3411  btrieve_bulk_retrieve_attributes_t GetBtrieveBulkRetrieveAttributes();
3412 
3413 public:
3418 
3430  Btrieve::StatusCode AddField(int offset, int length);
3440  Btrieve::StatusCode AddFilter(BtrieveFilter *btrieveFilter);
3450  Btrieve::StatusCode SetMaximumRecordCount(int maximumRecordCount);
3460  Btrieve::StatusCode SetMaximumRejectCount(int maximumRejectCount);
3470  Btrieve::StatusCode SetSkipCurrentRecord(bool skipCurrentRecord);
3471 
3472 private:
3473  btrieve_bulk_retrieve_attributes_t bulkRetrieveAttributes;
3474 };
3475 
3478 {
3479  friend class BtrieveFile;
3480 
3481 protected:
3482  btrieve_bulk_retrieve_result_t GetBtrieveBulkRetrieveResult();
3483 
3484 public:
3489 
3508  int GetRecord(int recordNumber, char *record, int recordSize);
3515  int GetRecordCount();
3523  int GetRecordLength(int recordNumber);
3532  long long GetRecordCursorPosition(int recordNumber);
3533 
3534 private:
3535  btrieve_bulk_retrieve_result_t bulkRetrieveResult;
3536 };
3537 
3540 {
3541  friend class BtrieveClient;
3542  friend class BtrieveFile;
3543 
3544 protected:
3545  btrieve_index_attributes_t GetBtrieveIndexAttributes();
3546 
3547 public:
3552 
3562  Btrieve::StatusCode AddKeySegment(BtrieveKeySegment *btrieveKeySegment);
3572  Btrieve::StatusCode SetIndex(Btrieve::Index index);
3582  Btrieve::StatusCode SetDuplicateMode(Btrieve::DuplicateMode duplicateMode);
3592  Btrieve::StatusCode SetModifiable(bool enableModifiable);
3600  Btrieve::StatusCode SetACSMode(Btrieve::ACSMode ACSMode);
3611  Btrieve::StatusCode SetACSName(const char *ACSName);
3619  Btrieve::StatusCode SetACSNumber(int ACSNumber);
3629  Btrieve::StatusCode SetACSUserDefined(const char *ACSName, const char *ACSMap, int ACSMapLength);
3630 
3631 private:
3632  btrieve_index_attributes_t btrieveIndexAttributes;
3633 };
3634 
3637 {
3638  friend class BtrieveFile;
3639 
3640 protected:
3641  btrieve_bulk_create_payload_t GetBtrieveBulkCreatePayload();
3642 
3643 public:
3648 
3659  Btrieve::StatusCode AddRecord(const char *record, int recordLength);
3660 
3661 private:
3662  btrieve_bulk_create_payload_t btrieveBulkCreatePayload;
3663 };
3664 
3667 {
3668  friend class BtrieveFile;
3669 
3670 protected:
3671  btrieve_bulk_create_result_t GetBtrieveBulkCreateResult();
3672 
3673 public:
3678 
3693  int GetRecordCount();
3702  long long GetRecordCursorPosition(int recordNumber);
3703 
3704 private:
3705  btrieve_bulk_create_result_t btrieveBulkCreateResult;
3706 };
3707 
3709 class LINKAGE BtrieveKeySegment
3710 {
3713 
3714 protected:
3715  btrieve_key_segment_t GetBtrieveKeySegment();
3716  BtrieveKeySegment(btrieve_key_segment_t btrieveKeySegmentIn);
3717 
3718 public:
3722  ~BtrieveKeySegment();
3723 
3739  Btrieve::ACSMode GetACSMode();
3747  int GetModifiable();
3755  int GetKeyContinues();
3763  Btrieve::DataType GetDataType();
3770  int GetACSNumber();
3778  int GetDescendingSortOrder();
3786  Btrieve::DuplicateMode GetDuplicateMode();
3794  Btrieve::Index GetIndex();
3801  int GetLength();
3809  Btrieve::NullKeyMode GetNullKeyMode();
3816  int GetNullValue();
3823  int GetOffset();
3831  long long GetUniqueValueCount();
3841  Btrieve::StatusCode SetDescendingSortOrder(bool setDescendingSortOrder);
3854  Btrieve::StatusCode SetField(int offset, int length, Btrieve::DataType dataType);
3864  Btrieve::StatusCode SetNullKeyMode(Btrieve::NullKeyMode nullKeyMode);
3874  Btrieve::StatusCode SetNullValue(int nullValue);
3875 
3876 private:
3877  btrieve_key_segment_t btrieveKeySegment;
3878 };
3879 
3881 class LINKAGE BtrieveVersion
3882 {
3883  friend class BtrieveClient;
3884 
3885 protected:
3886  btrieve_version_t GetBtrieveVersion();
3887 
3888 public:
3892  BtrieveVersion();
3893  ~BtrieveVersion();
3894 
3912  Btrieve::VersionType GetClientVersionType();
3922  Btrieve::VersionType GetRemoteVersionType();
3932  Btrieve::VersionType GetLocalVersionType();
3941  int GetClientRevisionNumber();
3950  int GetClientVersionNumber();
3959  int GetRemoteRevisionNumber();
3968  int GetRemoteVersionNumber();
3977  int GetLocalRevisionNumber();
3986  int GetLocalVersionNumber();
3987 
3988 private:
3989  btrieve_version_t btrieveVersion;
3990 };
3991 
4009 //
4033 
4054 
4164 
4274 
4398 
4501 
4597 
4789 
4792 class LINKAGE BtrieveCollection
4793 {
4794  friend class BtrieveClient;
4795 
4796 protected:
4797  void SetBtrieveClient(BtrieveClient *btrieveClient);
4798  BtrieveFile *GetBtrieveFile();
4799 
4800 public:
4802  BtrieveCollection();
4804  ~BtrieveCollection();
4805 
4813  int DocumentCreate(const char *json, const char *blob, int blobLength);
4819  int DocumentCreate(const char *json);
4827  const char *DocumentRetrieve(int id, char *blob, int blobSize);
4833  const char *DocumentRetrieve(int id);
4834  #ifndef SWIG
4835  Btrieve::StatusCode DocumentRetrieve(int id, char *json, int jsonSize, char *blob, int blobSize);
4845  #endif
4846  int DocumentRetrieveBlob(int id, int offset, int length, char *blob, int blobSize);
4862  int DocumentGetBlobLength(int id);
4870  const char *DocumentGetCreationTimeAsString(int id);
4879  Btrieve::StatusCode DocumentUpdate(int id, const char *json, const char *blob, int blobLength);
4885  Btrieve::StatusCode DocumentDelete(int id);
4886  // TODO: Support case insensitive names in query.
4922  Btrieve::StatusCode Query(BtrieveDocumentSet *btrieveDocumentSet, const char *query, bool reverseOrder = false);
4929  Btrieve::StatusCode Encrypt(const char *password, const char *passwordAgain);
4935  Btrieve::StatusCode Decrypt(const char *password);
4942 
4943 private:
4944  BtrieveClient *btrieveClient;
4945  BtrieveFile *btrieveFile;
4946  Btrieve::StatusCode lastStatusCode;
4947 };
4948 
4952 class LINKAGE BtrieveDocumentSet
4953 {
4954  friend class BtrieveCollection;
4955 
4956 protected:
4957  std::set<int> *GetStdSet();
4958  void SetReverseOrder(bool reverseOrder);
4959 
4960 public:
4962  BtrieveDocumentSet();
4963  ~BtrieveDocumentSet();
4964 
4969  int Size();
4974  int Pop();
4980  Btrieve::StatusCode GetLastStatusCode();
4981 
4982 private:
4983  std::set<int> *stdSet;
4984  bool reverseOrder;
4985  Btrieve::StatusCode lastStatusCode;
4986 };
4988 
4989 #endif
FileVersion
The Btrieve file versions.
Definition: btrieveCpp.h:261
The Btrieve bulk retrieve result class.
Definition: btrieveCpp.h:3477
The Btrieve file attributes class.
Definition: btrieveCpp.h:2245
EncryptType
The Btrieve file encryption types.
Definition: btrieveCpp.h:631
struct btrieve_client * btrieve_client_t
A Btrieve client.
Definition: btrieveC.h:1260
VariableLengthRecordsMode
The Btrieve variable length records modes.
Definition: btrieveCpp.h:1235
struct btrieve_file_attributes * btrieve_file_attributes_t
A Btrieve file attributes.
Definition: btrieveC.h:1273
Btrieve::StatusCode GetLastStatusCode()
Get the last status code.
Connector
The Btrieve connectors.
Definition: btrieveCpp.h:107
The Btrieve file information class.
Definition: btrieveCpp.h:2385
VersionType
The Btrieve version types.
Definition: btrieveCpp.h:1248
NullKeyMode
The Btrieve null key modes.
Definition: btrieveCpp.h:583
#define BTRIEVE_MAXIMUM_RECORD_LENGTH
The Btrieve maximum record length.
Definition: btrieveC.h:29
Btrieve::StatusCode GetLastStatusCode()
Get the last status code.
struct btrieve_bulk_create_result * btrieve_bulk_create_result_t
A Btrieve bulk create result.
Definition: btrieveC.h:1245
The Btrieve bulk create result class.
Definition: btrieveCpp.h:3666
ACSMode
The Btrieve alternate collation sequence modes.
Definition: btrieveCpp.h:49
#define BTRIEVE_MAXIMUM_KEY_LENGTH
The Btrieve maximum key segment length.
Definition: btrieveC.h:32
Index
The Btrieve indexes.
Definition: btrieveCpp.h:303
PageLockType
The Btrieve page lock type.
Definition: btrieveCpp.h:648
RecordCompressionMode
The Btrieve record compression modes.
Definition: btrieveCpp.h:694
StatusCode
The Btrieve status codes.
Definition: btrieveCpp.h:709
The Btrieve class.
Definition: btrieveCpp.h:38
Comparison
The Btrieve comparisons.
Definition: btrieveCpp.h:79
struct btrieve_key_segment * btrieve_key_segment_t
A Btrieve key segment.
Definition: btrieveC.h:1295
OpenMode
The Btrieve open modes.
Definition: btrieveCpp.h:597
struct btrieve_bulk_create_payload * btrieve_bulk_create_payload_t
A Btrieve bulk create payload.
Definition: btrieveC.h:1241
PageSize
The Btrieve page sizes.
Definition: btrieveCpp.h:665
None.
Definition: btrieveCpp.h:568
OwnerMode
The Btrieve file owner modes.
Definition: btrieveCpp.h:614
The Btrieve bulk retrieve attributes class.
Definition: btrieveCpp.h:3406
UnlockMode
The Btrieve unlock modes.
Definition: btrieveCpp.h:1222
DuplicateMode
The Btrieve duplicate modes.
Definition: btrieveCpp.h:183
No preference.
Definition: btrieveCpp.h:553
struct btrieve_filter * btrieve_filter_t
A Btrieve filter.
Definition: btrieveC.h:1281
The Btrieve file class.
Definition: btrieveCpp.h:1712
The Btrieve version class.
Definition: btrieveCpp.h:3881
The Btrieve bulk create payload class.
Definition: btrieveCpp.h:3636
Btrieve::StatusCode GetLastStatusCode()
Get the last status code.
struct btrieve_bulk_retrieve_result * btrieve_bulk_retrieve_result_t
A Btrieve bulk retrieve result.
Definition: btrieveC.h:1253
struct btrieve_bulk_retrieve_attributes * btrieve_bulk_retrieve_attributes_t
A Btrieve bulk retrieve attributes.
Definition: btrieveC.h:1249
The Btrieve index attributes class.
Definition: btrieveCpp.h:3539
TransactionMode
The Btrieve transaction modes.
Definition: btrieveCpp.h:1208
FreeSpaceThreshold
The Btrieve free space thresholds.
Definition: btrieveCpp.h:286
CreateMode
The Btrieve create modes.
Definition: btrieveCpp.h:67
struct btrieve_file * btrieve_file_t
A Btrieve file.
Definition: btrieveC.h:1266
struct btrieve_index_attributes * btrieve_index_attributes_t
A Btrieve index attributes.
Definition: btrieveC.h:1288
The Btrieve key segment class.
Definition: btrieveCpp.h:3709
LocationMode
The Btrieve location modes.
Definition: btrieveCpp.h:551
The Btrieve client class.
Definition: btrieveCpp.h:1384
DiskDrive
The Btrieve disk drives.
Definition: btrieveCpp.h:120
LockMode
The Btrieve lock modes.
Definition: btrieveCpp.h:566
struct btrieve_file_information * btrieve_file_information_t
A Btrieve file information.
Definition: btrieveC.h:1277
The Btrieve filter class.
Definition: btrieveCpp.h:3298
SystemDataMode
The Btrieve system data modes.
Definition: btrieveCpp.h:1196
struct btrieve_version * btrieve_version_t
A Btrieve version.
Definition: btrieveC.h:1299
DataType
The Btrieve data types.
Definition: btrieveCpp.h:198