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