1 #include <grass/gis.h> 2 #include <grass/segment.h> 3 #include "point.h" 4 5 insert(POINT ** pres_pt,int row,int col,int backrow,int backcol)6void insert(POINT ** pres_pt, int row, int col, int backrow, int backcol) 7 { 8 extern POINT *head_start_pt; 9 POINT *new_pt; 10 11 new_pt = (struct point *)G_malloc(sizeof(struct point)); 12 13 new_pt->row = row; 14 new_pt->col = col; 15 new_pt->backrow = backrow; 16 new_pt->backcol = backcol; 17 new_pt->next = NULL; 18 19 if (head_start_pt == NULL) { 20 head_start_pt = new_pt; 21 *pres_pt = head_start_pt; 22 } 23 else { 24 (*pres_pt)->next = new_pt; 25 *pres_pt = (*pres_pt)->next; 26 } 27 } 28