new replacement of gnd by 0
This commit is contained in:
parent
d850fdd7a3
commit
0bebd1e9e0
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-05-11 Holger Vogt
|
||||||
|
* inpcom.c: new fcn inp_fix_gnd_name: 'gnd' replaced by ' 0 ', if delimiters
|
||||||
|
are '(' or ' ' or ',' on the left and ')' or ' ' or ',' on the right.
|
||||||
|
fcn inp_bsource_compat: 'm={m}' replaced by ' '
|
||||||
|
|
||||||
2010-05-10 Holger Vogt
|
2010-05-10 Holger Vogt
|
||||||
* subckt.c:1349: fcn finishLine: add e. and h. to net name
|
* subckt.c:1349: fcn finishLine: add e. and h. to net name
|
||||||
inside i(...).
|
inside i(...).
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ inp_pathopen(char *name, char *mode)
|
||||||
|
|
||||||
/* replace " gnd " by " 0 "
|
/* replace " gnd " by " 0 "
|
||||||
and then remove excessive white spaces */
|
and then remove excessive white spaces */
|
||||||
|
/*
|
||||||
static void
|
static void
|
||||||
inp_fix_gnd_name( struct line *deck ) {
|
inp_fix_gnd_name( struct line *deck ) {
|
||||||
struct line *c = deck;
|
struct line *c = deck;
|
||||||
|
|
@ -239,7 +240,7 @@ inp_fix_gnd_name( struct line *deck ) {
|
||||||
while ( c != NULL ) {
|
while ( c != NULL ) {
|
||||||
gnd = c->li_line;
|
gnd = c->li_line;
|
||||||
if ( *gnd == '*' ) { c = c->li_next; continue; }
|
if ( *gnd == '*' ) { c = c->li_next; continue; }
|
||||||
/* replace " gnd " by " 0 " */
|
// replace " gnd " by " 0 "
|
||||||
while ( (gnd = strstr( gnd, "gnd " ) ) ) {
|
while ( (gnd = strstr( gnd, "gnd " ) ) ) {
|
||||||
if ( isspace(*(gnd-1)) ) {
|
if ( isspace(*(gnd-1)) ) {
|
||||||
memcpy( gnd, "0 ", 4 );
|
memcpy( gnd, "0 ", 4 );
|
||||||
|
|
@ -247,13 +248,37 @@ inp_fix_gnd_name( struct line *deck ) {
|
||||||
gnd += 4;
|
gnd += 4;
|
||||||
found_gnd = TRUE;
|
found_gnd = TRUE;
|
||||||
}
|
}
|
||||||
/* remove white spaces after replacement, retain " 0 " */
|
// remove white spaces after replacement, retain " 0 "
|
||||||
if (found_gnd)
|
if (found_gnd)
|
||||||
c->li_line = inp_remove_ws(c->li_line);
|
c->li_line = inp_remove_ws(c->li_line);
|
||||||
c = c->li_next;
|
c = c->li_next;
|
||||||
found_gnd = FALSE;
|
found_gnd = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* replace "gnd" by " 0 "
|
||||||
|
Delimiters of gnd may be ' ' or ',' or '(' or ')' */
|
||||||
|
static void
|
||||||
|
inp_fix_gnd_name( struct line *deck ) {
|
||||||
|
struct line *c = deck;
|
||||||
|
char *gnd;
|
||||||
|
|
||||||
|
while ( c != NULL ) {
|
||||||
|
gnd = c->li_line;
|
||||||
|
if ( *gnd == '*' ) { c = c->li_next; continue; }
|
||||||
|
// replace "§gnd§" by "§ 0 §", § being a ' ' ',' '(' ')'.
|
||||||
|
while ( (gnd = strstr( gnd, "gnd" ) ) ) {
|
||||||
|
if (( isspace(*(gnd-1)) || *(gnd-1) == '(' || *(gnd-1) == ',' ) &&
|
||||||
|
( isspace(*(gnd+3)) || *(gnd+3) == ')' || *(gnd+3) == ',' ))
|
||||||
|
{
|
||||||
|
memcpy( gnd, " 0 ", 3 );
|
||||||
|
}
|
||||||
|
gnd += 3;
|
||||||
|
}
|
||||||
|
c = c->li_next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static struct line*
|
static struct line*
|
||||||
create_new_card( char *card_str, int *line_number ) {
|
create_new_card( char *card_str, int *line_number ) {
|
||||||
|
|
@ -3890,7 +3915,7 @@ static void inp_bsource_compat(struct line *deck)
|
||||||
equal_ptr = strstr(curr_line, "=");
|
equal_ptr = strstr(curr_line, "=");
|
||||||
/* find the m={m} token and remove it */
|
/* find the m={m} token and remove it */
|
||||||
if(str_ptr = strstr(curr_line, "m={m}"))
|
if(str_ptr = strstr(curr_line, "m={m}"))
|
||||||
*str_ptr = '\0';
|
memcpy( str_ptr, " ", 5 );
|
||||||
/* scan the line and remove all '{' and '}' */
|
/* scan the line and remove all '{' and '}' */
|
||||||
str_ptr = curr_line;
|
str_ptr = curr_line;
|
||||||
while (*str_ptr) {
|
while (*str_ptr) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue