Wrapping Python - A function wrapping template
Kirk McDonald
kirklin.mcdonald at gmail.com
Sat Jun 17 16:18:38 PDT 2006
Kirk McDonald wrote:
> In wrapping Python with D, I have just made a large step:
>
The testdll.d file now looks like this:
[testdll.d]
module testdll;
import pyd.pyd;
char[] foo(int i) {
if (i > 10) {
return "It's greater than 10!";
} else {
return "It's less than 10!";
}
}
extern (C)
export void inittestdll() {
def!("foo", foo);
module_init("testdll");
}
// EOF
Quite a lot of things remain to be done, but at least the API looks nice
and clean.
-Kirk McDonald
More information about the Digitalmars-d
mailing list