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