[swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)

Max Howell max.howell at apple.com
Tue Dec 8 15:09:48 CST 2015


Chris, adding the C prefix is our recommendation so it is clear at the import statement that the sources in question are using the raw C interface rather than any “Swifty” wrapper.

We hope thus that the community will provide modules that add error handling, default arguments, closures, etc. while (importantly) still maintaining the general API of the C library in question and then name them without the C prefix.

Here is our documentation with further justification:

https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md

> On Dec 8, 2015, at 12:55 PM, Chris Hanson via swift-users <swift-users at swift.org> wrote:
> 
> On Dec 7, 2015, at 7:40 PM, Gage Morgan via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:
>> 
>> 1) Map the cairo.h file to a system module named CCairo
> 
> Since Swift can natively call C APIs, I would recommend just using “Cairo” as the module name.
> 
> There’s no need to distinguish a module as being related to a C API.
> 
>   -- Chris
> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151208/c6eebbee/attachment.html>


More information about the swift-users mailing list