Home | History | Annotate | Line # | Download | only in include
hesiod.h revision 1.4
      1  1.4  perry /*	$NetBSD: hesiod.h,v 1.4 2005/02/03 04:39:32 perry Exp $	*/
      2  1.2  lukem 
      3  1.3  lukem /*-
      4  1.3  lukem  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
      5  1.3  lukem  * All rights reserved.
      6  1.2  lukem  *
      7  1.3  lukem  * Redistribution and use in source and binary forms, with or without
      8  1.3  lukem  * modification, are permitted provided that the following conditions
      9  1.3  lukem  * are met:
     10  1.3  lukem  * 1. Redistributions of source code must retain the above copyright
     11  1.3  lukem  *    notice, this list of conditions and the following disclaimer.
     12  1.3  lukem  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.3  lukem  *    notice, this list of conditions and the following disclaimer in the
     14  1.3  lukem  *    documentation and/or other materials provided with the distribution.
     15  1.3  lukem  * 3. All advertising materials mentioning features or use of this software
     16  1.3  lukem  *    must display the following acknowledgement:
     17  1.3  lukem  *        This product includes software developed by the NetBSD
     18  1.3  lukem  *        Foundation, Inc. and its contributors.
     19  1.3  lukem  * 4. Neither the name of The NetBSD Foundation nor the names of its
     20  1.3  lukem  *    contributors may be used to endorse or promote products derived
     21  1.3  lukem  *    from this software without specific prior written permission.
     22  1.2  lukem  *
     23  1.3  lukem  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     24  1.3  lukem  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     25  1.3  lukem  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     26  1.3  lukem  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     27  1.3  lukem  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28  1.3  lukem  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29  1.3  lukem  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30  1.3  lukem  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31  1.3  lukem  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32  1.3  lukem  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33  1.3  lukem  * POSSIBILITY OF SUCH DAMAGE.
     34  1.3  lukem  */
     35  1.3  lukem 
     36  1.3  lukem /*
     37  1.3  lukem  * Copyright (c) 1996 by Internet Software Consortium.
     38  1.2  lukem  *
     39  1.3  lukem  * Permission to use, copy, modify, and distribute this software for any
     40  1.3  lukem  * purpose with or without fee is hereby granted, provided that the above
     41  1.3  lukem  * copyright notice and this permission notice appear in all copies.
     42  1.3  lukem  *
     43  1.3  lukem  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
     44  1.3  lukem  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
     45  1.3  lukem  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
     46  1.3  lukem  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
     47  1.3  lukem  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
     48  1.3  lukem  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
     49  1.3  lukem  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
     50  1.3  lukem  * SOFTWARE.
     51  1.2  lukem  */
     52  1.3  lukem 
     53  1.2  lukem #ifndef _HESIOD_H_
     54  1.2  lukem #define _HESIOD_H_
     55  1.2  lukem 
     56  1.3  lukem 	/* Application-visible indication that we have the new interfaces */
     57  1.3  lukem 
     58  1.3  lukem #define HESIOD_INTERFACES
     59  1.3  lukem 
     60  1.3  lukem 	/* Configuration information. */
     61  1.2  lukem 
     62  1.2  lukem #ifndef _PATH_HESIOD_CONF			/* Configuration file. */
     63  1.2  lukem #define _PATH_HESIOD_CONF	"/etc/hesiod.conf"
     64  1.2  lukem #endif
     65  1.2  lukem 
     66  1.2  lukem #define DEF_RHS		""			/* Defaults if HESIOD_CONF */
     67  1.2  lukem #define DEF_LHS		""			/*    file is not present. */
     68  1.2  lukem 
     69  1.3  lukem 	/* Error codes (for backwards compatibility) */
     70  1.2  lukem 
     71  1.2  lukem #define	HES_ER_UNINIT	-1	/* uninitialized */
     72  1.2  lukem #define	HES_ER_OK	0	/* no error */
     73  1.2  lukem #define	HES_ER_NOTFOUND	1	/* Hesiod name not found by server */
     74  1.2  lukem #define HES_ER_CONFIG	2	/* local problem (no config file?) */
     75  1.2  lukem #define HES_ER_NET	3	/* network problem */
     76  1.2  lukem 
     77  1.3  lukem 	/* Declaration of routines */
     78  1.3  lukem 
     79  1.2  lukem #include <sys/cdefs.h>
     80  1.2  lukem 
     81  1.2  lukem __BEGIN_DECLS
     82  1.4  perry int	hesiod_init	(void **);
     83  1.4  perry char  **hesiod_resolve	(void *, const char *, const char *);
     84  1.4  perry void	hesiod_free_list(void *, char **);
     85  1.4  perry char   *hesiod_to_bind	(void *, const char *, const char *);
     86  1.4  perry void	hesiod_end	(void *);
     87  1.3  lukem 
     88  1.3  lukem 				/* backwards compatibility */
     89  1.4  perry int	hes_init	(void);
     90  1.4  perry char   *hes_to_bind	(const char *, const char *);
     91  1.4  perry char  **hes_resolve	(const char *, const char *);
     92  1.4  perry int	hes_error	(void);
     93  1.4  perry void	hes_free	(char **);
     94  1.2  lukem __END_DECLS
     95  1.2  lukem 
     96  1.2  lukem #endif /* ! _HESIOD_H_ */
     97