12 |
|
*/ |
13 |
|
|
14 |
|
#include <stdlib.h> |
15 |
– |
#include <stdio.h> |
15 |
|
#include <math.h> |
17 |
– |
#include <string.h> |
16 |
|
|
17 |
|
#include "calcomp.h" |
18 |
+ |
#include "rtio.h" |
19 |
|
#include "resolu.h" |
20 |
|
#include "rterror.h" |
21 |
|
#include "fvect.h" |
44 |
|
FVECT lastp, p; |
45 |
|
int i, nseg; |
46 |
|
|
47 |
+ |
esupport |= E_VARIABLE|E_FUNCTION|E_RCONST; |
48 |
+ |
esupport &= ~(E_OUTCHAN|E_INCHAN); |
49 |
|
varset("PI", ':', PI); |
50 |
|
funset("hermite", 5, ':', l_hermite); |
51 |
|
funset("bezier", 5, ':', l_bezier); |
57 |
|
for (i = 8; i < argc; i++) |
58 |
|
if (!strcmp(argv[i], "-e")) |
59 |
|
scompile(argv[++i], NULL, 0); |
60 |
< |
else if (!strcmp(argv[i], "-f")) |
61 |
< |
fcompile(argv[++i]); |
62 |
< |
else |
60 |
> |
else if (!strcmp(argv[i], "-f")) { |
61 |
> |
char *fpath = getpath(argv[++i], getrlibpath(), 0); |
62 |
> |
if (fpath == NULL) { |
63 |
> |
fprintf(stderr, "%s: cannot find file '%s'\n", |
64 |
> |
argv[0], argv[i]); |
65 |
> |
quit(1); |
66 |
> |
} |
67 |
> |
fcompile(fpath); |
68 |
> |
} else |
69 |
|
goto userror; |
70 |
|
|
71 |
|
sprintf(stmp, "%s(t)=%s;", XNAME, argv[3]); |
76 |
|
scompile(stmp, NULL, 0); |
77 |
|
sprintf(stmp, "%s(t)=%s;", RNAME, argv[6]); |
78 |
|
scompile(stmp, NULL, 0); |
79 |
< |
nseg = atoi(argv[7]); |
79 |
> |
nseg = eval(argv[7]) + .5; |
80 |
|
if (nseg <= 0) |
81 |
|
goto userror; |
82 |
|
|
83 |
|
fputs("# ", stdout); |
84 |
|
printargs(argc, argv, stdout); |
85 |
< |
eclock = 0; |
85 |
> |
doptimize(1); |
86 |
> |
eclock++; |
87 |
|
|
88 |
|
for (i = 0; i <= nseg; i++) { |
89 |
|
t = (double)i/nseg; |