Mercurial > repos > rhope
diff runtime/builtin.c @ 99:e09c2d1d6d5b
Got dataflow graph code working in compiler (nworker_c.rhope)
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 06 Aug 2010 01:42:37 -0400 |
parents | a844c623c7df |
children | c14698c512f1 |
line wrap: on
line diff
--- a/runtime/builtin.c Tue Aug 03 23:51:39 2010 -0400 +++ b/runtime/builtin.c Fri Aug 06 01:42:37 2010 -0400 @@ -6,6 +6,8 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <stdarg.h> +#include <stdint.h> void register_builtin_type(uint32_t type) { @@ -115,13 +117,32 @@ t_Boolean * b = (t_Boolean *)new_object(TYPE_BOOLEAN); b->Val = val != 0; return (object*)b; -} - -object * make_Worker(int32_t index, int16_t initialsize, int16_t initialcount) -{ - t_Worker * worker = (t_Worker *)_internal_worker_alloc(initialsize); - worker->payload.Index = index; - worker->payload.Count = initialcount; - return (object *)worker; +} + +object * make_Worker(int32_t index, int16_t initialsize, int16_t initialcount) +{ + t_Worker * worker = (t_Worker *)_internal_worker_alloc(initialsize); + worker->payload.Index = index; + worker->payload.Count = initialcount; + return (object *)worker; } +object * make_List(int32_t numels,...) +{ + int32_t idx, elidx; + object * inout[3]; + va_list args; + + va_start(args, numels); + rhope(FUNC_List, inout, 0, 1); + + for (idx = 0; idx < numels; ++idx) + { + elidx = va_arg(args, int32_t); + inout[1] = make_Int32(elidx); + inout[2] = va_arg(args, object *); + } + return inout[0]; +} + +