File: b3pb3def.bi

< Prev  TOC  Next >
'
'  b3pb3def.bi
'  1-Jan-1999
'  Bullet 3 Basic include, defines for powerbasic 3.x
'  Copyright (C)1999 Cornel Huth        http://40th.com/
'

DIM SORT.DUPS.ALLOWED AS LONG          ' using vars for constants GT 64K
DIM SORT.USE.ANSI.SET AS LONG

DIM OPENFLAGS.COMMIT AS LONG
DIM OPENFLAGS.NOCRIT AS LONG
DIM OPENFLAGS.NOCACHE AS LONG
DIM OPENFLAGS.FOURGB AS LONG
DIM OPENFLAGS.IO.RNDSEQ AS LONG
DIM OPENFLAGS.IO.RND AS LONG
DIM OPENFLAGS.IO.SEQ AS LONG

DIM OPENFLAGS.NOINHERIT AS LONG        ' these OPENFLAGS.* are LT 65536
DIM OPENFLAGS.DENY.NONE AS LONG        ' and could be defined as constants
DIM OPENFLAGS.DENY.READ AS LONG
DIM OPENFLAGS.DENY.WRITE AS LONG
DIM OPENFLAGS.DENY.RW AS LONG
DIM OPENFLAGS.ACCESS.READ7 AS LONG
DIM OPENFLAGS.ACCESS.RW AS LONG
DIM OPENFLAGS.ACCESS.WRITE AS LONG
DIM OPENFLAGS.ACCESS.READ AS LONG


%MAX.DBF.FIELDS    = 1024        ' max fields in a DBF
rem %MAX.RECORD.LENGTH =65024        ' max record length (never more than 65535, recommend max is 1024)
                                 ' record length must be LTE bullet_MASZ (max single alloc size)
%MAX.KEY.LENGTH      =196        ' max length of a key value, in bytes
%IX4.MAX.EXP.SIZE    =380        ' max length of key expression, in bytes (incl. 0T)

%XACTION.IX4.BIT=1               ' BLTKH.xactionFlag bit0
%XACTION.DBF.BIT=1               ' BLTDH.xactionFlag bit0
%XACTION.DBT.BIT=2               ' BLTDH.xactionFlag bit1

%FLAGS.DIRTY.BIT            =1   ' BLTDH/BLTKH.flags, bit0 (R/O)
%FLAGS.FULL.LOCK.BIT        =2   ' BLTDH/BLTKH.flags, bit1 (R/O)
%FLAGS.FULL.SHARED.LOCK.BIT =4   ' BLTDH/BLTKH.flags, bit2 (R/O)
%FLAGS.READ.THROUGH.LOCK.BIT=8   ' BLTDH/BLTKH.flags, bit3 (set at open)
%FLAGS.SKIP.DELETED.BIT     =16  ' BLTDH.flags, bit4 (set at data open)
%FLAGS.ATOMIC.BIT           =16  ' BLTKH.flags, bit4 (set at ix4 open)
%FLAGS.HDR.LOCK.BIT         =32  ' BLTDH.flags, bit5 (R/O)
%FLAGS.HDR.SHARED.LOCK.BIT  =64  ' BLTDH.flags, bit6 (R/O)
%FLAGS.READONLY.BIT         =128 ' BLTDH/BLTKH.flags, bit7 (set at open)

%FLAGSEX.IU.SKIPDATA        =1   ' insertEx/updateEx skips data record add/update
%FLAGSEX.LOCK.DUAL          =128 ' lockEx has KH handle with dual operation on its xbLink handle


%SORT.ASCII=1    ' sort by: ASCII value  (values 1-255 for low-byte of sortCmpCode)
%SORT.NLS  =2    ' NLS                   (up to 16 components allowed but all are to be...
%SORT.S16  =3    ' 16-bit signed integer (...of the same sort type unless SORT_MIXED is used)
%SORT.U16  =4    ' 16-bit unsigned integer |-------------------------------------------|
%SORT.S32  =5    ' 32-bit signed integer   | See the documentation for important notes |
%SORT.U32  =6    ' 32-bit unsigned integer | on 64-bit and _MIXED-data requirements    |
%SORT.S64  =7    ' 64-bit signed           |-------------------------------------------|
%SORT.U64  =8    ' 64-bit unsigned
%SORT.MIXED=9    ' mixed types allowed (an N|F field's key is stored as a DOUBLE in the index)
                 ' 10-31 reserved, 32-255 free

%SORT.MIXED.S16 =51 ' 16-bit signed as part of SORT_MIXED ('3')
%SORT.MIXED.U16 =52 ' 16-bit unsigned                     ('4')
%SORT.MIXED.S32 =53 ' 32-bit signed     these are special field types... ('5')
%SORT.MIXED.U32 =54 ' 32-bit unsigned   ...not sortCmp codes             ('6')
%SORT.MIXED.S64 =55 ' 64-bit signed                       ('7')
%SORT.MIXED.U64 =56 ' 64-bit unsigned                     ('8')
%SORT.MIXED.DBL =89 ' 8-byte floating-point double        ('Y')
                    ' the above FIELD TYPES are for -binary- data fields
                    ' dBASE standard field types are: C,N,D,L,M
                    ' dBASE extended field types are: F,B,G

SORT.DUPS.ALLOWED =65536   ' bit16 of sortCmpCode
SORT.USE.ANSI.SET =131072  ' bit17

%LOCK.MODE.EXCLUSIVE=0
%LOCK.MODE.SHARED   =1
%LOCK.MODE.ATOMIC   =2
%LOCK.MODE.SH2EX=%LOCK.MODE.EXCLUSIVE + %LOCK.MODE.ATOMIC ' 2
%LOCK.MODE.EX2SH=%LOCK.MODE.SHARED + %LOCK.MODE.ATOMIC    ' 3


%BLTVAR.IFS    = -4    ' IFS pointers (R/O)
%BLTVAR.DLLH   = -3    ' HW=ds, LW=sel is environment (R/O)
%BLTVAR.MAF    = -2    ' memory frees (R/O)
%BLTVAR.MAA    = -1    ' memory allocations (R/O)
%BLTVAR.VERSION=  0    ' returns pointer to Bullet version string
%BLTVAR.MPNL   =  1    ' default max pathname length
%BLTVAR.MPCL   =  2    ' default max pathname component length
%BLTVAR.MPXL   =  3    ' default max pathname extension length
%BLTVAR.MFSF   =  4    ' max file size fudge to guard against math overflow near .maxFileSize
%BLTVAR.MARSV  =  10   ' default bytes to hold back from Bullet reindex routine
%BLTVAR.MASZRX =  11   ' default max total memory, in bytes, reindex is allowed to allocate
%BLTVAR.MASZ   =  12   ' default max single allocation request size, in bytes, that will be made
%BLTVAR.MCBSZ  =  13   ' memo copy buffer size
%BLTVAR.MCBMAM =  14   ' memo copy buffer/data sort memory allocation strategy

%CRYPTO.FROM.RECGET  =1
%CRYPTO.FROM.RECADD  =2
%CRYPTO.FROM.RECUPD  =4
%CRYPTO.FROM.XRECADD =3
%CRYPTO.FROM.XRECUPD =5

%CRYPTO.FROM.KEYGET  =16
%CRYPTO.FROM.KEYADD  =32
%CRYPTO.FROM.KEYADDBULK =160

OPENFLAGS.COMMIT       =4194304    '&H400000 ' slow file writes (DOS 4+, all)
OPENFLAGS.NOCRIT       =2097152    '&H200000 ' critical errors passed to caller (DOS 4+, all)
OPENFLAGS.NOCACHE      =1048576    '&H100000 ' (OS/2)
OPENFLAGS.FOURGB       =1048576    '&H100000 ' (FAT32)
OPENFLAGS.IO.RNDSEQ    = 196608    '&H030000 ' random access, with some sequential access (OS/2)
OPENFLAGS.IO.RND       = 131072    '&H020000 ' mostly random access (OS/2)
OPENFLAGS.IO.SEQ       =  65536    '&H010000 ' mostly sequential access (OS/2)
                                   ' the above values are right-shift by 8 internally
OPENFLAGS.NOINHERIT    = &H000080  ' child programs do not inherit asMode
OPENFLAGS.DENY.NONE    = &H000040  ' share: do not deny others
OPENFLAGS.DENY.READ    = &H000030  ' share: deny others read
OPENFLAGS.DENY.WRITE   = &H000020  ' share: deny others write
OPENFLAGS.DENY.RW      = &H000010  ' share: deny others read/write
OPENFLAGS.ACCESS.READ7 = &H000004  ' access: read-only, file timestamp not altered (DOS7)
OPENFLAGS.ACCESS.RW    = &H000002  ' access: read/write
OPENFLAGS.ACCESS.WRITE = &H000001  ' access: write only
OPENFLAGS.ACCESS.READ  = &H000000  ' access: read only

' -------------------------------------------------------------------------------------------------------
' Error codes

%EXB.FUNCTION.NOT.IMPLEMENTED   =1   ' function is not implemented
%EXB.NOT.ENOUGH.MEMORY          =8   ' cannot get memory requested
%EXB.INVALID.ACCESS             =12  ' invalid file access flags
%EXB.INVALID.PARAMETER          =13  ' parameter is not valid
%EXB.INVALID.DRIVE              =15  ' not a valid drive letter
%EXB.UNEXPECTED.EOF             =38  ' unexpect EOF (bytes read != bytes asked)
%EXB.DISK.FULL                  =39  ' disk full on WriteFile
%EXB.FILE.EXISTS                =80  ' cannot create file since it already exists
%EXB.SEM.OWNER.DIED             =105 ' in place of Win32 error 80h (mutex)
%EXB.ATOMIC.LOCK.NOT.SUPPORTED  =174 ' only OS/2 32-bit supports atomic locks
%EXB.READ.LOCKS.NOT.SUPPORTED   =175 ' OS/2 and WinNT support read (shared, non-exclusive) locks
%EXB.TIMEOUT                    =640 ' in place of Win32 error 102h (mutex)

' Other operating system errors are as returned by OS itself

' System/general error codes

%EXB.216501             =8251 ' INT21/6501h not supported by DOS extender (do not use default cc/cp)
%EXB.216506             =8256 ' INT21/6506h not supported by DOS extender (provide a sort table)
%EXB.216520             =8259 ' INT21/6520h not supported by DOS extender (can't upper case)

%WRN.USING.ST850        =8295 ' code page info could not be loaded, using default cp=850 (DOS, create ix4)
%WRN.USING.ST1252       =8296 ' cp info could not be loaded, using default cp=1252 (DOS, create ix4)
%EXB.ILLEGAL.CMD        =8300 ' cannot perform callback (MS-BASIC only: ds != ss)
                              ' function not allowed
%EXB.SYSTEM.HANDLE      =8305 ' Bullet won't use or close handles 0-2
%EXB.FILE.NOT.OPEN      =8306 ' file not open (not Bullet handle, including xbLink)
%EXB.FILE.IS.DIRTY      =8307 ' tried to reload/zap header but current still dirty
%EXB.BAD.FILETYPE       =8308 ' tried key op on non-key file, data op on non...
%EXB.EXPIRED            =8313 ' evaluation time period has expired
%EXB.BAD.INDEX          =8314 ' BltGetVer/SetVar index is not valid
%EXB.FILE.BOUNDS        =8316 ' file size GT max file size (or GT half that if read-through locks)
%EXB.READONLY           =8317 ' handle has read-only flag active and attempted to write to it
%WRN.INCOMPLETE.XACTION =8318 ' header xactionFlag indicates an incomplete transaction (IX4|DBF|DBT)
%EXB.FILE.ALREADY.OPEN  =8319 ' .handle is non-zero so already has an open file handle

%EXB.BAD.ALLOC.SIZE     =8351 ' requested allocation size is more than bullet.MASZ, or is 0
%EXB.IO.WRAP.DETECTED   =8352 ' file I/O for bytes to/from memory address would cause segment wrap

%EXB.NULLFNPTR          =8395 ' null function pointer detected (without default function available)
%EXB.NULLPTR            =8396 ' general null pointer detected
%EXB.INVALID.DLL        =8398 ' DLL/LIB is not valid

' Multi-access error codes

%EXB.BAD.LOCK.MODE      =8401 ' lock mode not valid
%EXB.NOTHING.TO.UNLOCK  =8404 ' no outstanding full locks
%EXB.ALREADY.FULL.LOCK  =8405 ' already have a full lock so cannot record lock/header lock
%EXB.ALREADY.HDR.LOCK   =8406 ' already have a hdr lock so cannot full lock
%EXB.DIFFERENT.LOCK.MODE=8407 ' current lock does not match new lock mode (shared/exclusive)
%EXB.SAME.LOCK.MODE     =8408 ' current lock same as new lock mode (relock)

' Index error codes

%EXB.KEY.NOT.FOUND      =8501 ' exact match of key not found (also, recNo not same, if specified)
%EXB.KEY.EXISTS         =8502 ' key exists already and dups not allowed (or key+recno exists w/dups)
%EXB.END.OF.FILE        =8503 ' already at last index order
%EXB.TOP.OF.FILE        =8504 ' already at first index order
%EXB.EMPTY.FILE         =8505 ' nothing to do since no keys
%EXB.BAD.INDEX.STACK    =8507 ' index file is corrupt (stack over/underflow)
%EXB.BAD.INDEX.READ0    =8508 ' index file is corrupt (read attempt of node 0)
%EXB.BAD.INDEX.WRITE0   =8509 ' index file is corrupt (write attempt to node 0)
%EXB.SEEK.PREV.FAILED   =8510 ' seek prev failed
%EXB.BAD.INDEX.ROOTNODE =8511 ' index file is corrupt (root node cannot = 0)
%EXB.BAD.INDEX.KEYCOUNT =8512 ' index file is corrupt (key count GT max keys on node)
%EXB.BAD.INDEX.NOTAVAIL =8513 ' index file is corrupt (avail node is not so marked)
%EXB.RECNO.IS.ZERO      =8514 ' cannot delete a key when passed a recNo of 0

%EXB.UNKNOWN.INDEX      =8522 ' not a Bullet IX4 index file
%EXB.KEY.TOO.LONG       =8523 ' keylength GT MAX.KEY.LENGTH, or is 0
%EXB.BAD.XLATE.INFO     =8524 ' build key xlate.info is invalid
%EXB.SORT.STACK.OV      =8525 ' sort stack exceeded max depth

%EXB.BAD.NODE.SIZE      =8534 ' nodeSize is not 512,1024,1536,2048,2560 (must be specified at open)
%EXB.FILENAME.TOO.LONG  =8535 ' filename GT max path length (or null ptr)
%EXB.BAD.SORT.CMP.CODE  =8538 ' sortCmp code (among those less than 20) is not valid
%EXP.REQUIRES.FPU       =8539 ' converting text to floating-pointing double requires FPU support

%EXB.KEYX.NULL          =8541 ' expression is effectively NULL
%EXB.KEYX.TOO.LONG      =8542 ' KH.expression GT 380 bytes
%EXB.KEYX.SYM.TOO.LONG  =8543 ' fieldname/funcname in expression GT 10 single-byte OEM chars
%EXB.KEYX.SYM.UNKNOWN   =8544 ' fieldname/funcname in expression unknown
%EXB.KEYX.TOO.MANY.SYMS =8545 ' too many symbols/fields used in expression
%EXB.KEYX.BAD.SUBSTR    =8546 ' invalid SUBSTR() operand in expression
%EXB.KEYX.BAD.SUBSTR.SZ =8547 ' SUBSTR() exceeds field's size
%EXB.KEYX.BAD.FORM      =8548 ' didn't match expected symbol in expression or bad nesting
%EXB.KEYX.BAD.TYPE      =8549 ' field type not compatible with sortCmp mode

%EXB.NO.READS.FOR.RUN   =8551 ' unlikely, use different reindex buffer size
%EXB.TOO.MANY.RUNS      =8552 ' unlikely, too many reindex runs (more than 65535 runs (8128 for 16-bit builds))
%EXB.TOO.MANY.RUNS.FOR.BUFFER=8553 ' unlikely, too many reindex runs for run buffer (varies by buffer size, key size)

' Data error codes

%EXB.EXT.XBLINK         =8601 ' xbLink handle is not internal DBF (xbLinkPtr is -1)
%EXB.RECORD.TOO.LONG    =8603 ' record length is GT 64K or GT bullet.MASZ
%EXB.BAD.FIELD.COUNT    =8605 ' fields LTE 0 or GT MAX.FIELDS (Init,Open)
%EXB.BAD.HEADER         =8606 ' bad header
%EXB.BAD.RECNO          =8609 ' recNo=0, or GT recs in data file hdr, or not last recNo for debump
%WRN.RECORD.EXCLUDE     =8610 ' record's tag byte matches exclude tag or does not match include tag
%EXB.EMPTY.FIELDLEN     =8611 ' field length is 0
%EXB.NO.RECORDS         =8612 ' no data records

' Memo error codes

%WRN.CANNOT.OPEN.MEMO   =8701 ' DBF says memo file but memo open fails
%EXB.BAD.BLOCKSIZE      =8703 ' memo blocksize must be at least 24 bytes
%EXB.MEMO.DELETED       =8704 ' memo is deleted
%EXB.MEMO.PAST.END      =8705 ' memo data requested is past end of record
%EXB.BAD.MEMONO         =8706 ' memo number is not valid
%EXB.MEMO.IN.USE        =8707 ' memo add encountered likely corrupt memo file
%EXB.BAD.AVAIL.LINK     =8708 ' memo avail link (in memoAvailBlock) cannot be valid (is 0)
%EXB.MEMO.ZERO.SIZE     =8709 ' memo data has no size
%EXB.MEMO.IS.SMALLER    =8710 ' memo attempt to shrink but already LTE size
%EXB.TOO.MANY.MEMOS     =8712 ' memo pack, record has more than MAX.MEMO.FIELDS

' end b3pb3def.bi




All content Copyright © 1999 Cornel Huth. All rights reserved.