#include "spice.h"
#include "ftedefs.h"
#include "fteinp.h"
Go to the source code of this file.
void inp_casefix |
( |
char * |
string | ) |
|
Definition at line 266 of file inpcom.c.
272 *
string =
strip(*
string);
273 if (!isspace(*
string) && !isprint(*
string))
275 if (isupper(*
string))
276 *
string = tolower(*
string);
struct line* inp_deckcopy |
( |
struct line * |
deck | ) |
|
Definition at line 303 of file inpcom.c.
struct line * inp_deckcopy(struct line *deck)
void inp_deckfree |
( |
struct line * |
deck | ) |
|
Definition at line 284 of file inpcom.c.
void inp_deckfree(struct line *deck)
FILE* inp_pathopen |
( |
char * |
name, |
|
|
char * |
mode |
|
) |
| |
Definition at line 65 of file inpcom.c.
80 if (strchr(name, DIR_TERM) || strchr(name,
'/')
84 return (fopen(buf, mode));
91 (void) sprintf(buf,
"%s/%s", v->va_string, name);
94 (void) sprintf(buf,
"%d/%s", v->va_num, name);
97 (void) sprintf(buf,
"%lg/%s", v->va_real, name);
101 if (fp = fopen(buf, mode))
void cp_pathfix(char *buf)
static char buf[MAXPROMPT]
bool cp_getvar(char *n, int t, char *r)
struct variable * va_next
void inp_readall |
( |
FILE * |
fp, |
|
|
struct line ** |
data, |
|
|
char * |
title |
|
) |
| |
Definition at line 110 of file inpcom.c.
120 char *buffer, *
s, *
t;
136 for (s = buffer; *s && (*s !=
'\n'); s++)
139 fprintf(
cp_err,
"Warning: premature EOF\n");
145 while (*s ==
' ' || *s ==
'\t')
154 if (
prefix(
".include", buffer)) {
155 for (s = buffer; *s && !isspace(*s); s++)
161 "Error: .include filename missing\n");
164 for (t = s; *t && !isspace(*t); t++)
174 (void) fclose(newfp);
183 end = cc =
alloc(
struct line);
194 (
void) strncpy(buffer + 1,
"end of:", 7);
202 end = cc =
alloc(
struct line);
216 switch (*working->li_line) {
220 working = working->li_next;
224 working->li_error =
copy(
225 "Illegal continuation card: ignored.");
226 working = working->li_next;
229 buffer =
tmalloc(strlen(prev->li_line) +
230 strlen(working->li_line) + 2);
231 (void) sprintf(buffer,
"%s %s", prev->li_line,
232 working->li_line + 1);
234 prev->li_line = buffer;
235 prev->li_next = working->li_next;
236 working->li_next =
NULL;
237 if (prev->li_actual) {
245 newcard =
alloc(
struct line);
246 newcard->li_linenum = prev->li_linenum;
247 newcard->li_line = s;
248 newcard->li_next = working;
249 prev->li_actual = newcard;
251 working = prev->li_next;
255 working = working->li_next;
void inp_readall(FILE *fp, struct line **data, char *title)
char * readline(FILE *fd)
FILE * inp_pathopen(char *name, char *mode)
char* readline |
( |
FILE * |
fd | ) |
|
Definition at line 20 of file inpcom.c.
40 while((c = getc(fd)) != EOF) {
43 if( strlen >= memlen ) {
45 if( !(strptr =
trealloc(strptr, memlen + 1))) {
57 strptr[strlen] =
'\0';
59 strptr =
trealloc(strptr, strlen + 1);