|
|
#include <sys/str.h>
Each template file begins with the createbin magic string.
#define fvalid 'RC' /* file valid */
The template file starts with the following structure:
struct StrHdrType { ushort_t Id; /* file valid */ ushort_t TableSz; /* size of table of names */ ushort_t StrRelease; ushort_t StrVersion; ulong_t FinalLfa; /* end of file used by addbin */ };
Following FinalLfa is a series of null terminated names and a long pointer into the file where this structure template starts.
Offset +0 +1 +2 +3 | __________________| 0 | RC | file valid entry | __________________| 2 | 800 | TableSz | __________________| 4 | 4 | strversion | __________________| 6 | 1 | strrelease | __________________| 8 | 82E | FinalLfa | __________________| C | c | r | e | d | | ___|____|____|____| 10 | \0| \0| \0| \0| Offset to template 11-14 | ___|____|____|____| 14 | /0| /0| /0| \0| | ___|____|____|____|
Each structure template starts with a headerType structure.
struct HeaderType { uchar_t StringSz; /* length of the longest string */ ushort_t TableSz; /* Size of the structure */ };
After the header information is an entry for each structure element as follows:
Element name terminated by a null. Element type a byte that indicates the element type. An optional short for the size of arrays. Element offset a short that contains the offset from the beginning of the structure to this element. NOTE: Element type bit 7 if on indicates that the element type is an array. Element type bit 6 indicates that the element is a bit structure. See sys/str.h for element type defines.