Changes in perlconfig.c [e7f5970:ffc4df6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
re7f5970 rffc4df6 33 33 owl_free(escape); 34 34 } 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 73 35 return ret; 74 36 } … … 542 504 } 543 505 544 void owl_perlconfig_ dispatch_free(owl_dispatch *d)506 void owl_perlconfig_io_dispatch_destroy(const owl_io_dispatch *d) 545 507 { 546 508 SvREFCNT_dec(d->data); 547 owl_free(d);548 509 } 549 510 … … 593 554 } 594 555 595 void owl_perlconfig_ dispatch(owl_dispatch *d)596 { 597 SV *cb = d ->data;556 void owl_perlconfig_io_dispatch(const owl_io_dispatch *d, void *data) 557 { 558 SV *cb = data; 598 559 dSP; 599 560 if(cb == NULL) { … … 607 568 PUSHMARK(SP); 608 569 PUTBACK; 609 570 610 571 call_sv(cb, G_DISCARD|G_KEEPERR|G_EVAL); 611 572
Note: See TracChangeset
for help on using the changeset viewer.