Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 7735) +++ trunk/src/layer.c (revision 7736) @@ -713,7 +713,7 @@ if (pcb_gui->set_layer_group != NULL) { pcb_layergrp_id_t grp; pcb_layer_id_t lid = v->new_id; - grp = pcb_layer_lookup_group(lid); + grp = pcb_layer_get_group(PCB, lid); return pcb_gui->set_layer_group(grp, lid, v->type, is_empty); } Index: trunk/src/layer_grp.c =================================================================== --- trunk/src/layer_grp.c (revision 7735) +++ trunk/src/layer_grp.c (revision 7736) @@ -522,13 +522,6 @@ return used; } -pcb_layergrp_id_t pcb_layer_lookup_group(pcb_layer_id_t layer_id) -{ - if ((layer_id < 0) || (layer_id > pcb_max_layer)) - return -1; - return PCB->Data->Layer[layer_id].grp; -} - int pcb_layer_add_in_group_(pcb_board_t *pcb, pcb_layer_group_t *grp, pcb_layergrp_id_t group_id, pcb_layer_id_t layer_id) { if ((layer_id < 0) || (layer_id >= pcb_max_layer)) Index: trunk/src/layer_grp.h =================================================================== --- trunk/src/layer_grp.h (revision 7735) +++ trunk/src/layer_grp.h (revision 7736) @@ -79,9 +79,6 @@ int pcb_layer_group_list(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len); int pcb_layer_group_list_any(pcb_layer_type_t mask, pcb_layergrp_id_t *res, int res_len); -/* Looks up which group a layer is in. Returns group ID. */ -pcb_layergrp_id_t pcb_layer_lookup_group(pcb_layer_id_t layer_id); - /* Put a layer in a group (the layer should not be in any other group); returns 0 on success */ int pcb_layer_add_in_group(pcb_board_t *pcb, pcb_layer_id_t layer_id, pcb_layergrp_id_t group_id); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 7735) +++ trunk/src_plugins/export_gerber/gerber.c (revision 7736) @@ -436,7 +436,7 @@ suff = "oln"; else { static char buf[20]; - pcb_layergrp_id_t group = pcb_layer_lookup_group(lid); + pcb_layergrp_id_t group = pcb_layer_get_group(PCB, lid); sprintf(buf, "ly%ld", group); suff = buf; } @@ -481,7 +481,7 @@ suff = "gm1"; else { static char buf[20]; - pcb_layergrp_id_t group = pcb_layer_lookup_group(lid); + pcb_layergrp_id_t group = pcb_layer_get_group(PCB, lid); sprintf(buf, "g%ld", group); suff = buf; } Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 7735) +++ trunk/src_plugins/io_kicad/write.c (revision 7736) @@ -293,12 +293,12 @@ /* we now proceed to write the internal copper text to the kicad file, layer by layer */ if (innerCount != 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper text, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -345,12 +345,12 @@ /* we now proceed to write the internal copper tracks to the kicad file, layer by layer */ if (innerCount != 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper tracks, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -430,12 +430,12 @@ /* we now proceed to write the internal copper polygons to the kicad file, layer by layer */ if (innerCount != 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper polygons, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 7735) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 7736) @@ -327,12 +327,12 @@ /* we now proceed to write the internal copper text to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper text, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -379,12 +379,12 @@ /* we now proceed to write the internal copper tracks to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper tracks, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -429,12 +429,12 @@ /* we now proceed to write the internal copper polygons to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper polygons, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 7735) +++ trunk/src_plugins/io_lihata/write.c (revision 7736) @@ -542,7 +542,7 @@ } for(n = 0; n < pcb_max_layer; n++) { - int gid = pcb_layer_lookup_group(n); + int gid = pcb_layer_get_group(PCB, n); if (v1_layers) { if (gid >= 0) { if (gid < sizeof(grp) / sizeof(grp[0]))