2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
25 * $XConsortium: util_err.h /main/4 1995/11/06 18:53:55 rswiston $
27 * @(#)util_err.h 1.14 11 Feb 1994 cde_app_builder/src/libAButil
29 * RESTRICTED CONFIDENTIAL INFORMATION:
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
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
43 #ifndef _ABUTIL_UTIL_ERR_H_
44 #define _ABUTIL_UTIL_ERR_H_
46 * util_err.h - error codes
48 * All error codes are negative. They are numbered in
49 * groups (general, file i/o, memory, ...).
51 * When returning an error, use the most specific error code.
54 #define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
57 #include <ab_private/AB.h>
58 #include <ab/util_types.h>
60 #define OK (0) /* smooth sailing */
61 #define ERR (-1) /* generic error */
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)
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)
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)
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 */
101 /*************************************************************************
105 *************************************************************************/
107 STRING util_error_string(int errCode);
108 int util_print_error(int errCode, STRING string); /* NULL OK for string*/
110 #endif /* _ABUTIL_UTIL_ERR_H_ */