>grand.central.org GCO Public CellServDB 25 Oct 2007
[arla.git] / arlad / fs_errors.h
blobffa07dce8350a0b7b4cf3bd15536890a70c49ee8
1 /*
2 * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 /* $Id$ */
36 #ifndef _FS_ERRORS_H_
37 #define _FS_ERRORS_H_ 1
39 #include <rx/rx.h>
40 #include <uae.h>
42 #if !defined(__GNUC__) && !defined(__attribute__)
43 #define __attribute__(x)
44 #endif
46 #define VICE_SPECIAL_ERRORS 101
48 #define VICE_SPECIAL_ERRORS_MIN 101
49 #define VICE_SPECIAL_ERRORS_MAX 112
51 #define VSALVAGE 101
52 #define VNOVNODE 102
53 #define VNOVOL 103
54 #define VVOLEXISTS 104
55 #define VNOSERVICE 105
56 #define VOFFLINE 106
57 #define VONLINE 107
58 #define VDISKFULL 108
59 #define VOVERQUOTA 109
60 #define VBUSY 110
61 #define VMOVED 111
62 #define VIO 112
64 #define VRESTARTING -100
66 #define ARLA_SPECIAL_ERROR_ADD 4000
67 #define ARLA_SPECIAL2_ERROR_ADD 4600
68 #define ARLA_SPECIAL_RX_ERROR_ADD 4800 /* ->4899 */
70 #define ARLA_VSALVAGE (ARLA_SPECIAL_ERROR_ADD+VSALVAGE)
71 #define ARLA_VNOVNODE (ARLA_SPECIAL_ERROR_ADD+VNOVNODE)
72 #define ARLA_VNOVOL (ARLA_SPECIAL_ERROR_ADD+VNOVOL)
73 #define ARLA_VVOLEXISTS (ARLA_SPECIAL_ERROR_ADD+VVOLEXISTS)
74 #define ARLA_VNOSERVICE (ARLA_SPECIAL_ERROR_ADD+VNOSERVICE)
75 #define ARLA_VOFFLINE (ARLA_SPECIAL_ERROR_ADD+VOFFLINE)
76 #define ARLA_VONLINE (ARLA_SPECIAL_ERROR_ADD+VONLINE)
77 #define ARLA_VDISKFULL (ARLA_SPECIAL_ERROR_ADD+VDISKFULL)
78 #define ARLA_VOVERQUOTA (ARLA_SPECIAL_ERROR_ADD+VOVERQUOTA)
79 #define ARLA_VBUSY (ARLA_SPECIAL_ERROR_ADD+VBUSY)
80 #define ARLA_VMOVED (ARLA_SPECIAL_ERROR_ADD+VMOVED)
81 #define ARLA_VIO (ARLA_SPECIAL_ERROR_ADD+VIO)
83 #define ARLA_VRESTARTING (ARLA_SPECIAL2_ERROR_ADD+VRESTARTING)
85 #define ARLA_CALL_DEAD (ARLA_SPECIAL_RX_ERROR_ADD-RX_CALL_DEAD)
86 #define ARLA_INVALID_OPERATION (ARLA_SPECIAL_RX_ERROR_ADD-RX_INVALID_OPERATION)
87 #define ARLA_CALL_TIMEOUT (ARLA_SPECIAL_RX_ERROR_ADD-RX_CALL_TIMEOUT)
88 #define ARLA_EOF (ARLA_SPECIAL_RX_ERROR_ADD-RX_EOF)
89 #define ARLA_PROTOCOL_ERROR (ARLA_SPECIAL_RX_ERROR_ADD-RX_PROTOCOL_ERROR)
90 #define ARLA_USER_ABORT (ARLA_SPECIAL_RX_ERROR_ADD-RX_USER_ABORT)
91 #define ARLA_ADDRINUSE (ARLA_SPECIAL_RX_ERROR_ADD-RX_ADDRINUSE)
92 #define ARLA_MSGSIZE (ARLA_SPECIAL_RX_ERROR_ADD-RX_MSGSIZE)
94 static inline int __attribute__ ((unused))
95 conv_to_arla_errno(int error)
97 if (error >= VICE_SPECIAL_ERRORS_MIN &&
98 error <= VICE_SPECIAL_ERRORS_MAX)
99 return error + ARLA_SPECIAL_ERROR_ADD;
100 else if (error == VRESTARTING)
101 return ARLA_VRESTARTING;
102 else if (error <= RX_MIN_ERROR && error >= RX_MAX_ERROR)
103 return ARLA_SPECIAL_RX_ERROR_ADD - error; /* RX code are negative */
104 else
105 return uae_error_to_errno(error);
108 #endif /* _FS_ERRORS_H_ */