void FoamDBResumeUpdates( VMFileHandle file);
This routine resumes the generation of updates for the database file.
Include: foamdb.h
dword FoamDBSaveRecord( VMFileHandle file, MemHandle record, PCB(sword, callback, (RecordHeader *record1, RecordHeader *record2))); /* Callback routine */
This routine saves the record record in the database file file, and frees up the passed memory block containing the record data. The callback routine determines where in the database the record should be stored. The Contdb library provides a front-end to this routine,
ContactSaveRecord(),
which should be used when saving records to a contact database.
PCB()
is a GEOS macro which signifies that one of the parameters for
FoamDBSaveRecord()
will be a callback routine that will return a sword and accept two RecordHeaders. This callback routine should be declared as:
sword _pascal MyCallBackRoutine(RecordHeader *record1, RecordHeader *record2);
It should return -1 if record1 should come before record2, or +1 if record1 should come after record2 in the database.
Include: foamdb.h
void FoamDBSetCurrentRecordID( VMFileHandle file, RecordID id);
Sets the record ID that will be used for the next created record.
Include: foamdb.h
void FoamDBSetFieldData(
VMFileHandle file,
MemHandle record,
FieldID id,
char *data, /* Data to be stored */
word dataSize); /* How many bytes of data */
Stores dataSize bytes of data in the field ID id of record.
Warning: When storing ASCII data (strings), the strings should not be null terminated. For example, if you want to store the string "ABCD", then let data be a pointer to the string and let dataSize equal 4.
Include: foamdb.h
void FoamDBSetFieldName(
VMFileHandle file,
MemHandle record,
FieldID id,
char *name);
Changes the name of the field with the ID id of record to name.
Warning: name is a null-terminated string.
Include: foamdb.h
void FoamDBSetNameForToken( VMFileHandle file, word nameToken, TCHAR *name);
Sets the name for the field identified by nameToken token
in the database's FieldName element array.
Warning: Field names are null-terminated.
Include: foamdb.h
void FoamDBSuspendNotifications( VMFileHandle file);
This routine stops the generation of notifications to the database file. Calls to this routine
must be matched by calls to
FoamDBResumeNotifications(),
Include: foamdb.h
void FoamDBSuspendUpdates( VMFileHandle file);
This routine stops the generation of updates for the database file. Calls to this routine
must be matched by calls to
FoamDBResumeUpdates().
Warning: It is dangerous to prevent updates.
Include: foamdb.h
Boolean FoamDBVisibleRecordEnum( VMFileHandle file, void *enumData, PCB(Boolean, callback, /* Non-zero to stop enum */ (RecordHeader *record, void *callbackEnumData))); /* Callback Routine */This routine calls an application-specified callback routine for each visible record in the database. The callback routine can return non-zero to stop the enumeration. enumData is a pointer to any kind of data that your application needs to pass to the callback routine and that the callback routine can modify. The callback routine can return non-zero to stop the enumeration.
For a more complete explanation of using callback routines in a FoamDB, refer to the explanation given for the similar routine
FoamDBFieldEnum().
The callback routine should be declared as
/* * Prototype of callback routine */ Boolean _pascal myCallBackRoutine(RecordHeader *record, void *callbackEnumData);
Include: foamdb.h
Boolean FoamDBVisibleRecordEnumWithRange( VMFileHandle file, void *enumData, dword startElement, dword numOfRecords, PCB(Boolean, callback, /* Non-zero to stop enum */ (RecordHeader *record, void *callbackEnumData))); /* Callback routine */
This routine calls the application-specified callback routine for some visible records in the database, starting with the record number startElement, and continuing for numOfRecords records. enumData is a pointer to any kind of data that your application needs to pass to the callback routine and that the callback routine can modify. The callback routine can return non-zero to stop the enumeration.
For a more complete explanation of using callback routines in a FoamDB, refer to the explanation given for the similar routine
FoamDBFieldEnum().
The callback routine should be declared as
/* * Prototype of callback routine */ Boolean _pascal myCallBackRoutine(RecordHeader *record, void *callbackEnumData);
Include: foamdb.h
GEOS SDK TechDocs
|
|
FoamDBGetCurrentRecordID() ...
|
FormatIDFromManufacturerAndType() ...