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