1 |
– |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Routines for loading and checking variables from file. |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include <stdio.h> |
11 |
+ |
#include <stdlib.h> |
12 |
|
#include <ctype.h> |
13 |
|
#include "vars.h" |
14 |
|
|
15 |
|
#define NOCHAR 127 /* constant for character to delete */ |
16 |
|
|
17 |
– |
#ifndef malloc |
18 |
– |
extern char *malloc(), *realloc(); |
19 |
– |
#endif |
20 |
– |
|
17 |
|
extern char *fgetline(); |
18 |
|
|
19 |
|
|
20 |
+ |
void |
21 |
|
loadvars(rfname) /* load variables into vv from file */ |
22 |
|
char *rfname; |
23 |
|
{ |
94 |
|
while (*cp++) |
95 |
|
; |
96 |
|
i = cp - vp->value; |
97 |
< |
vp->value = realloc(vp->value, i+n+1); |
97 |
> |
vp->value = (char *)realloc((void *)vp->value, i+n+1); |
98 |
|
} else |
99 |
< |
vp->value = malloc(n+1); |
99 |
> |
vp->value = (char *)malloc(n+1); |
100 |
|
if (vp->value == NULL) { |
101 |
|
perror(progname); |
102 |
|
quit(1); |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
+ |
void |
152 |
|
checkvalues() /* check assignments */ |
153 |
|
{ |
154 |
|
register int i; |
159 |
|
} |
160 |
|
|
161 |
|
|
162 |
+ |
void |
163 |
|
onevalue(vp) /* only one assignment for this variable */ |
164 |
|
register VARIABLE *vp; |
165 |
|
{ |
175 |
|
} |
176 |
|
|
177 |
|
|
178 |
+ |
void |
179 |
|
catvalues(vp) /* concatenate variable values */ |
180 |
|
register VARIABLE *vp; |
181 |
|
{ |
204 |
|
} |
205 |
|
|
206 |
|
|
207 |
+ |
void |
208 |
|
boolvalue(vp) /* check boolean for legal values */ |
209 |
|
register VARIABLE *vp; |
210 |
|
{ |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
+ |
void |
228 |
|
qualvalue(vp) /* check qualitative var. for legal values */ |
229 |
|
register VARIABLE *vp; |
230 |
|
{ |
247 |
|
} |
248 |
|
|
249 |
|
|
250 |
+ |
void |
251 |
|
intvalue(vp) /* check integer variable for legal values */ |
252 |
|
register VARIABLE *vp; |
253 |
|
{ |
260 |
|
} |
261 |
|
|
262 |
|
|
263 |
+ |
void |
264 |
|
fltvalue(vp) /* check float variable for legal values */ |
265 |
|
register VARIABLE *vp; |
266 |
|
{ |
273 |
|
} |
274 |
|
|
275 |
|
|
276 |
+ |
void |
277 |
|
printvars(fp) /* print variable values */ |
278 |
|
register FILE *fp; |
279 |
|
{ |