3 * sana2printfault.c - print SANA-II error message
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
10 #include <devices/sana2.h>
11 #include <net/sana2errno.h>
12 #include <proto/dos.h>
16 /****** sana2.lib/sana2PrintFault *********************************************
19 Sana2PrintFault - print SANA-II device error messages
22 #include <devices/sana2.h>
24 Sana2PrintFault(banner, ios2request)
26 void Sana2PrintFault(const char *, struct IOSana2Req *)
29 The Sana2PrintFault() function finds the error message corresponding
30 to the error in the given SANA-II IO request and writes it, followed
31 by a newline, to the Output(). If the argument string is non-NULL it
32 is preappended to the message string and separated from it by a colon
33 and space (`: '). If string is NULL only the error message string is
39 *******************************************************************************
44 Sana2PrintFault(const char *banner
, struct IOSana2Req
*ios2
)
46 register WORD err
= ios2
->ios2_Req
.io_Error
;
47 register ULONG werr
= ios2
->ios2_WireError
;
50 if (err
>= sana2io_nerr
|| -err
> io_nerr
) {
54 serr
= io_errlist
[-err
];
56 serr
= sana2io_errlist
[err
];
60 Printf("%s: ", banner
);
62 if (werr
== 0 || werr
>= sana2wire_nerr
) {
65 Printf("%s (%s)\n", serr
, sana2wire_errlist
[werr
]);