DStep is a tool for translating C and Objective-C headers to D modules.
For the latest release see: releases/latest.
Pre-compiled binaries are available for OS X, Linux and FreeBSD, as 64bit. See the releases section.
Arch packages are available in [community] repository (thanks to Михаил Страшун):
Alternatively install via Dub
The source code is available under the Boost Software License 1.0
- libclang - http://clang.llvm.org - 3.4 or later that is binary compatible with 3.4
- DMD - http://dlang.org/download.html - 2.069.2
- Dub http://code.dlang.org/download
- Install all requirements, see above
Clone the repository by running:
$ git clone git://github.com/jacob-carlborg/dstep.git
$ dstep Foo.h -o Foo.d
For translating Objective-C headers add the
$ dstep Foo.h -o Foo.d -ObjC
For translating multiple files at once, simply pass all the files to dstep.
In this case though,
-o (if given) would point to output directory name.
The directory will be created if it doesn't exist.
$ dstep Foo1.h Foo2.h Foo3.h .... FooN.h -o ./outputDirectory/
-h for usage information. Any flags recognized by Clang can be used.
- Doesn't translate preprocessor macros, with exception to simple constants and functions.
- Doesn't translate
import. A few standard C headers are translated
- Doesn't translate C++ at all
- Umbrella headers. Some headers just serve to include other headers. If these other headers contain some form of protection, like
#error, to be included directly this can cause problems for DStep
Some headers are designed to always be included together with other header files. These headers may very well use symbols from other header files without including them itself. Since DStep is designed to convert header files one-by-one this doesn't work. There are two workarounds for this:
#include-directives for the header files the header file is actually using
- Use the
-include <file>flag available in Clang to indicate the given
<file>should be processed before the file that should be translated. DStep accepts all flags Clang accepts