On Mon, Jan 17, 2011 at 2:51 PM, Jak Sprats <[email protected]> wrote:
> This seems to be what I am looking for ... some questions: > 1.) AlchemyDB is written in ANSI-C, what are the requirements for your > bindings (C++ at a minimum, any specifics on that) > Whatever requirements v8 has, basically. i don't remember v8-juice have any requirements above what v8 needs. > 2.) I just need one function wrapped, the function is called > "client()" and it can take between 1 and 6 arguments. > The code demonstrated on that page accepts up to 10 arguments, and more can be generated via a script. You don't need all of v8-juice for what you're doing: you can get by with only some of the header files: Go to: http://code.google.com/p/v8-juice/source/browse/#svn/trunk/src/include/v8/juice grab: - convert.h - forwarding.h - forwarding-*.h (generated code) - TypeList.h - TypeList_*.h ( generated code) And that should do it. The primary advantage, over using the whole v8-juice lib, is that you need only headers, not .cpp files. All of the type conversion/function-forwarding code is templates, and implemented in their header files. Your code should include convert.h and/or forwarding.h, and the rest are implementation details. Those files assume an includes path of <v8/juice/foo.h>, and you will need to replace those if you plan to use a different structure. > And on a long shot, do you know of any C programs that embedded V8 and > then the embedded v8 calls a C function via your bindings. This is > what I am trying to reproduce in AlchemyDB (the C function would be > "client()"). > i don't know of any programs which reach into v8 from C. i have implemented v8 add-ons on top of C libraries (like libcurl and libsqlite3), but that's going the other direction. C cannot call directly into JS because it can't use the objects needed by v8. It can, of course, use a C++ API which has been wrapped in (extern "C" {...}), which then can pass on the calls to v8. So the call chain would look like: C -> C++ -> JS i hope this helps a bit, -- ----- stephan beal http://wanderinghorse.net/home/stephan/ -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
