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