Go to the first, previous, next, last section, table of contents.


Annotator Information Structures

The aiarray argument for annopen and dbinit is a pointer to an array of objects of type DB_Anninfo. Each member of the array contains information provided to annopen and dbinit about an annotation file associated with the record:

char *name
the annotator name. The name `atruth' is reserved for a reference annotation file supplied by the creator of the database record to document its contents as accurately and thoroughly as possible. You may use other annotator names to identify annotation files that you create; unless there are compelling reasons not to do so, follow the convention that the annotator name is the name of the file's creator (a program or a person). To avoid confusion, do not use `dat', `datan', `dn', or `header' (all of which are commonly used as parts of DB file names) as annotator names. The special name `-' refers to the standard input or output. Other annotator names may contain upper- or lower-case letters, digits, and underscores. Annotation files are normally created in the current directory and found in any of the directories in the database path (see section The Database Path). Under UNIX, it is possible to create or find annotation files in any accessible directory by specifying annotator names that begin with absolute or relative directory pathnames (note that such prefixes are exempt from the restriction on legal characters in annotator names). Under MS-DOS, this is not possible; furthermore, note that the only the first three characters of the annotator name are used to construct the MS-DOS file name, so be careful to keep annotator names distinct from each other and from commonly used MS-DOS file name "extensions".
int stat
the file type/access code. Usually, stat is either READ or WRITE, to specify standard ("MIT format") annotation files to be read by getann or to be written by putann. Both MIT DB and AHA DB annotation files are kept on-line in MIT format. The symbols READ and WRITE are defined in `<ecg/db.h>'. An AHA-format annotation file can be read by getann or written by putann if the stat field is set to AHA_READ or AHA_WRITE before calling annopen or dbinit (see section Example 2: An Annotation Translator). Other formats may be supported via a similar mechanism; consult `<ecg/db.h>' for more information.

The number of DB_Anninfo objects in aiarray is given by the nann argument of annopen and dbinit. The annotation-reading function, getann, knows the annotators by number only; annopen and dbinit assign input annotator numbers beginning with 0 in the order in which they are given in the array of DB_Anninfo objects. Output annotator numbers used by putann also start at 0; note that input annotator 0 and output annotator 0 are distinct. Annotator numbers are supplied to getann and putann in their first arguments. There may be no more than DB_MAXANN (defined in `<ecg/db.h>') input annotators and DB_MAXANN output annotators open at once. See section annopen, for an example of how to set the contents of an array of DB_Anninfo objects.


Go to the first, previous, next, last section, table of contents.



George B. Moody (george@hstbme.mit.edu)