[NetBehaviour] apoo.c

James Morris james at jwm-art.net
Mon Aug 29 23:20:05 CEST 2011


/*  apoo.c
 *  gcc apoo.c -o apoo
 *  ./apoo
 */

#include <assert.h>

typedef struct chess
{
    int     var_apoo;
    float   var_bpoo;
    char    var_cpoo;

} chess;

chess piece = { 0, 0.0f, 0 };

#define GET_VAR_TYPE( TYPE, VAR ) \
TYPE get_##VAR##poo(void)    \
{                               \
    return piece.var_##VAR##poo;   \
}

GET_VAR_TYPE( int,      a )
GET_VAR_TYPE( float,    b )
GET_VAR_TYPE( char,     c )

int you_are_a(int _n) { return _n; }

int main(int argc, char** argv)
{
    int a, b, c;

    assert(("i hope you know",  a = get_apoo()) == 0
         && "you're splendid");
    assert(("in many ways",     b = get_bpoo()) == 0
         && "but you failed");
    assert(("to noticibly",     c = get_cpoo()) == 0
         && "realize you're");
    assert(you_are_a(("a construction",
                            (a++ ^ ++b ^ c++))) == 0
         && "that has always");
    return 0;
}

/*
 * -- 
 * http://jwm-art.net/
 * image/audio/text/code/
 */



More information about the NetBehaviour mailing list