Changeset e67359b


Ignore:
Timestamp:
Oct 26, 2009, 4:09:38 PM (15 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
3cc4bfc
Parents:
68c572a
git-author:
David Benjamin <davidben@mit.edu> (10/05/09 22:51:09)
git-committer:
David Benjamin <davidben@mit.edu> (10/26/09 16:09:38)
Message:
Add owl_new_av to abstract owl_list to AV*

Takes a callback function to convert elements to SV*.

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    rfb7742c re67359b  
    3333    owl_free(escape);
    3434  }
     35  return ret;
     36}
     37
     38AV *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
    3551  return ret;
    3652}
Note: See TracChangeset for help on using the changeset viewer.