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