Up: GEOS SDK TechDocs | Up | Prev: ConstructOptr() ... | Next: ContactMatchNumber() ...

ContactGetDBHandle()

VMFileHandle 	ContactGetDBHandle( void );

This function returns the handle of the Contact database, the database that contains all of the "address book" data used by the contdb library. This handle is necessary for various operations with the library. When you're done with the handle, remember to call ContactReleaseDBHandle() .

Include: contdb.goh

See Also: ContactGetDBHandleNoBlock(), ContactReleaseDBHandle().

ContactGetDBHandleNoBlock()

VMFileHandle 	ContactGetDBHandleNoBlock( void );

This function behaves in the same manner as ContactGetDBHandle() , except that if it cannot get the handle, it returns zero instead of waiting until the handleis available.When you're done with the handle, remember to call ContactReleaseDBHandle() .

Include: contdb.goh

See Also: ContactGetDBHandle().

ContactGetName()

Boolean	ContactGetName( 
        MemHandle 		record,
        TCHAR 		*dest);

This function gets the name associated with the record, filling in the dest buffer. If there was no name in the record, this function returns non-zero; otherwise, it returns zero.

Include: contdb.goh

See Also: ContactGetDBHandle().

ContactGetTruncatedName()

Boolean	ContactGetTrunactedName( 
        MemHandle 		record,
        TCHAR 		*dest,
        word		destSize);				/* Size of dest buffer */

This function gets the name associated with the record, filling in the dest buffer. It will truncate the name, as necessary to make it fit inside the buffer. Remember to leave space for the null terminator when determining how big a buffer you'll need. If there was no name in the record, this function returns non-zero; otherwise, it returns zero.

Include: contdb.goh

See Also: ContactGetDBHandle().

ContactGetUserDataID()

RecordID	ContactGetUserDataID( void );

This functionreturns the RecordID of the special Contacts database record containing the user's own contact data.

Include: contdb.goh

See Also: FoamDBGetRecordFromID().

ContactImportDBFromTextFile()

void 	ContactImportDBFromTextFile(
        hptr 		fileImport);					/* file's handle */

This function imports contact database information from an ASCII text file. This file's format is described below. The function will compare imported records to those already in the Contacts database. Any identical records will be merged.

A short sample file is shown below.

[RECORD]
[FIELD]
Name
[FIELD-NAME]
[FIELD-DATA]
Hudson W.
[FIELD-END]
[FIELD]
Company
[FIELD-NAME]
[FIELD-DATA]
Space Marines
[FIELD-END]
[FIELD]
Title
[FIELD-NAME]
[FIELD-DATA]
Private
[FIELD-END]
[RECORD-END]
[RECORD]
[FIELD]
Name
[FIELD-NAME]
[FIELD-DATA]
Adams, John Quincy
[FIELD-END]
[FIELD]
Tel
[FIELD-NAME]
[FIELD-DATA]
1 617 438 1776
[FIELD-END]
[FIELD]
[FIELD-NAME]
Company
[FIELD-DATA]
[FIELD-END]
USA Government
[FIELD]
Notes
[FIELD-NAME]
Note(Birthday)
[FIELD-DATA]
July 11, 1767
Gift ideas: flowers
[FIELD-END]
[RECORD-END]

The ASCII file follows these rules:

Include: contdb.goh

See Also: ContactExportDBToTextFile().

ContactMatchName()

RecordID	ContactMatchName( 
        TCHAR		name,
        ContdbFieldType		type,
        Boolean		stopEarly,
        FieldID		*field,
        word		*numMatches );

This function takes aname, 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.

The comparison of names does not consider case.

This function takes the following arguments:

name
String containing the name to match.
type
The type of phone number to match; one of CFT_NAME, CFT_COMPANY CFT_TITLE, CFT_ADDRESS, CFT_PHONE, CFT_FAX, CFT_EMAIL, CFT_DTMF, CFT_NOTES.
stopEarly
Set this flag true to stop searching after finding the first matching name; set it false to find out the number of matching names.
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. This number is only meaningful if the stopEarly flag is false .

Include: contdb.goh

See Also: ContactEnsureEmptyField(), FoamDBSetFieldData().


Up: GEOS SDK TechDocs | Up | Prev: ConstructOptr() ... | Next: ContactMatchNumber() ...