<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bourne-again Blog</title>
	<atom:link href="http://criminy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://criminy.wordpress.com</link>
	<description>Random programming and other rants.</description>
	<lastBuildDate>Mon, 26 May 2008 02:40:27 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='criminy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0bc1357d55ad6d6503ecfdcca65fe8ea?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Bourne-again Blog</title>
		<link>http://criminy.wordpress.com</link>
	</image>
			<item>
		<title>Cross-language constants</title>
		<link>http://criminy.wordpress.com/2008/05/25/cross-language-constants/</link>
		<comments>http://criminy.wordpress.com/2008/05/25/cross-language-constants/#comments</comments>
		<pubDate>Mon, 26 May 2008 02:40:27 +0000</pubDate>
		<dc:creator>criminy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Lua]]></category>

		<guid isPermaLink="false">http://criminy.wordpress.com/?p=52</guid>
		<description><![CDATA[Original post: October 18, 2006
This CPP macro allows me to take a #define’d constant and register it with Lua.

    /* leet hax but remember to always pass a null buffer! */
    #define RegisterConstant(L,buffer,c) \
    { \
    buffer = malloc(strlen(#c “=”)+(sizeof(int)/2*3) + 1); \
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=criminy.wordpress.com&blog=97488&post=52&subd=criminy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h2><em>Original post: October 18, 2006</em></h2>
<p>This CPP macro allows me to take a #define’d constant and register it with Lua.</p>
<p><code><br />
    /* leet hax but remember to always pass a null buffer! */<br />
    #define RegisterConstant(L,buffer,c) \<br />
    { \<br />
    buffer = malloc(strlen(#c “=”)+(sizeof(int)/2*3) + 1); \<br />
    sprintf(buffer,#c “=%i”,c); \<br />
    luaL_loadstring(L,buffer); \<br />
    lua_pcall(L,0,-1,0); \<br />
    free(buffer); buffer = NULL; \<br />
    }</code></p>
<p>I’ve used this with allegro by processing keyboard.h through a script and throwing the output file in a..would you call it a singleton header? Probably not.</p>
<p><code>    cat /usr/include/allegro/keyboard.h | grep “\#define KEY_” | awk ‘{print “RegisterConstant(L,buf,” $1 “);”}’ &gt;&gt; constants.h<br />
    —-<br />
    cat constants.h | tail -n 4<br />
    RegisterConstant(L,buf,KEY_SCRLOCK);<br />
    RegisterConstant(L,buf,KEY_NUMLOCK);<br />
    RegisterConstant(L,buf,KEY_CAPSLOCK);<br />
    RegisterConstant(L,buf,KEY_MAX);</code></p>
<p>Now KEY_MAX, KEY_SCRLOCK, and everything else in constants.h are valid variables in Lua. I just #include “constants.h” in a lua setup function (where L and buf are declared).<br />
My Main main(), which will probably replace the main in breakout tutorial when I rewrite it =\:</p>
<p><code><br />
    int main(int argc,char * argv[]) /*{+{*/ {<br />
    do(g_status = g_loops[g_status]());<br />
    while(g_status LESS_THAN STATUS_EXIT_LOOP);<br />
    return(gshutdown());<br />
    }END_OF_MAIN()/*}_}*/</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/criminy.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/criminy.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/criminy.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/criminy.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/criminy.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/criminy.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/criminy.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/criminy.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/criminy.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/criminy.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/criminy.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/criminy.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=criminy.wordpress.com&blog=97488&post=52&subd=criminy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://criminy.wordpress.com/2008/05/25/cross-language-constants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7024aefacddeb293827e6198055787a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">criminy</media:title>
		</media:content>
	</item>
		<item>
		<title>Content wipe, Oops</title>
		<link>http://criminy.wordpress.com/2008/05/25/content-wipe-oops/</link>
		<comments>http://criminy.wordpress.com/2008/05/25/content-wipe-oops/#comments</comments>
		<pubDate>Mon, 26 May 2008 02:40:20 +0000</pubDate>
		<dc:creator>criminy</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://criminy.wordpress.com/?p=51</guid>
		<description><![CDATA[I decided to do a content wipe for restarting this blog, them immediately realized my past page-views had spiked at some point, meaning my past posts were read by someone. In fact, I had quite large spikes which I think mean something. I have no hard-copy but google cached them. I&#8217;ll put up what I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=criminy.wordpress.com&blog=97488&post=51&subd=criminy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I decided to do a content wipe for restarting this blog, them immediately realized my past page-views had spiked at some point, meaning my past posts were read by someone. In fact, I had quite large spikes which I think mean<em> something</em>. I have no hard-copy but google cached them. I&#8217;ll put up what I can get, which doesn&#8217;t look like much.</p>
<p>As I think about certain posts, and what I was doing, there were some themes I noticed:</p>
<ul>
<li>C/C++, mainly C.</li>
<li>Allegro
	</li>
<li>XFCE/Thunar</li>
<li>perl</li>
<li>flock</li>
<li>I said things as if they were important</li>
<li>I may have been using Arch Linux back then</li>
</ul>
<p>Times change, it&#8217;s weak, but they do. I tried convincing a bunch of people just that, but I was met with silly ideals and pretensions about web design. I won&#8217;t name the site, but I&#8217;ll say change is good.</p>
<p>Then -&gt; Now<br />
Vi -&gt; Emacs<br />
XFCE -&gt; Gnome<br />
Arch -&gt; Ubuntu<br />
Jobless -&gt; Employed<br />
C/(C with classes)/Perl -&gt; Modern C++/Scheme</p>
<p>It is odd to dwell on the past year and realize what change is.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/criminy.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/criminy.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/criminy.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/criminy.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/criminy.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/criminy.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/criminy.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/criminy.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/criminy.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/criminy.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/criminy.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/criminy.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=criminy.wordpress.com&blog=97488&post=51&subd=criminy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://criminy.wordpress.com/2008/05/25/content-wipe-oops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7024aefacddeb293827e6198055787a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">criminy</media:title>
		</media:content>
	</item>
	</channel>
</rss>