/[anubis]/anubis/src/guile.c
ViewVC logotype

Diff of /anubis/src/guile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by polak, Fri May 2 20:34:43 2003 UTC revision 1.10 by gray, Sat May 10 08:58:02 2003 UTC
# Line 141  eval_catch_handler(void *data, SCM tag, Line 141  eval_catch_handler(void *data, SCM tag,
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)) {
# Line 161  guile_to_anubis(SCM cell) Line 161  guile_to_anubis(SCM 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)
# Line 187  anubis_to_guile(struct list *list) Line 189  anubis_to_guile(struct list *list)
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    
# Line 230  list_to_args(struct list *arglist) Line 235  list_to_args(struct list *arglist)
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;
# Line 238  list_to_args(struct list *arglist) Line 244  list_to_args(struct list *arglist)
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;
# Line 247  guile_process_proc(struct list *arglist, Line 253  guile_process_proc(struct list *arglist,
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;
# Line 353  static struct rc_kwdef guile_rule_kw[] = Line 359  static struct rc_kwdef guile_rule_kw[] =
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);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26