2
* PROGRAM: JRD Access Method
4
* DESCRIPTION: Message encoding definition file
6
* The contents of this file are subject to the Interbase Public
7
* License Version 1.0 (the "License"); you may not use this file
8
* except in compliance with the License. You may obtain a copy
9
* of the License at http://www.Inprise.com/IPL.html
11
* Software distributed under the License is distributed on an
12
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
13
* or implied. See the License for the specific language governing
14
* rights and limitations under the License.
16
* The Original Code was created by Inprise Corporation
17
* and its predecessors. Portions created by Inprise Corporation are
18
* Copyright (C) Inprise Corporation.
20
* All Rights Reserved.
21
* Contributor(s): ______________________________________.
26
const ISC_STATUS ISC_MASK = 0x14000000; /* Defines the code as a valid ISC code */
27
const ISC_STATUS FAC_MASK = 0x00FF0000; /* Specifies the facility where the code is located */
28
const ISC_STATUS CODE_MASK = 0x0000FFFF; /* Specifies the code in the message file */
29
const ISC_STATUS CLASS_MASK = 0xF0000000; /* Defines the code as warning, error, info, or other */
31
/* The following definitions can be used to specify the context in
32
* which a status code is used.
34
//#define CLASS_ERROR 0L /* Code represents an error */
35
//#define CLASS_WARNING 1L /* Code represents a warning */
36
//#define CLASS_INFO 2L /* Code represents an information msg */
38
//#define MAKE_ERROR(code) (code | (CLASS_ERROR & 0x3L) << 30)
39
//#define MAKE_WARNING(code) (code | (CLASS_WARNING & 0x3L) << 30)
40
//#define MAKE_INFO(code) (code | (CLASS_INFO & 0x3L) << 30)
42
/* The procedure for encoding an error message is as follows:
43
* Be sure to update gds.c::gds__decode if this calculation changes
44
* since gds__decode returns the error code, facility, and error type
45
* from a given error message */
47
#define ENCODE_ISC_MSG(code, facility) ((facility & 0x1F) << 16) | \
48
((code & 0x3FFF) << 0) | \
51
#define GET_FACILITY(code) (code & FAC_MASK) >> 16
52
#define GET_CLASS(code) (code & CLASS_MASK) >> 30
53
#define GET_CODE(code) (code & CODE_MASK) >> 0
55
#endif // MSG_ENCODE_H