1 /* nyqsrc/seqfnint.c -- interface to cmt/seqdecls.h,
2 * nyqsrc/seqext.h, cmt/seq.h, nyqsrc/seqinterf.h,
3 * cmt/seqmread.h, cmt/seqmwrite.h, cmt/seqread.h,
4 * cmt/seqwrite.h */
5
6 #ifndef mips
7 #include "stdlib.h"
8 #endif
9 #include "xlisp.h"
10
11 extern LVAL s_true;
12 #define cvboolean(i) ((i) ? s_true : NIL)
13 #define testarg2(e) (moreargs() ? (e) : (getflonum(xltoofew())))
14 #define xlgaanynum() (floatp(*xlargv) ? getflonum(nextarg()) : \
15 (fixp(*xlargv) ? (double) getfixnum(nextarg()) : \
16 getflonum(xlbadtype(*xlargv))))
17 #define getboolean(lval) ((lval) != NIL)
18
19 extern LVAL RSLT_sym;
20
21 #include "seqdecls.h"
22
23 #include "seqext.h"
24
25 #include "seq.h"
26
27 /* xlc_seq_reset -- interface to C routine seq_reset */
28 /**/
xlc_seq_reset(void)29 LVAL xlc_seq_reset(void)
30 {
31 seq_type arg1 = getseq(xlgaseq());
32
33 xllastarg();
34 seq_reset(arg1);
35 return NIL;
36 }
37
38
39 /* xlc_seq_insert_ctrl -- interface to C routine insert_ctrl */
40 /**/
xlc_seq_insert_ctrl(void)41 LVAL xlc_seq_insert_ctrl(void)
42 {
43 seq_type arg1 = getseq(xlgaseq());
44 long arg2 = (long) getfixnum(xlgafixnum());
45 long arg3 = (long) getfixnum(xlgafixnum());
46 long arg4 = (long) getfixnum(xlgafixnum());
47 long arg5 = (long) getfixnum(xlgafixnum());
48 long arg6 = (long) getfixnum(xlgafixnum());
49
50 xllastarg();
51 insert_ctrl(arg1, arg2, arg3, arg4, arg5, arg6);
52 return NIL;
53 }
54
55
56 /* xlc_seq_insert_ramp -- interface to C routine insert_ctrlramp */
57 /**/
xlc_seq_insert_ramp(void)58 LVAL xlc_seq_insert_ramp(void)
59 {
60 seq_type arg1 = getseq(xlgaseq());
61 long arg2 = (long) getfixnum(xlgafixnum());
62 long arg3 = (long) getfixnum(xlgafixnum());
63 long arg4 = (long) getfixnum(xlgafixnum());
64 long arg5 = (long) getfixnum(xlgafixnum());
65 long arg6 = (long) getfixnum(xlgafixnum());
66 long arg7 = (long) getfixnum(xlgafixnum());
67 long arg8 = (long) getfixnum(xlgafixnum());
68 long arg9 = (long) getfixnum(xlgafixnum());
69
70 xllastarg();
71 insert_ctrlramp(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
72 return NIL;
73 }
74
75
76 /* xlc_seq_insert_macctrl -- interface to C routine insert_macctrl */
77 /**/
xlc_seq_insert_macctrl(void)78 LVAL xlc_seq_insert_macctrl(void)
79 {
80 seq_type arg1 = getseq(xlgaseq());
81 long arg2 = (long) getfixnum(xlgafixnum());
82 long arg3 = (long) getfixnum(xlgafixnum());
83 long arg4 = (long) getfixnum(xlgafixnum());
84 long arg5 = (long) getfixnum(xlgafixnum());
85 long arg6 = (long) getfixnum(xlgafixnum());
86
87 xllastarg();
88 insert_macctrl(arg1, arg2, arg3, arg4, arg5, arg6);
89 return NIL;
90 }
91
92
93 /* xlc_seq_insert_note -- interface to C routine insert_note */
94 /**/
xlc_seq_insert_note(void)95 LVAL xlc_seq_insert_note(void)
96 {
97 seq_type arg1 = getseq(xlgaseq());
98 long arg2 = (long) getfixnum(xlgafixnum());
99 long arg3 = (long) getfixnum(xlgafixnum());
100 long arg4 = (long) getfixnum(xlgafixnum());
101 long arg5 = (long) getfixnum(xlgafixnum());
102 long arg6 = (long) getfixnum(xlgafixnum());
103 long arg7 = (long) getfixnum(xlgafixnum());
104
105 xllastarg();
106 insert_note(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
107 return NIL;
108 }
109
110
111 /* xlc_seq_copy -- interface to C routine seq_copy */
112 /**/
xlc_seq_copy(void)113 LVAL xlc_seq_copy(void)
114 {
115 seq_type arg1 = getseq(xlgaseq());
116 seq_type result;
117
118 xllastarg();
119 result = seq_copy(arg1);
120 return cvseq(result);
121 }
122
123
124 /* xlc_seq_create -- interface to C routine seq_create */
125 /**/
xlc_seq_create(void)126 LVAL xlc_seq_create(void)
127 {
128 seq_type result;
129
130 xllastarg();
131 result = seq_create();
132 return cvseq(result);
133 }
134
135
136 #include "seqinterf.h"
137
138 /* xlc_seq_next -- interface to C routine seq_next */
139 /**/
xlc_seq_next(void)140 LVAL xlc_seq_next(void)
141 {
142 seq_type arg1 = getseq(xlgaseq());
143 boolean result;
144
145 xllastarg();
146 result = seq_next(arg1);
147 return cvboolean(result);
148 }
149
150
151 /* xlc_seq_get -- interface to C routine seq_get */
152 /**/
xlc_seq_get(void)153 LVAL xlc_seq_get(void)
154 {
155 seq_type arg1 = getseq(xlgaseq());
156 long arg2 = (long) 0;
157 long arg3 = (long) 0;
158 long arg4 = (long) 0;
159 long arg5 = (long) 0;
160 long arg6 = (long) 0;
161 long arg7 = (long) 0;
162 long arg8 = (long) 0;
163 LVAL result;
164
165 xllastarg();
166 seq_get(arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8);
167 { LVAL *next = &getvalue(RSLT_sym);
168 *next = cons(NIL, NIL);
169 car(*next) = cvfixnum(arg2); next = &cdr(*next);
170 *next = cons(NIL, NIL);
171 car(*next) = cvfixnum(arg3); next = &cdr(*next);
172 *next = cons(NIL, NIL);
173 car(*next) = cvfixnum(arg4); next = &cdr(*next);
174 *next = cons(NIL, NIL);
175 car(*next) = cvfixnum(arg5); next = &cdr(*next);
176 *next = cons(NIL, NIL);
177 car(*next) = cvfixnum(arg6); next = &cdr(*next);
178 *next = cons(NIL, NIL);
179 car(*next) = cvfixnum(arg7); next = &cdr(*next);
180 *next = cons(NIL, NIL);
181 car(*next) = cvfixnum(arg8);
182 }
183 result = getvalue(RSLT_sym);
184 return result;
185 }
186
187
188 #include "seqmwrite.h"
189
190 /* xlc_seq_write_smf -- interface to C routine seq_xlwrite_smf */
191 /**/
xlc_seq_write_smf(void)192 LVAL xlc_seq_write_smf(void)
193 {
194 seq_type arg1 = getseq(xlgaseq());
195 LVAL arg2 = xlgetarg();
196
197 xllastarg();
198 seq_xlwrite_smf(arg1, arg2);
199 return NIL;
200 }
201
202
203 #include "seqmread.h"
204
205 /* xlc_seq_read_smf -- interface to C routine seq_read_smf */
206 /**/
xlc_seq_read_smf(void)207 LVAL xlc_seq_read_smf(void)
208 {
209 seq_type arg1 = getseq(xlgaseq());
210 FILE * arg2 = getfile(xlgastream());
211
212 xllastarg();
213 seq_read_smf(arg1, arg2);
214 return NIL;
215 }
216
217
218 #include "seqread.h"
219
220 /* xlc_seq_read -- interface to C routine seq_read */
221 /**/
xlc_seq_read(void)222 LVAL xlc_seq_read(void)
223 {
224 seq_type arg1 = getseq(xlgaseq());
225 FILE * arg2 = getfile(xlgastream());
226
227 xllastarg();
228 seq_read(arg1, arg2);
229 return NIL;
230 }
231
232
233 #include "seqwrite.h"
234
235 /* xlc_seq_write -- interface to C routine seq_write */
236 /**/
xlc_seq_write(void)237 LVAL xlc_seq_write(void)
238 {
239 seq_type arg1 = getseq(xlgaseq());
240 FILE * arg2 = getfile(xlgastream());
241 int arg3 = getboolean(xlgetarg());
242
243 xllastarg();
244 seq_write(arg1, arg2, arg3);
245 return NIL;
246 }
247
248
249