tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / netlib / sana2printfault.c
blob599f51cc6d0233577b21d6d3a271a3852753d70d
1 /* $Id$
3 * sana2printfault.c - print SANA-II error message
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
7 * All rights reserved.
8 */
10 #include <devices/sana2.h>
11 #include <net/sana2errno.h>
12 #include <proto/dos.h>
14 #include "conf.h"
16 /****** sana2.lib/sana2PrintFault *********************************************
18 NAME
19 Sana2PrintFault - print SANA-II device error messages
21 SYNOPSIS
22 #include <devices/sana2.h>
24 Sana2PrintFault(banner, ios2request)
26 void Sana2PrintFault(const char *, struct IOSana2Req *)
28 FUNCTION
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
34 printed.
36 SEE ALSO
37 Sana2PrintFault()
39 *******************************************************************************
43 void
44 Sana2PrintFault(const char *banner, struct IOSana2Req *ios2)
46 register WORD err = ios2->ios2_Req.io_Error;
47 register ULONG werr = ios2->ios2_WireError;
48 CONST_STRPTR serr;
50 if (err >= sana2io_nerr || -err > io_nerr) {
51 serr = io_errlist[0];
52 } else {
53 if (err < 0)
54 serr = io_errlist[-err];
55 else
56 serr = sana2io_errlist[err];
59 if (banner)
60 Printf("%s: ", banner);
62 if (werr == 0 || werr >= sana2wire_nerr) {
63 Printf("%s\n", serr);
64 } else {
65 Printf("%s (%s)\n", serr, sana2wire_errlist[werr]);