?? cff.txt
字號:
long cftail_dupname(
void *handle
void *keyptr,
int keylen,
void *itemptr
)
Goto end of DupName duplicate entries for the key, get current item.
Returns OK or ERROR
long cfnext(
void *handle,
Item *itemptr
)
Goto next sequential entry, get current item.
Returns OK, EOI or ERROR,
long cfnext_dupnum(
void *handle
void *keyptr,
int keylen,
void *itemptr
)
Goto next normal duplicate entry for the key, get current item.
Returns OK, EOI or ERROR
long cfnext_dupname(
void *handle
void *keyptr,
int keylen,
void *itemptr
)
Goto next DupName duplicate entry for the key, get current item.
Returns OK, EOI or ERROR
long cfprev(
void *handle,
Item *itemptr
)
Goto previous sequential entry, get current item.
Returns OK, BOI or ERROR,
long cfprev_dupnum(
void *handle
void *keyptr,
int keylen,
void *itemptr
)
Goto previous normal duplicate entry for the key, get current item.
Returns OK, BOI or ERROR
long cfprev_dupname(
void *handle
void *keyptr,
int keylen,
void *itemptr
)
Goto previous DupName duplicate entry for the key, get current item.
Returns OK, BOI or ERROR
long cfkey(
void *handle,
void *keybufptr,
int keybuflen
)
Returns OK, BOI, EOI or ERROR.
If OK, fills the buffer denoted by 'keybufptr' with no more than
'keybuflen' bytes of the current key.
long cfitem(
void *handle,
Item *itemptr
)
Get item from current position.
Returns OK, BOI, EOI or ERROR.
long cfdata(
void *handle,
void *databufptr,
int databuflen
)
Returns OK, BOI, EOI or ERROR if invalid handle or no data available.
If OK, fills the buffer denoted by 'databufptr' with no more than
'databuflen' bytes of the current key's data area, if it exists.
long cfkeylen(
void *handle,
int *len
)
returns OK if a current key exists, len is set to the length of the key
NOTE: Short hashed keys always return a length of 8, even if they
were originally shorter.
long cfdatalen(
void *handle,
int *len
)
returns OK if a current key exists, len is set to data size or 0 if no data
long cfmark(
void *handle
)
Saves the current position. (see cffind_mark()).
Returns OK or ERROR.
INSERT ITEMS
int cfinsert(
void *handle,
void *keyptr,
int keylen,
void *itemptr
)
Returns OK or ERROR, duplicate entries are not allowed
int cfreinsert(
void *handle,
void *keyptr,
int keylen,
void *itemptr
)
Returns OK or ERROR, the key must exist, duplicate entries are not allowed.
If the existing item references data, the data space is deleted.
int cfinsert_dupnum(
void *handle,
void *keyptr,
int keylen,
void *itemptr,
long *dupcnt // returns the current dupcnt, 1 based
)
Returns OK or ERROR, 'normal' duplicates are allowed.
int cfreinsert_dupnum(
void *handle,
void *keyptr,
int keylen,
void *itemptr,
long *dupnum // points to the desired dupnum, 0 based
)
Returns OK or ERROR, the key and dupnumn'th duplicate must exist.
If the existing item references data, the data space is deleted.
NOTE: Items entered as normal duplicates do not remain in the order
in which they are entered, B+ trees sort the keys and items,
hashed directories get rearranged when split. Therefore, reinserting
to a specific dupnum is a chancy business and should be done only
when the programmer is certain of the algorithm.
int cfinsert_dupname(
void *handle,
void *keyptr,
int keylen,
void *itemptr,
DupName *dupname // returns current dupname
)
Returns OK or ERROR, the value referenced by 'dupname' is filled with the
current DupName.
NOTE: DupNames are constantly incremented and provide a completely unique
way to identify a key-item pair. Each DupName contains a 48 bit counter
that is decremented only under special circumstances (see cfdelete_lastdupname).
If a program inserted 1000 dupnames per second, it would take more than 8000
years to overflow the counter.
int cfreinsert_dupname(
void *handle,
void *keyptr,
int keylen,
void *itemptr,
DupName *dupname // points to the desired DupName
)
If the existing item references data, the data space is deleted.
Returns OK or ERROR, the key and dupname'th duplicate must exist.
INSERT DATA
NOTE: 1. Data may not be inserted in objects with untagged items.
2. reput acts like realloc, if the entry doesn't exist it is created.
If dupnums or DupNames are used with reput, then the desired entry
must exist or the operation fails.
void *cfput(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr // if non NULL then the Item is filled in
)
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
void *cfreput(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr // if non NULL then the Item is filled in
)
Overwrites old data, if no old data, a new entry is created.
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
void *cfput_dupnum(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr,
long *dupcnt // returns the current dupcnt, 1 based
)
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
void *cfreput_dupnum(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr, // if non NULL then the Item is filled in
long *dupnum // references the desired dupnum, 0 based
)
Overwrites old data, if no old data, the operation fails.
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
void *cfput_dupname(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr, // if non NULL then the Item is filled in
DupName *dupname // returns the current DupName
)
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
void *cfreput_dupname(
void *handle,
void *keyptr,
int keylen,
void *databuffer,
long databuflen,
void *itemptr, // if non NULL the Item is filled in
DupName *dupname // references the desired DupName
)
Overwrites old data, if no old data, the operation fails.
Returns 'itemptr' if successful, NULL if not.
The Item referenced by 'itemptr' describes a data chunk.
If itemptr is NULL, then the non-NULL value returned on success is not
a valid itemptr in its own right.
RETRIEVE DATA
long cfget(
void *handle,
void *keyptr,
void keylen,
void *databufptr,
long databuflen
)
Read the data for the first item of the key into the buffer for no
more than 'databuflen' bytes;
Returns FOUND, FOUND+1 if dups present, NOTFOUND, or ERROR
if >= FOUND sets up for sequential access.
int cfqget(
void *handle,
void *keyptr,
int keylen,
void *databufptr,
int databuflen
)
Read the data or item value of the key. If item value, buflen == 8.
i.e. if data is stored you get it; if the data is really a value you get
the 60 bit value + 4 bits of tag in the high 4 bits.
OPTIMIZED FOR SPEED, only works for memory based hash dictionaries.
Returns FOUND, NOTFOUND, or ERROR
long cfget_dupnum(
void *handle,
void *keyptr,
int keylen,
void *databufptr,
long databuflen,
long *dupnum // references the desired dupnum, 0 based
)
Read the data for the dupnum'th item of the key into the buffer for no
more than 'databuflen' bytes;
Returns FOUND, FOUND+1, NOTFOUND or ERROR.
If >= FOUND, sets up for sequential access.
long cfget_dupname(
void *handle,
DupName *dupname, // points to the desired DupName
void *databufptr,
long databuflen
)
Read the data for the dupname into the buffer for no
more than 'databuflen' bytes;
Returns FOUND, NOTFOUND or ERROR.
If FOUND, sets up for sequential access.
FIND ITEMS
int cffind(
void *handle,
void *keyptr,
int keylen,
void *itemptr // if FOUND the item is returned
)
Locates the first item of a key, and sets up for sequential access.
Returns FOUND, FOUND+1 if dups present, NOTFOUND, or ERROR
int cfqfind(
void *handle,
void *keyptr,
int keylen,
Item *keyi; // or NULL
Item *dati; // or NULL
)
Returns pointers to the key and data, and FOUND, NOTFOUND or ERROR;
OPTIMIZED FOR SPEED, only works for memory based hash dictionaries.
int cfqfinddat(
void *handle,
void *keyptr,
int keylen,
Item *dati;
)
Returns pointer to the data, and FOUND, NOTFOUND or ERROR;
dati.a1 points to data
data.a2.size is data size;
OPTIMIZED FOR SPEED, only works for memory based hash dictionaries.
int cfqfindkey(
void *handle,
void *keyptr,
int keylen,
Item *keyi;
)
Returns pointer to the key, and FOUND, NOTFOUND or ERROR;
keyi.a1 points to the key;
OPTIMIZED FOR SPEED, only works for memory based hash dictionaries.
int cffind_dupnum(
void *handle,
void *keyptr,
int keylen,
void *itemptr, // if FOUND the item is returned
long *dupnum // points to the desired dupnum, 0 based
)
Returns FOUND, NOTFOUND or ERROR.
If == FOUND, sets up for sequential access.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -