X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ioncore%2Fextlconv.c;fp=ioncore%2Fextlconv.c;h=9fc7af9467f094ff3d6eac4012f048744915d360;hb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;hp=5f23b7464b28de5fa69f59a4183819a5178c356c;hpb=8366314611bf30a0f31d25bf5f5023186fa87692;p=ion3.git diff --git a/ioncore/extlconv.c b/ioncore/extlconv.c index 5f23b74..9fc7af9 100644 --- a/ioncore/extlconv.c +++ b/ioncore/extlconv.c @@ -1,7 +1,7 @@ /* * ion/ioncore/extlconv.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -19,21 +19,43 @@ /*{{{ Object list */ -ExtlTab extl_obj_iterable_to_table(ObjIterator *iter, void *st) +bool extl_iter_objlist_(ExtlFn fn, ObjIterator *iter, void *st) { - ExtlTab tab=extl_create_table(); - int i=1; Obj *obj; while(1){ obj=iter(st); if(obj==NULL) break; - if(extl_table_seti_o(tab, i, obj)) - i++; + if(!extl_iter_obj(fn, obj)) + return FALSE; } - return tab; + return TRUE; +} + + +bool extl_iter_objlist(ExtlFn fn, ObjList *list) +{ + ObjListIterTmp tmp; + + objlist_iter_init(&tmp, list); + + return extl_iter_objlist_(fn, (ObjIterator*)objlist_iter, &tmp); +} + + +bool extl_iter_obj(ExtlFn fn, Obj *obj) +{ + bool ret1, ret2=FALSE; + + extl_protect(NULL); + + ret1=extl_call(fn, "o", "b", obj, &ret2); + + extl_unprotect(NULL); + + return (ret1 && ret2); }