ГОСТ Р ИСО/МЭК 10373-6—2015
П Redds a Line from.a file If) and returns two char -arrays (s and t)
// I». Is used to redd files written in "comma separation" format,
void read_ilne (FILE *f, char »s, char »tj
l
int a-0;
int
1
-
0
;
a-fgetc(i); /* Takes chars from the file pointed by f */
while (isspace(a)) l* spaces at the beginning of line are taken out */
a-fgetc [1);
while (a!-’,’ 4* af-EOF) /* spaces a! the beginning of line are taken out */
t(Char)a;
a-fgetc[f);
1
L |i) - ’\Q ’;
i-O;
a-fgetc(f);
while (a!-’\n’ uh a!-EOF)
(
s*i•• -(char)a;
a-tgetc Jf);
l
s[i]-’\G’; /♦ We ado the line end */
I
// Reads a line from,a file ff) and discards it.
void Skip_line (FILE *f)
f
int a-0;
a-fgetc(t);
while (a!-’\n’ 44 a!-EOF)
(
a-fgetc(f);
1
I
П Creates a ESL node wLth the given volt and time parameters
ESL ’createnodel(double volt!, double timef)
f
ESL ’new-NULL;
new-(ESL ’)malloc(sizeof(ESL));
if (new!-NULL)
(
new->volt-voltr;
new->time-iirr.ef;
new->s.g-NULL;
I
else
fpnntl(stderr,">Je.T,eryError");
return new;
I
// Frees the allocated memory for ESL nodes
void freelist(ESL ’first) // frees ESL list
f
ESL *to_free;
while (first->sig!-NULL)
(
62