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