xref: /dragonfly/sbin/restore/extern.h (revision 6e5c5008)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the University nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  *	@(#)extern.h	8.2 (Berkeley) 1/7/94
30  * $FreeBSD: src/sbin/restore/extern.h,v 1.5 1999/08/28 00:14:05 peter Exp $
31  */
32 
33 struct entry	*addentry(const char *, ufs1_ino_t, int);
34 long		 addfile(char *, ufs1_ino_t, int);
35 int		 addwhiteout(char *);
36 void		 badentry(struct entry *, const char *);
37 void	 	 canon(const char *, char *, size_t);
38 void		 checkrestore(void);
39 void		 closemt(void);
40 void		 createfiles(void);
41 void		 createleaves(const char *);
42 void		 createlinks(void);
43 long		 deletefile(char *, ufs1_ino_t, int);
44 void		 deleteino(ufs1_ino_t);
45 void		 delwhiteout(struct entry *);
46 ufs1_ino_t	 dirlookup(const char *);
47 void 	 	 done(int) __dead2;
48 void		 dumpsymtable(const char *, long);
49 void	 	 extractdirs(int);
50 int		 extractfile(char *);
51 void		 findunreflinks(void);
52 char		*flagvalues(struct entry *);
53 void		 freeentry(struct entry *);
54 void		 freename(char *);
55 int	 	 genliteraldir(char *, ufs1_ino_t);
56 char		*gentempname(struct entry *);
57 void		 getfile(void (*)(char *, size_t), void (*)(char *, size_t));
58 void		 getvol(long);
59 void		 initsymtable(const char *);
60 int	 	 inodetype(ufs1_ino_t);
61 int		 linkit(char *, char *, int);
62 struct entry	*lookupino(ufs1_ino_t);
63 struct entry	*lookupname(const char *);
64 long		 listfile(char *, ufs1_ino_t, int);
65 ufs1_ino_t	 lowerbnd(ufs1_ino_t);
66 void		 mktempname(struct entry *);
67 void		 moveentry(struct entry *, const char *);
68 void		 msg(const char *, ...) __printflike(1, 2);
69 char		*myname(struct entry *);
70 void		 newnode(struct entry *);
71 void		 newtapebuf(long);
72 long		 nodeupdates(char *, ufs1_ino_t, int);
73 void	 	 onintr(int);
74 void		 panic(const char *, ...) __printflike(1, 2);
75 void		 pathcheck(char *);
76 struct direct	*pathsearch(const char *);
77 void		 printdumpinfo(void);
78 void		 removeleaf(struct entry *);
79 void		 removenode(struct entry *);
80 void		 removeoldleaves(void);
81 void		 removeoldnodes(void);
82 void		 renameit(const char *, const char *);
83 int		 reply(const char *);
84 RST_DIR		*rst_opendir(const char *);
85 struct direct	*rst_readdir(RST_DIR *);
86 void		 rst_closedir(RST_DIR *dirp);
87 void	 	 runcmdshell(void);
88 char		*savename(const char *);
89 void	 	 setdirmodes(int);
90 void		 setinput(char *);
91 void		 setup(void);
92 void	 	 skipdirs(void);
93 void		 skipfile(void);
94 void		 skipmaps(void);
95 void		 swabst(const char *, u_char *);
96 void	 	 treescan(char *, ufs1_ino_t, long (*)(char *, ufs1_ino_t, int));
97 ufs1_ino_t	 upperbnd(ufs1_ino_t);
98 long		 verifyfile(char *, ufs1_ino_t, int);
99 void		 xtrnull(char *, size_t);
100 
101 /* From ../dump/dumprmt.c */
102 void		rmtclose(void);
103 int		rmthost(char *);
104 int		rmtioctl(int, int);
105 int		rmtopen(char *, int);
106 int		rmtread(char *, int);
107 int		rmtseek(int, int);
108