xref: /minix3/usr.bin/patch/util.h (revision 757e83288ac54fa2d663d17e4a302156fdb3650a)
1*757e8328SLionel Sambuc /*
2*757e8328SLionel Sambuc  * $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $
3*757e8328SLionel Sambuc  * $DragonFly: src/usr.bin/patch/util.h,v 1.2 2007/09/29 23:11:10 swildner Exp $
4*757e8328SLionel Sambuc  * $NetBSD: util.h,v 1.12 2011/09/06 18:25:14 joerg Exp $
5*757e8328SLionel Sambuc  */
6*757e8328SLionel Sambuc 
7*757e8328SLionel Sambuc /*
8*757e8328SLionel Sambuc  * patch - a program to apply diffs to original files
9*757e8328SLionel Sambuc  *
10*757e8328SLionel Sambuc  * Copyright 1986, Larry Wall
11*757e8328SLionel Sambuc  *
12*757e8328SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
13*757e8328SLionel Sambuc  * modification, are permitted provided that the following condition is met:
14*757e8328SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright notice,
15*757e8328SLionel Sambuc  * this condition and the following disclaimer.
16*757e8328SLionel Sambuc  *
17*757e8328SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
18*757e8328SLionel Sambuc  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19*757e8328SLionel Sambuc  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20*757e8328SLionel Sambuc  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
21*757e8328SLionel Sambuc  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*757e8328SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23*757e8328SLionel Sambuc  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24*757e8328SLionel Sambuc  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*757e8328SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*757e8328SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*757e8328SLionel Sambuc  * SUCH DAMAGE.
28*757e8328SLionel Sambuc  *
29*757e8328SLionel Sambuc  * -C option added in 1998, original code by Marc Espie, based on FreeBSD
30*757e8328SLionel Sambuc  * behaviour
31*757e8328SLionel Sambuc  */
32*757e8328SLionel Sambuc 
33*757e8328SLionel Sambuc char		*fetchname(const char *, bool *, int);
34*757e8328SLionel Sambuc char		*checked_in(char *);
35*757e8328SLionel Sambuc int		backup_file(const char *);
36*757e8328SLionel Sambuc int		move_file(const char *, const char *);
37*757e8328SLionel Sambuc int		copy_file(const char *, const char *);
38*757e8328SLionel Sambuc void		say(const char *, ...) __printflike(1, 2);
39*757e8328SLionel Sambuc void		fatal(const char *, ...) __printflike(1, 2) __dead;
40*757e8328SLionel Sambuc void		pfatal(const char *, ...) __printflike(1, 2) __dead;
41*757e8328SLionel Sambuc void		ask(const char *, ...) __printflike(1, 2);
42*757e8328SLionel Sambuc char		*savestr(const char *);
43*757e8328SLionel Sambuc void		set_signals(int);
44*757e8328SLionel Sambuc void		ignore_signals(void);
45*757e8328SLionel Sambuc void		makedirs(const char *, bool);
46*757e8328SLionel Sambuc void		version(void) __dead;
47*757e8328SLionel Sambuc void		my_exit(int) __dead;
48*757e8328SLionel Sambuc 
49*757e8328SLionel Sambuc /* in mkpath.c */
50*757e8328SLionel Sambuc extern int mkpath(char *);
51