how to interop with 3rd party c api #332
Replies: 2 comments
|
Yes, in order to interop with a 3rd party C API, all that is necessary is to declare what is needed from your code. Simple example Structures are declared like normal: Foreign Functions are declared like this: And you can also tell Adept about the archive/library/framework to link to like this for example:
Most commonly, it's just archives like this: Also, for defined values or enums, the following can be used: For type aliases, the following can be used: And lastly, for macros, polymorphic functions are used ( Also yes, operator overloading is supported, which is defined by creating a custom function/method with a special name. More operator overloading info and variants can be found here For example, |
|
You can find many examples in AdeptImport: https://github.com/AdeptLanguage/AdeptImport I also did many Adept bindings in the past. You can check out my repositories: https://github.com/iahung2?tab=repositories. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am excited to see this lovely language.May I ask how to interop with 3rd party c api,for example:
-- using sqlite3/curl in Adept,should I write an api wrapper first?
A peice of code snippet would be much appriecated.
And btw,is there operator overloading available in the language?
Thanks and best regards.
All reactions