Up: GEOS SDK TechDocs | Up | Prev: ContactGetDBHandle() ... | Next: DataStoreCreate() ...

ContactMatchNumber()

RecordID	ContactMatchNumber( 
        TCHAR		number,
        ContdbCallType		type,
        FieldID		*field,
        word		*numMatches );

This function takes a phone number, searches all fields of the specified type in all records of the Contact database, returning the RecordID and FieldID of the matching field, if any; if there was no match, it returns -1.

This function takes the following arguments:

number
String containing the phone number to match.
type
The type of phone number to match; one of CCT_PHONE, CCT_SMS, CCT_FAX, CCT_EMAIL, CCT_GSM_FAX, CCT_ANY.
field
Pointer to a FieldID buffer. The function will fill this buffer in with the FieldID of the matching field, if any.
numMatches
Pointer to a word buffer. The function will fill this buffer in with the number of matching records found.

Include: contdb.goh

See Also: ContactEnsureEmptyField(), FoamDBSetFieldData().

ContactRecreateFieldLabel()

void ContdbRecreateFieldLabel(
        TCHAR 		*subLabel,
        TCHAR 		*destination,
        int 		fieldType);

This utility function takes a field sub-label (e.g., "GSM/PCN") and field type and creates a label from them (e.g. "Tel(GSM)". It will translate standard labels from English to the user's language. (Some field sublabels are standard, such as the "GSM" in "Tel(GSM)" and will be translated; the user's custom sublabels will not be translated.) This function takes the following arguments:

subLabel
The sublabel string.
destination
String buffer to hold the field name.
fieldType
The ContdbFieldType value of the field.

Include: contdb.goh

See Also: ContactImportDBFromTextFile().

ContactReleaseDBHandle()

void	ContactReleaseDBHandle( void );

This function releases the Contact database's handle, signalling that the application is done with the database for now.

Include: contdb.goh

See Also: ContactGetDBHandle(), ContactReleaseDBHandle().

ContactSaveRecord()

dword	ContactSaveRecord(
        MemHandle 		record);

This functionsaves the passed record in the database, inserting it in the proper sort order. It returns the record's RecordID number.

Include: contdb.goh

See Also: FoamDBDiscardRecord(), FoamDBDeleteRecord().

ContactSetTemplateRecord()

void	ContactSetTemplateRecord( 
        MemHandle 		record);

This functionmakes the passed record the Contact database's template record. It also frees that contact's handle.

Include: contdb.goh

See Also: ContactCreateRecordFromTemplate().

ContdbTranslateSubFieldLabelToEnglish()

void	ContdbTranslateSubFieldLabelToEnglish(
        TCHAR 		*subLabel,
        TCHAR 		*destination);

This function translates a foreign sub-label to its english equivalent. This function only recognizes certain "standard" sublabels; the user's custom labels will not be translated. This function takes two arguments: a buffer containing the string to translate and a string buffer to hold the translation.

See Also: DBAllocUngrouped().

DataStoreAddField()

DataStoreStructureError	DataStoreAddField(
        word		dsToken,
        FieldDescriptor		*fieldDescPtr,
        FieldID		*fieldIDPtr);

Adds a field to the datastore and writes the new field's FieldID to fieldIDPtr. Returns a DataStoreStructureError value (DSSE_NO_ERROR if successful). Takes the following arguments:

dsToken
Session token to the opened datastore.
fieldDescPtr
Pointer to a FieldDescriptor structure. Set FD _flags to FF_PRIMARY_KEY if the field is part of the key.
		typedef struct {
			FieldData		FD_data;
			TCHAR		*FD_name;
		} FieldDescriptor;
		typedef struct {
			FieldType		FD_type;
			FieldCategory		FD_category;
			FieldFlags		FD_flags;
		} FieldData;
fieldIDPtr
Pointer to the FieldID of the added field.

Include: datastor.h

DataStoreBuildIndex()

DataStoreStructureError	DataStoreBuildIndex(
        word					dsToken,
        MemHandle					*indexBlockHan,
        word					dataSize,
        DataStoreIndexCallbackParams					*paramsPtr,
        sword _pascal (*CallbackRoutine) (
        	word	dsToken,
        	DataStoreIndexCallbackParams	*paramsPtr));

Builds an index of RecordNum s (low word only) based on either a specified field or a callback function. Returns a DataStoreStructureError value (DSSE_NO_ERROR if successful). Takes the following arguments:

dsToken
Session token to the opened datastore.
indexBlockHan
Pointer to the handle of the index block.
dataSize
Number of bytes of data to write to the index block.
paramsPtr
Pointer to a DataStoreIndexCallbackParams structure. To build an index on a field, specify the field in DSICP _indexField . Set DSICP _sortOrder to SO_ASCENDING or SO_DESCENDING. If you specify a callback, the caller will pass DSICP _cbData , DSICP _rec1 and DSICP _rec2 to the callback.
		typedef struct {
			FieldID		DSICP_indexField;
			SortOrder		DSICP_sortOrder;
			void		*DSICP_cbData;
			RecordHeader		*DSICP_rec1;
			RecordHeader		*DSICP_rec1;
		} DataStoreIndexCallbackParams;
CallbackRoutine
Subroutine to determine which of two passed records comes before the other. The function should return:

-1 if DSICP_rec1 comes before DSICP_rec2
1 if DSICP_rec1 comes after DSICP_rec2

Warnings: Cannot call this routine on datastores that contain more than 4,000 records (will return DSSE_INDEX_RECORD_NUMBER_LIMIT_EXCEEDED).

Include: datastor.h

DataStoreClose()

DataStoreError	DataStoreClose(
        word		dsToken);	/* session token to opened datastore */

Closes the datastore if no other application has it open; otherwise, closes the "session" associated with dsToken . Returns a DataStoreError value (DSE_NO_ERROR if successful).

Warnings: Returns DSE_CLOSE_WITH_LOCKED_RECORD if the calling session has a record locked.

Include: datastor.h


Up: GEOS SDK TechDocs | Up | Prev: ContactGetDBHandle() ... | Next: DataStoreCreate() ...