[project @ 2000-05-26 10:14:33 by sewardj]
[ghc-hetmet.git] / ghc / interpreter / dh_demo.c
1
2
3 #include <stdio.h>
4 #include <assert.h>
5 #include <windows.h>
6 //#include "../includes/DietHEP.h"
7
8
9 typedef enum { dh_stdcall, dh_ccall } DH_CALLCONV;
10 typedef int                           DH_MODULE;
11 typedef char*                         DH_LPCSTR;
12
13 __declspec(dllimport)
14 extern DH_MODULE DH_LoadLibrary    ( DH_LPCSTR modname );
15 __declspec(dllimport)
16 extern void*     DH_GetProcAddress ( DH_CALLCONV  cconv, 
17                                      DH_MODULE    hModule, 
18                                      DH_LPCSTR    lpProcName );
19
20
21 int main ( int argc, char** argv )
22 {
23    {
24    DH_MODULE hModule;
25    void(*proc)(int);
26
27    hModule = DH_LoadLibrary("Dh_Demo");   /* note no .hs */
28    assert(hModule != 0);
29    proc = DH_GetProcAddress ( dh_ccall, hModule, "wurble" );
30    assert(proc);
31
32    proc(44);
33    proc(45);
34    proc(46);
35    }
36    return 0;
37 }