]> www.wagner.pp.ru Git - oss/fgis.git/blob - lib/dgt_iter.c
First checked in version
[oss/fgis.git] / lib / dgt_iter.c
1 #include "dgt.h"
2 void for_each_line(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream)
3 { reset_dgt(dgt);
4   while(!dgt_eof(dgt))
5   { if (dgt_is_line(dgt))
6      item_proc(dgt);
7     if (outstream) dgt_put(outstream,dgt->buffer);
8     dgt_next(dgt);
9   }
10 }
11 void for_each_point(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream)
12 { reset_dgt(dgt);
13   while(!dgt_eof(dgt))
14   { if (dgt_is_point(dgt))
15      item_proc(dgt);
16     if (outstream) dgt_put(outstream,dgt->buffer);
17     dgt_next(dgt);
18   }
19 }
20 void for_each_item(DGT *dgt,void (*item_proc)(DGT *dgt))
21 { reset_dgt(dgt);
22   while(!dgt_eof(dgt))
23   { 
24      item_proc(dgt);
25     dgt_next(dgt);
26   }
27 }