Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 12040) +++ trunk/src/buffer.c (revision 12041) @@ -497,8 +497,8 @@ PCB_ENDALL_LOOP; /* swap silkscreen layers */ - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, &SLayer, 1); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, &CLayer, 1); + pcb_layer_list(pcb, PCB_LYT_BOTTOM | PCB_LYT_SILK, &SLayer, 1); + pcb_layer_list(pcb, PCB_LYT_TOP | PCB_LYT_SILK, &CLayer, 1); assert(SLayer != -1); assert(CLayer != -1); swap = Buffer->Data->Layer[SLayer]; Index: trunk/src/draw_ly_spec.c =================================================================== --- trunk/src/draw_ly_spec.c (revision 12040) +++ trunk/src/draw_ly_spec.c (revision 12041) @@ -127,7 +127,7 @@ pcb_layergrp_id_t gid = -1; comp_ctx_t cctx; - if (pcb_layer_list(PCB_LYT_SILK | lyt_side, &lid, 1) == 0) + if (pcb_layer_list(PCB, PCB_LYT_SILK | lyt_side, &lid, 1) == 0) return; pcb_layergrp_list(PCB, PCB_LYT_SILK | lyt_side, &gid, 1); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 12040) +++ trunk/src/gui_act.c (revision 12041) @@ -1702,7 +1702,7 @@ if (pcb_strcasecmp(argv[0], "silk") == 0) { PCB->RatDraw = 0; - if (pcb_layer_list(PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) + if (pcb_layer_list(PCB, PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) pcb_layervis_change_group_vis(lid, 1, 1); else pcb_message(PCB_MSG_ERROR, "Can't find this-side silk layer\n"); @@ -1762,7 +1762,7 @@ return 0; } else if (pcb_strcasecmp(argv[0], "silk") == 0) { - if (pcb_layer_list(PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) + if (pcb_layer_list(PCB, PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) pcb_layervis_change_group_vis(lid, -1, 0); else pcb_message(PCB_MSG_ERROR, "Can't find this-side silk layer\n"); Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 12040) +++ trunk/src/layer.c (revision 12041) @@ -255,7 +255,7 @@ } -int pcb_layer_list(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len) +int pcb_layer_list(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len) { int n, used = 0; pcb_virt_layer_t *v; @@ -265,7 +265,7 @@ APPEND_VIRT(v); for (n = 0; n < PCB_MAX_LAYER; n++) - if ((pcb_layer_flags(PCB, n) & mask) == mask) + if ((pcb_layer_flags(pcb, n) & mask) == mask) APPEND(n); if (mask == PCB_LYT_UI) @@ -275,7 +275,7 @@ return used; } -int pcb_layer_list_any(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len) +int pcb_layer_list_any(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len) { int n, used = 0; pcb_virt_layer_t *v; @@ -285,7 +285,7 @@ APPEND_VIRT(v); for (n = 0; n < PCB_MAX_LAYER; n++) - if ((pcb_layer_flags(PCB, n) & mask)) + if ((pcb_layer_flags(pcb, n) & mask)) APPEND(n); if (mask & PCB_LYT_UI) Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 12040) +++ trunk/src/layer.h (revision 12041) @@ -220,8 +220,8 @@ The plain version require exact match (look for a specific layer), the _any version allows partial match so work with PCB_LYT_ANY*. */ -int pcb_layer_list(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); -int pcb_layer_list_any(pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); +int pcb_layer_list(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); +int pcb_layer_list_any(pcb_board_t *pcb, pcb_layer_type_t mask, pcb_layer_id_t *res, int res_len); /**** layer creation (for load/import code) ****/ Index: trunk/src/layer_vis.c =================================================================== --- trunk/src/layer_vis.c (revision 12040) +++ trunk/src/layer_vis.c (revision 12041) @@ -150,7 +150,7 @@ PCB->RatOn = pcb_true; /* Bring the top copper group to the front and make it active. */ - if (pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, &comp, 1) > 0) + if (pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, &comp, 1) > 0) pcb_layervis_change_group_vis(comp, 1, 1); } Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 12040) +++ trunk/src/obj_line_drcenf.c (revision 12041) @@ -297,7 +297,7 @@ info.solder = pcb_true; else { info.solder = pcb_false; - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, &comp, 1); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, &comp, 1); } temp = length; /* assume the worst */ @@ -452,7 +452,7 @@ info.solder = pcb_true; else { info.solder = pcb_false; - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, &comp, 1); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, &comp, 1); } /* search for intersection */ Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 12040) +++ trunk/src_plugins/diag/diag.c (revision 12041) @@ -160,7 +160,7 @@ printf("Max: theoretical=%d current_board=%d\n", PCB_MAX_LAYER+2, pcb_max_layer); - used = pcb_layer_list_any(PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0])); + used = pcb_layer_list_any(PCB, PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0])); for(n = 0; n < used; n++) { pcb_layer_id_t layer_id = arr[n]; pcb_layergrp_id_t grp = pcb_layer_get_group(PCB, layer_id); @@ -168,7 +168,7 @@ } /* query by logical layer: any bottom copper */ - used = pcb_layer_list(PCB_LYT_COPPER | PCB_LYT_BOTTOM, arr, sizeof(arr)/sizeof(arr[0])); + used = pcb_layer_list(PCB, PCB_LYT_COPPER | PCB_LYT_BOTTOM, arr, sizeof(arr)/sizeof(arr[0])); printf("All %d bottom copper layers are:\n", used); for(n = 0; n < used; n++) { pcb_layer_id_t layer_id = arr[n]; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 12040) +++ trunk/src_plugins/export_ps/ps.c (revision 12041) @@ -642,7 +642,7 @@ } lid = -1; - pcb_layer_list(PCB_LYT_OUTLINE, &lid, 1); + pcb_layer_list(PCB, PCB_LYT_OUTLINE, &lid, 1); if (lid >= 0) global.outline_layer = pcb_get_layer(lid); else Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c (revision 12040) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/layers.c (revision 12041) @@ -84,7 +84,7 @@ layer_id_t layer_list(multiple layer_type_t flags, int idx) { pcb_layer_id_t ids[LAYER_SEARCH_MAX]; - int len = pcb_layer_list(flags, ids, LAYER_SEARCH_MAX); + int len = pcb_layer_list(PCB, flags, ids, LAYER_SEARCH_MAX); if (idx < 0) return len; if (idx >= len) @@ -95,7 +95,7 @@ layer_id_t layer_list_any(multiple layer_type_t flags, int idx) { pcb_layer_id_t ids[LAYER_SEARCH_MAX]; - int len = pcb_layer_list_any(flags, ids, LAYER_SEARCH_MAX); + int len = pcb_layer_list_any(PCB, flags, ids, LAYER_SEARCH_MAX); if (idx < 0) return len; if (idx >= len) Index: trunk/src_plugins/hid_lesstif/dlg_preview.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_preview.c (revision 12040) +++ trunk/src_plugins/hid_lesstif/dlg_preview.c (revision 12041) @@ -285,7 +285,7 @@ pcb_layer_id_t lid; if (layergrp_edit != NULL) return; - if (pcb_layer_list(PCB_LYT_CSECT, &lid, 1) > 0) { + if (pcb_layer_list(PCB, PCB_LYT_CSECT, &lid, 1) > 0) { layergrp_edit = lesstif_show_layer(lid, "Layer groups", 0); layergrp_edit->mouse_ev = pcb_stub_draw_csect_mouse_ev; layergrp_edit->pre_close = layergrp_pre_close; @@ -309,7 +309,7 @@ pcb_layer_id_t lid; if (fontsel_glob != NULL) return; - if (pcb_layer_list(PCB_LYT_DIALOG, &lid, 1) > 0) { + if (pcb_layer_list(PCB, PCB_LYT_DIALOG, &lid, 1) > 0) { fontsel_glob = lesstif_show_layer(lid, "Pen font selection", 0); fontsel_glob->ctx.dialog_draw = pcb_stub_draw_fontsel; fontsel_glob->mouse_ev = pcb_stub_draw_fontsel_mouse_ev; @@ -335,7 +335,7 @@ pcb_layer_t *old_layer; int old_type; - if (pcb_layer_list(PCB_LYT_DIALOG, &lid, 1) <= 0) + if (pcb_layer_list(PCB, PCB_LYT_DIALOG, &lid, 1) <= 0) return; old_txt = *pcb_stub_draw_fontsel_text_obj; Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 12040) +++ trunk/src_plugins/hid_remote/remote.c (revision 12041) @@ -72,7 +72,7 @@ pcb_remote_new_layer_group(pcb_layergrp_name(PCB, gid), gid, pcb_layergrp_flags(PCB, gid)); } - used = pcb_layer_list_any(PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0])); + used = pcb_layer_list_any(PCB, PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, arr, sizeof(arr)/sizeof(arr[0])); #warning layer TODO: remove this temporary hack for virtual layers for(n = 0; n < used; n++) { Index: trunk/src_plugins/io_autotrax/read.c =================================================================== --- trunk/src_plugins/io_autotrax/read.c (revision 12040) +++ trunk/src_plugins/io_autotrax/read.c (revision 12041) @@ -718,7 +718,7 @@ static pcb_layer_id_t autotrax_reg_layer(read_state_t *st, const char *autotrax_layer, unsigned int mask) { pcb_layer_id_t id; - if (pcb_layer_list(mask, &id, 1) != 1) { + if (pcb_layer_list(st->pcb, mask, &id, 1) != 1) { pcb_layergrp_id_t gid; pcb_layergrp_list(st->pcb, mask, &gid, 1); id = pcb_layer_create(st->pcb, gid, autotrax_layer); @@ -741,7 +741,7 @@ st->protel_to_stackup[1] = autotrax_reg_layer(st, "top copper", PCB_LYT_COPPER | PCB_LYT_TOP); st->protel_to_stackup[6] = autotrax_reg_layer(st, "bottom copper", PCB_LYT_COPPER | PCB_LYT_BOTTOM); - if (pcb_layer_list(PCB_LYT_SILK | PCB_LYT_TOP, &id, 1) == 1) { + if (pcb_layer_list(st->pcb, PCB_LYT_SILK | PCB_LYT_TOP, &id, 1) == 1) { pcb_layergrp_id_t gid; pcb_layergrp_list(st->pcb, PCB_LYT_SILK | PCB_LYT_TOP, &gid, 1); st->protel_to_stackup[11] = pcb_layer_create(st->pcb, gid, "Board"); /* != outline, cutouts */ Index: trunk/src_plugins/io_autotrax/write.c =================================================================== --- trunk/src_plugins/io_autotrax/write.c (revision 12040) +++ trunk/src_plugins/io_autotrax/write.c (revision 12041) @@ -265,19 +265,19 @@ current_group = 0; /* figure out which pcb layers are bottom copper and make a list */ - bottom_count = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); + bottom_count = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); if (bottom_count > 0 ) { bottomLayers = malloc(sizeof(pcb_layer_id_t) * bottom_count); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottom_count); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottom_count); } else { bottomLayers = NULL; } /* figure out which pcb layers are internal copper layers and make a list */ - inner_count = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); + inner_count = pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); if (inner_count > 0 ) { innerLayers = malloc(sizeof(pcb_layer_id_t) * inner_count); - pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, inner_count); + pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, inner_count); } else { innerLayers = NULL; } @@ -288,37 +288,37 @@ } /* figure out which pcb layers are top copper and make a list */ - top_count = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); + top_count = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); if (top_count > 0 ) { topLayers = malloc(sizeof(pcb_layer_id_t) * top_count); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, top_count); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, top_count); } else { topLayers = NULL; } /* figure out which pcb layers are bottom silk and make a list */ - bottom_silk_count = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); + bottom_silk_count = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); if (bottom_silk_count > 0 ) { bottomSilk = malloc(sizeof(pcb_layer_id_t) * bottom_silk_count); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottom_silk_count); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottom_silk_count); } else { bottomSilk = NULL; } /* figure out which pcb layers are top silk and make a list */ - top_silk_count = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); + top_silk_count = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); if (top_silk_count > 0) { topSilk = malloc(sizeof(pcb_layer_id_t) * top_silk_count); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, top_silk_count); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, topSilk, top_silk_count); } else { topSilk = NULL; } /* figure out which pcb layers are outlines and make a list */ - outline_count = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0); + outline_count = pcb_layer_list(PCB, PCB_LYT_OUTLINE, NULL, 0); if (outline_count > 0) { outlineLayers = malloc(sizeof(pcb_layer_id_t) * outline_count); - pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outline_count); + pcb_layer_list(PCB, PCB_LYT_OUTLINE, outlineLayers, outline_count); } else { outlineLayers = NULL; } Index: trunk/src_plugins/io_eagle/read.c =================================================================== --- trunk/src_plugins/io_eagle/read.c (revision 12040) +++ trunk/src_plugins/io_eagle/read.c (revision 12041) @@ -342,7 +342,7 @@ } if (typ != 0) { if (reuse) - pcb_layer_list(typ, &ly->ly, 1); + pcb_layer_list(st->pcb, typ, &ly->ly, 1); if ((ly->ly < 0) && (pcb_layergrp_list(st->pcb, typ, &gid, 1) > 0)) ly->ly = pcb_layer_create(st->pcb, gid, ly->name); } Index: trunk/src_plugins/io_hyp/parser.c =================================================================== --- trunk/src_plugins/io_hyp/parser.c (revision 12040) +++ trunk/src_plugins/io_hyp/parser.c (revision 12041) @@ -1270,13 +1270,13 @@ #endif /* get list of copper layer id's */ - layer_count = pcb_layer_list(PCB_LYT_COPPER, NULL, 0); + layer_count = pcb_layer_list(PCB, PCB_LYT_COPPER, NULL, 0); if (layer_count <= 0) return; layer_array = malloc(sizeof(pcb_layer_id_t) * layer_count); if (layer_array == NULL) return; - layer_count = pcb_layer_list(PCB_LYT_COPPER, layer_array, layer_count); + layer_count = pcb_layer_list(PCB, PCB_LYT_COPPER, layer_array, layer_count); /* loop over all layers */ for (l = 0; l < layer_count; l++) { Index: trunk/src_plugins/io_hyp/write.c =================================================================== --- trunk/src_plugins/io_hyp/write.c (revision 12040) +++ trunk/src_plugins/io_hyp/write.c (revision 12041) @@ -224,7 +224,7 @@ fprintf(wr->f, "{BOARD\n"); - if (pcb_layer_list(PCB_LYT_OUTLINE, &lid, 1) != 1) { + if (pcb_layer_list(PCB, PCB_LYT_OUTLINE, &lid, 1) != 1) { /* implicit outline */ fprintf(wr->f, "* implicit outline derived from board width and height\n"); write_pr_line(wr, 0, 0, PCB->MaxWidth, 0); Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 12040) +++ trunk/src_plugins/io_kicad/read.c (revision 12041) @@ -997,7 +997,7 @@ static unsigned int kicad_reg_layer(read_state_t *st, const char *kicad_name, unsigned int mask) { pcb_layer_id_t id; - if (pcb_layer_list(mask, &id, 1) != 1) { + if (pcb_layer_list(st->pcb, mask, &id, 1) != 1) { pcb_layergrp_id_t gid; pcb_layergrp_list(PCB, mask, &gid, 1); id = pcb_layer_create(st->pcb, gid, kicad_name); Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 12040) +++ trunk/src_plugins/io_kicad/write.c (revision 12041) @@ -203,55 +203,55 @@ currentGroup = 0; /* figure out which pcb layers are bottom copper and make a list */ - bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); + bottomCount = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); if (bottomCount > 0 ) { bottomLayers = malloc(sizeof(pcb_layer_id_t) * bottomCount); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount); } else { bottomLayers = NULL; } /* figure out which pcb layers are internal copper layers and make a list */ - innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); + innerCount = pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); if (innerCount > 0 ) { innerLayers = malloc(sizeof(pcb_layer_id_t) * innerCount); - pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount); + pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount); } else { innerLayers = NULL; } /* figure out which pcb layers are top copper and make a list */ - topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); + topCount = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); if (topCount > 0 ) { topLayers = malloc(sizeof(pcb_layer_id_t) * topCount); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount); } else { topLayers = NULL; } /* figure out which pcb layers are bottom silk and make a list */ - bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); + bottomSilkCount = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); if (bottomSilkCount > 0 ) { bottomSilk = malloc(sizeof(pcb_layer_id_t) * bottomSilkCount); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount); } else { bottomSilk = NULL; } /* figure out which pcb layers are top silk and make a list */ - topSilkCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); + topSilkCount = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); if (topSilkCount > 0) { topSilk = malloc(sizeof(pcb_layer_id_t) * topSilkCount); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount); } else { topSilk = NULL; } /* figure out which pcb layers are outlines and make a list */ - outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0); + outlineCount = pcb_layer_list(PCB, PCB_LYT_OUTLINE, NULL, 0); if (outlineCount > 0) { outlineLayers = malloc(sizeof(pcb_layer_id_t) * outlineCount); - pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount); + pcb_layer_list(PCB, PCB_LYT_OUTLINE, outlineLayers, outlineCount); } else { outlineLayers = NULL; } Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 12040) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 12041) @@ -214,55 +214,55 @@ currentGroup = 0; /* figure out which pcb layers are bottom copper and make a list */ - bottomCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); + bottomCount = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, NULL, 0); if (bottomCount > 0 ) { bottomLayers = malloc(sizeof(pcb_layer_id_t) * bottomCount); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_COPPER, bottomLayers, bottomCount); } else { bottomLayers = NULL; } /* figure out which pcb layers are internal copper layers and make a list */ - innerCount = pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); + innerCount = pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, NULL, 0); if (innerCount > 0 ) { innerLayers = malloc(sizeof(pcb_layer_id_t) * innerCount); - pcb_layer_list(PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount); + pcb_layer_list(PCB, PCB_LYT_INTERN | PCB_LYT_COPPER, innerLayers, innerCount); } else { innerLayers = NULL; } /* figure out which pcb layers are top copper and make a list */ - topCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); + topCount = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, NULL, 0); if (topCount > 0 ) { topLayers = malloc(sizeof(pcb_layer_id_t) * topCount); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, topLayers, topCount); } else { topLayers = NULL; } /* figure out which pcb layers are bottom silk and make a list */ - bottomSilkCount = pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); + bottomSilkCount = pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, NULL, 0); if (bottomSilkCount > 0 ) { bottomSilk = malloc(sizeof(pcb_layer_id_t) * bottomSilkCount); - pcb_layer_list(PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount); + pcb_layer_list(PCB, PCB_LYT_BOTTOM | PCB_LYT_SILK, bottomSilk, bottomSilkCount); } else { bottomSilk = NULL; } /* figure out which pcb layers are top silk and make a list */ - topSilkCount = pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); + topSilkCount = pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, NULL, 0); if (topSilkCount > 0) { topSilk = malloc(sizeof(pcb_layer_id_t) * topSilkCount); - pcb_layer_list(PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount); + pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_SILK, topSilk, topSilkCount); } else { topSilk = NULL; } /* figure out which pcb layers are outlines and make a list */ - outlineCount = pcb_layer_list(PCB_LYT_OUTLINE, NULL, 0); + outlineCount = pcb_layer_list(PCB, PCB_LYT_OUTLINE, NULL, 0); if (outlineCount > 0) { outlineLayers = malloc(sizeof(pcb_layer_id_t) * outlineCount); - pcb_layer_list(PCB_LYT_OUTLINE, outlineLayers, outlineCount); + pcb_layer_list(PCB, PCB_LYT_OUTLINE, outlineLayers, outlineCount); } else { outlineLayers = NULL; } Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 12040) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 12041) @@ -588,7 +588,7 @@ GtkWidget *pcb_gtk_preview_dialog_new(pcb_gtk_common_t *com, pcb_gtk_init_drawing_widget_t init_widget, pcb_gtk_preview_expose_t expose, hid_dialog_draw_t dialog_draw) { pcb_layer_id_t lid; - if (pcb_layer_list(PCB_LYT_DIALOG, &lid, 1) > 0) + if (pcb_layer_list(PCB, PCB_LYT_DIALOG, &lid, 1) > 0) return pcb_gtk_preview_generic_new(com, init_widget, expose, lid, dialog_draw); else return NULL; Index: trunk/src_plugins/lib_gtk_config/gui-config.c =================================================================== --- trunk/src_plugins/lib_gtk_config/gui-config.c (revision 12040) +++ trunk/src_plugins/lib_gtk_config/gui-config.c (revision 12041) @@ -1377,7 +1377,7 @@ /* -- Layer stack tab */ vbox = ghid_notebook_page(tabs, _("Physical layer stack"), 0, 6); - if (pcb_layer_list(PCB_LYT_CSECT, &lid, 1) > 0) { + if (pcb_layer_list(PCB, PCB_LYT_CSECT, &lid, 1) > 0) { pcb_gtk_preview_t *p; prv = pcb_gtk_preview_layer_new(com, com->init_drawing_widget, com->preview_expose, lid); gtk_box_pack_start(GTK_BOX(vbox), prv, TRUE, TRUE, 0); Index: trunk/src_plugins/lib_polyhelp/topoly.c =================================================================== --- trunk/src_plugins/lib_polyhelp/topoly.c (revision 12040) +++ trunk/src_plugins/lib_polyhelp/topoly.c (revision 12041) @@ -284,7 +284,7 @@ pcb_coord_t x, y; double bestd = (double)pcb->MaxHeight*(double)pcb->MaxHeight + (double)pcb->MaxWidth*(double)pcb->MaxWidth; - if (pcb_layer_list(PCB_LYT_OUTLINE, &lid, 1) != 1) + if (pcb_layer_list(pcb, PCB_LYT_OUTLINE, &lid, 1) != 1) return NULL; layer = pcb_get_layer(lid); Index: trunk/src_plugins/query/query_access.c =================================================================== --- trunk/src_plugins/query/query_access.c (revision 12040) +++ trunk/src_plugins/query/query_access.c (revision 12041) @@ -265,7 +265,7 @@ pcb_layer_id_t id; const char *s1; - if (pcb_layer_list(mask, &id, 1) != 1) + if (pcb_layer_list(PCB, mask, &id, 1) != 1) PCB_QRY_RET_INV(res); fld2str_req(s1, fld, 0);