Index: trunk/globalconst.h =================================================================== --- trunk/globalconst.h (revision 2064) +++ trunk/globalconst.h (revision 2065) @@ -42,12 +42,6 @@ #endif /* --------------------------------------------------------------------------- - * some file-, directory- and environment names - */ -#define EMERGENCY_NAME "PCB.%.8i.save" /* %i --> pid */ -#define BACKUP_NAME "PCB.%.8i.backup" /* %i --> pid */ - -/* --------------------------------------------------------------------------- * some default values */ #define DEFAULT_CELLSIZE 50 /* default cell size for symbols */ Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 2064) +++ trunk/src/conf_core.h (revision 2065) @@ -79,6 +79,10 @@ CFT_STRING library_shell; CFT_LIST library_search_paths; + CFT_STRING emergency_name; /* file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional fields: %i --> pid */ + CFT_STRING backup_name; /* file name template for periodic backup anonymous .pcb files; optional fields: %i --> pid */ + + CFT_STRING save_command; CFT_LIST default_font_file; /* name of default font file (list of names to search) */ CFT_LIST default_pcb_file; Index: trunk/src/pcb-conf.lht =================================================================== --- trunk/src/pcb-conf.lht (revision 2064) +++ trunk/src/pcb-conf.lht (revision 2065) @@ -83,6 +83,9 @@ # file_path = {} library_shell = {} + emergency_name = {PCB.%.8i.save} + backup_name = {PCB.%.8i.backup} + li:library_search_paths = { ../pcblib ~/pcblib/ Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2064) +++ trunk/src/plug_io.c (revision 2065) @@ -542,7 +542,7 @@ /* memory might have been released before this function is called */ if (PCB && PCB->Changed) { - sprintf(filename, EMERGENCY_NAME, (int) getpid()); + sprintf(filename, conf_core.rc.emergency_name, (int) getpid()); Message(_("Trying to save your layout in '%s'\n"), filename); WritePCBFile(filename); } @@ -605,7 +605,7 @@ /* --------------------------------------------------------------------------- * creates backup file. The default is to use the pcb file name with * a "-" appended (like "foo.pcb-") and if we don't have a pcb file name - * then use the template in BACKUP_NAME + * then use the template in conf_core.rc.backup_name */ void Backup(void) { @@ -620,13 +620,13 @@ sprintf(filename, "%s-", PCB->Filename); } else { - /* BACKUP_NAME has %.8i which will be replaced by the process ID */ - filename = (char *) malloc(sizeof(char) * (strlen(BACKUP_NAME) + 8)); + /* conf_core.rc.backup_name has %.8i which will be replaced by the process ID */ + filename = (char *) malloc(sizeof(char) * (strlen(conf_core.rc.backup_name) + 8)); if (filename == NULL) { fprintf(stderr, "Backup(): malloc failed\n"); exit(1); } - sprintf(filename, BACKUP_NAME, (int) getpid()); + sprintf(filename, conf_core.rc.backup_name, (int) getpid()); } WritePCBFile(filename); @@ -642,7 +642,7 @@ */ void SaveTMPData(void) { - sprintf(TMPFilename, EMERGENCY_NAME, (int) getpid()); + sprintf(TMPFilename, conf_core.rc.emergency_name, (int) getpid()); WritePCBFile(TMPFilename); }