Index: trunk/src_plugins/lib_netmap/map_2nets.c =================================================================== --- trunk/src_plugins/lib_netmap/map_2nets.c (revision 34950) +++ trunk/src_plugins/lib_netmap/map_2nets.c (revision 34951) @@ -54,7 +54,9 @@ if (seg == NULL) return; - ns = malloc(sizeof(pcb_2netmap_iseg_t)); + ns = calloc(sizeof(pcb_2netmap_iseg_t), 1); + ns->next = map->isegs; + map->isegs = ns; ns->seg = seg; ns->net = NULL; @@ -98,6 +100,21 @@ list_obj(ctx, pcb, NULL, (pcb_any_obj_t *)ps); } +static pcb_2netmap_oseg_t *oseg_new(pcb_2netmap_t *map, pcb_net_t *net) +{ + pcb_2netmap_oseg_t *os; + os = calloc(sizeof(pcb_2netmap_iseg_t), 1); + os->next = map->isegs; + map->isegs = os; + os->net = net; + return os; +} + +static void map_segs(pcb_2netmap_t *map) +{ + +} + int pcb_map_2nets_init(pcb_2netmap_t *map, pcb_board_t *pcb, pcb_2netmap_control_t how) { pcb_qry_exec_t ec; @@ -122,6 +139,7 @@ /* the result is really a graph because of junctions; search random paths from terminal to terminal (junctions resolved into overlaps) */ + map_segs(map); pcb_qry_uninit(&ec); Index: trunk/src_plugins/lib_netmap/map_2nets.h =================================================================== --- trunk/src_plugins/lib_netmap/map_2nets.h (revision 34950) +++ trunk/src_plugins/lib_netmap/map_2nets.h (revision 34951) @@ -34,12 +34,14 @@ PCB_2NETMAPCTRL_RATS = 1 /* include rat lines */ } pcb_2netmap_control_t; -typedef struct pcb_2netmap_iseg_s { +typedef struct pcb_2netmap_iseg_s pcb_2netmap_iseg_t; +struct pcb_2netmap_iseg_s { pcb_qry_netseg_len_t *seg; pcb_net_t *net; unsigned shorted:1; /* set if the segment connects two different nets */ unsigned used:1; /* already part of an output segment */ -} pcb_2netmap_iseg_t; + pcb_2netmap_iseg_t *next; +}; typedef union pcb_2netmap_obj_s { pcb_arc_t arc; @@ -46,17 +48,21 @@ pcb_line_t line; } pcb_2netmap_obj_t; -typedef struct pcb_2netmap_oseg_s { +typedef struct pcb_2netmap_oseg_s pcb_2netmap_oseg_t; +struct pcb_2netmap_oseg_s { vtp0_t *objs; /* of pcb_2netmap_obj_t ; these are not real board objects, they are just copies for the fields */ pcb_net_t *net; unsigned shorted:1; /* set if the segment connects two different nets */ -} pcb_2netmap_oseg_t; + pcb_2netmap_oseg_t *next; +}; typedef struct pcb_2netmap_s { pcb_2netmap_control_t ctrl; - htpp_t o2n; /* of (pcb_2netmap_iseg_t *); tells the net for an object */ + pcb_2netmap_iseg_t *osegs; /* output: head of a singly linked list */ /* internal */ + htpp_t o2n; /* of (pcb_2netmap_iseg_t *); tells the net for an object */ + pcb_2netmap_iseg_t *isegs; /* head of a singly linked list */ pcb_qry_exec_t *ec; } pcb_2netmap_t;