1 /**@(#)
2 */
3 #include <stdio.h>
4 #include <tina/sys.h>
5 #include <tina/sysfuncs.h>
6 #include <tina/math.h>
7 #include <tina/vision.h>
8 #include <tina/visionfuncs.h>
9
10 void ffg_write_file_fp(FILE * fp, List * list)
11 {
12 int count;
13 List *lptr;
14 List *gptr;
15
16 for (count = 0, lptr = list; lptr != NULL; lptr = lptr->next)
17 count++;
18
19 (void) fprintf(fp, "%d\n", count);
20
21 for (lptr = list; lptr != NULL; lptr = lptr->next)
22 {
23 Match_cliche *m = (Match_cliche *) lptr->to;
24
25 if (m->focus == NULL || m->group == NULL)
26 continue;
27
28 (void) fprintf(fp, "%d ", geom_label_get(m->focus->to, m->focus->type));
29 for (count = 0, gptr = m->group; gptr != NULL; gptr = gptr->next)
30 count++;
31 (void) fprintf(fp, "%d ", count);
32 for (gptr = m->group; gptr != NULL; gptr = gptr->next)
33 (void) fprintf(fp, "%d ", geom_label_get(gptr->to, gptr->type));
34 (void) fprintf(fp, "\n");
35 }
36 }
37
38 void ffg_write_file(char *pathname, List * list)
39
40 /* Match_cliche list */
41 {
42 char temps[256];
43 FILE *fp;
44
45 if ((fp = fopen(pathname, "w")) == NULL)
46 {
47 (void) string_append(temps, "can not open file ", pathname, 0);
48 error(temps, non_fatal);
49 return;
50 }
51 ffg_write_file_fp(fp, list);
52 (void) fclose(fp);
53 }
54
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.