| 7 |
|
|
| 8 |
|
#include "copyright.h" |
| 9 |
|
|
| 10 |
< |
#include "ray.h" |
| 10 |
> |
#include <math.h> |
| 11 |
|
|
| 12 |
+ |
#include "ray.h" |
| 13 |
+ |
#include "paths.h" |
| 14 |
|
#include "otypes.h" |
| 13 |
– |
|
| 15 |
|
#include "func.h" |
| 16 |
|
|
| 17 |
|
|
| 32 |
|
static OBJREC *fobj = NULL; /* current function object */ |
| 33 |
|
static RAY *fray = NULL; /* current function ray */ |
| 34 |
|
|
| 35 |
< |
static double l_erf(), l_erfc(), l_arg(); |
| 35 |
> |
static double l_erf(char *), l_erfc(char *), l_arg(char *); |
| 36 |
|
|
| 37 |
|
|
| 38 |
< |
MFUNC * |
| 39 |
< |
getfunc(m, ff, ef, dofwd) /* get function for this modifier */ |
| 40 |
< |
OBJREC *m; |
| 41 |
< |
int ff; |
| 42 |
< |
unsigned int ef; |
| 43 |
< |
int dofwd; |
| 38 |
> |
extern MFUNC * |
| 39 |
> |
getfunc( /* get function for this modifier */ |
| 40 |
> |
OBJREC *m, |
| 41 |
> |
int ff, |
| 42 |
> |
unsigned int ef, |
| 43 |
> |
int dofwd |
| 44 |
> |
) |
| 45 |
|
{ |
| 46 |
|
static char initfile[] = INITFILE; |
| 47 |
|
char sbuf[MAXSTR]; |
| 133 |
|
objerror(m, USER, "too few string arguments"); |
| 134 |
|
memerr: |
| 135 |
|
error(SYSTEM, "out of memory in getfunc"); |
| 136 |
+ |
return NULL; /* pro forma return */ |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
|
| 140 |
< |
void |
| 141 |
< |
freefunc(m) /* free memory associated with modifier */ |
| 142 |
< |
OBJREC *m; |
| 140 |
> |
extern void |
| 141 |
> |
freefunc( /* free memory associated with modifier */ |
| 142 |
> |
OBJREC *m |
| 143 |
> |
) |
| 144 |
|
{ |
| 145 |
|
register MFUNC *f; |
| 146 |
|
register int i; |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
|
| 170 |
< |
int |
| 171 |
< |
setfunc(m, r) /* set channels for function call */ |
| 172 |
< |
OBJREC *m; |
| 173 |
< |
register RAY *r; |
| 170 |
> |
extern int |
| 171 |
> |
setfunc( /* set channels for function call */ |
| 172 |
> |
OBJREC *m, |
| 173 |
> |
register RAY *r |
| 174 |
> |
) |
| 175 |
|
{ |
| 176 |
|
static unsigned long lastrno = ~0; |
| 177 |
|
register MFUNC *f; |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
|
| 202 |
< |
void |
| 203 |
< |
loadfunc(fname) /* load definition file */ |
| 204 |
< |
char *fname; |
| 202 |
> |
extern void |
| 203 |
> |
loadfunc( /* load definition file */ |
| 204 |
> |
char *fname |
| 205 |
> |
) |
| 206 |
|
{ |
| 207 |
|
char *ffname; |
| 208 |
|
|
| 215 |
|
|
| 216 |
|
|
| 217 |
|
static double |
| 218 |
< |
l_arg() /* return nth real argument */ |
| 218 |
> |
l_arg(char *nm) /* return nth real argument */ |
| 219 |
|
{ |
| 220 |
|
register int n; |
| 221 |
|
|
| 236 |
|
|
| 237 |
|
|
| 238 |
|
static double |
| 239 |
< |
l_erf() /* error function */ |
| 239 |
> |
l_erf(char *nm) /* error function */ |
| 240 |
|
{ |
| 235 |
– |
extern double erf(); |
| 236 |
– |
|
| 241 |
|
return(erf(argument(1))); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
|
| 245 |
|
static double |
| 246 |
< |
l_erfc() /* cumulative error function */ |
| 246 |
> |
l_erfc(char *nm) /* cumulative error function */ |
| 247 |
|
{ |
| 244 |
– |
extern double erfc(); |
| 245 |
– |
|
| 248 |
|
return(erfc(argument(1))); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
|
| 252 |
< |
double |
| 253 |
< |
chanvalue(n) /* return channel n to calcomp */ |
| 254 |
< |
register int n; |
| 252 |
> |
extern double |
| 253 |
> |
chanvalue( /* return channel n to calcomp */ |
| 254 |
> |
register int n |
| 255 |
> |
) |
| 256 |
|
{ |
| 257 |
|
if (fray == NULL) |
| 258 |
|
syntax("ray parameter used in constant expression"); |