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
|
/* Copyright (C) 1997-2002 Luke Howard.
This file is part of the nss_ldap library.
Contributed by Luke Howard, <lukeh@padl.com>, 1997.
The nss_ldap library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The nss_ldap 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the nss_ldap library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "config.h"
#ifdef HAVE_THREAD_H
#include <thread.h>
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
#endif
#include <stdlib.h>
#include <lber.h>
#include <ldap.h>
#include <netdb.h>
#include "ldap-nss.h"
static char rcsId[] = "$Id: globals.c,v 2.21 2002/03/19 08:02:31 lukeh Exp $";
int _nss_ldap_herrno2nssstat_tab[] = {
#ifdef HAVE_NSS_H
[NSS_SUCCESS - _NSS_LOOKUP_OFFSET] = 0,
[NSS_TRYAGAIN - _NSS_LOOKUP_OFFSET] = TRY_AGAIN,
[NSS_NOTFOUND - _NSS_LOOKUP_OFFSET] = HOST_NOT_FOUND,
[NSS_UNAVAIL - _NSS_LOOKUP_OFFSET] = NO_RECOVERY
#else
#ifdef __GNUC__
[NSS_SUCCESS] = 0,
[NSS_TRYAGAIN] = TRY_AGAIN,
[NSS_NOTFOUND] = HOST_NOT_FOUND,
[NSS_UNAVAIL] = NO_RECOVERY
#else
0,
TRY_AGAIN,
HOST_NOT_FOUND,
NO_RECOVERY
#endif /* __GNUC__ */
#endif
};
size_t _nss_ldap_herrno2nssstat_tab_count =
(sizeof (_nss_ldap_herrno2nssstat_tab) /
sizeof (_nss_ldap_herrno2nssstat_tab[0]));
#ifdef HAVE_IRS_H
#ifdef __GNUC__
int _nss_ldap_errno2nssstat_tab[] = {
[NSS_SUCCESS] = 0,
[NSS_TRYAGAIN] = ERANGE,
[NSS_NOTFOUND] = ENOENT,
[NSS_UNAVAIL] = EPERM
};
#else
int _nss_ldap_errno2nssstat_tab[] = {
0,
ERANGE,
ENOENT,
EPERM
};
#endif
size_t _nss_ldap_errno2nssstat_tab_count =
(sizeof (_nss_ldap_errno2nssstat_tab) /
sizeof (_nss_ldap_errno2nssstat_tab[0]));
#endif /* HAVE_IRS_H */
|