FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Derelict automation?

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
revcompgeek



Joined: 24 Nov 2007
Posts: 27

PostPosted: Sat May 17, 2008 11:53 pm    Post subject: Derelict automation? Reply with quote

How difficult would it be to make a program that would read a shared library or the source code to one to figure out the constants and functions used in the library, and generate a file for them? I don't know too much about this, but it seems reasonable.
Back to top
View user's profile Send private message
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Sun May 18, 2008 10:38 am    Post subject: Reply with quote

To do it properly (i.e. so that it works in all cases it should) would require a fair bit of the tokenization and semantic analysis of a compiler so wouldn't be trivial. But maybe for analysing many C headers something rather simpler might suffice? Not very helpful I guess.

I was thinking about something like that when going through the freetype update but never got around to it. But if you want to try I'd suggest starting with something relatively simple like a script/program to convert a list of #defines to an enum (at least in cases where the provided constant isn't produced from macros).
Back to top
View user's profile Send private message Send e-mail
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun May 18, 2008 7:18 pm    Post subject: Reply with quote

There have been several little scripts cobbled together to do something like this, some of them specifically for Derelict (though often not publicly released). One general case program I recall was h2d, or some such. A forum search should turn up some stuff.

The difficulty comes in handling the corner cases, particularly with things like macros and bitfields. I initially thought about creating this sort of script when I first started out with Derelict, but I prefer to do it all by hand. Most of the libraries we bind to have very little to convert. OpenGL and SDL being the exception. I have a copy-paste system that I'm used to now that goes rather quickly when I want to convert something so I really have no interest in anything like this. Most packages can be knocked together inside of 30 minutes. Other people who contribute to Derelict, or make Derelict-like bindings, rarely do more than one or two packages.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Cyborg16



Joined: 28 Apr 2007
Posts: 39

PostPosted: Wed May 21, 2008 4:26 am    Post subject: Reply with quote

Hmm, think I spent rather longer than 30 minutes on freetype. Some basic scripts to handle all the common conversions would have helped, but as aldacron says there'd be little point in trying to get a script to handle everything.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group