xref: /freebsd/libexec/ypxfr/ypxfr_extern.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*df57947fSPedro F. Giffuni /*-
2*df57947fSPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3*df57947fSPedro F. Giffuni  *
4665823d0SBill Paul  * Copyright (c) 1995
5665823d0SBill Paul  *	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
6665823d0SBill Paul  *
7665823d0SBill Paul  * Redistribution and use in source and binary forms, with or without
8665823d0SBill Paul  * modification, are permitted provided that the following conditions
9665823d0SBill Paul  * are met:
10665823d0SBill Paul  * 1. Redistributions of source code must retain the above copyright
11665823d0SBill Paul  *    notice, this list of conditions and the following disclaimer.
12665823d0SBill Paul  * 2. Redistributions in binary form must reproduce the above copyright
13665823d0SBill Paul  *    notice, this list of conditions and the following disclaimer in the
14665823d0SBill Paul  *    documentation and/or other materials provided with the distribution.
15665823d0SBill Paul  * 3. All advertising materials mentioning features or use of this software
16665823d0SBill Paul  *    must display the following acknowledgement:
17665823d0SBill Paul  *	This product includes software developed by Bill Paul.
18665823d0SBill Paul  * 4. Neither the name of the author nor the names of any co-contributors
19665823d0SBill Paul  *    may be used to endorse or promote products derived from this software
20665823d0SBill Paul  *    without specific prior written permission.
21665823d0SBill Paul  *
22665823d0SBill Paul  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
23665823d0SBill Paul  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24665823d0SBill Paul  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25665823d0SBill Paul  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
26665823d0SBill Paul  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27665823d0SBill Paul  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28665823d0SBill Paul  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29665823d0SBill Paul  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30665823d0SBill Paul  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31665823d0SBill Paul  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32665823d0SBill Paul  * SUCH DAMAGE.
33665823d0SBill Paul  */
34665823d0SBill Paul #include <sys/types.h>
35665823d0SBill Paul #include <limits.h>
36665823d0SBill Paul #include <paths.h>
3716deb43aSBill Paul #include <db.h>
38a2e787bfSBill Paul #include <rpcsvc/yp.h>
3916deb43aSBill Paul 
4016deb43aSBill Paul extern HASHINFO	openinfo;
4116deb43aSBill Paul extern BTREEINFO openinfo_b;
42665823d0SBill Paul 
43665823d0SBill Paul #ifndef _PATH_YP
44665823d0SBill Paul #define _PATH_YP "/var/yp/"
45665823d0SBill Paul #endif
46665823d0SBill Paul 
47665823d0SBill Paul extern char	*yp_dir;
48665823d0SBill Paul extern int	debug;
49db83a391SDimitry Andric extern enum ypstat	yp_errno;
50ed4d1c46SDag-Erling Smørgrav extern void	yp_error(const char *, ...);
51ed4d1c46SDag-Erling Smørgrav extern int	_yp_check(char **);
52425dd8acSDag-Erling Smørgrav extern const char *ypxfrerr_string(ypxfrstat);
53ed4d1c46SDag-Erling Smørgrav extern DB	*yp_open_db_rw(const char *, const char *, const int);
54ed4d1c46SDag-Erling Smørgrav extern void	yp_init_dbs(void);
55ed4d1c46SDag-Erling Smørgrav extern int	yp_put_record(DB *, DBT *, DBT *, int);
56ed4d1c46SDag-Erling Smørgrav extern int	yp_get_record(const char *, const char *, const DBT *, DBT *, int);
57dc584ddbSDag-Erling Smørgrav extern int	ypxfr_get_map(char *, char *, char *, int (*)(int, char *, int, char *, int, char*));
58ed4d1c46SDag-Erling Smørgrav extern char	*ypxfr_get_master(char *, char *, char *, const int);
59ed4d1c46SDag-Erling Smørgrav extern unsigned	long ypxfr_get_order(char *, char *, char *, const int);
60ed4d1c46SDag-Erling Smørgrav extern int	ypxfr_match(char *, char *, char *, char *, unsigned long);
61ed4d1c46SDag-Erling Smørgrav extern char	*ypxfxerr_string(ypxfrstat);
62ed4d1c46SDag-Erling Smørgrav extern int	ypxfrd_get_map(char  *, char *, char *, char *);
63