Any interest in libgit bindings?

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Oct 11 12:38:26 PDT 2012


On 10/11/12, Jacob Carlborg <doob at me.com> wrote:
> Actually I already do the same. But that's only for the C standard
> library and a couple of Posix headers, basically all files in core.stdc.
> But the problem is that I get the full path to the source file where the
> symbol is defined. How do I turn that in to an import declaration?
> Something relative to the include paths?

I guess it depends on what you get from clang. The XML I'm working on
has this sort of output:
  <File id="f3" name="git2/submodule.h"/>
  <File id="f4"
name="c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../include/inttypes.h"/>
  <File id="f39" name="c:/mingw/bin/../lib/gcc/mingw32/4.6.1/include/stddef.h"/>

This is translated into:
git2\submodule.d
mingw\include\inttypes.d
mingw\lib\gcc\mingw32\_4\_6\_1\include\stddef.d

The last one could use improvement (_4\_6\_1\ should be _4_6_1). I
call remDrive, chomp(".h"), chomp(".tcc"), translate slashes to dot,
and I make sure module names aren't keywords and it's done.

As for macros, I don't have access to those. If a symbol is
initialized with a macro then I get the post-processed value of the
macro, but I don't have the definition of the macro itself.


More information about the Digitalmars-d mailing list