comments in source files

This commit is contained in:
Stefan Frederik 2022-01-14 14:56:13 +01:00
parent 3260d438c1
commit 9f64e87b34
4 changed files with 16 additions and 9 deletions

View File

@ -1097,6 +1097,9 @@ int sym_vs_sch_pins()
case 'G': case 'G':
load_ascii_string(&tmp, fd); load_ascii_string(&tmp, fd);
break; break;
case '#':
read_line(fd, 1);
break;
case 'L': case 'L':
case 'B': case 'B':
if(fscanf(fd, "%d",&tmpi)< 1) { if(fscanf(fd, "%d",&tmpi)< 1) {

View File

@ -373,6 +373,9 @@ void merge_file(int selection_load, const char ext[])
case 'v': case 'v':
load_ascii_string(&aux_ptr, fd); load_ascii_string(&aux_ptr, fd);
break; break;
case '#':
read_line(fd, 1);
break;
case 'V': case 'V':
load_ascii_string(&aux_ptr, fd); load_ascii_string(&aux_ptr, fd);
break; break;

View File

@ -772,7 +772,7 @@ void read_xschem_file(FILE *fd)
xctx->file_version[0] = '\0'; xctx->file_version[0] = '\0';
while(!endfile) while(!endfile)
{ {
if(fscanf(fd," %c",tag)==EOF) break; if(fscanf(fd," %c",tag)==EOF) break; /* space before %c --> eat white space */
switch(tag[0]) switch(tag[0])
{ {
case 'v': case 'v':
@ -783,6 +783,9 @@ void read_xschem_file(FILE *fd)
} }
dbg(1, "read_xschem_file(): file_version=%s\n", xctx->file_version); dbg(1, "read_xschem_file(): file_version=%s\n", xctx->file_version);
break; break;
case '#':
read_line(fd, 1);
break;
case 'E': case 'E':
load_ascii_string(&xctx->schtedaxprop,fd); load_ascii_string(&xctx->schtedaxprop,fd);
break; break;
@ -1432,7 +1435,8 @@ static void get_sym_type(const char *symname, char **type,
case 'B': case 'B':
fscan_ret = fscanf(fd, "%d",&c); fscan_ret = fscanf(fd, "%d",&c);
if(fscan_ret != 1 || c <0 || c>=cadlayers) { if(fscan_ret != 1 || c <0 || c>=cadlayers) {
fprintf(errfp,"get_sym_type(): box layer wrong or missing or > defined cadlayers, ignoring, increase cadlayers\n"); fprintf(errfp,"get_sym_type(): box layer wrong or missing or > defined cadlayers, "
"ignoring, increase cadlayers\n");
ungetc(tag[0], fd); ungetc(tag[0], fd);
read_record(tag[0], fd, 1); read_record(tag[0], fd, 1);
} }
@ -1751,6 +1755,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
case 'v': case 'v':
load_ascii_string(&aux_ptr, lcc[level].fd); load_ascii_string(&aux_ptr, lcc[level].fd);
break; break;
case '#':
read_line(lcc[level].fd, 1);
break;
case 'E': case 'E':
load_ascii_string(&aux_ptr, lcc[level].fd); load_ascii_string(&aux_ptr, lcc[level].fd);
break; break;

View File

@ -23,15 +23,9 @@ unitx=m
T {ANALOG AUDIO AMPLIFIER T {ANALOG AUDIO AMPLIFIER
N-Channel only power stage} 430 -270 0 0 0.5 0.5 {layer=8} N-Channel only power stage} 430 -270 0 0 0.5 0.5 {layer=8}
N 180 -500 180 -470 {lab=E9} N 180 -500 180 -470 {lab=E9}
#
# comment
#
N 260 -470 340 -470 {lab=E9} N 260 -470 340 -470 {lab=E9}
N 340 -500 340 -470 {lab=E9} N 340 -500 340 -470 {lab=E9}
N 1110 -700 1110 -670 {lab=SA} N 1110 -700 1110 -670 {lab=SA}
N 840 -1020 840 -980 {lab=E4} N 840 -1020 840 -980 {lab=E4}
N 1110 -590 1110 -570 {lab=OUTI} N 1110 -590 1110 -570 {lab=OUTI}
N 1110 -510 1110 -470 {lab=#net1} N 1110 -510 1110 -470 {lab=#net1}
@ -123,7 +117,7 @@ C {res.sym} 960 -410 0 1 {name=R7 m=1 value=190 net_name=true}
C {nmos3.sym} 1090 -760 0 0 {name=xm1 model=irf540 m=1 C {nmos3.sym} 1090 -760 0 0 {name=xm1 model=irf540 m=1
program=evince program=evince
url="https://www.vishay.com/docs/91021/91021.pdf" net_name=true} url="https://www.vishay.com/docs/91021/91021.pdf" net_name=true}
C {res.sym} 960 -730 0 1 {name=R0 m=1 value=190 net_name=true} #comment C {res.sym} 960 -730 0 1 {name=R0 m=1 value=190 net_name=true}
C {lab_pin.sym} 1390 -590 0 1 {name=p14 lab=OUT} C {lab_pin.sym} 1390 -590 0 1 {name=p14 lab=OUT}
C {lab_pin.sym} 1110 -280 0 0 {name=p18 lab=VNN} C {lab_pin.sym} 1110 -280 0 0 {name=p18 lab=VNN}
C {lab_wire.sym} 920 -440 0 0 {name=l8 lab=GB} C {lab_wire.sym} 920 -440 0 0 {name=l8 lab=GB}