-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdumpmod.e
More file actions
42 lines (30 loc) · 837 Bytes
/
dumpmod.e
File metadata and controls
42 lines (30 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
->OPT POWERPC
-> private tool for dumping a cached module to disk (by LS) PUBLIC DOMAIN.
MODULE '*binary'
MODULE 'dos/dos'
MODULE 'exec/lists'
MODULE 'exec/nodes'
PROC main() HANDLE
DEF modulecache=NIL:PTR TO modulecache
DEF cmh:PTR TO moduleheader, t=NIL, fh
DEF m:PTR TO moduleheader
modulecache := FindSemaphore('EcxCache')
IF modulecache = NIL THEN Raise("NOCA")
cmh := modulecache.modlist.head
PrintF('dumping \s\n', arg)
WHILE cmh.succ
IF StrCmp(cmh.mname, arg)
fh := Open('t:t.m', NEWFILE)
Write(fh, cmh, cmh.modsize)
Close(fh)
Raise(0)
ENDIF
cmh := cmh.succ
ENDWHILE
PrintF('not found!\n')
EXCEPT DO
SELECT exception
CASE "NOCA" ; PrintF('no cache available!\n')
CASE "MEM" ; PrintF('Out of memory\n')
ENDSELECT
ENDPROC