[project @ 2001-01-17 12:14:30 by simonmar]
[ghc-hetmet.git] / ghc / interpreter / dh_demo.c
index 86c41f0..e925b7e 100644 (file)
@@ -3,7 +3,22 @@
 #include <stdio.h>
 #include <assert.h>
 #include <windows.h>
-#include "../includes/DietHEP.h"
+//#include "../includes/DietHEP.h"
+
+
+typedef enum { dh_stdcall, dh_ccall } DH_CALLCONV;
+typedef int                           DH_MODULE;
+typedef char*                         DH_LPCSTR;
+
+__declspec(dllimport)
+extern __stdcall
+       DH_MODULE DH_LoadLibrary    ( DH_LPCSTR modname );
+__declspec(dllimport)
+extern __stdcall
+       void*     DH_GetProcAddress ( DH_CALLCONV  cconv, 
+                                     DH_MODULE    hModule, 
+                                     DH_LPCSTR    lpProcName );
+
 
 int main ( int argc, char** argv )
 {
@@ -11,7 +26,7 @@ int main ( int argc, char** argv )
    DH_MODULE hModule;
    void(*proc)(int);
 
-   hModule = DH_LoadLibrary("FooBar");   /* note no .hs */
+   hModule = DH_LoadLibrary("Dh_Demo");   /* note no .hs */
    assert(hModule != 0);
    proc = DH_GetProcAddress ( dh_ccall, hModule, "wurble" );
    assert(proc);