xref: /titanic_50/usr/src/lib/libldap5/sources/ldap/common/compat.c (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * The contents of this file are subject to the Netscape Public
5  * License Version 1.1 (the "License"); you may not use this file
6  * except in compliance with the License. You may obtain a copy of
7  * the License at http://www.mozilla.org/NPL/
8  *
9  * Software distributed under the License is distributed on an "AS
10  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * rights and limitations under the License.
13  *
14  * The Original Code is Mozilla Communicator client code, released
15  * March 31, 1998.
16  *
17  * The Initial Developer of the Original Code is Netscape
18  * Communications Corporation. Portions created by Netscape are
19  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
20  * Rights Reserved.
21  *
22  * Contributor(s):
23  */
24 /*
25  *  Copyright (c) 1994 The Regents of the University of Michigan.
26  *  All rights reserved.
27  */
28 /*
29  *  compat.c - compatibility routines.
30  *
31  */
32 
33 #if 0
34 #ifndef lint
35 static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n";
36 #endif
37 #endif
38 
39 #include "ldap-int.h"
40 
41 #ifdef notdef
42 #if defined( HPUX10 ) && defined( _REENTRANT )
43 extern int h_errno;
44 
45 struct hostent *
46 nsldapi_compat_gethostbyname_r( const char *name, struct hostent *result,
47 	char *buffer, int buflen, int *h_errnop )
48 {
49     struct hostent_data	*hep;
50 
51     if ( buflen < sizeof(struct hostent_data)) {	/* sanity check */
52 	*h_errnop = NO_RECOVERY;	/* XXX best error code to use? */
53 	return( NULL );
54     }
55 
56     hep = (struct hostent_data *)buffer;
57     hep->current = NULL;
58 
59     if ( gethostbyname_r( name, result, hep ) == -1) {
60 	*h_errnop = h_errno; /* XXX don't see anywhere else to get this */
61 	return NULL;
62     }
63     return result;
64 }
65 
66 char *
67 nsldapi_compat_ctime_r( const time_t *clock, char *buf, int buflen )
68 {
69     NSLDAPI_CTIME1( clock, buf, buflen );
70     return buf;
71 }
72 #endif /* HPUX10 && _REENTRANT */
73 #endif
74