Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 24883) +++ trunk/src/board.c (revision 24884) @@ -51,8 +51,8 @@ if (pcb == NULL) return; - free(pcb->Name); - free(pcb->Filename); + free(pcb->hidlib.name); + free(pcb->hidlib.filename); free(pcb->PrintFilename); pcb_ratspatch_destroy(pcb); pcb_data_free(pcb->Data); @@ -137,10 +137,10 @@ if (dpcb == 0) { nw = PCB; - if (nw->Filename != NULL) { + if (nw->hidlib.filename != NULL) { /* make sure the new PCB doesn't inherit the name and loader of the default pcb */ - free(nw->Filename); - nw->Filename = NULL; + free(nw->hidlib.filename); + nw->hidlib.filename = NULL; nw->Data->loader = NULL; } } @@ -241,18 +241,18 @@ const char *pcb_board_get_filename(void) { - return PCB->Filename; + return PCB->hidlib.filename; } const char *pcb_board_get_name(void) { - return PCB->Name; + return PCB->hidlib.name; } pcb_bool pcb_board_change_name(char *Name) { - free(PCB->Name); - PCB->Name = Name; + free(PCB->hidlib.name); + PCB->hidlib.name = Name; pcb_board_changed(0); return pcb_true; } Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 24883) +++ trunk/src/board.h (revision 24884) @@ -68,8 +68,6 @@ pcb_hidlib_t hidlib; long ID; - char *Name; /* name of board */ - char *Filename; /* name of file (from load) */ char *PrintFilename; /* from print dialog */ char *Netlistname; /* name of netlist file */ Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 24883) +++ trunk/src/change_act.c (revision 24884) @@ -517,7 +517,7 @@ /* change the layout's name */ case F_Layout: - name = pcb_hid_prompt_for("Enter the layout name:", PCB_EMPTY(PCB->Name), "Layout name"); + name = pcb_hid_prompt_for("Enter the layout name:", PCB_EMPTY(PCB->hidlib.name), "Layout name"); /* NB: ChangeLayoutName takes ownership of the passed memory */ if (name && pcb_board_change_name(name)) pcb_board_set_changed_flag(pcb_true); Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 24883) +++ trunk/src/file_act.c (revision 24884) @@ -107,7 +107,7 @@ break; case F_Revert: - if (PCB->Filename && (!PCB->Changed || (pcb_hid_message_box("warning", "Revert: lose data", "Really revert all modifications?", "no", 0, "yes", 1, NULL) == 1))) + if (PCB->hidlib.filename && (!PCB->Changed || (pcb_hid_message_box("warning", "Revert: lose data", "Really revert all modifications?", "no", 0, "yes", 1, NULL) == 1))) pcb_revert_pcb(); break; @@ -153,8 +153,8 @@ conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", POL_OVERWRITE); /* we have only one font now, make sure it is selected */ /* setup the new name and reset some values to default */ - free(PCB->Name); - PCB->Name = name; + free(PCB->hidlib.name); + PCB->hidlib.name = name; pcb_layervis_reset_stack(); pcb_crosshair_set_range(0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); @@ -204,7 +204,7 @@ pcb_message(PCB_MSG_ERROR, "SaveTo(Layout) doesn't take file name or format - did you mean SaveTo(LayoutAs)?\n"); return FGW_ERR_ARGC; } - if (pcb_save_pcb(PCB->Filename, NULL) == 0) + if (pcb_save_pcb(PCB->hidlib.filename, NULL) == 0) pcb_board_set_changed_flag(pcb_false); if (pcb_gui->notify_filename_changed != NULL) pcb_gui->notify_filename_changed(); @@ -213,8 +213,8 @@ case F_LayoutAs: if (pcb_save_pcb(name, fmt) == 0) { pcb_board_set_changed_flag(pcb_false); - free(PCB->Filename); - PCB->Filename = pcb_strdup(name); + free(PCB->hidlib.filename); + PCB->hidlib.filename = pcb_strdup(name); if (pcb_gui->notify_filename_changed != NULL) pcb_gui->notify_filename_changed(); } Index: trunk/src/hidlib.h =================================================================== --- trunk/src/hidlib.h (revision 24883) +++ trunk/src/hidlib.h (revision 24884) @@ -30,6 +30,8 @@ pcb_coord_t grid; /* grid resolution */ pcb_coord_t grid_ox, grid_oy; /* grid offset */ pcb_coord_t size_x, size_y; /* drawing area extents (or board dimensions) */ + char *name; /* name of the design */ + char *filename; /* name of the file (from load) */ }; /* optional: if non-NULL, called back to determine the file name or project Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 24883) +++ trunk/src/main.c (revision 24884) @@ -648,7 +648,7 @@ exit(1); } /* keep filename if load failed: file might not exist, save it by that name */ - PCB->Filename = pcb_strdup(command_line_pcb); + PCB->hidlib.filename = pcb_strdup(command_line_pcb); } } Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 24883) +++ trunk/src/main_act.c (revision 24884) @@ -353,7 +353,7 @@ PCB_ACT_CONVARG(1, FGW_STR, System, cmd = argv[1].val.str); PCB_ACT_IRES(0); - pcb_setenv("PCB_RND_BOARD_FILE_NAME", PCB->Filename == NULL ? "" : PCB->Filename, 1); + pcb_setenv("PCB_RND_BOARD_FILE_NAME", PCB->hidlib.filename == NULL ? "" : PCB->hidlib.filename, 1); pcb_snprintf(tmp, sizeof(tmp), "%mm", pcb_crosshair.X); pcb_setenv("PCB_RND_CROSSHAIR_X_MM", tmp, 1); pcb_snprintf(tmp, sizeof(tmp), "%mm", pcb_crosshair.Y); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 24883) +++ trunk/src/plug_io.c (revision 24884) @@ -329,9 +329,9 @@ int len; if (fmt == NULL) { - if (PCB->Filename != NULL) { /* have a file name, guess from extension */ - int fn_len = strlen(PCB->Filename); - const char *end = PCB->Filename + fn_len; + if (PCB->hidlib.filename != NULL) { /* have a file name, guess from extension */ + int fn_len = strlen(PCB->hidlib.filename); + const char *end = PCB->hidlib.filename + fn_len; pcb_plug_io_t *n, *best = NULL; int best_score = 0; @@ -358,7 +358,7 @@ return NULL; } else { - if (PCB->Filename != NULL) + if (PCB->hidlib.filename != NULL) pcb_message(PCB_MSG_WARNING, "Saving a file with unknown format: failed to guess format from file name, falling back to %s as configured in rc/save_final_fallback_fmt\n", fmt); } } @@ -523,7 +523,7 @@ /* clear 'changed flag' */ pcb_board_set_changed_flag(pcb_false); - PCB->Filename = new_filename; + PCB->hidlib.filename = new_filename; /* just in case a bad file saved file is loaded */ /* Use attribute PCB::grid::unit as unit, if we can */ @@ -649,7 +649,7 @@ int pcb_revert_pcb(void) { - return real_load_pcb(PCB->Filename, NULL, pcb_true, pcb_true, 1); + return real_load_pcb(PCB->hidlib.filename, NULL, pcb_true, pcb_true, 1); } void pcb_print_quoted_string_(FILE * FP, const char *S) Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 24883) +++ trunk/src/rats_patch.c (revision 24884) @@ -492,12 +492,12 @@ if (fn == NULL) { char *default_file; - if (PCB->Filename != NULL) { + if (PCB->hidlib.filename != NULL) { char *end; int len; - len = strlen(PCB->Filename); + len = strlen(PCB->hidlib.filename); default_file = malloc(len + 8); - memcpy(default_file, PCB->Filename, len + 1); + memcpy(default_file, PCB->hidlib.filename, len + 1); end = strrchr(default_file, '.'); if ((end == NULL) || (pcb_strcasecmp(end, ".pcb") != 0)) end = default_file + len; Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 24883) +++ trunk/src_plugins/cam/cam.c (revision 24884) @@ -53,8 +53,8 @@ static void cam_init_inst_fn(cam_ctx_t *ctx) { - if ((PCB != NULL) && (PCB->Filename != NULL)) { - char *fn = pcb_derive_default_filename_(PCB->Filename, ""); + if ((PCB != NULL) && (PCB->hidlib.filename != NULL)) { + char *fn = pcb_derive_default_filename_(PCB->hidlib.filename, ""); char *val, *end = strrchr(fn, PCB_DIR_SEPARATOR_C); if (end != NULL) val = pcb_strdup(end+1); Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 24883) +++ trunk/src_plugins/cam/cam_gui.c (revision 24884) @@ -338,7 +338,7 @@ { /* set default outfile */ pcb_hid_attr_val_t hv; - hv.str_value = pcb_derive_default_filename_(PCB->Filename, ""); + hv.str_value = pcb_derive_default_filename_(PCB->hidlib.filename, ""); pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->woutfile, &hv); free((char *)hv.str_value); cam_gui_opts2dlg(ctx); Index: trunk/src_plugins/dialogs/dlg_loadsave.c =================================================================== --- trunk/src_plugins/dialogs/dlg_loadsave.c (revision 24883) +++ trunk/src_plugins/dialogs/dlg_loadsave.c (revision 24884) @@ -183,7 +183,7 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, Save, function = argv[1].val.str); if (pcb_strcasecmp(function, "Layout") == 0) - if (PCB->Filename != NULL) + if (PCB->hidlib.filename != NULL) return pcb_actionl("SaveTo", "Layout", NULL); if (pcb_strcasecmp(function, "PasteBuffer") == 0) { @@ -270,10 +270,10 @@ /* construct the input file name and run a file selection dialog to get the final file name */ if (name_in == NULL) { - if (PCB->Filename == NULL) + if (PCB->hidlib.filename == NULL) name_in = pcb_concat("unnamed", extensions_param[fmt], NULL); else - name_in = pcb_strdup(PCB->Filename); + name_in = pcb_strdup(PCB->hidlib.filename); } final_name = pcb_gui->fileselect(prompt, NULL, name_in, NULL, NULL, "board", PCB_HID_FSD_MAY_NOT_EXIST, fmtsub); free(name_in); Index: trunk/src_plugins/dialogs/dlg_pref_board.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_board.c (revision 24883) +++ trunk/src_plugins/dialogs/dlg_pref_board.c (revision 24884) @@ -35,7 +35,7 @@ /* Actual board meta to dialog box */ static void pref_board_brd2dlg(pref_ctx_t *ctx) { - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wname, str_value, PCB_EMPTY(PCB->Name)); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wname, str_value, PCB_EMPTY(PCB->hidlib.name)); PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wthermscale, real_value, PCB->ThermScale); PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wtype, str_value, (PCB->is_footprint ? "footprint" : "PCB board")); } @@ -49,10 +49,10 @@ pref_ctx_t *ctx = caller_data; newname = PCB_EMPTY(ctx->dlg[ctx->board.wname].default_val.str_value); - oldname = PCB_EMPTY(PCB->Name); + oldname = PCB_EMPTY(PCB->hidlib.name); if (strcmp(oldname, newname) != 0) { - free(PCB->Name); - PCB->Name = pcb_strdup(newname); + free(PCB->hidlib.name); + PCB->hidlib.name = pcb_strdup(newname); changed = 1; } @@ -85,7 +85,7 @@ PCB_DAD_LABEL(ctx->dlg, "Board name"); PCB_DAD_STRING(ctx->dlg); ctx->board.wname = PCB_DAD_CURRENT(ctx->dlg); - ctx->dlg[ctx->board.wname].default_val.str_value = pcb_strdup(PCB_EMPTY(PCB->Name)); + ctx->dlg[ctx->board.wname].default_val.str_value = pcb_strdup(PCB_EMPTY(PCB->hidlib.name)); PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); PCB_DAD_LABEL(ctx->dlg, "Thermal scale"); PCB_DAD_REAL(ctx->dlg, ""); Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 24883) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 24884) @@ -174,7 +174,7 @@ conf_set(ctx->role, ctx->nat->hash_path, ctx->idx, val, POL_OVERWRITE); if ((ctx->role == CFR_USER) || (ctx->role == CFR_PROJECT)) - conf_save_file(NULL, (PCB == NULL ? NULL : PCB->Filename), ctx->role, NULL); + conf_save_file(NULL, (PCB == NULL ? NULL : PCB->hidlib.filename), ctx->role, NULL); else if (ctx->role == CFR_DESIGN) pcb_board_set_changed_flag(1); Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 24883) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 24884) @@ -326,7 +326,7 @@ yoff -= TEXT_LINE; text_at(info, gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Author: %s", pcb_author()); yoff -= TEXT_LINE; - text_at(info, gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", PCB_UNKNOWN(PCB->Name)); + text_at(info, gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", PCB_UNKNOWN(PCB->hidlib.name)); } int pplg_check_ver_draw_fab(int ver_needed) { return 0; } Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 24883) +++ trunk/src_plugins/export_bboard/bboard.c (revision 24884) @@ -162,7 +162,7 @@ static pcb_hid_attribute_t *bboard_get_export_options(int *n) { if ((PCB != NULL) && (bboard_options[HA_bboardfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png"); + pcb_derive_default_filename(PCB->hidlib.filename, &bboard_options[HA_bboardfile], ".png"); 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 24883) +++ trunk/src_plugins/export_bom/bom.c (revision 24884) @@ -67,7 +67,7 @@ static pcb_hid_attribute_t *bom_get_export_options(int *n) { if ((PCB != NULL) && (bom_options[HA_bomfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom"); + pcb_derive_default_filename(PCB->hidlib.filename, &bom_options[HA_bomfile], ".bom"); if (n) *n = NUM_OPTIONS; @@ -251,7 +251,7 @@ fprintf(fp, "# PcbBOM Version 1.0\n"); fprintf(fp, "# Date: %s\n", utcTime); fprintf(fp, "# Author: %s\n", pcb_author()); - fprintf(fp, "# Title: %s - PCB BOM\n", PCB_UNKNOWN(PCB->Name)); + fprintf(fp, "# Title: %s - PCB BOM\n", PCB_UNKNOWN(PCB->hidlib.name)); fprintf(fp, "# Quantity, Description, Value, RefDes\n"); fprintf(fp, "# --------------------------------------------\n"); Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 24883) +++ trunk/src_plugins/export_dsn/dsn.c (revision 24884) @@ -109,7 +109,7 @@ static pcb_hid_attribute_t *dsn_get_export_options(int *n) { if ((PCB != NULL) && (dsn_options[HA_dsnfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn"); + pcb_derive_default_filename(PCB->hidlib.filename, &dsn_options[HA_dsnfile], ".dsn"); if (n) *n = NUM_OPTIONS; return dsn_options; @@ -513,7 +513,7 @@ } /* pcb [required] */ - fprintf(fp, "(pcb %s\n", ((PCB->Name) && *(PCB->Name) ? (PCB->Name) : "notnamed")); + fprintf(fp, "(pcb %s\n", ((PCB->hidlib.name) && *(PCB->hidlib.name) ? (PCB->hidlib.name) : "notnamed")); /* parser descriptor [optional] */ fprintf(fp, " (parser\n"); Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 24883) +++ trunk/src_plugins/export_dxf/dxf.c (revision 24884) @@ -206,7 +206,7 @@ const char *suffix = ".dxf"; if ((PCB != NULL) && (dxf_attribute_list[HA_dxffile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &dxf_attribute_list[HA_dxffile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &dxf_attribute_list[HA_dxffile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 24883) +++ trunk/src_plugins/export_excellon/excellon.c (revision 24884) @@ -194,7 +194,7 @@ static pcb_hid_attribute_t *excellon_get_export_options(int *n) { if ((PCB != NULL) && (excellon_options[HA_excellonfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &excellon_options[HA_excellonfile], ""); + pcb_derive_default_filename(PCB->hidlib.filename, &excellon_options[HA_excellonfile], ""); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_fidocadj/fidocadj.c =================================================================== --- trunk/src_plugins/export_fidocadj/fidocadj.c (revision 24883) +++ trunk/src_plugins/export_fidocadj/fidocadj.c (revision 24884) @@ -90,7 +90,7 @@ const char *suffix = ".fcd"; if ((PCB != NULL) && (fidocadj_attribute_list[HA_fidocadjfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &fidocadj_attribute_list[HA_fidocadjfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &fidocadj_attribute_list[HA_fidocadjfile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 24883) +++ trunk/src_plugins/export_gcode/gcode.c (revision 24884) @@ -247,7 +247,7 @@ } if ((PCB != NULL) && (gcode_attribute_list[HA_basename].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode"); + pcb_derive_default_filename(PCB->hidlib.filename, &gcode_attribute_list[HA_basename], ".gcode"); if (n) { *n = NUM_OPTIONS; } Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 24883) +++ trunk/src_plugins/export_gerber/gerber.c (revision 24884) @@ -287,7 +287,7 @@ static pcb_hid_attribute_t *gerber_get_export_options(int *n) { if ((PCB != NULL) && (gerber_options[HA_gerberfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], ""); + pcb_derive_default_filename(PCB->hidlib.filename, &gerber_options[HA_gerberfile], ""); if (n) *n = NUM_OPTIONS; @@ -794,7 +794,7 @@ pcb_print_utc(utcTime, sizeof(utcTime), 0); /* Print a cute file header at the beginning of each file. */ - fprintf(f, "G04 Title: %s, %s *\r\n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(group_name)); + fprintf(f, "G04 Title: %s, %s *\r\n", PCB_UNKNOWN(PCB->hidlib.name), PCB_UNKNOWN(group_name)); fprintf(f, "G04 Creator: pcb-rnd " PCB_VERSION " *\r\n"); fprintf(f, "G04 CreationDate: %s *\r\n", utcTime); Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 24883) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 24884) @@ -125,7 +125,7 @@ fprintf(ctx->f, "C \n"); fprintf(ctx->f, "C File created on %s\n", utc); fprintf(ctx->f, "C \n"); - fprintf(ctx->f, "P JOB %s\n", (PCB->Name == NULL) ? PCB->Filename : PCB->Name); + fprintf(ctx->f, "P JOB %s\n", (PCB->hidlib.name == NULL) ? PCB->hidlib.filename : PCB->hidlib.name); fprintf(ctx->f, "P CODE 00\n"); fprintf(ctx->f, "P UNITS CUST %d\n", ctx->is_mil ? 0 : 1); fprintf(ctx->f, "P DIM N\n"); @@ -418,7 +418,7 @@ static pcb_hid_attribute_t *ipcd356_get_export_options(int *n) { if ((PCB != NULL) && (ipcd356_options[HA_ipcd356_filename].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &ipcd356_options[HA_ipcd356_filename], ".net"); + pcb_derive_default_filename(PCB->hidlib.filename, &ipcd356_options[HA_ipcd356_filename], ".net"); if (n != NULL) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 24883) +++ trunk/src_plugins/export_openems/export_openems.c (revision 24884) @@ -164,7 +164,7 @@ pcb_mesh_t *mesh = pcb_mesh_get(MESH_NAME); if ((PCB != NULL) && (openems_attribute_list[HA_openemsfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &openems_attribute_list[HA_openemsfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &openems_attribute_list[HA_openemsfile], suffix); if (mesh != NULL) { openems_attribute_list[HA_def_substrate_thick].default_val.coord_value = mesh->def_subs_thick; Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 24883) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 24884) @@ -133,7 +133,7 @@ const char *suffix = ".scad"; if ((PCB != NULL) && (openscad_attribute_list[HA_openscadfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &openscad_attribute_list[HA_openscadfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &openscad_attribute_list[HA_openscadfile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 24883) +++ trunk/src_plugins/export_png/png.c (revision 24884) @@ -491,7 +491,7 @@ const char *suffix = get_file_suffix(); if ((PCB != NULL) && (png_attribute_list[HA_pngfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &png_attribute_list[HA_pngfile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 24883) +++ trunk/src_plugins/export_ps/eps.c (revision 24884) @@ -149,7 +149,7 @@ static pcb_hid_attribute_t *eps_get_export_options(int *n) { if ((PCB != NULL) && (eps_attribute_list[HA_psfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps"); + pcb_derive_default_filename(PCB->hidlib.filename, &eps_attribute_list[HA_psfile], ".eps"); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 24883) +++ trunk/src_plugins/export_ps/ps.c (revision 24884) @@ -344,7 +344,7 @@ static pcb_hid_attribute_t *ps_get_export_options(int *n) { if ((PCB != NULL) && (ps_attribute_list[HA_psfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps"); + pcb_derive_default_filename(PCB->hidlib.filename, &ps_attribute_list[HA_psfile], ".ps"); if (n) *n = NUM_OPTIONS; @@ -383,7 +383,7 @@ * %%Title DCS provides text title for the document that is useful * for printing banner pages. */ - fprintf(f, "%%%%Title: %s\n", pcb_hid_export_fn(PCB->Filename)); + fprintf(f, "%%%%Title: %s\n", pcb_hid_export_fn(PCB->hidlib.filename)); /* * %%CreationDate DCS indicates the date and time the document was @@ -745,7 +745,7 @@ if (group < 0 || group != lastgroup) { if (global.pagecount == 1) { currenttime = time(NULL); - fprintf(global.f, "30 30 moveto (%s) show\n", pcb_hid_export_fn(PCB->Filename)); + fprintf(global.f, "30 30 moveto (%s) show\n", pcb_hid_export_fn(PCB->hidlib.filename)); fprintf(global.f, "(%d.) tocp\n", global.pagecount); fprintf(global.f, "(Table of Contents \\(This Page\\)) toc\n"); @@ -823,11 +823,11 @@ fprintf(global.f, "/Helvetica findfont 10 scalefont setfont\n"); if (global.legend) { gds_t tmp; - fprintf(global.f, "30 30 moveto (%s) show\n", pcb_hid_export_fn(PCB->Filename)); + fprintf(global.f, "30 30 moveto (%s) show\n", pcb_hid_export_fn(PCB->hidlib.filename)); gds_init(&tmp); - if (PCB->Name) - fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->Name, pcb_layer_to_file_name(&tmp, layer, flags, purpose, purpi, PCB_FNS_fixed)); + if (PCB->hidlib.name) + fprintf(global.f, "30 41 moveto (%s, %s) show\n", PCB->hidlib.name, pcb_layer_to_file_name(&tmp, layer, flags, purpose, purpi, PCB_FNS_fixed)); else fprintf(global.f, "30 41 moveto (%s) show\n", pcb_layer_to_file_name(&tmp, layer, flags, purpose, purpi, PCB_FNS_fixed)); gds_uninit(&tmp); Index: trunk/src_plugins/export_stat/stat.c =================================================================== --- trunk/src_plugins/export_stat/stat.c (revision 24883) +++ trunk/src_plugins/export_stat/stat.c (revision 24884) @@ -115,7 +115,7 @@ const char *suffix = ".stat.lht"; if ((PCB != NULL) && (stat_attribute_list[HA_statfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &stat_attribute_list[HA_statfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &stat_attribute_list[HA_statfile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 24883) +++ trunk/src_plugins/export_svg/svg.c (revision 24884) @@ -200,7 +200,7 @@ const char *suffix = ".svg"; if ((PCB != NULL) && (svg_attribute_list[HA_svgfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix); + pcb_derive_default_filename(PCB->hidlib.filename, &svg_attribute_list[HA_svgfile], suffix); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_test/export_test.c =================================================================== --- trunk/src_plugins/export_test/export_test.c (revision 24883) +++ trunk/src_plugins/export_test/export_test.c (revision 24884) @@ -44,7 +44,7 @@ static pcb_hid_attribute_t *export_test_get_export_options(int *n) { if ((PCB != NULL) && (export_test_options[HA_export_testfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test"); + pcb_derive_default_filename(PCB->hidlib.filename, &export_test_options[HA_export_testfile], ".export_test"); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c =================================================================== --- trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 24883) +++ trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 24884) @@ -237,14 +237,14 @@ static void pcb_fuse_destroy(void *private_data) { - char *fn = PCB->Filename; + char *fn = PCB->hidlib.filename; if (!pcb_fuse_changed) return; /* pwd is lost during daemonisation */ - if (!pcb_is_path_abs(PCB->Filename)) - fn = pcb_strdup_printf("%s%c%s", fuse_cwd, PCB_DIR_SEPARATOR_C, PCB->Filename); + if (!pcb_is_path_abs(PCB->hidlib.filename)) + fn = pcb_strdup_printf("%s%c%s", fuse_cwd, PCB_DIR_SEPARATOR_C, PCB->hidlib.filename); if (pcb_save_pcb(fn, NULL) != 0) { fprintf(stderr, "Failed to save the modified board file\n"); Index: trunk/src_plugins/export_vfs_mc/export_vfs_mc.c =================================================================== --- trunk/src_plugins/export_vfs_mc/export_vfs_mc.c (revision 24883) +++ trunk/src_plugins/export_vfs_mc/export_vfs_mc.c (revision 24884) @@ -98,7 +98,7 @@ exit(1); } gds_uninit(&inp); - if (pcb_save_pcb(PCB->Filename, NULL) != 0) { + if (pcb_save_pcb(PCB->hidlib.filename, NULL) != 0) { fprintf(stderr, "Failed to save the modified board file\n"); exit(1); } Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 24883) +++ trunk/src_plugins/export_xy/xy.c (revision 24884) @@ -144,7 +144,7 @@ last_unit_value = xy_options[HA_unit].default_val.int_value; } if ((PCB != NULL) && (xy_options[HA_xyfile].default_val.str_value == NULL)) - pcb_derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy"); + pcb_derive_default_filename(PCB->hidlib.filename, &xy_options[HA_xyfile], ".xy"); if (n) *n = NUM_OPTIONS; @@ -353,7 +353,7 @@ } if (strncmp(*input, "title%", 6) == 0) { *input += 6; - gds_append_str(s, PCB_UNKNOWN(PCB->Name)); + gds_append_str(s, PCB_UNKNOWN(PCB->hidlib.name)); return 0; } if (strncmp(*input, "suffix%", 7) == 0) { Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 24883) +++ trunk/src_plugins/hid_batch/batch.c (revision 24884) @@ -67,12 +67,12 @@ { if (prompt != NULL) free(prompt); - if (PCB && PCB->Filename) { - prompt = strrchr(PCB->Filename, '/'); + if (PCB && PCB->hidlib.filename) { + prompt = strrchr(PCB->hidlib.filename, '/'); if (prompt) prompt++; else - prompt = PCB->Filename; + prompt = PCB->hidlib.filename; if (prompt != NULL) prompt = pcb_strdup(prompt); } @@ -122,11 +122,11 @@ static fgw_error_t pcb_act_info(fgw_arg_t *res, int argc, fgw_arg_t *argv) { int i, j; - if (!PCB || !PCB->Data || !PCB->Filename) { + if (!PCB || !PCB->Data || !PCB->hidlib.filename) { printf("No PCB loaded.\n"); return 0; } - printf("Filename: %s\n", PCB->Filename); + printf("Filename: %s\n", PCB->hidlib.filename); pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->hidlib.size_x, PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y); for (i = 0; i < PCB_MAX_LAYER; i++) { pcb_layergrp_id_t lg = pcb_layer_get_group(PCB, i); Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 24883) +++ trunk/src_plugins/hid_lesstif/main.c (revision 24884) @@ -369,10 +369,10 @@ LesstifNetlistChanged(NULL, 0, NULL); LesstifRouteStylesChanged(NULL, 0, NULL); lesstif_update_layer_groups(); - if (PCB->Filename) { - char *cp = strrchr(PCB->Filename, '/'); + if (PCB->hidlib.filename) { + char *cp = strrchr(PCB->hidlib.filename, '/'); stdarg_n = 0; - stdarg(XmNtitle, cp ? cp + 1 : PCB->Filename); + stdarg(XmNtitle, cp ? cp + 1 : PCB->hidlib.filename); XtSetValues(appwidget, stdarg_args, stdarg_n); } return; Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 24883) +++ trunk/src_plugins/import_sch/import_sch.c (revision 24884) @@ -190,7 +190,7 @@ if (sources == NULL) { /* Replace .pcb with .sch and hope for the best. */ - char *pcbname = PCB->Filename; + char *pcbname = PCB->hidlib.filename; char *schname; char *dot, *slash, *bslash; @@ -327,7 +327,7 @@ cmd[0] = conf_import_sch.plugins.import_sch.make_program; cmd[1] = "-s"; - cmd[2] = pcb_concat("PCB=", PCB->Filename, NULL); + cmd[2] = pcb_concat("PCB=", PCB->hidlib.filename, NULL); cmd[3] = srclist; cmd[4] = pcb_concat("OUT=", tmpfile, NULL); i = 5; Index: trunk/src_plugins/io_dsn/read.c =================================================================== --- trunk/src_plugins/io_dsn/read.c (revision 24883) +++ trunk/src_plugins/io_dsn/read.c (revision 24884) @@ -1678,8 +1678,8 @@ /* default unit in case the file does not specify one */ ctx->unit = get_unit_struct("inch"); - free(ctx->pcb->Name); - ctx->pcb->Name = pcb_strdup(STRE(root->children)); + free(ctx->pcb->hidlib.name); + ctx->pcb->hidlib.name = pcb_strdup(STRE(root->children)); for(n = root->children->next; n != NULL; n = n->next) { if (n->str == NULL) Index: trunk/src_plugins/io_dsn/write.c =================================================================== --- trunk/src_plugins/io_dsn/write.c (revision 24883) +++ trunk/src_plugins/io_dsn/write.c (revision 24884) @@ -132,8 +132,8 @@ } fprintf(wctx->f, "(pcb "); - if ((wctx->pcb->Name != NULL) && (*wctx->pcb->Name != '\0')) { - for(s = wctx->pcb->Name; *s != '\0'; s++) { + if ((wctx->pcb->hidlib.name != NULL) && (*wctx->pcb->hidlib.name != '\0')) { + for(s = wctx->pcb->hidlib.name; *s != '\0'; s++) { if (isalnum(*s)) fputc(*s, wctx->f); else Index: trunk/src_plugins/io_hyp/write.c =================================================================== --- trunk/src_plugins/io_hyp/write.c (revision 24883) +++ trunk/src_plugins/io_hyp/write.c (revision 24884) @@ -131,8 +131,8 @@ pcb_print_utc(dt, sizeof(dt), 0); - fprintf(wr->f, "* %s exported by pcb-rnd " PCB_VERSION " (" PCB_REVISION ") on %s\n", wr->pcb->Filename, dt); - fprintf(wr->f, "* Board: %s\n", wr->pcb->Name); + fprintf(wr->f, "* %s exported by pcb-rnd " PCB_VERSION " (" PCB_REVISION ") on %s\n", wr->pcb->hidlib.filename, dt); + fprintf(wr->f, "* Board: %s\n", wr->pcb->hidlib.name); fprintf(wr->f, "{VERSION=2.0}\n"); fprintf(wr->f, "{DATA_MODE=DETAILED}\n"); fprintf(wr->f, "{UNITS=METRIC LENGTH}\n"); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 24883) +++ trunk/src_plugins/io_lihata/read.c (revision 24884) @@ -404,9 +404,9 @@ if (nd->type != LHT_HASH) return iolht_error(nd, "board meta must be a hash\n"); - parse_text(&pcb->Name, lht_dom_hash_get(nd, "meta")); + parse_text(&pcb->hidlib.name, lht_dom_hash_get(nd, "meta")); - parse_text(&pcb->Name, lht_dom_hash_get(nd, "board_name")); + parse_text(&pcb->hidlib.name, lht_dom_hash_get(nd, "board_name")); grp = lht_dom_hash_get(nd, "grid"); if ((grp != NULL) && (grp->type == LHT_HASH)) { @@ -2213,7 +2213,7 @@ static void parse_conf(pcb_board_t *pcb, lht_node_t *sub) { if (conf_insert_tree_as(CFR_DESIGN, sub) != 0) - pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree '%s' found in %s\n", sub->name, pcb->Filename); + pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree '%s' found in %s\n", sub->name, pcb->hidlib.filename); else conf_update(NULL, -1); } Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 24883) +++ trunk/src_plugins/io_lihata/write.c (revision 24884) @@ -135,7 +135,7 @@ lht_node_t *meta, *grp; meta = lht_dom_node_alloc(LHT_HASH, "meta"); - lht_dom_hash_put(meta, build_text("board_name", pcb->Name)); + lht_dom_hash_put(meta, build_text("board_name", pcb->hidlib.name)); grp = lht_dom_node_alloc(LHT_HASH, "grid"); lht_dom_hash_put(meta, grp); @@ -1512,8 +1512,8 @@ char *orig_fn, *end; char *pcb_fn = pcb_strdup_subst(fnpat, pcb_build_fn_cb, NULL, PCB_SUBST_ALL); - orig_fn = PCB->Filename; - PCB->Filename = NULL; + orig_fn = PCB->hidlib.filename; + PCB->hidlib.filename = NULL; /* avoid .lht.lht.pcb */ end = pcb_fn + strlen(pcb_fn) - 1; @@ -1524,8 +1524,8 @@ free(pcb_fn); /* restore these because SaveTo() has changed them */ - free(PCB->Filename); - PCB->Filename = orig_fn; + free(PCB->hidlib.filename); + PCB->hidlib.filename = orig_fn; PCB->Data->loader = ctx; } } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 24883) +++ trunk/src_plugins/io_pcb/file.c (revision 24884) @@ -288,7 +288,7 @@ fprintf(FP, "FileVersion[%i]\n", PCBFileVersionNeeded()); fputs("\nPCB[", FP); - pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->Name)); + pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->hidlib.name)); pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->hidlib.size_x, PCB->hidlib.size_y); pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->hidlib.grid, PCB->hidlib.grid_ox, PCB->hidlib.grid_oy, conf_core.editor.draw_grid); pcb_fprintf(FP, "Cursor[%[0] %[0] 1000]\n", pcb_crosshair.X, pcb_crosshair.Y); Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 24883) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 24884) @@ -1965,7 +1965,7 @@ case 18: #line 305 "parse_y.y" /* yacc.c:1652 */ { - yyPCB->Name = (yyvsp[-1].string); + yyPCB->hidlib.name = (yyvsp[-1].string); yyPCB->hidlib.size_x = PCB_MAX_COORD; yyPCB->hidlib.size_y = PCB_MAX_COORD; old_fmt = 1; @@ -1976,7 +1976,7 @@ case 19: #line 312 "parse_y.y" /* yacc.c:1652 */ { - yyPCB->Name = (yyvsp[-3].string); + yyPCB->hidlib.name = (yyvsp[-3].string); yyPCB->hidlib.size_x = OU ((yyvsp[-2].measure)); yyPCB->hidlib.size_y = OU ((yyvsp[-1].measure)); old_fmt = 1; @@ -1987,7 +1987,7 @@ case 20: #line 319 "parse_y.y" /* yacc.c:1652 */ { - yyPCB->Name = (yyvsp[-3].string); + yyPCB->hidlib.name = (yyvsp[-3].string); yyPCB->hidlib.size_x = NU ((yyvsp[-2].measure)); yyPCB->hidlib.size_y = NU ((yyvsp[-1].measure)); old_fmt = 0; Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 24883) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 24884) @@ -303,7 +303,7 @@ pcbname : T_PCB '(' STRING ')' { - yyPCB->Name = $3; + yyPCB->hidlib.name = $3; yyPCB->hidlib.size_x = PCB_MAX_COORD; yyPCB->hidlib.size_y = PCB_MAX_COORD; old_fmt = 1; @@ -310,7 +310,7 @@ } | T_PCB '(' STRING measure measure ')' { - yyPCB->Name = $3; + yyPCB->hidlib.name = $3; yyPCB->hidlib.size_x = OU ($4); yyPCB->hidlib.size_y = OU ($5); old_fmt = 1; @@ -317,7 +317,7 @@ } | T_PCB '[' STRING measure measure ']' { - yyPCB->Name = $3; + yyPCB->hidlib.name = $3; yyPCB->hidlib.size_x = NU ($4); yyPCB->hidlib.size_y = NU ($5); old_fmt = 0; Index: trunk/src_plugins/io_tedax/io_tedax.c =================================================================== --- trunk/src_plugins/io_tedax/io_tedax.c (revision 24883) +++ trunk/src_plugins/io_tedax/io_tedax.c (revision 24884) @@ -84,7 +84,7 @@ } if (pcb_strcasecmp(type, "stackup") == 0) { - PCB_ACT_IRES(tedax_stackup_save(PCB, PCB->Name, fname)); + PCB_ACT_IRES(tedax_stackup_save(PCB, PCB->hidlib.name, fname)); return 0; } Index: trunk/src_plugins/io_tedax/tboard.c =================================================================== --- trunk/src_plugins/io_tedax/tboard.c (revision 24883) +++ trunk/src_plugins/io_tedax/tboard.c (revision 24884) @@ -147,7 +147,7 @@ goto error; fprintf(f, "\nbegin board v1 "); - tedax_fprint_escape(f, pcb->Name); + tedax_fprint_escape(f, pcb->hidlib.name); fputc('\n', f); pcb_fprintf(f, " drawing_area 0 0 %.06mm %.06mm\n", pcb->hidlib.size_x, pcb->hidlib.size_y); for(n = 0, a = pcb->Attributes.List; n < pcb->Attributes.Number; n++,a++) { Index: trunk/src_plugins/lib_gtk_common/bu_command.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_command.c (revision 24883) +++ trunk/src_plugins/lib_gtk_common/bu_command.c (revision 24884) @@ -245,7 +245,7 @@ pcb_parse_command(command, pcb_false); g_free(command); } - ctx->com->window_set_name_label(PCB->Name); + ctx->com->window_set_name_label(PCB->hidlib.name); ctx->com->set_status_line_label(); } Index: trunk/src_plugins/lib_gtk_common/bu_info_bar.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_info_bar.c (revision 24883) +++ trunk/src_plugins/lib_gtk_common/bu_info_bar.c (revision 24884) @@ -78,7 +78,7 @@ g_signal_connect(ibar->info_bar, "response", G_CALLBACK(info_bar_response_cb), ibar); - file_path_utf8 = g_filename_to_utf8(PCB->Filename, -1, NULL, NULL, NULL); + file_path_utf8 = g_filename_to_utf8(PCB->hidlib.filename, -1, NULL, NULL, NULL); secondary_text = PCB->Changed ? "Do you want to drop your changes and reload the file?" : "Do you want to reload the file?"; Index: trunk/src_plugins/lib_gtk_common/dlg_route_style.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_route_style.c (revision 24883) +++ trunk/src_plugins/lib_gtk_common/dlg_route_style.c (revision 24884) @@ -244,7 +244,7 @@ make_route_style_buttons(GHID_ROUTE_STYLE(dialog->rss)); pcb_trace("Style: %d deleted\n", dialog->rss->selected); pcb_board_set_changed_flag(pcb_true); - dialog->rss->com->window_set_name_label(PCB->Name); + dialog->rss->com->window_set_name_label(PCB->hidlib.name); add_new_iter(dialog->rss); dialog->inhibit_style_change = 0; pcb_gtk_route_style_select_style(dialog->rss, &pcb_custom_route_style); @@ -454,7 +454,7 @@ if (changed) { pcb_board_set_changed_flag(pcb_true); - com->window_set_name_label(PCB->Name); + com->window_set_name_label(PCB->hidlib.name); } if (changed || need_rebuild) { Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 24883) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 24884) @@ -151,7 +151,7 @@ ghid_handle_units_changed(tw); - tw->com->window_set_name_label(PCB->Name); + tw->com->window_set_name_label(PCB->hidlib.name); tw->com->set_status_line_label(); pcb_gtk_close_info_bar(&tw->ibar); update_board_mtime_from_disk(&tw->ext_chg); @@ -161,7 +161,7 @@ { /* Do nothing if it is not the active PCB file that is being saved. */ - if (PCB->Filename == NULL || strcmp(filename, PCB->Filename) != 0) + if (PCB->hidlib.filename == NULL || strcmp(filename, PCB->hidlib.filename) != 0) return; if (done) @@ -172,7 +172,7 @@ { /* Pick up the mtime of the new PCB file */ update_board_mtime_from_disk(&tw->ext_chg); - tw->com->window_set_name_label(PCB->Name); + tw->com->window_set_name_label(PCB->hidlib.name); } void ghid_install_accel_groups(GtkWindow *window, pcb_gtk_topwin_t *tw) @@ -202,10 +202,10 @@ if ((name == NULL) || (*name == '\0')) name = "Unnamed"; - if (!PCB->Filename || !*PCB->Filename) + if (!PCB->hidlib.filename || !*PCB->hidlib.filename) filename = ""; else - filename = PCB->Filename; + filename = PCB->hidlib.filename; pcb_snprintf(tmp, sizeof(tmp), "%s%s (%s) - %s - pcb-rnd", PCB->Changed ? "*" : "", name, filename, PCB->is_footprint ? "footprint" : "board"); gtk_window_set_title(GTK_WINDOW(tw->com->top_window), tmp); Index: trunk/src_plugins/lib_gtk_common/util_ext_chg.c =================================================================== --- trunk/src_plugins/lib_gtk_common/util_ext_chg.c (revision 24883) +++ trunk/src_plugins/lib_gtk_common/util_ext_chg.c (revision 24884) @@ -43,10 +43,10 @@ GTimeVal timeval; /* Treat zero time as a flag to indicate we've not got an mtime yet */ - if (PCB->Filename == NULL || (ec->our_mtime.tv_sec == 0 && ec->our_mtime.tv_usec == 0)) + if (PCB->hidlib.filename == NULL || (ec->our_mtime.tv_sec == 0 && ec->our_mtime.tv_usec == 0)) return pcb_false; - file = g_file_new_for_path(PCB->Filename); + file = g_file_new_for_path(PCB->hidlib.filename); info = g_file_query_info(file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL); g_object_unref(file); @@ -76,10 +76,10 @@ ec->our_mtime.tv_usec = 0; ec->last_seen_mtime = ec->our_mtime; - if (PCB->Filename == NULL) + if (PCB->hidlib.filename == NULL) return; - file = g_file_new_for_path(PCB->Filename); + file = g_file_new_for_path(PCB->hidlib.filename); info = g_file_query_info(file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL); g_object_unref(file); Index: trunk/src_plugins/lib_gtk_hid/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 24883) +++ trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 24884) @@ -120,7 +120,7 @@ static void ghid_port_button_press_main(void) { ghid_invalidate_all(); - ghid_window_set_name_label(PCB->Name); + ghid_window_set_name_label(PCB->hidlib.name); ghid_set_status_line_label(); if (!gport->view.panning) g_idle_add(ghid_idle_cb, &ghidgui->topwin); @@ -131,7 +131,7 @@ pcb_tool_adjust_attached_objects(); ghid_invalidate_all(); - ghid_window_set_name_label(PCB->Name); + ghid_window_set_name_label(PCB->hidlib.name); ghid_set_status_line_label(); g_idle_add(ghid_idle_cb, &ghidgui->topwin); } Index: trunk/src_plugins/lib_gtk_hid/glue_event.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_event.c (revision 24883) +++ trunk/src_plugins/lib_gtk_hid/glue_event.c (revision 24884) @@ -29,7 +29,7 @@ return; if (PCB != NULL) - ghidgui->common.window_set_name_label(PCB->Name); + ghidgui->common.window_set_name_label(PCB->hidlib.name); if (!gport->drawing_allowed) return; @@ -51,7 +51,7 @@ return; if (PCB != NULL) - ghidgui->common.window_set_name_label(PCB->Name); + ghidgui->common.window_set_name_label(PCB->hidlib.name); } static void ghid_gui_sync(void *user_data, int argc, pcb_event_arg_t argv[]) @@ -62,7 +62,7 @@ /* Sync gui status display with pcb state */ pcb_tool_adjust_attached_objects(); ghid_invalidate_all(); - ghidgui->common.window_set_name_label(PCB->Name); + ghidgui->common.window_set_name_label(PCB->hidlib.name); ghidgui->common.set_status_line_label(); /* Sync menu checkboxes */ @@ -71,7 +71,7 @@ static void ghid_gui_sync_status(void *user_data, int argc, pcb_event_arg_t argv[]) { - ghidgui->common.window_set_name_label(PCB->Name); + ghidgui->common.window_set_name_label(PCB->hidlib.name); ghidgui->common.set_status_line_label(); } Index: trunk/src_plugins/lib_hid_common/place.c =================================================================== --- trunk/src_plugins/lib_hid_common/place.c (revision 24883) +++ trunk/src_plugins/lib_hid_common/place.c (revision 24884) @@ -227,7 +227,7 @@ if (role != CFR_DESIGN) { - int r = conf_save_file(NULL, (PCB == NULL ? NULL : PCB->Filename), role, NULL); + int r = conf_save_file(NULL, (PCB == NULL ? NULL : PCB->hidlib.filename), role, NULL); if (r != 0) pcb_message(PCB_MSG_ERROR, "Failed to save window geometry in %s\n", conf_role_name(role)); } Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 24883) +++ trunk/src_plugins/propedit/propsel.c (revision 24884) @@ -115,7 +115,7 @@ static void map_board(pcb_propedit_t *ctx, pcb_board_t *pcb) { - map_add_prop(ctx, "p/board/name", String, pcb->Name); + map_add_prop(ctx, "p/board/name", String, pcb->hidlib.name); map_add_prop(ctx, "p/board/width", pcb_coord_t, pcb->hidlib.size_x); map_add_prop(ctx, "p/board/height", pcb_coord_t, pcb->hidlib.size_y); map_attr(ctx, &pcb->Attributes); Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 24883) +++ trunk/src_plugins/shand_cmd/command.c (revision 24884) @@ -164,8 +164,8 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, SaveLayout, filename = argv[1].val.str); if (filename == NULL) { - if (PCB->Filename) { - if (pcb_save_pcb(PCB->Filename, NULL) == 0) + if (PCB->hidlib.filename) { + if (pcb_save_pcb(PCB->hidlib.filename, NULL) == 0) pcb_board_set_changed_flag(pcb_false); } else @@ -174,8 +174,8 @@ else { if (pcb_save_pcb(filename, NULL) == 0) { pcb_board_set_changed_flag(pcb_false); - free(PCB->Filename); - PCB->Filename = pcb_strdup(filename); + free(PCB->hidlib.filename); + PCB->hidlib.filename = pcb_strdup(filename); if (pcb_gui->notify_filename_changed != NULL) pcb_gui->notify_filename_changed(); }