2 * $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $
3 * $DragonFly: src/usr.bin/patch/util.h,v 1.2 2007/09/29 23:11:10 swildner Exp $
8 * patch - a program to apply diffs to original files
10 * Copyright 1986, Larry Wall
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following condition is met:
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this condition and the following disclaimer.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * -C option added in 1998, original code by Marc Espie, based on FreeBSD
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);
51 void my_exit(int) __attribute__((noreturn
));
54 extern int mkpath(char *);