util.h revision 246074
1/* $FreeBSD: head/usr.bin/patch/util.h 246074 2013-01-29 17:03:18Z gabor $ */ 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 33char *fetchname(const char *, bool *, int); 34char *checked_in(char *); 35int backup_file(const char *); 36int move_file(const char *, const char *); 37int copy_file(const char *, const char *); 38void say(const char *, ...) 39 __attribute__((__format__(__printf__, 1, 2))); 40void fatal(const char *, ...) 41 __attribute__((__format__(__printf__, 1, 2))); 42void pfatal(const char *, ...) 43 __attribute__((__format__(__printf__, 1, 2))); 44void ask(const char *, ...) 45 __attribute__((__format__(__printf__, 1, 2))); 46char *savestr(const char *); 47void set_signals(int); 48void ignore_signals(void); 49void makedirs(const char *, bool); 50void version(void); 51void my_exit(int) __attribute__((noreturn)); 52 53/* in mkpath.c */ 54extern int mkpath(char *); 55