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>
13 #include <proto/dos.h>
15 #include <clib/dos_protos.h>
18 /****** sana2.lib/sana2PrintFault *********************************************
21 Sana2PrintFault - print SANA-II device error messages
24 #include <devices/sana2.h>
26 Sana2PrintFault(banner, ios2request)
28 void Sana2PrintFault(const char *, struct IOSana2Req *)
31 The Sana2PrintFault() function finds the error message corresponding
32 to the error in the given SANA-II IO request and writes it, followed
33 by a newline, to the Output(). If the argument string is non-NULL it
34 is preappended to the message string and separated from it by a colon
35 and space (`: '). If string is NULL only the error message string is
41 *******************************************************************************
46 Sana2PrintFault(const char *banner
, struct IOSana2Req
*ios2
)
48 register WORD err
= ios2
->ios2_Req
.io_Error
;
49 register ULONG werr
= ios2
->ios2_WireError
;
53 args
[0] = (LONG
)banner
;
55 if (err
>= sana2io_nerr
|| -err
> io_nerr
) {
56 args
[1] = (LONG
)io_errlist
[0];
59 args
[1] = (LONG
)io_errlist
[-err
];
61 args
[1] = (LONG
)sana2io_errlist
[err
];
63 if (werr
== 0 || werr
>= sana2wire_nerr
) {
70 format
= "%s: %s (%s)\n";
73 args
[2] = (LONG
)sana2wire_errlist
[werr
];
76 VPrintf(format
, banner
!= NULL
? args
: args
+ 1);