-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcifs_errors.h
131 lines (118 loc) · 4.61 KB
/
cifs_errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef CIFS_ERRORS_H
#define CIFS_ERRORS_H
/* ========================================================================== **
* cifs_errors.h
*
* Copyright:
* Copyright (C) 2000-2004 by Christopher R. Hertel
*
* Email: [email protected]
*
* $Id: cifs_errors.h,v 0.12 2004/05/30 03:11:34 crh Exp $
*
* -------------------------------------------------------------------------- **
*
* Description:
*
* This file contains error code definitions.
*
* -------------------------------------------------------------------------- **
*
* License:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* -------------------------------------------------------------------------- **
*
* ========================================================================== **
*/
/* Error Classes */
#define cifs_errERR (-0x0000)
#define cifs_errWARN (-0x1000)
#define cifs_errINFO (-0x2000)
#define cifs_errMASK 0xF000
typedef enum
{
/* Success */
cifs_errSuccess = 0,
/* Errors */
cifs_errGeneric = (cifs_errERR - 1),
cifs_errNullInput = (cifs_errERR - 2),
cifs_errNameTooLong = (cifs_errERR - 3),
cifs_errLeadingDot = (cifs_errERR - 4),
cifs_errDoubleDot = (cifs_errERR - 5),
cifs_errEndDot = (cifs_errERR - 6),
cifs_errScopeTooLong = (cifs_errERR - 7),
cifs_errBadLblFlag = (cifs_errERR - 8),
cifs_errOutOfBounds = (cifs_errERR - 9),
cifs_errTruncatedBufr = (cifs_errERR - 10),
cifs_errBufrTooSmall = (cifs_errERR - 11),
cifs_errBadL1Value = (cifs_errERR - 12),
cifs_errSyntaxError = (cifs_errERR - 13),
cifs_errInvalidLblLen = (cifs_errERR - 14),
cifs_errIllegalSSType = (cifs_errERR - 15),
cifs_errInvalidSSLen = (cifs_errERR - 16),
cifs_errBadCalledName = (cifs_errERR - 17),
cifs_errBadCallingName = (cifs_errERR - 18),
cifs_errUnknownCommand = (cifs_errERR - 19),
cifs_errInvalidPacket = (cifs_errERR - 20),
/* Warnings */
cifs_warnGeneric = (cifs_errWARN - 1),
cifs_warnContainsDot = (cifs_errWARN - 2),
cifs_warnNonPrint = (cifs_errWARN - 3),
cifs_warnNonAlpha = (cifs_errWARN - 4),
cifs_warnNulByte = (cifs_errWARN - 5),
cifs_warnInvalidChar = (cifs_errWARN - 6),
cifs_warnNonAlphaNum = (cifs_errWARN - 7),
cifs_warnEmptyStr = (cifs_errWARN - 8),
cifs_warnAsterisk = (cifs_errWARN - 9),
cifs_warnLenExceeded = (cifs_errWARN - 10),
cifs_warnUnknownKey = (cifs_errWARN - 11),
cifs_warnDuplicateKey = (cifs_errWARN - 12),
/* Info Codes */
cifs_infoGeneric = (cifs_errINFO - 1),
/* The End */
cifs_errTheEnd = -0xFFFF
} cifs_error;
/* -------------------------------------------------------------------------- **
* Macros:
*
* cifs_errIsError( E ) - Returns TRUE if E is in the Error catagory.
* cifs_errIsWarn( W ) - Returns TRUE if W is in the Warning category.
* cifs_errIsInfo( I ) - Returns TRUE if I is in the Information category.
* cifs_errClass( E ) - Returns the error class of error code E.
* cifs_errCode( E ) - Returns the error number (positive int) of E.
*
* The cifs_errClass() macro allows you to do things like this:
*
* switch( cifs_errClass(err) )
* {
* case cifs_errERR: return( "Error: " );
* case cifs_errWARN: return( "Warning: " );
* case cifs_errINFO: return( "Info: " );
* }
* return( "Unknown Error Class: " );
*
*/
#define cifs_errIsError( E ) \
( -cifs_errERR == (cifs_errMASK & -(E)) ? true : false )
#define cifs_errIsWarn( W ) \
( -cifs_errWARN == (cifs_errMASK & -(W)) ? true : false )
#define cifs_errIsInfo( I ) \
( -cifs_errINFO == (cifs_errMASK & -(I)) ? true : false )
#define cifs_errClass( E ) (-(cifs_errMASK & -(E)))
#define cifs_errCode( E ) (~cifs_errMASK & -(E))
/* ========================================================================== */
#endif /* CIFS_ERRORS_H */