|
Phonebook Format This phonebook format is used by Intel's fax applications, but may be used by other applications as well. It is not actually a part of the DCA/Intel CAS. It has an extendable format that will be very useful for many applications. A phonebook file has two major parts, a header and a data space for the variable length records. Each record has a unique record number from 0 to 999. This number is always used to refer to the record. There is an array of record offsets in the phonebook header. The offset of record N from the beginning of the file is the (4 x N)th byte in the array. An offset of 0 means that the corresponding record number is unused. There are up to 10 variable ASCIIZ fields defined for any phonebook. The application that created the phonebook defines what they are called. Each variable field has a maximum length of 60 bytes. The names of these fields are stored in the header, and the values of these fields are stored with each record. The phonebook header looks like this: Ofs Len Description 0 2 ID Field: must be 1AH BBH 2 1 Major version number (from Get External Data Block, function 0EH) 3 1 Minor version number 4 2 Number of records in the file, 0 to 1000 6 2 Number of unused bytes in the file, 0 to 32766 8 2 Number of variable fields in this phonebook, 0 to 10 10 150 Array of 10 variable field names, 15 bytes apiece, as ASCIIZ strings 160 4000 Array of record offsets, 4 bytes apiece When a record is deleted, an offset of 0 is placed in the offset array and the length of the record is added to the unused bytes count. When a record is changed and its new length is larger than its old length, the record is written at the end of the file, its offset in the offset array is updated, and the number of freed bytes is added onto the unused bytes count. A record is variable in length. There are two types of records: Person and Group. Person Records look like this: Ofs Len Description 0 2 Record ID 2 2 Number of groups the individual belongs to. 4 2 Number of bytes the record occupies. 6 1 Record type. This is 1 for a Person Record. 7 1 Type of hardware: 0 - Limited to fax 1 - Faxes and file transfer using fax modem 2-127 Reserved 8 32 ASCIIZ name. Must NOT be blank. 40 47 ASCIIZ phone number. At least one digit or M is required. 87 var ASCIIZ variable fields var var Array of 2-byte record IDs of groups that this person belongs to. Group records look like this: Ofs Len Description 0 2 Record ID 2 2 Number of members in the group 4 2 Number of bytes the record occupies 6 1 Record type. This is 2 for a group record. 7 1 File transfer capability: 0 - At least one member doesn't have file transfer capability. 1 - All members have file transfer capability. 2-127 Reserved 8 32 ASCIIZ name. Must not be blank. 40 47 reserved - must be zeros. 87 var Array of 2-byte record IDs of the members in the group. The first four fields of both record types are basically the same, so a 40- byte record header can be read in from any record. See Also PCX Format Error Codes |
|