Index: trunk/src/hid_cam.c =================================================================== --- trunk/src/hid_cam.c (revision 19128) +++ trunk/src/hid_cam.c (revision 19129) @@ -36,7 +36,7 @@ #include "layer_vis.h" #include "plug_io.h" -char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, pcb_file_name_style_t style) +char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, const char *purpose, int purpi, pcb_file_name_style_t style) { const pcb_virt_layer_t *v; pcb_layergrp_id_t group; Index: trunk/src/hid_cam.h =================================================================== --- trunk/src/hid_cam.h (revision 19128) +++ trunk/src/hid_cam.h (revision 19129) @@ -54,7 +54,7 @@ } pcb_file_name_style_t; /* Returns a filename base that can be used to output the layer. */ -char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, pcb_file_name_style_t style); +char *pcb_layer_to_file_name(char *dest, pcb_layer_id_t lid, unsigned int flags, const char *purpose, int purpi, pcb_file_name_style_t style); /* Returns a filename base that can be used to output the layer; if flags is 0, look it up. Copies result in dest (which should be at least PCB_DERIVE_FN_SUFF_LEN bytes wide). Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 19128) +++ trunk/src_plugins/export_gcode/gcode.c (revision 19129) @@ -412,7 +412,7 @@ 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(PCB, i), PCB_FNS_fixed); + const char *name = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); gcode_cur_group = i; /* magic */ Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 19128) +++ trunk/src_plugins/export_gerber/gerber.c (revision 19129) @@ -547,7 +547,7 @@ #undef fmatch -static void assign_file_suffix(char *dest, pcb_layergrp_id_t gid, pcb_layer_id_t lid, unsigned int flags, int purpi) +static void assign_file_suffix(char *dest, pcb_layergrp_id_t gid, pcb_layer_id_t lid, unsigned int flags, const char *purpose, int purpi) { int fns_style; const char *sext = ".gbr"; @@ -576,7 +576,7 @@ if ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL)) sext = ".cnc"; - pcb_layer_to_file_name(dest, lid, flags, fns_style); + pcb_layer_to_file_name(dest, lid, flags, purpose, purpi, fns_style); strcat(dest, sext); } @@ -794,7 +794,7 @@ } pagecount++; - assign_file_suffix(filesuff, group, layer, flags, purpi); + assign_file_suffix(filesuff, group, layer, flags, purpose, purpi); if (f == NULL) { /* open a new file if we closed the previous (cam mode: only one file) */ f = pcb_fopen(gerber_cam.active ? gerber_cam.fn : filename, "wb"); /* Binary needed to force CR-LF */ if (f == NULL) { Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 19128) +++ trunk/src_plugins/export_nelma/nelma.c (revision 19129) @@ -264,7 +264,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(PCB, i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); if (z != 10) { fprintf(out, ",\n"); @@ -327,7 +327,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(PCB, i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); if (m != 0 || i != 0) fprintf(out, ",\n"); @@ -393,7 +393,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(PCB, i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); if (z != 10) { sprintf(buf, "substrate-%d", z); @@ -424,7 +424,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(PCB, i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); fprintf(out, "object %s-%s {\n", pin->ListEntry, ext); fprintf(out, "\tposition = { 0, 0 }\n"); @@ -618,7 +618,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(PCB, i), PCB_FNS_fixed); + const char *ext = pcb_layer_to_file_name(tmp_ln, -1, pcb_layergrp_flags(PCB, i), PCB->LayerGroups.grp[i].purpose, PCB->LayerGroups.grp[i].purpi, PCB_FNS_fixed); nelma_cur_group = i; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 19128) +++ trunk/src_plugins/export_ps/eps.c (revision 19129) @@ -389,7 +389,7 @@ if (is_mask || is_paste) return 0; - name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed); + name = pcb_layer_to_file_name(tmp_ln, layer, flags, purpose, purpi, PCB_FNS_fixed); #if 0 printf("Layer %s group %d drill %d mask %d\n", name, group, is_drill, is_mask); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 19128) +++ trunk/src_plugins/export_ps/ps.c (revision 19129) @@ -825,7 +825,7 @@ } - name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed); + name = pcb_layer_to_file_name(tmp_ln, layer, flags, purpose, purpi, PCB_FNS_fixed); global.is_drill = ((flags & PCB_LYT_PDRILL) || (flags & PCB_LYT_UDRILL)); global.is_mask = !!(flags & PCB_LYT_MASK); @@ -875,7 +875,7 @@ ps_end_file(global.f); fclose(global.f); } - global.f = psopen(global.filename, pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed)); + global.f = psopen(global.filename, pcb_layer_to_file_name(tmp_fn, layer, flags, purpose, purpi, PCB_FNS_fixed)); if (!global.f) { perror(global.filename); return 0; @@ -892,7 +892,7 @@ * ordinal page number must reflect the position of that page in * the body of the PostScript file and must start with 1, not 0. */ - fprintf(global.f, "%%%%Page: %s %d\n", pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed), global.pagecount); + fprintf(global.f, "%%%%Page: %s %d\n", pcb_layer_to_file_name(tmp_fn, layer, flags, purpose, purpi, PCB_FNS_fixed), global.pagecount); if (global.mirror) mirror_this = !mirror_this; @@ -903,9 +903,9 @@ if (global.legend) { fprintf(global.f, "30 30 moveto (%s) show\n", PCB->Filename); if (PCB->Name) - fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed)); + fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, pcb_layer_to_file_name(tmp_fn, layer, flags, purpose, purpi, PCB_FNS_fixed)); else - fprintf(global.f, "30 41 moveto (%s) show\n", pcb_layer_to_file_name(tmp_fn, layer, flags, PCB_FNS_fixed)); + fprintf(global.f, "30 41 moveto (%s) show\n", pcb_layer_to_file_name(tmp_fn, layer, flags, purpose, purpi, PCB_FNS_fixed)); if (mirror_this) fprintf(global.f, "( \\(mirrored\\)) show\n"); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 19128) +++ trunk/src_plugins/export_svg/svg.c (revision 19129) @@ -386,7 +386,7 @@ { char tmp_ln[PCB_PATH_MAX]; - const char *name = name = pcb_layer_to_file_name(tmp_ln, layer, flags, PCB_FNS_fixed); + const char *name = name = pcb_layer_to_file_name(tmp_ln, layer, flags, purpose, purpi, PCB_FNS_fixed); fprintf(f, "