#include "HsFFI.h"

void writeIntOffPtr(HsPtr arg1, HsInt arg2, HsInt arg3)
{
  ((typeof(arg3)*)arg1)[arg2] = arg3;
}

HsInt readIntOffPtr(HsPtr arg1, HsInt arg2)
{
  return ((typeof(readIntOffPtr(arg1,arg2))*)arg1)[arg2];
}

void writeCharOffPtr(HsPtr arg1, HsInt arg2, HsChar arg3)
{
  ((typeof(arg3)*)arg1)[arg2] = arg3;
}

HsChar readCharOffPtr(HsPtr arg1, HsInt arg2)
{
  return ((typeof(readCharOffPtr(arg1,arg2))*)arg1)[arg2];
}


Support code for Storable.hs - defines teh read/writeFooOffPtr functions.
Support code for Storable.hs - defines teh read/writeFooOffPtr functions.

In writing this code, some attempt was made to make it easier to cut
and paste definitions so that it would be easier to generate the
missing definitions.  It'd probably be easier to use the more obvious
technique of using cpp to do the job.
