Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4899) +++ trunk/doc-rnd/hacking/renames (revision 4900) @@ -418,3 +418,5 @@ hid_save_and_show_layer_ons -> pcb_hid_save_and_show_layer_ons hid_restore_layer_ons -> pcb_hid_restore_layer_ons hid_get_flag -> pcb_hid_get_flag +derive_default_filename -> pcb_derive_default_filename +layer_type_to_file_name -> pcb_layer_type_to_file_name Index: trunk/src/hid_helper.c =================================================================== --- trunk/src/hid_helper.c (revision 4899) +++ trunk/src/hid_helper.c (revision 4900) @@ -32,7 +32,7 @@ #include "hid_attrib.h" #include "compat_misc.h" -const char *layer_type_to_file_name(int idx, int style) +const char *pcb_layer_type_to_file_name(int idx, int style) { int group; int nlayers; @@ -92,7 +92,7 @@ } } -void derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory) +void pcb_derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory) { char *buf; char *pf; Index: trunk/src/hid_helper.h =================================================================== --- trunk/src/hid_helper.h (revision 4899) +++ trunk/src/hid_helper.h (revision 4900) @@ -12,8 +12,8 @@ }; /* Returns a filename base that can be used to output the layer. */ -const char *layer_type_to_file_name(int idx, int style); +const char *pcb_layer_type_to_file_name(int idx, int style); -void derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory); +void pcb_derive_default_filename(const char *pcbfile, pcb_hid_attribute_t * filename_attrib, const char *suffix, char **memory); #endif Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 4899) +++ trunk/src_plugins/export_bboard/bboard.c (revision 4900) @@ -163,7 +163,7 @@ { static char *last_made_filename = 0; if (PCB) - derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png", &last_made_filename); bboard_options[HA_bgcolor].default_val.str_value = pcb_strdup("#FFFFFF"); Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 4899) +++ trunk/src_plugins/export_bom/bom.c (revision 4900) @@ -67,7 +67,7 @@ static char *last_bom_filename = NULL; if (PCB) - derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom", &last_bom_filename); + pcb_derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom", &last_bom_filename); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 4899) +++ trunk/src_plugins/export_dsn/dsn.c (revision 4900) @@ -103,7 +103,7 @@ { static char *last_dsn_filename = 0; if (PCB) { - derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn", &last_dsn_filename); + pcb_derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn", &last_dsn_filename); } if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 4899) +++ trunk/src_plugins/export_dxf/dxf.c (revision 4900) @@ -3771,8 +3771,8 @@ last_dxf_filename = 0; last_dxf_xref_filename = 0; if (PCB) { - derive_default_filename(PCB->Filename, &dxf_options[HA_dxffile], "", &last_dxf_filename); - derive_default_filename(PCB->Filename, &dxf_options[HA_xreffile], "", &last_dxf_xref_filename); + pcb_derive_default_filename(PCB->Filename, &dxf_options[HA_dxffile], "", &last_dxf_filename); + pcb_derive_default_filename(PCB->Filename, &dxf_options[HA_xreffile], "", &last_dxf_xref_filename); } if (n) { *n = NUM_OPTIONS; @@ -4510,7 +4510,7 @@ sext = ".dxf"; break; } - strcpy(dxf_filesuffix, layer_type_to_file_name(idx, PCB_FNS_first)); + strcpy(dxf_filesuffix, pcb_layer_type_to_file_name(idx, PCB_FNS_first)); strcat(dxf_filesuffix, sext); fp = fopen(dxf_filename, "w"); if (fp == NULL) { Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 4899) +++ trunk/src_plugins/export_gcode/gcode.c (revision 4900) @@ -240,7 +240,7 @@ } if (PCB) { - derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode", &last_made_filename); } if (n) { *n = NUM_OPTIONS; @@ -407,10 +407,10 @@ /* magic */ idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - printf("idx=%d %s\n", idx, layer_type_to_file_name(idx, PCB_FNS_fixed)); + printf("idx=%d %s\n", idx, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); is_solder = (GetLayerGroupNumberByNumber(idx) == GetLayerGroupNumberByNumber(solder_silk_layer)) ? 1 : 0; save_drill = is_solder; /* save drills for one layer only */ - gcode_start_png(gcode_basename, layer_type_to_file_name(idx, PCB_FNS_fixed)); + gcode_start_png(gcode_basename, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); pcb_hid_save_and_show_layer_ons(save_ons); gcode_start_png_export(); pcb_hid_restore_layer_ons(save_ons); @@ -430,7 +430,7 @@ } gdImageDestroy(temp_im); } - sprintf(filename, "%s.%s.cnc", gcode_basename, layer_type_to_file_name(idx, PCB_FNS_fixed)); + sprintf(filename, "%s.%s.cnc", gcode_basename, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); for (r = 0; r < gdImageSX(gcode_im); r++) { for (c = 0; c < gdImageSY(gcode_im); c++) { v = gdImageGetPixel(gcode_im, r, gdImageSY(gcode_im) - 1 - c); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 4899) +++ trunk/src_plugins/export_gerber/gerber.c (revision 4900) @@ -355,7 +355,7 @@ { static char *last_made_filename = NULL; if (PCB) - derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], "", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], "", &last_made_filename); if (n) *n = NUM_OPTIONS; @@ -393,7 +393,7 @@ static pcb_box_t region; -/* Very similar to layer_type_to_file_name() but appends only a +/* Very similar to pcb_layer_type_to_file_name() but appends only a three-character suffix compatible with Eagle's defaults. */ static void assign_eagle_file_suffix(char *dest, int idx) { @@ -493,7 +493,7 @@ break; } - strcpy(dest, layer_type_to_file_name(idx, fns_style)); + strcpy(dest, pcb_layer_type_to_file_name(idx, fns_style)); strcat(dest, sext); } Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 4899) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 4900) @@ -106,7 +106,7 @@ static char *last_IPCD356_filename = 0; if (PCB) { - derive_default_filename(PCB->Filename, &IPCD356_options[HA_IPCD356_filename], ".net", &last_IPCD356_filename); + pcb_derive_default_filename(PCB->Filename, &IPCD356_options[HA_IPCD356_filename], ".net", &last_IPCD356_filename); } if (n) Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 4899) +++ trunk/src_plugins/export_nelma/nelma.c (revision 4900) @@ -260,7 +260,7 @@ for (i = 0; i < MAX_LAYER; i++) if (nelma_export_group[i]) { idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - ext = layer_type_to_file_name(idx, PCB_FNS_fixed); + ext = pcb_layer_type_to_file_name(idx, PCB_FNS_fixed); if (z != 10) { fprintf(out, ",\n"); @@ -325,7 +325,7 @@ for (i = 0; i < MAX_LAYER; i++) if (nelma_export_group[i]) { idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - ext = layer_type_to_file_name(idx, PCB_FNS_fixed); + ext = pcb_layer_type_to_file_name(idx, PCB_FNS_fixed); if (m != 0 || i != 0) fprintf(out, ",\n"); @@ -396,7 +396,7 @@ for (i = 0; i < MAX_LAYER; i++) if (nelma_export_group[i]) { idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - ext = layer_type_to_file_name(idx, PCB_FNS_fixed); + ext = pcb_layer_type_to_file_name(idx, PCB_FNS_fixed); if (z != 10) { sprintf(buf, "substrate-%d", z); @@ -430,7 +430,7 @@ for (i = 0; i < MAX_LAYER; i++) if (nelma_export_group[i]) { idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - ext = layer_type_to_file_name(idx, PCB_FNS_fixed); + ext = pcb_layer_type_to_file_name(idx, PCB_FNS_fixed); fprintf(out, "object %s-%s {\n", pin->ListEntry, ext); fprintf(out, "\tposition = { 0, 0 }\n"); @@ -485,7 +485,7 @@ static char *last_made_filename = 0; if (PCB) { - derive_default_filename(PCB->Filename, &nelma_attribute_list[HA_basename], ".nelma", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &nelma_attribute_list[HA_basename], ".nelma", &last_made_filename); } if (n) { *n = NUM_OPTIONS; @@ -634,7 +634,7 @@ /* magic */ idx = (i >= 0 && i < max_group) ? PCB->LayerGroups.Entries[i][0] : i; - nelma_start_png(nelma_basename, layer_type_to_file_name(idx, PCB_FNS_fixed)); + nelma_start_png(nelma_basename, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); pcb_hid_save_and_show_layer_ons(save_ons); nelma_start_png_export(); Index: trunk/src_plugins/export_openscad/scad.c =================================================================== --- trunk/src_plugins/export_openscad/scad.c (revision 4899) +++ trunk/src_plugins/export_openscad/scad.c (revision 4900) @@ -338,7 +338,7 @@ { static char *last_made_filename = 0; if (PCB) - derive_default_filename(PCB->Filename, &scad_options[HA_scadfile], ".scad", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &scad_options[HA_scadfile], ".scad", &last_made_filename); /* scad_options[HA_minimal_drill].coord_value = scad_options[HA_minimal_drill].*/ if (n) Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 4899) +++ trunk/src_plugins/export_png/png.c (revision 4900) @@ -372,7 +372,7 @@ const char *suffix = get_file_suffix(); if (PCB) - derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix, &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix, &last_made_filename); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 4899) +++ trunk/src_plugins/export_ps/eps.c (revision 4900) @@ -138,7 +138,7 @@ static char *last_made_filename = 0; if (PCB) - derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps", &last_made_filename); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4899) +++ trunk/src_plugins/export_ps/ps.c (revision 4900) @@ -421,7 +421,7 @@ { static char *last_made_filename = 0; if (PCB) - derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps", &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps", &last_made_filename); if (n) *n = NUM_OPTIONS; @@ -834,7 +834,7 @@ ps_end_file(global.f); fclose(global.f); } - global.f = psopen(global.filename, layer_type_to_file_name(idx, PCB_FNS_fixed)); + global.f = psopen(global.filename, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); if (!global.f) { perror(global.filename); return 0; @@ -851,7 +851,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", layer_type_to_file_name(idx, PCB_FNS_fixed), global.pagecount); + fprintf(global.f, "%%%%Page: %s %d\n", pcb_layer_type_to_file_name(idx, PCB_FNS_fixed), global.pagecount); if (global.mirror) mirror_this = !mirror_this; @@ -863,9 +863,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, layer_type_to_file_name(idx, PCB_FNS_fixed)); + fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, pcb_layer_type_to_file_name(idx, PCB_FNS_fixed)); else - fprintf(global.f, "30 41 moveto (%s) show\n", layer_type_to_file_name(idx, PCB_FNS_fixed)); + fprintf(global.f, "30 41 moveto (%s) show\n", pcb_layer_type_to_file_name(idx, 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 4899) +++ trunk/src_plugins/export_svg/svg.c (revision 4900) @@ -184,7 +184,7 @@ const char *suffix = ".svg"; if (PCB) - derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix, &last_made_filename); + pcb_derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix, &last_made_filename); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_test/export_test.c =================================================================== --- trunk/src_plugins/export_test/export_test.c (revision 4899) +++ trunk/src_plugins/export_test/export_test.c (revision 4900) @@ -46,7 +46,7 @@ static char *last_export_test_filename = 0; if (PCB) { - derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test", &last_export_test_filename); + pcb_derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test", &last_export_test_filename); } if (n) Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 4899) +++ trunk/src_plugins/export_xy/xy.c (revision 4900) @@ -75,7 +75,7 @@ last_unit_value = xy_options[HA_unit].default_val.int_value; } if (PCB) - derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy", &last_xy_filename); + pcb_derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy", &last_xy_filename); if (n) *n = NUM_OPTIONS;