3 # create dos_strerror() from dos_errno.h
5 # written by Yasha (ITOH Yasufumi)
8 # $NetBSD: makestrerror.awk,v 1.1 1998/09/01 19:53:26 itohy Exp $
10 /^\
/\
* dos_errlist
begin \
*\
/$
/,/^\
/\
* dos_errlist
end \
*\
/$
/ {
11 if ($
0 ~
/^\
/\
* dos_errlist
begin \
*\
/$
/) {
13 print "| This file is automatically generated. DO NOT EDIT."
14 print "#include \"dos_asm.h\""
15 print "#include \"dos_errno.h\""
18 print "GLOBAL(dos_nerr)"
19 print " .long DOS_ELAST+1"
21 print "ENTRY_NOPROFILE(dos_strerror)"
22 print " movel %sp@(4),%d0"
23 print " moveq #80,%d1"
26 print " moveq #DOS_EEXIST,%d0"
27 print "Lnot80: moveq #DOS_ELAST+1,%d1"
30 print " movel %d1,%d0"
31 print "Lnotuk: lslw #1,%d0"
32 print "Lh1:\tmovew\t%pc@(Lerrtbl-Lh1-2:B,%d0:W),%d0\t| 303B 000A"
33 print "Lh2:\tlea\t%pc@(Lerrtbl-Lh2-2:B,%d0:W),%a0\t| 41FB 0006"
34 print " movel %a0,%d0"
39 } else if ($
0 ~
/^\
/\
* dos_errlist
end \
*\
/$
/) {
40 print "\t.word\tLukmsg-Lerrtbl | default message"
43 for (i =
0; i
< nmsg
; i
++)
44 print "Lmsg" i
":\t.asciz\t\"" msg
[i
] "\""
46 print "Lukmsg:\t.asciz\t\"Unknown error\""
49 if ($
3 != nmsg
|| $
4 != "/*") {
50 printf FILENAME ":" NR ": format error"
54 print "\t.word\tLmsg" nmsg
"-Lerrtbl"
59 msg
[nmsg
] =
substr($
0, 5, length - 7)