[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] SC -> c++ interface
I see in SCUM_Prim.cpp that you define some primitives
as "_SCUM_View_DoSomething". Is this simply a naming
convention or the _ are translated as some member
operator into the sc language? I see a similar pattern
in the LangPrimSource
Anyhow, this name you feed into the definePrimitive
call is not the same name that those primitives are
known from the sc language. Where the actual names (sc
names of the primitives) are stored?
--- stefan kersten <steve@xxxxxxxxxx> escribió:
> On Tue, Nov 23, 2004 at 01:24:58PM -0300, Charlls
> Quarra wrote:
> > > in order to
> > > make native code available to the language
> runtime,
> > > you have
> > > to write a 'primitive', which is a wrapper
> function
> > > that
> > > adheres to a certain calling convention, make
> the
> > > primitive
> > > available by name with definePrimitive and call
> the
> > > primitive from sclang as in:
> >
> > Thanks, That is what my question was about;
> learning
> > about this calling convention, since it doesnt
> seem to
> > be documented (at least not under the 'Extending
> SC'
> > helpfiles)
>
> a primitive has the following signature:
>
> int MyPrimitive(struct VMGlobals* g, int
> numArgsPushed);
>
> have a look at source/lang/LangPrimSource/*.cpp and
> SCUM_Prim.cpp on how to access arguments etc.
>
> definePrimitive(...) in headers/lang/PyrPrimitive.h
>
> registers primitives with the language runtime.
>
> hth,
> <sk>
> _______________________________________________
> sc-dev mailing list
> sc-dev@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-dev
>
=====
Running on:
1.5 Ghz P4
256Mb
asus v800x chipset
RH9 CCRMA-patched linux
___________________________________
¡Llevate a Yahoo! en tu Unifón!
Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar.
Encontrá más información en: http://ar.mobile.yahoo.com/sms.html