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