From: John H. Kelm <johnhkelm@us...> - 2005-07-09 00:51:07
Update of /cvsroot/gaim/web/htdocs/summerofcode/john/posts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17066
--- NEW FILE: 2005-07-08.txt ---
Writing XSUBs by hand would be awful. Having xsubpp handle them for you make the job a little better, but it is still very repetative. There are tools available to expedite the process of creating XSUBs, but they did not work well for my application. Today I had enough of fooling around with grep and substitutions in vi (Esc esc esc ctr W W yy p dd.....ad nauseam). I wrote a nice little script in Perl to handle converting the header files into wrapped XSUBs and it gives me a dump of all the enum's and object types in the format needed for the XS typemap and my includes. This is a lot like what h2xs is supposed to do, but tailored to my specifications. Regular expressions are your friend.
Furthermore, I made some progress in writing some more test code. A lot of the results are not easily testable by evaluating some condition so there is only so much automation possible. I hope to get a little bit more tested tonight.
With my script in hand and some motivation I can run through more of the code, but still no luck on fixing the module loading in HEAD--I guess a project for another day. At least everything still works as long as I change the only line in plugin.c, but it should play well with others and not need to throw its sybols in the global table. Anyway, writing XSUBs at a faster pace now due to my script--it was more an excuse to write some interesting code rather than to have a better tool for building XSUBs, but oh well.