diff --git a/src/actions.c b/src/actions.c index 0347a99d..f7b248e4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -546,16 +546,11 @@ void remove_symbol(int j) int i,c; xSymbol save; dbg(1, "remove_symbol(): removing symbol %d\n", j); - if(xctx.sym[j].prop_ptr != NULL) { - my_free(666, &xctx.sym[j].prop_ptr); - } - if(xctx.sym[j].templ != NULL) { - my_free(667, &xctx.sym[j].templ); - } - if(xctx.sym[j].type != NULL) { - my_free(668, &xctx.sym[j].type); - } + my_free(666, &xctx.sym[j].prop_ptr); + my_free(667, &xctx.sym[j].templ); + my_free(668, &xctx.sym[j].type); + my_free(684, &xctx.sym[j].name); /* /20150409 */ for(c=0;cprop_ptr,"type",0)); */ my_strdup(23, &type,(xctx.inst[j].ptr+ xctx.sym)->type); if( type && IS_LABEL_SH_OR_PIN(type)) break; symbol = xctx.sym + xctx.inst[j].ptr; diff --git a/src/draw.c b/src/draw.c index f8ee33d1..73dc385b 100644 --- a/src/draw.c +++ b/src/draw.c @@ -484,8 +484,7 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot, if(!has_x) return; if( (hide_symbols==1 && (xctx.inst[n].ptr+ xctx.sym)->prop_ptr && - !strcmp(get_tok_value( (xctx.inst[n].ptr+ xctx.sym)->prop_ptr, "type",0 ), "subcircuit") ) || - (hide_symbols == 2) ) { + !strcmp( (xctx.inst[n].ptr+ xctx.sym)->type, "subcircuit") ) || (hide_symbols == 2) ) { hide = 1; } else { hide = 0; diff --git a/src/save.c b/src/save.c index aeac8c91..d7960276 100644 --- a/src/save.c +++ b/src/save.c @@ -1560,7 +1560,7 @@ int load_sym_def(const char *name, FILE *embed_fd) if((lcc[level].fd=fopen(sympath,fopen_read_mode))==NULL) { if(recursion_counter == 1) dbg(0, "l_s_d(): Symbol not found: %s\n",sympath); - my_snprintf(sympath, S(sympath), "%s/%s.sym", tclgetvar("XSCHEM_SHAREDIR"), "systemlib/missing"); + my_snprintf(sympath, S(sympath), "%s/%s", tclgetvar("XSCHEM_SHAREDIR"), "systemlib/missing.sym"); if((lcc[level].fd=fopen(sympath, fopen_read_mode))==NULL) { fprintf(errfp, "l_s_d(): systemlib/missing.sym missing, I give up\n"); diff --git a/src/scheduler.c b/src/scheduler.c index 1f07b88b..b02ee14e 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -290,7 +290,20 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } Tcl_ResetResult(interp); } - + else if(!strcmp(argv[1], "load_symbol")) + { + int save, missing = 0; + if(argc > 2) { + save = xctx.symbols; + match_symbol(argv[2]); + if( xctx.symbols != save && !strcmp( xctx.sym[xctx.symbols - 1].type, "missing") ) { + missing = 1; + remove_symbol( xctx.symbols - 1); + } + } + Tcl_ResetResult(interp); + Tcl_AppendResult(interp, missing ? "0" : "1", NULL); + } else if(!strcmp(argv[1],"place_symbol")) { int ret; diff --git a/src/spice.awk b/src/spice.awk old mode 100644 new mode 100755 diff --git a/src/verilog.awk b/src/verilog.awk old mode 100644 new mode 100755 diff --git a/src/xschem.tcl b/src/xschem.tcl index dc0804ec..6608de04 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -1608,10 +1608,11 @@ proc enter_text {textlabel {preserve_disabled disabled}} { } button .t.buttons.b3 -text "Load" -command \ { - global INITIALPROPDIR - set a [tk_getOpenFile -parent .t -initialdir $INITIALPROPDIR ] + global INITIALTEXTDIR + if { ![info exists INITIALTEXTDIR] } { set INITIALTEXTDIR $current_dirname } + set a [tk_getOpenFile -parent .t -initialdir $INITIALTEXTDIR ] if [string compare $a ""] { - set INITIALPROPDIR [file dirname $a] + set INITIALTEXTDIR [file dirname $a] read_data_window .t.txt $a } }