17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the Netscape Public
37c478bd9Sstevel@tonic-gate  * License Version 1.1 (the "License"); you may not use this file
47c478bd9Sstevel@tonic-gate  * except in compliance with the License. You may obtain a copy of
57c478bd9Sstevel@tonic-gate  * the License at http://www.mozilla.org/NPL/
67c478bd9Sstevel@tonic-gate  *
77c478bd9Sstevel@tonic-gate  * Software distributed under the License is distributed on an "AS
87c478bd9Sstevel@tonic-gate  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
97c478bd9Sstevel@tonic-gate  * implied. See the License for the specific language governing
107c478bd9Sstevel@tonic-gate  * rights and limitations under the License.
117c478bd9Sstevel@tonic-gate  *
127c478bd9Sstevel@tonic-gate  * The Original Code is Mozilla Communicator client code, released
137c478bd9Sstevel@tonic-gate  * March 31, 1998.
147c478bd9Sstevel@tonic-gate  *
157c478bd9Sstevel@tonic-gate  * The Initial Developer of the Original Code is Netscape
167c478bd9Sstevel@tonic-gate  * Communications Corporation. Portions created by Netscape are
177c478bd9Sstevel@tonic-gate  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
187c478bd9Sstevel@tonic-gate  * Rights Reserved.
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * Contributor(s):
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  *  Copyright (c) 1994 The Regents of the University of Michigan.
247c478bd9Sstevel@tonic-gate  *  All rights reserved.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  *  compat.c - compatibility routines.
287c478bd9Sstevel@tonic-gate  *
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #if 0
32*1da57d55SToomas Soome #ifndef lint
337c478bd9Sstevel@tonic-gate static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n";
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #include "ldap-int.h"
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifdef notdef
407c478bd9Sstevel@tonic-gate #if defined( HPUX10 ) && defined( _REENTRANT )
417c478bd9Sstevel@tonic-gate extern int h_errno;
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate struct hostent *
nsldapi_compat_gethostbyname_r(const char * name,struct hostent * result,char * buffer,int buflen,int * h_errnop)447c478bd9Sstevel@tonic-gate nsldapi_compat_gethostbyname_r( const char *name, struct hostent *result,
457c478bd9Sstevel@tonic-gate 	char *buffer, int buflen, int *h_errnop )
467c478bd9Sstevel@tonic-gate {
477c478bd9Sstevel@tonic-gate     struct hostent_data	*hep;
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate     if ( buflen < sizeof(struct hostent_data)) {	/* sanity check */
507c478bd9Sstevel@tonic-gate 	*h_errnop = NO_RECOVERY;	/* XXX best error code to use? */
517c478bd9Sstevel@tonic-gate 	return( NULL );
527c478bd9Sstevel@tonic-gate     }
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate     hep = (struct hostent_data *)buffer;
557c478bd9Sstevel@tonic-gate     hep->current = NULL;
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate     if ( gethostbyname_r( name, result, hep ) == -1) {
587c478bd9Sstevel@tonic-gate 	*h_errnop = h_errno; /* XXX don't see anywhere else to get this */
597c478bd9Sstevel@tonic-gate 	return NULL;
607c478bd9Sstevel@tonic-gate     }
617c478bd9Sstevel@tonic-gate     return result;
627c478bd9Sstevel@tonic-gate }
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate char *
nsldapi_compat_ctime_r(const time_t * clock,char * buf,int buflen)657c478bd9Sstevel@tonic-gate nsldapi_compat_ctime_r( const time_t *clock, char *buf, int buflen )
667c478bd9Sstevel@tonic-gate {
677c478bd9Sstevel@tonic-gate     NSLDAPI_CTIME1( clock, buf, buflen );
687c478bd9Sstevel@tonic-gate     return buf;
697c478bd9Sstevel@tonic-gate }
707c478bd9Sstevel@tonic-gate #endif /* HPUX10 && _REENTRANT */
717c478bd9Sstevel@tonic-gate #endif
72