winpcap binding

simendsjo simendsjo at gmail.com
Thu Aug 4 01:31:14 PDT 2011


On 04.08.2011 09:10, maarten van damme wrote:
> Hello everyone,
> It's been a couple of days since I've started trying to use the pcap
> library with d.
> first I've started from scratch but I gave up partly because I don't
> know enough of how sockets are implemented in d and how I was going to
> be able to bridge those two, I ended up making one giant mess :p.
> Then I've stumbled upon htod.exe but as of this moment it refuses to
> spit something useful out. I was wondering if someone had ever used it
> before?
> I do "htod.exe pcap.h ../pcap-stdinc.h *longpath*\winsock2.h
> *longpath*\excpt.h"
>
> Also I don't really know what I have to do with the bindings once I have
> working d modules, simply place it with the shipped .lib files and wait
> for magic to happen? (I've no experience whatsoever with c(++))
>
> I'm also prety convinced d could gain a lot more users/libraries if
> binding between header files and d files went way easier.
>
> maarten

The dsource bindings project have many bindings you can look at for 
examples: http://dsource.org/projects/bindings
The win32 binding has some instructions on translating: 
http://dsource.org/projects/bindings/wiki/WindowsApi/Instructions
dpl also has some instructions: 
http://www.d-programming-language.org/windows.html
And some more: http://www.d-programming-language.org/htomodule.html

I don't think htod is designed as a one-stop for converting header 
files. You'll probably have to manually change the file it spits out for 
all but the simplest cases.


More information about the Digitalmars-d-learn mailing list