Category : OS/2 Files
Archive   : RUNDLL.ZIP
Filename : DOSCALLS.AWK

 
Output of file : DOSCALLS.AWK contained in archive : RUNDLL.ZIP
# doscalls.awk
# creates doscalls.c from bsedos.h
# doscalls.c is #included by proc2.c
# C>sort -b +2 \os2\inc\bsedos.h | awk -f doscalls.awk > doscalls.c

# bsedos.h contains prototypes such as:
# USHORT APIENTRY DosCreateThread(PFNTHREAD, PTID, PBYTE);
# doscalls.awk turns these into string name/function ptr pairs:
# "DosCreateThread", DosCreateThread,

BEGIN { init() }

END { fini() }

$2 ~ /APIENTRY/ && $3 ~ /Dos/ { doscall($3) }

function init() {
print "/* doscalls.c */"
print "LOCAL DOSCALLS NEAR dos[] = {"
print "\"\",\t0,"
}

function fini() {
print "} ; "
print "#define NUM_DOSCALLS\t", num_doscalls
}

function doscall(s) {
gsub(/\(/, " ", s) # replace open paren with space
split(s, arr) # tokenize
print "\"" arr[1] "\", " arr[1] "," # print with and without quotes
num_doscalls++
}




  3 Responses to “Category : OS/2 Files
Archive   : RUNDLL.ZIP
Filename : DOSCALLS.AWK

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/