Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtappbuilder / src / libAButil / util_err.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23
24 /*
25  *      $XConsortium: util_err.h /main/4 1995/11/06 18:53:55 rswiston $
26  *
27  * @(#)util_err.h       1.14 11 Feb 1994        cde_app_builder/src/libAButil
28  *
29  *      RESTRICTED CONFIDENTIAL INFORMATION:
30  *      
31  *      The information in this document is subject to special
32  *      restrictions in a confidential disclosure agreement between
33  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
34  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
35  *      Sun's specific written approval.  This document and all copies
36  *      and derivative works thereof must be returned or destroyed at
37  *      Sun's request.
38  *
39  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
40  *
41  */
42
43 #ifndef _ABUTIL_UTIL_ERR_H_
44 #define _ABUTIL_UTIL_ERR_H_
45 /*
46  * util_err.h - error codes
47  *
48  * All error codes are negative.  They are numbered in 
49  * groups (general, file i/o, memory, ...).
50  *
51  * When returning an error, use the most specific error code.
52  */
53 #ifndef _POSIX_SOURCE
54 #define _POSIX_SOURCE 1         /* we want to be POSIX-compliant */
55 #endif
56
57 #include <ab_private/AB.h>
58 #include <ab/util_types.h>
59
60 #define OK                      (0)     /* smooth sailing */
61 #define ERR                     (-1)    /* generic error */
62
63 #define ERR_INTERNAL            (-100)  /* internal errors */
64 #define ERR_RECURSION           (-101)  /* recursion not allowed! */
65 #define ERR_DATA_SPACE_FULL     (-102)
66 #define ERR_BUFFER_TOO_SMALL    (-103)
67 #define ERR_NOT_IMPLEMENTED     (-104)
68 #define ERR_NOT_INITIALIZED     (-105)
69
70 #define ERR_CLIENT              (-200)  /* errors on the part of the caller */
71 #define ERR_NOT_ALLOWED         (-201)
72 #define ERR_NOT_FOUND           (-202)  /* search failed */
73 #define ERR_DUPLICATE_KEY       (-203)  /* insert of duplicate key */
74 #define ERR_BAD_PARAM           (-220)  /* bad parameter */
75 #define ERR_BAD_PARAM1          (-221)  /* parameter #1 bad */
76 #define ERR_BAD_PARAM2          (-222)
77 #define ERR_BAD_PARAM3          (-223)
78 #define ERR_BAD_PARAM4          (-224)
79 #define ERR_BAD_PARAM5          (-225)
80 #define ERR_BAD_PARAM6          (-226)
81 #define ERR_BAD_PARAM7          (-227)
82 #define ERR_BAD_PARAM8          (-228)
83 #define ERR_BAD_PARAM9          (-229)
84
85 #define ERR_IO                  (-300)  /* I/O errors */
86 #define ERR_FILE_NOT_FOUND      (-301)
87 #define ERR_OPEN                (-302)
88 #define ERR_WRITE               (-303)
89 #define ERR_READ                (-304)
90 #define ERR_EOF                 (-305)
91 #define ERR_BAD_FILE_FORMAT     (-306)
92 #define ERR_RENAME              (-307)
93 #define ERR_READ_ONLY           (-308)
94 #define ERR_BACKUP              (-309)
95
96 #define ERR_MEMORY              (-400)  /* memory errors */
97 #define ERR_NO_MEMORY           (-401)
98 #define ERR_MEMORY_CORRUPT      (-402)
99 #define ERR_MULTIPLE_FREE       (-403)  /* multiple frees of same object/buf */
100
101 /*************************************************************************
102 **                                                                      **
103 **      Functions                                                       **
104 **                                                                      **
105 *************************************************************************/
106
107 STRING  util_error_string(int errCode);
108 int     util_print_error(int errCode, STRING string); /* NULL OK for string*/
109
110 #endif /* _ABUTIL_UTIL_ERR_H_ */