This program translates the `atruth' annotations for the record named in its argument into an AHA-format annotation file with the annotator name `aha'.
1 #include <stdio.h>
2 #include <ecg/db.h>
3
4 main(argc, argv)
5 int argc;
6 char *argv[];
7 {
8 DB_Anninfo an[2];
9 DB_Annotation annot;
10
11 if (argc < 2) {
12 fprintf(stderr, "usage: %s record\n", argv[0]);
13 exit(1);
14 }
15 an[0].name = "atruth"; an[0].stat = READ;
16 an[1].name = "aha"; an[1].stat = AHA_WRITE;
17 if (annopen(argv[1], an, 2) < 0) exit(2);
18 while (getann(0, &annot) == 0 && putann(0, &annot) == 0)
19 ;
20 dbquit();
21 exit(0);
22 }
Notes:
argv[0] is the name by
which the program was invoked.
annopen.
getann and putann. The loop ends normally
when getann reaches the end of the input file, or prematurely if
there is a read or write error.
Go to the first, previous, next, last section, table of contents.