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