Hi Rishi
The rebol part of accessing a shared library (dll in Windows) is illustrated
by a script on the Ecotope rebsite. The script shows how to access the
functions in the C-Runtime library crtdll.dll on Win98. Just change the
extension to .r.
http://www.nwlink.com/~ecotope1/reb/clib.txt
If you want to access some custom functions written in C, you will have to
get a C programmer to write the code and compile it to a dll which exports
those functions. They will be able to tell you the args and return specs for
wrapping it in a Rebol routine. You need a View/Pro license or Command to
access a shared library.
HTH
-Larry
----- Original Message -----
From: "Rishi Oswal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 7:57 PM
Subject: [REBOL] Re: accessing c functions
> hmmm... thanks for the reply. I browsed through the
> doc but am a bit confused how to create a shared
> library.
>
> Has anyone done a simple program in rebol that calls a
> c function that takes input and returns something such
> as this:
>
> int add(int a, int b) {return(a+b);}
>
> A simple example of this would be useful (prefer
> windows example but unix is ok also)...
>
> any help would be appreciated...
>
> rishi
>
>
>
> --- [EMAIL PROTECTED] wrote:
> >
> > You certainly can. What you would do is compile a
> > shared library with
> > your C functions and then use the library component
> > of View/Pro to
> > access them. Check out the documentation on this
> > component here:
> >
> > http://www.rebol.com/docs/library.html
> >
> > If you need more working examples, I'm sure the
> > friendly folks on this
> > list will help you out.
> >
> > Sterling
> >
> > > Hi. I am working on a program for a class and was
> > > wondering if it would be possible, using view/pro,
> > to:
> > >
> > > 1. send input to and execute a c function from
> > rebol.
> > > 2. receive the output of the c function back to
> > rebol.
> > >
> > > The reason I want to do this is because their is a
> > > recursive function in the code that needs to run
> > > fast..
> > >
> > > is this possible? If so, what is the general way i
> > > would go about doing this?
> > >
> > > thanks,
> > >
> > > rishi
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Auctions - buy the things you want at great
> > prices
> > > http://auctions.yahoo.com/
> > > --
> > > To unsubscribe from this list, please send an
> > email to
> > > [EMAIL PROTECTED] with "unsubscribe" in the
> > > subject, without the quotes.
> >
> > --
> > To unsubscribe from this list, please send an email
> > to
> > [EMAIL PROTECTED] with "unsubscribe" in the
> > subject, without the quotes.
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.