141 |
} |
} |
142 |
|
|
143 |
|
|
144 |
static struct list * |
static LIST * |
145 |
guile_to_anubis(SCM cell) |
guile_to_anubis(SCM cell) |
146 |
{ |
{ |
147 |
static struct list *list; |
static LIST *list; |
148 |
|
|
149 |
list = list_create(); |
list = list_create(); |
150 |
for (; cell != SCM_EOL; cell = SCM_CDR(cell)) { |
for (; cell != SCM_EOL; cell = SCM_CDR(cell)) { |
161 |
} |
} |
162 |
|
|
163 |
static SCM |
static SCM |
164 |
anubis_to_guile(struct list *list) |
anubis_to_guile(LIST *list) |
165 |
{ |
{ |
166 |
ASSOC *asc; |
ASSOC *asc; |
167 |
|
ITERATOR *itr; |
168 |
SCM head = SCM_EOL, |
SCM head = SCM_EOL, |
169 |
tail; /* Don't let gcc fool you: tail cannot be used |
tail; /* Don't let gcc fool you: tail cannot be used |
170 |
uninitialized */ |
uninitialized */ |
171 |
|
|
172 |
for (asc = list_first(list); asc; asc = list_next(list)) { |
itr = iterator_create(list); |
173 |
|
for (asc = iterator_first(itr); asc; asc = iterator_next(itr)) { |
174 |
SCM cell, car, cdr; |
SCM cell, car, cdr; |
175 |
|
|
176 |
if (asc->key) |
if (asc->key) |
189 |
SCM_SETCDR(tail, cell); |
SCM_SETCDR(tail, cell); |
190 |
tail = cell; |
tail = cell; |
191 |
} |
} |
192 |
|
iterator_destroy(&itr); |
193 |
if (head != SCM_EOL) |
if (head != SCM_EOL) |
194 |
SCM_SETCDR(tail, SCM_EOL); |
SCM_SETCDR(tail, SCM_EOL); |
195 |
return head; |
return head; |
196 |
} |
} |
197 |
|
|
198 |
static SCM |
static SCM |
199 |
list_to_args(struct list *arglist) |
list_to_args(LIST *arglist) |
200 |
{ |
{ |
201 |
char *p; |
char *p; |
202 |
|
ITERATOR *itr; |
203 |
SCM head = SCM_EOL, |
SCM head = SCM_EOL, |
204 |
tail; /* Don't let gcc fool you: tail cannot be used |
tail; /* Don't let gcc fool you: tail cannot be used |
205 |
uninitialized */ |
uninitialized */ |
206 |
SCM val; |
SCM val; |
207 |
|
|
208 |
list_first(arglist); |
itr = iterator_create(arglist); |
209 |
while ((p = list_next(arglist))) { |
iterator_first(itr); |
210 |
|
while ((p = iterator_next(itr))) { |
211 |
SCM cell; |
SCM cell; |
212 |
SCM_NEWCELL(cell); |
SCM_NEWCELL(cell); |
213 |
|
|
235 |
SCM_SETCDR(tail, cell); |
SCM_SETCDR(tail, cell); |
236 |
tail = cell; |
tail = cell; |
237 |
} |
} |
238 |
|
iterator_destroy(&itr); |
239 |
if (head != SCM_EOL) |
if (head != SCM_EOL) |
240 |
SCM_SETCDR(tail, SCM_EOL); |
SCM_SETCDR(tail, SCM_EOL); |
241 |
return head; |
return head; |
244 |
/* (define (postproc header-list body) */ |
/* (define (postproc header-list body) */ |
245 |
|
|
246 |
void |
void |
247 |
guile_process_proc(struct list *arglist, MESSAGE *msg) |
guile_process_proc(LIST *arglist, MESSAGE *msg) |
248 |
{ |
{ |
249 |
char *procname; |
char *procname; |
250 |
SCM arg_hdr, arg_body; |
SCM arg_hdr, arg_body; |
253 |
jmp_buf jmp_env; |
jmp_buf jmp_env; |
254 |
SCM res; |
SCM res; |
255 |
|
|
256 |
procname = list_first(arglist); |
procname = list_item(arglist, 0); |
257 |
if (!procname) { |
if (!procname) { |
258 |
anubis_error(SOFT, _("missing procedure name")); |
anubis_error(SOFT, _("missing procedure name")); |
259 |
return; |
return; |
359 |
}; |
}; |
360 |
|
|
361 |
int |
int |
362 |
guile_parser(int method, int key, struct list *arglist, |
guile_parser(int method, int key, LIST *arglist, |
363 |
void *inv_data, void *func_data, MESSAGE *msg) |
void *inv_data, void *func_data, MESSAGE *msg) |
364 |
{ |
{ |
365 |
char *arg = list_item(arglist, 0); |
char *arg = list_item(arglist, 0); |