Skip to Main Content
Learning D
book

Learning D

by Michael Parker
November 2015
Intermediate to advanced content levelIntermediate to advanced
464 pages
11h 11m
English
Packt Publishing
Content preview from Learning D

Binding D to C

The first step that must be taken when implementing a binding to a C library is to decide whether it will be a static or dynamic binding. The former requires nothing more than the translation of all of the C types, global variables, and function signatures. The latter additionally requires a supporting API to load a shared library into memory. We'll cover both approaches in this section.

Once the type of binding has been settled, then begins the work of translating the C headers. This requires enough familiarity with C to understand not just the types and function signatures, but also the preprocessor definitions. While we'll cover some common preprocessor usage to look out for and how to translate it to D, there's not enough room ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning F# 4.0

Beginning F# 4.0

Robert Pickering, Kit Eason
Visual Cryptography and Secret Image Sharing

Visual Cryptography and Secret Image Sharing

Stelvio Cimato, Ching-Nung Yang
Expert F# 4.0, Fourth Edition

Expert F# 4.0, Fourth Edition

Don Syme, Adam Granicz, Antonio Cisternino

Publisher Resources

ISBN: 9781783552481Supplemental Content