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