void CLofig::saveas (string &name) { char *current_name; cmess1 << " o Saving netlist as \"" << name << "\"...\n"; current_name = fig->NAME; fig->NAME = namealloc ((char*)name.c_str ()); savelofig (fig); fig->NAME = current_name; }
void CLofig::save (void) { cmess1 << " o Saving netlist \"" << fig->NAME << "\"...\n"; savelofig (fig); }
int main(int argc, char **argv) { lofig_list *f; char *filein=NULL, *fileout=NULL; int i,j; int opt=0; if (argc<2) { printusage(); exit(1); } mbkenv(); for (i=1; i<argc; i++) if (argv[i][0]=='-') for (j=1; argv[i][j]!='\0'; j++) { switch (argv[i][j]) { case 'a': opt|=ADDSIG; break; case 'n': opt|=NOALIM; break; case 'g': opt|=NOLOGEN; break; case 'r': opt|=RENINS; break; case 'v': opt|=VSTDRV; break; case 'c': opt|=VECCON; break; case 'm': opt|=MBKDRV; break; case 'u': opt|=NOVECT; break; default: fprintf(stderr, "** Unknown option -%c\n", argv[i][1]); printusage(); exit(2); } } else if (!filein) filein=argv[i]; else if (!fileout) fileout=argv[i]; else { fputs("** Too many filenames\n", stderr); printusage(); exit(4); } if (!filein) { fputs("** Filename expected!\n", stderr); printusage(); exit(3); } f=getlofig(filein,'A'); guessextdir(f); if (opt & NOALIM) removepowers(f); if (opt & RENINS) renameinstance(f); if (opt & NOLOGEN) removelogen(f); #if 0 if (opt & VECCON) { vectlocon(f); sortlocon(&f->LOCON); f->LOCON=(locon_list *)reverse(f->LOCON); } #endif if (fileout) f->NAME=namealloc(fileout); if (!(opt & NOVECT)) vectlosig(&f->LOSIG); if (opt & MBKDRV) savelofig(f); else { if (opt&VSTDRV) vhdlsavevelofig(f, 0); else if (opt&ADDSIG) vhdlsavevelofig(f, 1); else vhdlsavevelofig(f, 2); } #if 0 #ifdef VEL_DEBUG f->NAME=namealloc("netlist"); vhdlsavevelofig(f,1); #endif #endif exit(0); }