1772
|
1 #ifndef _OSK
|
|
2
|
|
3 /* Our own versions of modlink() and modload() which use
|
|
4 F$NMLink and F$NMLoad to load a module --BGP */
|
|
5
|
|
6 #include <os9.h>
|
|
7
|
|
8 #define F_NMLINK 0x21
|
|
9 #define F_NMLOAD 0x22
|
2027
|
10 #if 0
|
1772
|
11 #define F_UNLOAD 0x1d
|
2027
|
12 #endif
|
1772
|
13
|
|
14 extern int errno;
|
|
15
|
|
16
|
|
17 int nmlink (mod, type, lang)
|
|
18 char *mod;
|
|
19 int type, lang;
|
|
20 {
|
|
21 struct registers reg;
|
|
22 int result;
|
|
23
|
|
24 reg.rg_a = type | lang;
|
|
25 reg.rg_x = mod;
|
|
26 result = _os9 (F_NMLINK, ®);
|
|
27 errno = reg.rg_b & 0xff;
|
|
28 return (result);
|
|
29 }
|
|
30
|
|
31
|
|
32
|
|
33 int nmload (mod, type, lang)
|
|
34 char *mod;
|
|
35 int type, lang;
|
|
36 {
|
|
37 struct registers reg;
|
|
38 int result;
|
|
39
|
|
40 reg.rg_a = type | lang;
|
|
41 reg.rg_x = mod;
|
|
42 result = _os9 (F_NMLOAD, ®);
|
|
43 errno = reg.rg_b & 0xff;
|
|
44 return (result);
|
|
45 }
|
|
46
|
|
47
|
|
48 /* our own munload using F$UnLoad to unlink the module --REB */
|
|
49
|
|
50 int munload (mod, typelang)
|
|
51 char *mod;
|
|
52 int typelang;
|
|
53 {
|
|
54 struct registers reg;
|
|
55 int result;
|
|
56
|
|
57 reg.rg_a = typelang;
|
|
58 reg.rg_x = mod;
|
|
59 result = _os9 (F_UNLOAD, ®);
|
|
60 errno = reg.rg_b & 0xff;
|
|
61 return (result);
|
|
62 }
|
|
63 #endif
|