xref: /freebsd/contrib/sendmail/include/sm/errstring.h (revision d0cef73d40a409e3116f095b83633b1364e95741)
140266059SGregory Neil Shapiro /*
2a7ec597cSGregory Neil Shapiro  * Copyright (c) 1998-2001, 2003 Sendmail, Inc. and its suppliers.
340266059SGregory Neil Shapiro  *	All rights reserved.
440266059SGregory Neil Shapiro  *
540266059SGregory Neil Shapiro  * By using this file, you agree to the terms and conditions set
640266059SGregory Neil Shapiro  * forth in the LICENSE file which can be found at the top level of
740266059SGregory Neil Shapiro  * the sendmail distribution.
840266059SGregory Neil Shapiro  *
9d0cef73dSGregory Neil Shapiro  *	$Id: errstring.h,v 1.10 2007/03/21 23:56:19 ca Exp $
1040266059SGregory Neil Shapiro  */
1140266059SGregory Neil Shapiro 
1240266059SGregory Neil Shapiro /*
1340266059SGregory Neil Shapiro **  Error codes.
1440266059SGregory Neil Shapiro */
1540266059SGregory Neil Shapiro 
1640266059SGregory Neil Shapiro #ifndef SM_ERRSTRING_H
1740266059SGregory Neil Shapiro # define SM_ERRSTRING_H
1840266059SGregory Neil Shapiro 
19d0cef73dSGregory Neil Shapiro #if defined(__QNX__)
20d0cef73dSGregory Neil Shapiro # define E_PSEUDOBASE	512
21d0cef73dSGregory Neil Shapiro #endif /* defined(__QNX__) */
22d0cef73dSGregory Neil Shapiro 
2340266059SGregory Neil Shapiro #include <errno.h>
24e92d3f3fSGregory Neil Shapiro #if NEEDINTERRNO
2540266059SGregory Neil Shapiro extern int errno;
26e92d3f3fSGregory Neil Shapiro #endif /* NEEDINTERRNO */
2740266059SGregory Neil Shapiro 
2840266059SGregory Neil Shapiro /*
2940266059SGregory Neil Shapiro **  These are used in a few cases where we need some special
3040266059SGregory Neil Shapiro **  error codes, but where the system doesn't provide something
3140266059SGregory Neil Shapiro **  reasonable.  They are printed in sm_errstring.
3240266059SGregory Neil Shapiro */
3340266059SGregory Neil Shapiro 
3440266059SGregory Neil Shapiro #ifndef E_PSEUDOBASE
3540266059SGregory Neil Shapiro # define E_PSEUDOBASE	256
3640266059SGregory Neil Shapiro #endif /* ! E_PSEUDOBASE */
3740266059SGregory Neil Shapiro 
3840266059SGregory Neil Shapiro #define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0)	/* Timeout on file open */
3940266059SGregory Neil Shapiro #define E_SM_NOSLINK	(E_PSEUDOBASE + 1)	/* Symbolic links not allowed */
4040266059SGregory Neil Shapiro #define E_SM_NOHLINK	(E_PSEUDOBASE + 2)	/* Hard links not allowed */
4140266059SGregory Neil Shapiro #define E_SM_REGONLY	(E_PSEUDOBASE + 3)	/* Regular files only */
4240266059SGregory Neil Shapiro #define E_SM_ISEXEC	(E_PSEUDOBASE + 4)	/* Executable files not allowed */
4340266059SGregory Neil Shapiro #define E_SM_WWDIR	(E_PSEUDOBASE + 5)	/* World writable directory */
4440266059SGregory Neil Shapiro #define E_SM_GWDIR	(E_PSEUDOBASE + 6)	/* Group writable directory */
4540266059SGregory Neil Shapiro #define E_SM_FILECHANGE (E_PSEUDOBASE + 7)	/* File changed after open */
4640266059SGregory Neil Shapiro #define E_SM_WWFILE	(E_PSEUDOBASE + 8)	/* World writable file */
4740266059SGregory Neil Shapiro #define E_SM_GWFILE	(E_PSEUDOBASE + 9)	/* Group writable file */
4840266059SGregory Neil Shapiro #define E_SM_GRFILE	(E_PSEUDOBASE + 10)	/* g readable file */
4940266059SGregory Neil Shapiro #define E_SM_WRFILE	(E_PSEUDOBASE + 11)	/* o readable file */
5040266059SGregory Neil Shapiro #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
5140266059SGregory Neil Shapiro #define E_SMDBBASE	(E_PSEUDOBASE + 40)	/* base for libsmdb errors */
5240266059SGregory Neil Shapiro #define E_LDAPBASE	(E_PSEUDOBASE + 70)	/* base for LDAP errors */
53e92d3f3fSGregory Neil Shapiro #define E_LDAPURLBASE	(E_PSEUDOBASE + 200)	/* base for LDAP URL errors */
5440266059SGregory Neil Shapiro 
55a7ec597cSGregory Neil Shapiro 
5640266059SGregory Neil Shapiro /* libsmdb */
5740266059SGregory Neil Shapiro #define SMDBE_OK			0
5840266059SGregory Neil Shapiro #define SMDBE_MALLOC			(E_SMDBBASE + 1)
5940266059SGregory Neil Shapiro #define SMDBE_GDBM_IS_BAD		(E_SMDBBASE + 2)
6040266059SGregory Neil Shapiro #define SMDBE_UNSUPPORTED		(E_SMDBBASE + 3)
6140266059SGregory Neil Shapiro #define SMDBE_DUPLICATE			(E_SMDBBASE + 4)
6240266059SGregory Neil Shapiro #define SMDBE_BAD_OPEN			(E_SMDBBASE + 5)
6340266059SGregory Neil Shapiro #define SMDBE_NOT_FOUND			(E_SMDBBASE + 6)
6440266059SGregory Neil Shapiro #define SMDBE_UNKNOWN_DB_TYPE		(E_SMDBBASE + 7)
6540266059SGregory Neil Shapiro #define SMDBE_UNSUPPORTED_DB_TYPE	(E_SMDBBASE + 8)
6640266059SGregory Neil Shapiro #define SMDBE_INCOMPLETE		(E_SMDBBASE + 9)
6740266059SGregory Neil Shapiro #define SMDBE_KEY_EMPTY			(E_SMDBBASE + 10)
6840266059SGregory Neil Shapiro #define SMDBE_KEY_EXIST			(E_SMDBBASE + 11)
6940266059SGregory Neil Shapiro #define SMDBE_LOCK_DEADLOCK		(E_SMDBBASE + 12)
7040266059SGregory Neil Shapiro #define SMDBE_LOCK_NOT_GRANTED		(E_SMDBBASE + 13)
7140266059SGregory Neil Shapiro #define SMDBE_LOCK_NOT_HELD		(E_SMDBBASE + 14)
7240266059SGregory Neil Shapiro #define SMDBE_RUN_RECOVERY		(E_SMDBBASE + 15)
7340266059SGregory Neil Shapiro #define SMDBE_IO_ERROR			(E_SMDBBASE + 16)
7440266059SGregory Neil Shapiro #define SMDBE_READ_ONLY			(E_SMDBBASE + 17)
7540266059SGregory Neil Shapiro #define SMDBE_DB_NAME_TOO_LONG		(E_SMDBBASE + 18)
7640266059SGregory Neil Shapiro #define SMDBE_INVALID_PARAMETER		(E_SMDBBASE + 19)
7740266059SGregory Neil Shapiro #define SMDBE_ONLY_SUPPORTS_ONE_CURSOR	(E_SMDBBASE + 20)
7840266059SGregory Neil Shapiro #define SMDBE_NOT_A_VALID_CURSOR	(E_SMDBBASE + 21)
7940266059SGregory Neil Shapiro #define SMDBE_LAST_ENTRY		(E_SMDBBASE + 22)
8040266059SGregory Neil Shapiro #define SMDBE_OLD_VERSION		(E_SMDBBASE + 23)
81a7ec597cSGregory Neil Shapiro #define SMDBE_VERSION_MISMATCH		(E_SMDBBASE + 24)
8240266059SGregory Neil Shapiro 
83a7ec597cSGregory Neil Shapiro extern const char *sm_errstring __P((int _errno));
84a7ec597cSGregory Neil Shapiro 
8540266059SGregory Neil Shapiro 
8640266059SGregory Neil Shapiro #endif /* SM_ERRSTRING_H */
87