Mercurial > hg > CbC > old > device
view test/tmpa.c @ 585:a5b902b20300 ia32-no-rname
ia32 reconfigure end (correct?)
author | kono |
---|---|
date | Wed, 18 Jan 2006 12:26:48 +0900 (2006-01-18) |
parents | a379da780856 |
children | 682c8ec38d45 |
line wrap: on
line source
#include <stdio.h> struct enemy{ int charno; // image number float x; // x location float y; // y location int ap; // armor point }; void print_param(struct enemy *e) { printf("#0011:charno:%d x,y:%f,%f hp:%d\n", e->charno,e->x,e->y,e->ap); } typedef struct{ char dest; int VF01[4]; code (*ret)(); void *env; } interface; code a0(interface a) { printf("#0023:%d\n",a.dest); goto a.ret(0),a.env; } int main(int argc,char *argv[]) { struct enemy e; #if 0 interface args = {15,{0,0,0,0},return,environment}; #else interface args = {15,{0,0,0,0},0,0}; args.ret = return; args.env = environment; #endif e.charno=5; e.x=50.0; e.y=30.0; e.ap=100; print_param(&e); printf("#0042:%d %d\n",args.VF01[2],args.VF01[1]); goto a0(args); }