Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    re7f5970 rffc4df6  
    3333    owl_free(escape);
    3434  }
    35   return ret;
    36 }
    37 
    38 AV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *))
    39 {
    40   AV *ret;
    41   int i;
    42   void *element;
    43 
    44   ret = newAV();
    45 
    46   for (i = 0; i < owl_list_get_size(l); i++) {
    47     element = owl_list_get_element(l, i);
    48     av_push(ret, to_sv(element));
    49   }
    50 
    51   return ret;
    52 }
    53 
    54 HV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *))
    55 {
    56   HV *ret;
    57   owl_list l;
    58   const char *key;
    59   void *element;
    60   int i;
    61 
    62   ret = newHV();
    63 
    64   /* TODO: add an iterator-like interface to owl_dict */
    65   owl_dict_get_keys(d, &l);
    66   for (i = 0; i < owl_list_get_size(&l); i++) {
    67     key = owl_list_get_element(&l, i);
    68     element = owl_dict_find_element(d, key);
    69     (void)hv_store(ret, key, strlen(key), to_sv(element), 0);
    70   }
    71   owl_list_free_all(&l, owl_free);
    72 
    7335  return ret;
    7436}
     
    542504}
    543505
    544 void owl_perlconfig_dispatch_free(owl_dispatch *d)
     506void owl_perlconfig_io_dispatch_destroy(const owl_io_dispatch *d)
    545507{
    546508  SvREFCNT_dec(d->data);
    547   owl_free(d);
    548509}
    549510
     
    593554}
    594555
    595 void owl_perlconfig_dispatch(owl_dispatch *d)
    596 {
    597   SV *cb = d->data;
     556void owl_perlconfig_io_dispatch(const owl_io_dispatch *d, void *data)
     557{
     558  SV *cb = data;
    598559  dSP;
    599560  if(cb == NULL) {
     
    607568  PUSHMARK(SP);
    608569  PUTBACK;
    609  
     570
    610571  call_sv(cb, G_DISCARD|G_KEEPERR|G_EVAL);
    611572
Note: See TracChangeset for help on using the changeset viewer.