pch.h revision 265160
1169689Skan/*- 2169689Skan * Copyright 1986, Larry Wall 3169689Skan * 4169689Skan * Redistribution and use in source and binary forms, with or without 5169689Skan * modification, are permitted provided that the following condition is met: 6169689Skan * 1. Redistributions of source code must retain the above copyright notice, 7169689Skan * this condition and the following disclaimer. 8169689Skan * 9169689Skan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY 10169689Skan * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 11169689Skan * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 12169689Skan * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 13169689Skan * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 14169689Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 15169689Skan * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 16169689Skan * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 17169689Skan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 18169689Skan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 19169689Skan * SUCH DAMAGE. 20169689Skan * 21169689Skan * patch - a program to apply diffs to original files 22169689Skan * 23169689Skan * -C option added in 1998, original code by Marc Espie, based on FreeBSD 24169689Skan * behaviour 25169689Skan * 26169689Skan * $OpenBSD: pch.h,v 1.9 2003/10/31 20:20:45 millert Exp $ 27169689Skan * $FreeBSD: stable/10/usr.bin/patch/pch.h 265160 2014-04-30 20:39:08Z pfg $ 28169689Skan */ 29169689Skan 30169689Skan#define OLD_FILE 0 31169689Skan#define NEW_FILE 1 32169689Skan#define INDEX_FILE 2 33169689Skan#define MAX_FILE 3 34169689Skan 35169689Skanstruct file_name { 36169689Skan char *path; 37169689Skan bool exists; 38169689Skan}; 39169689Skan 40169689Skanvoid re_patch(void); 41169689Skanvoid open_patch_file(const char *); 42169689Skanvoid set_hunkmax(void); 43169689Skanbool there_is_another_patch(void); 44169689Skanbool another_hunk(void); 45169689Skanbool pch_swap(void); 46169689Skanchar *pfetch(LINENUM); 47169689Skanshort pch_line_len(LINENUM); 48169689SkanLINENUM pch_first(void); 49169689SkanLINENUM pch_ptrn_lines(void); 50169689SkanLINENUM pch_newfirst(void); 51169689SkanLINENUM pch_repl_lines(void); 52169689SkanLINENUM pch_end(void); 53169689SkanLINENUM pch_context(void); 54169689SkanLINENUM pch_hunk_beg(void); 55169689Skanchar pch_char(LINENUM); 56169689Skanvoid do_ed_script(void); 57169689Skan