]> git.cameronkatri.com Git - apple_cmds.git/blob - patch_cmds/patch/pch.h
file_cmds: 321.100.11
[apple_cmds.git] / patch_cmds / patch / pch.h
1 /* $OpenBSD: pch.h,v 1.9 2003/10/31 20:20:45 millert Exp $ */
2
3 /*
4 * patch - a program to apply diffs to original files
5 *
6 * Copyright 1986, Larry Wall
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following condition is met:
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this condition and the following disclaimer.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 *
25 * -C option added in 1998, original code by Marc Espie, based on FreeBSD
26 * behaviour
27 */
28
29 #define OLD_FILE 0
30 #define NEW_FILE 1
31 #define INDEX_FILE 2
32 #define MAX_FILE 3
33
34 struct file_name {
35 char *path;
36 bool exists;
37 };
38
39 void re_patch(void);
40 void open_patch_file(const char *);
41 void set_hunkmax(void);
42 bool there_is_another_patch(void);
43 bool another_hunk(void);
44 bool pch_swap(void);
45 char *pfetch(LINENUM);
46 short pch_line_len(LINENUM);
47 LINENUM pch_first(void);
48 LINENUM pch_ptrn_lines(void);
49 LINENUM pch_newfirst(void);
50 LINENUM pch_repl_lines(void);
51 LINENUM pch_end(void);
52 LINENUM pch_context(void);
53 LINENUM pch_hunk_beg(void);
54 char pch_char(LINENUM);
55 char *pfetch(LINENUM);
56 void do_ed_script(void);