Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 7734) +++ trunk/src/draw.c (revision 7735) @@ -194,7 +194,7 @@ for (ngroups = 0, i = 0; i < pcb_max_layer; i++) { pcb_layer_t *l = LAYER_ON_STACK(i); pcb_layergrp_id_t group = pcb_layer_get_group(PCB, pcb_layer_stack[i]); - unsigned int gflg = pcb_layergrp_flags(group); + unsigned int gflg = pcb_layergrp_flags(PCB, group); if (gflg & PCB_LYT_SILK) /* do not draw silk here, it'll be drawn separately */ continue; @@ -261,7 +261,7 @@ slk_len = pcb_layer_group_list(PCB_LYT_SILK, slk, sizeof(slk) / sizeof(slk[0])); for(i = 0; i < slk_len; i++) { if (pcb_layer_gui_set_glayer(slk[i], 0)) { - unsigned int loc = pcb_layergrp_flags(slk[i]); + unsigned int loc = pcb_layergrp_flags(PCB, slk[i]); DrawSilk(loc & PCB_LYT_ANYWHERE, drawn_area); pcb_gui->end_layer(); } @@ -341,7 +341,7 @@ static void DrawPPV(pcb_layergrp_id_t group, const pcb_box_t * drawn_area) { int side; - unsigned int gflg = pcb_layergrp_flags(group); + unsigned int gflg = pcb_layergrp_flags(PCB, group); if (PCB->PinOn || !pcb_gui->gui) { /* draw element pins */ @@ -532,7 +532,7 @@ pcb_layer_t *Layer; pcb_cardinal_t n_entries = PCB->LayerGroups.grp[group].len; pcb_layer_id_t *layers = PCB->LayerGroups.grp[group].lid; - unsigned int gflg = pcb_layergrp_flags(group); + unsigned int gflg = pcb_layergrp_flags(PCB, group); if (gflg & PCB_LYT_OUTLINE) rv = 0; Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 7734) +++ trunk/src/find_lookup.c (revision 7735) @@ -519,7 +519,7 @@ /* try all new pads */ /* handle the special pad layers */ - flg = pcb_layergrp_flags(group); + flg = pcb_layergrp_flags(PCB, group); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) layer = PCB_COMPONENT_SIDE; else continue; /* skip pads for this group */ @@ -926,7 +926,7 @@ } /* handle the special pad layers */ - flg = pcb_layergrp_flags(LayerGroup); + flg = pcb_layergrp_flags(PCB, LayerGroup); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) info.layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) info.layer = PCB_COMPONENT_SIDE; else return pcb_false; @@ -1049,7 +1049,7 @@ } /* handle the special pad layers */ - flg = pcb_layergrp_flags(LayerGroup); + flg = pcb_layergrp_flags(PCB, LayerGroup); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) info.layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) info.layer = PCB_COMPONENT_SIDE; else return pcb_false; @@ -1143,7 +1143,7 @@ } /* handle the special pad layers */ - flg = pcb_layergrp_flags(LayerGroup); + flg = pcb_layergrp_flags(PCB, LayerGroup); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) info.layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) info.layer = PCB_COMPONENT_SIDE; else return pcb_false; @@ -1323,7 +1323,7 @@ } /* handle the special pad layers */ - flg = pcb_layergrp_flags(LayerGroup); + flg = pcb_layergrp_flags(PCB, LayerGroup); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) info.layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) info.layer = PCB_COMPONENT_SIDE; else return retv; @@ -1444,7 +1444,7 @@ } /* handle the special pad layers */ - flg = pcb_layergrp_flags(LayerGroup); + flg = pcb_layergrp_flags(PCB, LayerGroup); if ((flg & PCB_LYT_BOTTOM) && (flg & PCB_LYT_COPPER)) info.layer = PCB_SOLDER_SIDE; else if ((flg & PCB_LYT_TOP) && (flg & PCB_LYT_COPPER)) info.layer = PCB_COMPONENT_SIDE; else return pcb_false; Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 7734) +++ trunk/src/layer.c (revision 7735) @@ -179,7 +179,7 @@ return 0; l = &PCB->Data->Layer[layer_idx]; - return pcb_layergrp_flags(l->grp); + return pcb_layergrp_flags(PCB, l->grp); } #define APPEND(n) \ Index: trunk/src/layer_grp.c =================================================================== --- trunk/src/layer_grp.c (revision 7734) +++ trunk/src/layer_grp.c (revision 7735) @@ -113,13 +113,13 @@ return gid; } -unsigned int pcb_layergrp_flags(pcb_layergrp_id_t gid) +unsigned int pcb_layergrp_flags(pcb_board_t *pcb, pcb_layergrp_id_t gid) { - if ((gid < 0) || (gid >= PCB->LayerGroups.len)) + if ((gid < 0) || (gid >= pcb->LayerGroups.len)) return 0; - return PCB->LayerGroups.grp[gid].type; + return pcb->LayerGroups.grp[gid].type; } const char *pcb_layergrp_name(pcb_layergrp_id_t gid) @@ -484,7 +484,7 @@ return 0; if (pcb_gui->set_layer_group != NULL) - return pcb_gui->set_layer_group(grp, PCB->LayerGroups.grp[grp].lid[0], pcb_layergrp_flags(grp), is_empty); + return pcb_gui->set_layer_group(grp, PCB->LayerGroups.grp[grp].lid[0], pcb_layergrp_flags(PCB, grp), is_empty); /* if the GUI doesn't have a set_layer, assume it wants to draw all layers */ return 1; @@ -506,7 +506,7 @@ { int group, used = 0; for (group = 0; group < pcb_max_group; group++) { - if ((pcb_layergrp_flags(group) & mask) == mask) + if ((pcb_layergrp_flags(PCB, group) & mask) == mask) APPEND(group); } return used; @@ -516,7 +516,7 @@ { int group, used = 0; for (group = 0; group < pcb_max_group; group++) { - if ((pcb_layergrp_flags(group) & mask)) + if ((pcb_layergrp_flags(PCB, group) & mask)) APPEND(group); } return used; Index: trunk/src/layer_grp.h =================================================================== --- trunk/src/layer_grp.h (revision 7734) +++ trunk/src/layer_grp.h (revision 7735) @@ -71,7 +71,7 @@ int pcb_layer_gui_set_glayer(pcb_layergrp_id_t grp, int is_empty); /* returns a bitfield of pcb_layer_type_t; returns 0 if layer_idx is invalid. */ -unsigned int pcb_layergrp_flags(pcb_layergrp_id_t group_idx); +unsigned int pcb_layergrp_flags(pcb_board_t *pcb, pcb_layergrp_id_t group_idx); const char *pcb_layergrp_name(pcb_layergrp_id_t gid); /* Same as pcb_layer_list but lists layer groups. A group is matching Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 7734) +++ trunk/src/obj_line_drcenf.c (revision 7735) @@ -287,7 +287,7 @@ } group = pcb_layer_get_group(PCB, INDEXOFCURRENT); comp = pcb_max_group + 10; /* this out-of-range group might save a call */ - if (pcb_layergrp_flags(group) & PCB_LYT_BOTTOM) + if (pcb_layergrp_flags(PCB, group) & PCB_LYT_BOTTOM) info.solder = pcb_true; else { info.solder = pcb_false; @@ -442,7 +442,7 @@ /* prepare for the intersection search */ group = pcb_layer_get_group(PCB, INDEXOFCURRENT); comp = pcb_max_group + 10; /* this out-of-range group might save a call */ - if (pcb_layergrp_flags(group) & PCB_LYT_BOTTOM) + if (pcb_layergrp_flags(PCB, group) & PCB_LYT_BOTTOM) info.solder = pcb_true; else { info.solder = pcb_false; Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 7734) +++ trunk/src/obj_text.c (revision 7735) @@ -672,7 +672,7 @@ pcb_gui->set_color(Output.fgGC, layer->Color); if (layer->grp >= 0) - flg = pcb_layergrp_flags(layer->grp); + flg = pcb_layergrp_flags(PCB, layer->grp); if (flg & PCB_LYT_SILK) min_silk_line = PCB->minSlk; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 7734) +++ trunk/src/polygon.c (revision 7735) @@ -1030,7 +1030,7 @@ return 0; group = pcb_layer_get_group_(Layer); - gflg = pcb_layergrp_flags(group); + gflg = pcb_layergrp_flags(PCB, group); info.solder = (gflg & PCB_LYT_BOTTOM); info.data = Data; info.other = here; Index: trunk/src_plugins/draw_csect/draw_csect.c =================================================================== --- trunk/src_plugins/draw_csect/draw_csect.c (revision 7734) +++ trunk/src_plugins/draw_csect/draw_csect.c (revision 7735) @@ -309,7 +309,7 @@ g = get_group_coords(y, &y1, &y2); - if ((g >= 0) && ((pcb_layergrp_flags(g) & accept_mask) == accept_mask)) { + if ((g >= 0) && ((pcb_layergrp_flags(PCB, g) & accept_mask) == accept_mask)) { gactive = g; switch(loc) { case MARK_GRP_FRAME: @@ -472,7 +472,7 @@ if ((gactive < 0) || (gactive == drag_gid+1)) return; - tflg = pcb_layergrp_flags(gactive); + tflg = pcb_layergrp_flags(PCB, gactive); pcb_layergrp_move(&PCB->LayerGroups, drag_gid, gactive); @@ -528,12 +528,12 @@ pcb_coord_t tmp; pcb_layergrp_id_t gid; gid = get_group_coords(y, &tmp, &tmp); - if ((gid >= 0) && (pcb_layergrp_flags(gid) & PCB_LYT_COPPER) && (pcb_layergrp_flags(gid) & PCB_LYT_INTERN)) { + if ((gid >= 0) && (pcb_layergrp_flags(PCB, gid) & PCB_LYT_COPPER) && (pcb_layergrp_flags(PCB, gid) & PCB_LYT_INTERN)) { drag_gid = gid; /* temporary workaround for the restricted setup */ - if (pcb_layergrp_flags(gid - 1) & PCB_LYT_SUBSTRATE) + if (pcb_layergrp_flags(PCB, gid - 1) & PCB_LYT_SUBSTRATE) drag_gid_subst = gid - 1; - else if ((pcb_layergrp_flags(gid - 1) & PCB_LYT_OUTLINE) && (pcb_layergrp_flags(gid - 2) & PCB_LYT_SUBSTRATE)) + else if ((pcb_layergrp_flags(PCB, gid - 1) & PCB_LYT_OUTLINE) && (pcb_layergrp_flags(PCB, gid - 2) & PCB_LYT_SUBSTRATE)) drag_gid_subst = gid - 2; res = 1; } @@ -559,9 +559,9 @@ else if (drag_delgrp) { if (gactive >= 0) { pcb_layergrp_del(PCB, gactive, 1); - if (pcb_layergrp_flags(gactive) & PCB_LYT_SUBSTRATE) + if (pcb_layergrp_flags(PCB, gactive) & PCB_LYT_SUBSTRATE) pcb_layergrp_del(PCB, gactive, 1); - else if (pcb_layergrp_flags(gactive-1) & PCB_LYT_SUBSTRATE) + else if (pcb_layergrp_flags(PCB, gactive-1) & PCB_LYT_SUBSTRATE) pcb_layergrp_del(PCB, gactive-1, 1); } drag_delgrp = 0; Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 7734) +++ trunk/src_plugins/export_dsn/dsn.c (revision 7735) @@ -170,7 +170,7 @@ for (group = 0; group < pcb_max_group; group++) { pcb_layer_t *first_layer; - unsigned int gflg = pcb_layergrp_flags(group); + unsigned int gflg = pcb_layergrp_flags(PCB, group); if (gflg & PCB_LYT_SILK) continue; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 7734) +++ trunk/src_plugins/export_gcode/gcode.c (revision 7735) @@ -405,13 +405,13 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) { if (gcode_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *name = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *name = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); gcode_cur_group = i; /* magic */ idx = (i >= 0 && i < pcb_max_group) ? PCB->LayerGroups.grp[i].lid[0] : i; printf("idx=%d %s\n", idx, name); - is_solder = (pcb_layergrp_flags(pcb_layer_get_group(PCB, idx)) & PCB_LYT_BOTTOM) ? 1 : 0; + is_solder = (pcb_layergrp_flags(PCB, pcb_layer_get_group(PCB, idx)) & PCB_LYT_BOTTOM) ? 1 : 0; save_drill = is_solder; /* save drills for one layer only */ gcode_start_png(gcode_basename, name); pcb_hid_save_and_show_layer_ons(save_ons); Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 7734) +++ trunk/src_plugins/export_nelma/nelma.c (revision 7735) @@ -257,7 +257,7 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) if (nelma_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); if (z != 10) { fprintf(out, ",\n"); @@ -320,7 +320,7 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) if (nelma_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); if (m != 0 || i != 0) fprintf(out, ",\n"); @@ -386,7 +386,7 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) if (nelma_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); if (z != 10) { sprintf(buf, "substrate-%d", z); @@ -417,7 +417,7 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) if (nelma_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); fprintf(out, "object %s-%s {\n", pin->ListEntry, ext); fprintf(out, "\tposition = { 0, 0 }\n"); @@ -611,7 +611,7 @@ for (i = 0; i < PCB_MAX_LAYERGRP; i++) { if (nelma_export_group[i]) { char tmp_ln[PCB_PATH_MAX]; - const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB_FNS_fixed); nelma_cur_group = i; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 7734) +++ trunk/src_plugins/export_png/png.c (revision 7735) @@ -390,8 +390,8 @@ return pcb_max_group + 3 + l; } -static int is_solder(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(grp) & PCB_LYT_BOTTOM; } -static int is_component(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(grp) & PCB_LYT_TOP; } +static int is_solder(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(PCB, grp) & PCB_LYT_BOTTOM; } +static int is_component(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(PCB, grp) & PCB_LYT_TOP; } static int layer_sort(const void *va, const void *vb) { Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 7734) +++ trunk/src_plugins/export_ps/eps.c (revision 7735) @@ -153,8 +153,8 @@ return pcb_max_group + 3 + l; } -static int is_solder(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(grp) & PCB_LYT_BOTTOM; } -static int is_component(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(grp) & PCB_LYT_TOP; } +static int is_solder(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(PCB, grp) & PCB_LYT_BOTTOM; } +static int is_component(pcb_layergrp_id_t grp) { return pcb_layergrp_flags(PCB, grp) & PCB_LYT_TOP; } static int layer_sort(const void *va, const void *vb) { Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 7734) +++ trunk/src_plugins/hid_batch/batch.c (revision 7735) @@ -84,7 +84,7 @@ pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->MaxWidth, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); for (i = 0; i < PCB_MAX_LAYER; i++) { pcb_layergrp_id_t lg = pcb_layer_get_group(PCB, i); - unsigned int gflg = pcb_layergrp_flags(lg); + unsigned int gflg = pcb_layergrp_flags(PCB, lg); for (j = 0; j < PCB_MAX_LAYER; j++) putchar(j == lg ? '#' : '-'); printf(" %c %s\n", (gflg & PCB_LYT_TOP) ? 'c' : (gflg & PCB_LYT_BOTTOM) ? 's' : '-', PCB->Data->Layer[i].Name); Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 7734) +++ trunk/src_plugins/hid_remote/remote.c (revision 7735) @@ -69,7 +69,7 @@ used = pcb_layer_group_list_any(PCB_LYT_ANYTHING | PCB_LYT_ANYWHERE | PCB_LYT_VIRTUAL, garr, sizeof(garr)/sizeof(garr[0])); for(n = 0; n < used; n++) { pcb_layergrp_id_t gid = garr[n]; - pcb_remote_new_layer_group(pcb_layergrp_name(gid), gid, pcb_layergrp_flags(gid)); + pcb_remote_new_layer_group(pcb_layergrp_name(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])); Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 7734) +++ trunk/src_plugins/io_lihata/write.c (revision 7735) @@ -520,7 +520,7 @@ /* produce an old layer group assignment from top to bottom */ gm = 0; for(n = 0; n < pcb_max_group; n++) { - unsigned int gflg = pcb_layergrp_flags(n); + unsigned int gflg = pcb_layergrp_flags(PCB, n); if (gflg & PCB_LYT_COPPER) { if (gflg & PCB_LYT_TOP) gtop = gm; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 7734) +++ trunk/src_plugins/io_pcb/file.c (revision 7735) @@ -156,7 +156,7 @@ #warning layer TODO: revise this loop to save only what the original code saved for (group = 0; group < pcb_max_group; group++) if (PCB->LayerGroups.grp[group].len) { - unsigned int gflg = pcb_layergrp_flags(group); + unsigned int gflg = pcb_layergrp_flags(PCB, group); if (gflg & PCB_LYT_SILK) /* silk is hacked in asusming there's a top and bottom copper */ continue; Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 7734) +++ trunk/src_plugins/puller/puller.c (revision 7735) @@ -2284,7 +2284,7 @@ /* This canonicalizes all the lines, and cleans up near-misses. */ /* pcb_hid_actionl("djopt", "puller", 0); */ - cflg = pcb_layergrp_flags(pcb_layer_get_group_(CURRENT)); + cflg = pcb_layergrp_flags(PCB, pcb_layer_get_group_(CURRENT)); current_is_solder = (cflg & PCB_LYT_BOTTOM); current_is_component = (cflg & PCB_LYT_TOP);