ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.85 by root, Fri Nov 24 00:32:04 2006 UTC vs.
Revision 1.86 by root, Fri Nov 24 11:36:57 2006 UTC

942 coroapi.ver = CORO_API_VERSION; 942 coroapi.ver = CORO_API_VERSION;
943 coroapi.transfer = api_transfer; 943 coroapi.transfer = api_transfer;
944} 944}
945 945
946Coro::State 946Coro::State
947_newprocess(args) 947new (char *klass, ...)
948 SV * args
949 PROTOTYPE: $ 948 PROTOTYPE: $@
950 CODE: 949 CODE:
950{
951 Coro__State coro; 951 Coro__State coro;
952 int i;
952 953
953 if (!SvROK (args) || SvTYPE (SvRV (args)) != SVt_PVAV) 954 if (!SvOK (ST (1)))
954 croak ("Coro::State::_newprocess expects an arrayref"); 955 croak ("Coro::State::new needs something callable as first argument");
955 956
956 Newz (0, coro, 1, struct coro); 957 Newz (0, coro, 1, struct coro);
958 coro->args = newAV ();
957 959
958 coro->args = (AV *)SvREFCNT_inc (SvRV (args)); 960 for (i = 1; i < items; i++)
961 av_push (coro->args, newSVsv (ST (i)));
962
963 RETVAL = coro;
964
959 /*coro->mainstack = 0; *//*actual work is done inside transfer */ 965 /*coro->mainstack = 0; *//*actual work is done inside transfer */
960 /*coro->stack = 0;*/ 966 /*coro->stack = 0;*/
961 967}
962 RETVAL = coro;
963 OUTPUT: 968 OUTPUT:
964 RETVAL 969 RETVAL
965 970
966void 971void
967transfer(prev, next, flags) 972transfer(prev, next, flags)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines