Browse Source
used to generate the function table in lsi as the header file which code can include to get a matching ABI definition.master
Gavan Fantom
18 years ago
5 changed files with 142 additions and 68 deletions
@ -0,0 +1,40 @@
|
||||
/* abi.h */ |
||||
|
||||
typedef int (*vm_intfn)(void); |
||||
|
||||
/*
|
||||
* We must include here all prototypes for functions which can be |
||||
* included in the ABI function table |
||||
*/ |
||||
|
||||
int vm_intfn_nop(void); |
||||
int vm_intfn_global_store(void); |
||||
int vm_intfn_global_load(void); |
||||
int vm_intfn_global_array_store(void); |
||||
int vm_intfn_global_array_load(void); |
||||
int vm_intfn_printint(void); |
||||
int vm_intfn_printreal(void); |
||||
int vm_intfn_printstr(void); |
||||
int vm_intfn_dmxsetchannel(void); |
||||
int vm_intfn_dmxoutput(void); |
||||
int vm_intfn_gettime(void); |
||||
int vm_intfn_waittime(void); |
||||
int vm_intfn_wait(void); |
||||
int vm_intfn_wakeup(void); |
||||
int vm_intfn_spawn(void); |
||||
int vm_intfn_midi_read(void); |
||||
int vm_intfn_beatdetect_read(void); |
||||
int vm_intfn_beatdetect_phase(void); |
||||
int vm_intfn_beatdetect_confidence(void); |
||||
int vm_intfn_realtoint(void); |
||||
int vm_intfn_inttoreal(void); |
||||
int vm_intfn_map3d_setcal(void); |
||||
int vm_intfn_map3d_calibrate(void); |
||||
int vm_intfn_map3d_transform(void); |
||||
int vm_intfn_map3d_setparams(void); |
||||
int vm_intfn_map3d_load(void); |
||||
int vm_intfn_map3d_save(void); |
||||
int vm_intfn_sin(void); |
||||
int vm_intfn_cos(void); |
||||
int vm_intfn_random(void); |
||||
int vm_intfn_mouse_read(void); |
@ -0,0 +1,39 @@
|
||||
/* This should be a master file specifying all aspects of ABI */ |
||||
|
||||
/* Function assignments */ |
||||
|
||||
function nop |
||||
function global_store |
||||
function global_load |
||||
function global_array_store |
||||
function global_array_load |
||||
function printint |
||||
function printreal |
||||
function printstr |
||||
function dmxsetchannel |
||||
function dmxoutput |
||||
function gettime |
||||
function waittime |
||||
function wait |
||||
function wakeup |
||||
function spawn |
||||
function midi_read |
||||
function beatdetect_read |
||||
function beatdetect_phase |
||||
function beatdetect_confidence |
||||
funciton realtoint |
||||
function inttoreal |
||||
function map3d_setcal |
||||
function map3d_calibrate |
||||
function map3d_transform |
||||
function map3d_setparams |
||||
function map3d_load |
||||
function map3d_save |
||||
function sin |
||||
function cos |
||||
function random |
||||
function mouse_read |
||||
|
||||
/* |
||||
* The ABI should be identified by a SHA1 hash of this file |
||||
*/ |
@ -0,0 +1,50 @@
|
||||
#!/bin/sh |
||||
|
||||
INFILE=$1 |
||||
|
||||
if [ "X${INFILE}" = "X" ] |
||||
then |
||||
echo "Usage: $0 abispec" |
||||
exit 1 |
||||
fi |
||||
|
||||
ABI=abi.c |
||||
HEADER=abi.lh |
||||
|
||||
FNCOUNT=0 |
||||
|
||||
do_function() |
||||
{ |
||||
echo " vm_intfn_${ARG1}," >>${ABI} |
||||
echo "fndefint ${ARG1} ${FNCOUNT};" >>${HEADER} |
||||
FNCOUNT=$((${FNCOUNT}+1)) |
||||
} |
||||
|
||||
cat <<EOF >${ABI} |
||||
/* abi.c */ |
||||
/* autogenerated - do not edit */ |
||||
|
||||
#include "abi.h" |
||||
|
||||
vm_intfn vm_intfn_table[] = { |
||||
EOF |
||||
|
||||
cat <<EOF >${HEADER} |
||||
/* abi.lh */ |
||||
/* autogenerated - do not edit */ |
||||
|
||||
EOF |
||||
|
||||
while read TYPE ARG1 ARG2 |
||||
do |
||||
case "$TYPE" in |
||||
function) do_function |
||||
;; |
||||
esac |
||||
done <${INFILE} |
||||
|
||||
cat <<EOF >>${ABI} |
||||
}; |
||||
|
||||
const int vm_intfn_size = sizeof(vm_intfn_table) / sizeof(vm_intfn); |
||||
EOF |
Loading…
Reference in new issue