- vhdl_ignore
diff --git a/doc/xschem_man/xschem_properties.html b/doc/xschem_man/xschem_properties.html
index 184b3691..092533d7 100644
--- a/doc/xschem_man/xschem_properties.html
+++ b/doc/xschem_man/xschem_properties.html
@@ -73,8 +73,8 @@ p{padding: 15px 30px 10px;}
schematic (.sch) or symbol window (.sym).
There is actually one different global property
- string defined for any available netlisting modes, so if XSCHEM is set to produce SPICE
- netlists the SPICE global property string is displayed.
+ string defined for any available netlisting modes plus one global property string for symbol definition (file format 1.2),
+ so if XSCHEM is set to produce SPICE netlists the SPICE global property string is displayed.
So, in addition to properties associated to graphical objects and
@@ -82,7 +82,7 @@ p{padding: 15px 30px 10px;}
- The format attribute defines the format of the SPICE netlist.
+ In the above 'Symbol' global property string, the format attribute defines the format of the SPICE netlist.
The SPICE netlist element line starts with the
symbol name (in this case a resistor so 'rxxxxx'), the list of pins, the
resistor value and a multiplicity factor (m).
diff --git a/scconfig/src/default/deps_default.c b/scconfig/src/default/deps_default.c
index 45192727..25cfd227 100644
--- a/scconfig/src/default/deps_default.c
+++ b/scconfig/src/default/deps_default.c
@@ -109,6 +109,7 @@ void deps_default_init(void)
dep_add("libs/fs/makedev/*", find_fs_makedev);
dep_add("libs/io/pipe/*", find_io_pipe);
+ dep_add("libs/io/_pipe/*", find_io__pipe);
dep_add("libs/io/dup2/*", find_io_dup2);
dep_add("libs/io/fileno/*", find_io_fileno);
dep_add("libs/io/lseek/*", find_io_lseek);
diff --git a/scconfig/src/default/find.h b/scconfig/src/default/find.h
index 879b59c6..c252d9fa 100644
--- a/scconfig/src/default/find.h
+++ b/scconfig/src/default/find.h
@@ -127,6 +127,7 @@ int find_shell(const char *name, int logdepth, int fatal);
/* find_io.c */
int find_io_pipe(const char *name, int logdepth, int fatal);
+int find_io__pipe(const char *name, int logdepth, int fatal);
int find_io_dup2(const char *name, int logdepth, int fatal);
int find_io_fileno(const char *name, int logdepth, int fatal);
int find_io_lseek(const char *name, int logdepth, int fatal);
diff --git a/scconfig/src/default/find_io.c b/scconfig/src/default/find_io.c
index e2d55c92..1e572729 100644
--- a/scconfig/src/default/find_io.c
+++ b/scconfig/src/default/find_io.c
@@ -48,11 +48,31 @@ int find_io_pipe(const char *name, int logdepth, int fatal)
logprintf(logdepth, "find_io_pipe: trying to find pipe(2)...\n");
logdepth++;
-
- if (try_icl(logdepth, "libs/io/pipe", test_c, NULL, NULL, NULL)) return 0;
+ if (try_icl(logdepth, "libs/io/pipe", test_c, "#include \n", NULL, NULL)) return 0;
return try_fail(logdepth, "libs/io/pipe");
}
+int find_io__pipe(const char *name, int logdepth, int fatal)
+{
+ const char *test_c =
+ NL "int main() {"
+ NL " int fd[2];"
+ NL " if (_pipe(fd, 1024, _O_BINARY) == 0)"
+ NL " puts(\"OK\");"
+ NL " return 0;"
+ NL "}"
+ NL;
+
+ require("cc/cc", logdepth, fatal);
+
+ report("Checking for _pipe()... ");
+ logprintf(logdepth, "find_io__pipe: trying to find _pipe()...\n");
+ logdepth++;
+
+ if (try_icl(logdepth, "libs/io/_pipe", test_c, "#include \n#include \n", NULL, NULL)) return 0;
+ return try_fail(logdepth, "libs/io/_pipe");
+}
+
int find_io_dup2(const char *name, int logdepth, int fatal)
{
char *test_c =
diff --git a/src/actions.c b/src/actions.c
index 66c33848..1d6da2ed 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -469,13 +469,13 @@ void saveas(const char *f, int type) /* changed name from ask_save_file to save
char *p;
if(!f && has_x) {
my_strncpy(filename , abs_sym_path(schematic[currentsch], ""), S(filename));
- if(type == SCHEMATIC) {
- my_snprintf(name, S(name), "save_file_dialog {Save file} .sch.sym INITIALLOADDIR {%s}", filename);
- } else {
+ if(type == SYMBOL) {
if( (p = strrchr(filename, '.')) && !strcmp(p, ".sch") ) {
my_strncpy(filename, add_ext(filename, ".sym"), S(filename));
}
my_snprintf(name, S(name), "save_file_dialog {Save file} .sym.sch INITIALLOADDIR {%s}", filename);
+ } else {
+ my_snprintf(name, S(name), "save_file_dialog {Save file} .sch.sym INITIALLOADDIR {%s}", filename);
}
tcleval(name);
@@ -487,7 +487,6 @@ void saveas(const char *f, int type) /* changed name from ask_save_file to save
else res[0]='\0';
if(!res[0]) return; /* 20071104 */
- current_type = type;
dbg(1, "saveas(): res = %s\n", res);
save_schematic(res);
Tcl_VarEval(interp, "update_recent_file {", res,"}", NULL);
@@ -891,7 +890,6 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, int rot,
static char name[PATH_MAX];
char *type;
int cond;
- if(current_type==SYMBOL) return 0; /* 20161210 dont allow components placed inside symbols */
if(symbol_name==NULL) {
tcleval("load_file_dialog {Choose symbol} .sym INITIALINSTDIR");
my_strncpy(name, tclresult(), S(name));
@@ -1071,7 +1069,6 @@ void descend_schematic(void)
int inst_mult, inst_number;
int save_ok = 0;
- if(!(current_type==SCHEMATIC)) return; /*20180928 */
rebuild_selected_array();
if(lastselected !=1 || selectedgroup[0].type!=ELEMENT)
@@ -1186,7 +1183,6 @@ void descend_schematic(void)
void go_back(int confirm) /* 20171006 add confirm */
{
- int prev_curr_type=0;
int save_ok; /* 20171020 */
int from_embedded_sym;
int save_modified;
@@ -1195,7 +1191,6 @@ void go_back(int confirm) /* 20171006 add confirm */
save_ok=0;
if(currentsch>0)
{
- prev_curr_type=current_type; /* 20190521 */
/* if current sym/schematic is changed ask save before going up */
if(modified)
{
@@ -1227,9 +1222,7 @@ void go_back(int confirm) /* 20171006 add confirm */
load_schematic(1, filename, 1);
if(from_embedded_sym) modified=save_modified; /* to force ask save embedded sym in parent schematic */
- if(prev_curr_type==SCHEMATIC) {
- hilight_parent_pins();
- }
+ hilight_parent_pins();
if(enable_drill) drill_hilight(); /* 20171212 */
xorigin=zoom_array[currentsch].x;
yorigin=zoom_array[currentsch].y;
@@ -1239,7 +1232,6 @@ void go_back(int confirm) /* 20171006 add confirm */
change_linewidth(-1.);
draw();
- current_type=SCHEMATIC;
dbg(1, "go_back(): current path: %s\n", sch_path[currentsch]);
}
}
diff --git a/src/callback.c b/src/callback.c
index 26f7a6f4..65116bb1 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -710,7 +710,7 @@ int callback(int event, int mx, int my, KeySym key,
{
if(semaphore >= 2) break;
if(!strcmp(schematic[currentsch],"") || strstr(schematic[currentsch], "untitled")) { /* check if unnamed schematic, use saveas in this case */
- saveas(NULL, current_type);
+ saveas(NULL, SCHEMATIC);
} else {
save(1);
}
@@ -725,7 +725,7 @@ int callback(int event, int mx, int my, KeySym key,
if(key=='S' && state == (ShiftMask | ControlMask)) /* save as schematic */
{
if(semaphore >= 2) break;
- saveas(NULL, current_type);
+ saveas(NULL, SCHEMATIC);
break;
}
if(key=='e' && state == 0) /* descend to schematic */
@@ -752,13 +752,11 @@ int callback(int event, int mx, int my, KeySym key,
if(key=='a' && state == 0) /* make symbol */
{
if(semaphore >= 2) break; /* 20180914 */
- if(current_type==SCHEMATIC) {
- tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}");
- if(strcmp(tclresult(),"ok")==0)
- {
- save_schematic(schematic[currentsch]);
- make_symbol();
- }
+ tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}");
+ if(strcmp(tclresult(),"ok")==0)
+ {
+ save_schematic(schematic[currentsch]);
+ make_symbol();
}
break;
}
diff --git a/src/editprop.c b/src/editprop.c
index 01c5067b..74af4e95 100644
--- a/src/editprop.c
+++ b/src/editprop.c
@@ -769,47 +769,44 @@ void edit_text_property(int x)
tclgetvar("props"),
tclgetvar("retval") );
if(text_changed) {
- if(current_type==SYMBOL) {
- c = lastrect[PINLAYER];
- for(l=0;l0) {
- if(symline ~ /^G \{/ ) start=1
+ if(symline ~ /^[GK] \{/ ) start=1
if(start) template=template symline "\n"
if(symline ~ /\} *$/) start=0
}
@@ -70,7 +70,7 @@ function beginfile(f)
ip=op=n_pin=0
print "v {xschem version=2.9.7 file_version=1.1}" > sym
if(template=="") {
- printf "%s", "G {type=subcircuit\nformat=\"@name @pinlist @symname\"\n" >sym
+ printf "%s", "K {type=subcircuit\nformat=\"@name @pinlist @symname\"\n" >sym
printf "%s\n", "template=\"name=x1\"" >sym
printf "%s", "}\n" >sym
}
diff --git a/src/save.c b/src/save.c
index 6b784b59..92a16947 100644
--- a/src/save.c
+++ b/src/save.c
@@ -398,52 +398,45 @@ void save_line(FILE *fd)
void write_xschem_file(FILE *fd)
{
+ int ty=0;
fprintf(fd, "v {xschem version=%s file_version=%s}\n", XSCHEM_VERSION, XSCHEM_FILE_VERSION);
- /* 20171025 for symbol only put G {} field and look for format or type props in the 3 global prop strings. */
- if(current_type == SYMBOL) {
- if(schsymbolprop && schsymbolprop[0]) {
- fprintf(fd, "G ");
- save_ascii_string(schsymbolprop,fd);
- fprintf(fd, "\nV {}\nS {}\nE {}\n");
- }
- else if(schvhdlprop && !strncmp(schvhdlprop,"type=", 5)) {
+
+ if(schvhdlprop && !schsymbolprop) {
+ get_tok_value(schvhdlprop,"type",0);
+ ty = get_tok_size;
+ if(ty && !strcmp(schematic[currentsch] + strlen(schematic[currentsch]) - 4,".sym") ) {
+ fprintf(fd, "G {}\nK ");
+ save_ascii_string(schvhdlprop,fd);
+ fputc('\n', fd);
+ } else {
fprintf(fd, "G ");
save_ascii_string(schvhdlprop,fd);
- fprintf(fd, "\nV {}\nS {}\nE {}\n");
- }
- else if(schtedaxprop && !strncmp(schtedaxprop,"type=", 5)) {
- fprintf(fd, "G ");
- save_ascii_string(schtedaxprop,fd);
- fprintf(fd, "\nV {}\nS {}\nE {}\n");
- }
- else if(schprop && !strncmp(schprop,"type=", 5)) {
- fprintf(fd, "G ");
- save_ascii_string(schprop,fd);
- fprintf(fd, "\nV {}\nS {}\nE {}\n");
- } else if(schverilogprop && !strncmp(schverilogprop,"type=", 5)) {
- fprintf(fd, "G ");
- save_ascii_string(schverilogprop,fd);
- fprintf(fd, "\nV {}\nS {}\nE {}\n");
+ fputc('\n', fd);
+ fprintf(fd, "K ");
+ save_ascii_string(schsymbolprop,fd);
+ fputc('\n', fd);
}
} else {
fprintf(fd, "G ");
save_ascii_string(schvhdlprop,fd);
fputc('\n', fd);
- if(schsymbolprop && schsymbolprop[0]) {
- fprintf(fd, "K ");
- save_ascii_string(schsymbolprop,fd);
- fputc('\n', fd);
- }
- fprintf(fd, "V ");
- save_ascii_string(schverilogprop,fd); /*09112003 */
- fputc('\n', fd);
- fprintf(fd, "S ");
- save_ascii_string(schprop,fd); /* 20100217 */
- fputc('\n', fd);
- fprintf(fd, "E ");
- save_ascii_string(schtedaxprop,fd); /* 20100217 */
+ fprintf(fd, "K ");
+ save_ascii_string(schsymbolprop,fd);
fputc('\n', fd);
}
+
+ fprintf(fd, "V ");
+ save_ascii_string(schverilogprop,fd); /*09112003 */
+ fputc('\n', fd);
+
+ fprintf(fd, "S ");
+ save_ascii_string(schprop,fd); /* 20100217 */
+ fputc('\n', fd);
+
+ fprintf(fd, "E ");
+ save_ascii_string(schtedaxprop,fd); /* 20100217 */
+ fputc('\n', fd);
+
save_line(fd);
save_box(fd);
save_arc(fd);
@@ -728,6 +721,7 @@ void read_xschem_file(FILE *fd) /* 20180912 */
char tag[1];
int inst_cnt;
int version_found = 0;
+ int ty=0;
dbg(2, "read_xschem_file(): start\n");
inst_cnt = endfile = 0;
@@ -759,9 +753,6 @@ void read_xschem_file(FILE *fd) /* 20180912 */
break;
case 'G':
load_ascii_string(&schvhdlprop,fd);
- if(schvhdlprop && !strncmp(schvhdlprop, "type=", 5)) current_type = SYMBOL;
- else current_type=SCHEMATIC;
- dbg(2, "read_xschem_file(): schematic property:%s\n",schvhdlprop?schvhdlprop:"");
break;
case 'L':
load_line(fd);
@@ -782,7 +773,6 @@ void read_xschem_file(FILE *fd) /* 20180912 */
load_wire(fd);
break;
case 'C':
- current_type=SCHEMATIC;
load_inst(inst_cnt++, fd);
break;
case '[':
@@ -838,6 +828,17 @@ void read_xschem_file(FILE *fd) /* 20180912 */
break;
}
read_line(fd, 0); /* discard any remaining characters till (but not including) newline */
+
+ if(schvhdlprop) {
+ get_tok_value(schvhdlprop, "type",0);
+ ty = get_tok_size;
+ if(!schsymbolprop && ty && !strcmp(schematic[currentsch] + strlen(schematic[currentsch]) - 4,".sym")) {
+ char *tmp;
+ tmp = schsymbolprop;
+ schsymbolprop = schvhdlprop;
+ schvhdlprop = tmp;
+ }
+ }
if(check_version && !version_found) return;
if(!file_version[0]) {
my_snprintf(file_version, S(file_version), "1.0");
@@ -966,7 +967,6 @@ void load_schematic(int load_symbols, const char *filename, int reset_undo) /* 2
struct stat buf;
int i;
- current_type=SCHEMATIC; /* correct type is set later by read_xschem_file() */
prepared_hilight_structs=0; /* 20171212 */
prepared_netlist_structs=0; /* 20171212 */
prepared_hash_instances=0; /* 20171224 */
@@ -999,7 +999,7 @@ void load_schematic(int load_symbols, const char *filename, int reset_undo) /* 2
fclose(fd); /* 20150326 moved before load symbols */
set_modify(0);
dbg(2, "load_schematic(): loaded file:wire=%d inst=%d\n",lastwire , lastinst);
- if(load_symbols && current_type == SCHEMATIC) link_symbols_to_instances();
+ if(load_symbols) link_symbols_to_instances();
}
dbg(1, "load_schematic(): %s, returning\n", schematic[currentsch]);
} else {
diff --git a/src/scheduler.c b/src/scheduler.c
index e860b53c..78758c80 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -212,12 +212,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(!strcmp(argv[1],"make_symbol"))
{
if(has_x) tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}");
- if(!has_x || strcmp(tclresult(),"ok")==0)
- if(current_type==SCHEMATIC)
- {
- save_schematic(schematic[currentsch]);
- make_symbol();
- }
+ if(!has_x || strcmp(tclresult(),"ok")==0) {
+ save_schematic(schematic[currentsch]);
+ make_symbol();
+ }
Tcl_ResetResult(interp);
}
@@ -407,7 +405,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
my_snprintf(schematic[currentsch], S(schematic[currentsch]), "%s/%s", pwd_dir, name);
my_strncpy(current_name, name, S(current_name));
- current_type=SYMBOL;
} else {
for(i=0;;i++) {
if(i == 0) my_snprintf(name, S(name), "%s.sch", "untitled");
@@ -416,7 +413,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
my_snprintf(schematic[currentsch], S(schematic[currentsch]), "%s/%s", pwd_dir, name);
my_strncpy(current_name, name, S(current_name));
- current_type=SCHEMATIC;
}
draw();
set_modify(0); /* 20171025 */
@@ -895,19 +891,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
f = !strcmp(argv[2],"") ? NULL : argv[2];
if(!strcmp(argv[3], "SCHEMATIC")) saveas(f, SCHEMATIC);
else if(!strcmp(argv[3], "SYMBOL")) saveas(f, SYMBOL);
- else saveas(f, current_type);
+ else saveas(f, SCHEMATIC);
}
else if(argc == 3) {
const char *f;
f = !strcmp(argv[2],"") ? NULL : argv[2];
- saveas(f, current_type);
+ saveas(f, SCHEMATIC);
}
- else saveas(NULL, current_type);
+ else saveas(NULL, SCHEMATIC);
} else if(!strcmp(argv[1],"save")) {
dbg(1, "xschem(): saving: current schematic\n");
if(!strcmp(schematic[currentsch],"")) { /* 20170622 check if unnamed schematic, use saveas in this case... */
- saveas(NULL, current_type);
+ saveas(NULL, SCHEMATIC);
} else {
save(0);
}
@@ -915,7 +911,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
printf("top win:%lx\n", Tk_WindowId(Tk_Parent(Tk_MainWindow(interp))));
} else if(!strcmp(argv[1],"globals")) {
printf("*******global variables:*******\n");
- printf("current_type=%s\n", current_type == SCHEMATIC ? "SCHEMATIC" : "SYMBOL");
printf("netlist_dir=%s\n", netlist_dir? netlist_dir: "");
printf("lw=%d\n", lw);
printf("lastwire=%d\n", lastwire);
@@ -1567,13 +1562,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
else if(!strcmp(argv[1],"get") && argc==3)
{
- if(!strcmp(argv[2],"current_type")) { /* 20171025 */
- if( current_type == SYMBOL )
- Tcl_AppendResult(interp, "SYMBOL",NULL);
- else
- Tcl_AppendResult(interp, "SCHEMATIC",NULL);
- }
- else if(!strcmp(argv[2],"incr_hilight")) {
+ if(!strcmp(argv[2],"incr_hilight")) {
if( incr_hilight != 0 )
Tcl_AppendResult(interp, "1",NULL);
else
@@ -1877,13 +1866,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
double s = atof(argv[3]);
if(s>-20. && s<20.) nocairo_vert_correct = s;
}
- else if(!strcmp(argv[2],"current_type")) { /* 20171025 */
- if(!strcmp(argv[3],"SYMBOL")) {
- current_type=SYMBOL;
- } else {
- current_type=SCHEMATIC;
- }
- }
else if(!strcmp(argv[2],"persistent_command")) { /* 20171025 */
if(!strcmp(argv[3],"1")) {
persistent_command=1;
diff --git a/src/spice_netlist.c b/src/spice_netlist.c
index f830e85a..bea64714 100644
--- a/src/spice_netlist.c
+++ b/src/spice_netlist.c
@@ -41,12 +41,6 @@ void global_spice_netlist(int global) /* netlister driver */
char cellname[PATH_MAX]; /* 20081211 overflow safe 20161122 */
char *subckt_name;
- if(current_type==SYMBOL) {
- tcleval("alert_ {This is a symbol, no netlisting can be done.\n"
- "If this is a schematic delete any 'type=...'\n"
- "from global properties, save and restart xschem}");
- return;
- }
if(modified) {
save_ok = save_schematic(schematic[currentsch]);
if(save_ok == -1) return;
diff --git a/src/tedax_netlist.c b/src/tedax_netlist.c
index 91c6182d..9718d8ad 100644
--- a/src/tedax_netlist.c
+++ b/src/tedax_netlist.c
@@ -31,12 +31,6 @@ void global_tedax_netlist(int global) /* netlister driver */
char tcl_cmd_netlist[PATH_MAX + 100]; /* 20081211 overflow safe 20161122 */
char cellname[PATH_MAX]; /* 20081211 overflow safe 20161122 */
- if(current_type==SYMBOL) {
- tcleval("alert_ {This is a symbol, no netlisting can be done.\n"
- "If this is a schematic delete any 'type=...'\n"
- "from global properties, save and restart xschem}");
- return;
- }
if(modified) {
save_ok = save_schematic(schematic[currentsch]);
if(save_ok == -1) return;
diff --git a/src/verilog_netlist.c b/src/verilog_netlist.c
index 4d377152..d9390b44 100644
--- a/src/verilog_netlist.c
+++ b/src/verilog_netlist.c
@@ -39,12 +39,6 @@ void global_verilog_netlist(int global) /* netlister driver */
struct stat buf;
char *subckt_name;
- if(current_type==SYMBOL) {
- tcleval("alert_ {This is a symbol, no netlisting can be done.\n"
- "If this is a schematic delete any 'type=...'\n"
- "from global properties, save and restart xschem}");
- return;
- }
if(modified) {
save_ok = save_schematic(schematic[currentsch]);
if(save_ok == -1) return;
diff --git a/src/vhdl_netlist.c b/src/vhdl_netlist.c
index 08afee67..6019bb66 100644
--- a/src/vhdl_netlist.c
+++ b/src/vhdl_netlist.c
@@ -43,12 +43,6 @@ void global_vhdl_netlist(int global) /* netlister driver */
/* top sch properties used for library use declarations and type definitions */
/* to be printed before any entity declarations */
- if(current_type==SYMBOL) {
- tcleval("alert_ {This is a symbol, no netlisting can be done.\n"
- "If this is a schematic delete any 'type=...'\n"
- "from global properties, save and restart xschem}");
- return;
- }
if(modified) {
save_ok = save_schematic(schematic[currentsch]);
if(save_ok == -1) return;
diff --git a/src/xschem.h b/src/xschem.h
index 76e55994..2f7ad080 100644
--- a/src/xschem.h
+++ b/src/xschem.h
@@ -536,7 +536,6 @@ extern int tcp_port;
extern int debug_var;
extern char **color_array;
extern Colormap colormap;
-extern int current_type;
extern char current_name[PATH_MAX];
extern unsigned int color_index[];
extern int lw; /* line width */
diff --git a/src/xschem.tcl b/src/xschem.tcl
index 14aa9905..6c389b2c 100644
--- a/src/xschem.tcl
+++ b/src/xschem.tcl
@@ -840,8 +840,7 @@ proc save_file_dialog { msg ext global_initdir {initialfile {}} {overwrt 1} } {
}
proc is_xschem_file {f} {
- set fd [open $f r]
- set a [catch "open \"$f\" r" fd]
+ set a [catch {open "$f" r} fd]
set ret 0
set score 0
set instances 0
@@ -849,7 +848,7 @@ proc is_xschem_file {f} {
puts stderr "Can not open file $f"
} else {
while { [gets $fd line] >=0 } {
- if { [regexp {^[TGVSE] \{} $line] } { incr score }
+ if { [regexp {^[TKGVSE] \{} $line] } { incr score }
if { [regexp {^[BL] +[0-9]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +\{} $line] } { incr score }
if { [regexp {^N +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +\{} $line] } { incr score }
if { [regexp {^C +\{[^{}]+\} +[-0-9.eE]+ +[-0-9.eE]+ +[0-3]+ +[0-3]+ +\{} $line] } { incr instances; incr score }