/*
Automatically generated by HaskellDirect (ihc), snapshot 240699
Created: 14:34 , Friday 30 July, 1999
Command line: -c tclHaskell.idl -o TclPrim.hs -fhs-to-c --hugs -fno-qualified-names

*/
#include "HDirect.h"
#ifndef __INT64_DEFINED__
#ifdef __GNUC__
typedef long long int64;
#else
typedef _int64 int64;
#endif
#define __INT64_DEFINED__
#endif

#include "tclhaskell.h"
primFun(prim_TclPrim_readCharOffAddr)
{
void* arg0;
int arg1;
unsigned char res;
arg0 = (void*)(hugs->getAddr());
arg1 = (int)(hugs->getInt());
res =readCharOffAddr(arg0, arg1);
hugs->putChar((unsigned char)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_writeCharOffAddr)
{
void* arg0;
int arg1;
unsigned char arg2;
arg0 = (void*)(hugs->getAddr());
arg1 = (int)(hugs->getInt());
arg2 = (unsigned char)(hugs->getChar());
writeCharOffAddr(arg0, arg1, arg2);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primMalloc)
{
unsigned long arg0;
void* res;
arg0 = (unsigned long)(hugs->getWord());
res =primMalloc(arg0);
hugs->putAddr((void*)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primFree)
{
void* arg0;
arg0 = (void*)(hugs->getAddr());
primFree(arg0);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primPutEnv)
{
char* arg0;
arg0 = (char*)(hugs->getAddr());
primPutEnv(arg0);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primTclDebug)
{
int arg0;
arg0 = (int)(hugs->getInt());
primTclDebug(arg0);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primInitTcl)
{
int res;
res =primInitTcl();
hugs->putInt((int)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primRunTcl)
{
int res;
res =primRunTcl();
hugs->putInt((int)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primRunNonBlockingTcl)
{
int res;
res =primRunNonBlockingTcl();
hugs->putInt((int)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primRunOnceTcl)
{
int res;
res =primRunOnceTcl();
hugs->putInt((int)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primExecuteTcl)
{
char* arg0;
char* res;
arg0 = (char*)(hugs->getAddr());
res =primExecuteTcl(arg0);
hugs->putAddr((char*)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primExecuteTcl_)
{
char* arg0;
arg0 = (char*)(hugs->getAddr());
primExecuteTcl_(arg0);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primGetEvent)
{
char* res;
res =primGetEvent();
hugs->putAddr((char*)res);
hugs_returnIO(1);
}
primFun(prim_TclPrim_primSetVar)
{
char* arg0;
char* arg1;
arg0 = (char*)(hugs->getAddr());
arg1 = (char*)(hugs->getAddr());
primSetVar(arg0, arg1);
hugs_returnIO(0);
}
primFun(prim_TclPrim_primCheckAnyWindowsTcl)
{
int res;
res =primCheckAnyWindowsTcl();
hugs->putInt((int)res);
hugs_returnIO(1);
}
static struct primitive primTable[] = {
  {"prim_TclPrim_primCheckAnyWindowsTcl",2,prim_TclPrim_primCheckAnyWindowsTcl},
  {"prim_TclPrim_primSetVar",4,prim_TclPrim_primSetVar},
  {"prim_TclPrim_primGetEvent",2,prim_TclPrim_primGetEvent},
  {"prim_TclPrim_primExecuteTcl_",3,prim_TclPrim_primExecuteTcl_},
  {"prim_TclPrim_primExecuteTcl",3,prim_TclPrim_primExecuteTcl},
  {"prim_TclPrim_primRunOnceTcl",2,prim_TclPrim_primRunOnceTcl},
  {"prim_TclPrim_primRunNonBlockingTcl",2,prim_TclPrim_primRunNonBlockingTcl},
  {"prim_TclPrim_primRunTcl",2,prim_TclPrim_primRunTcl},
  {"prim_TclPrim_primInitTcl",2,prim_TclPrim_primInitTcl},
  {"prim_TclPrim_primTclDebug",3,prim_TclPrim_primTclDebug},
  {"prim_TclPrim_primPutEnv",3,prim_TclPrim_primPutEnv},
  {"prim_TclPrim_primFree",3,prim_TclPrim_primFree},
  {"prim_TclPrim_primMalloc",3,prim_TclPrim_primMalloc},
  {"prim_TclPrim_writeCharOffAddr",5,prim_TclPrim_writeCharOffAddr},
  {"prim_TclPrim_readCharOffAddr",4,prim_TclPrim_readCharOffAddr},
  {0,0,0}
};
static struct primInfo prims = { 0, primTable, 0 };
#ifdef __cplusplus
extern "C" {
#endif
DLLEXPORT(void) initModule(HugsAPI2 *);
DLLEXPORT(void) initModule(HugsAPI2 *hugsAPI) {
  hugs = hugsAPI;
  hugs->registerPrims(&prims);
}
#ifdef __cplusplus
}
#endif
