Annotation of src/usr.bin/patch/common.h, Revision 1.23
1.23 ! otto 1: /* $OpenBSD: common.h,v 1.22 2003/08/01 20:30:48 otto Exp $ */
1.22 otto 2:
3: #include <stdbool.h>
1.1 deraadt 4:
5: #define DEBUGGING
6:
7: /* constants */
8:
1.14 deraadt 9: #define MAXHUNKSIZE 100000 /* is this enough lines? */
10: #define INITHUNKMAX 125 /* initial dynamic allocation size */
1.8 niklas 11: #define MAXLINELEN 8192
1.1 deraadt 12: #define BUFFERSIZE 1024
13:
14: #define SCCSPREFIX "s."
15: #define GET "get -e %s"
16: #define SCCSDIFF "get -p %s | diff - %s >/dev/null"
17:
18: #define RCSSUFFIX ",v"
19: #define CHECKOUT "co -l %s"
20: #define RCSDIFF "rcsdiff %s > /dev/null"
21:
22: #define ORIGEXT ".orig"
23: #define REJEXT ".rej"
24:
25: /* handy definitions */
26:
27: #define strNE(s1,s2) (strcmp(s1, s2))
28: #define strEQ(s1,s2) (!strcmp(s1, s2))
29: #define strnNE(s1,s2,l) (strncmp(s1, s2, l))
30: #define strnEQ(s1,s2,l) (!strncmp(s1, s2, l))
31:
32: /* typedefs */
33:
1.14 deraadt 34: typedef long LINENUM; /* must be signed */
1.1 deraadt 35:
36: /* globals */
37:
1.20 deraadt 38: extern int filemode;
1.1 deraadt 39:
1.19 otto 40: extern char buf[MAXLINELEN];/* general purpose buffer */
1.1 deraadt 41:
1.19 otto 42: extern bool using_plan_a; /* try to keep everything in memory */
43: extern bool out_of_mem; /* ran out of memory in plan a */
1.1 deraadt 44:
45: #define MAXFILEC 2
46:
1.19 otto 47: extern char *filearg[MAXFILEC];
48: extern bool ok_to_create_file;
49: extern char *outname;
50: extern char *origprae;
51:
52: extern char *TMPOUTNAME;
53: extern char *TMPINNAME;
54: extern char *TMPREJNAME;
55: extern char *TMPPATNAME;
56: extern bool toutkeep;
57: extern bool trejkeep;
58:
1.1 deraadt 59: #ifdef DEBUGGING
1.19 otto 60: extern int debug;
1.1 deraadt 61: #endif
1.19 otto 62:
63: extern bool force;
64: extern bool batch;
65: extern bool verbose;
66: extern bool reverse;
67: extern bool noreverse;
68: extern bool skip_rest_of_patch;
69: extern int strippath;
70: extern bool canonicalize;
1.17 otto 71: /* TRUE if -C was specified on command line. */
1.19 otto 72: extern bool check_only;
1.21 otto 73: extern bool warn_on_invalid_line;
1.23 ! otto 74: extern bool last_line_missing_eol;
1.17 otto 75:
1.1 deraadt 76:
77: #define CONTEXT_DIFF 1
78: #define NORMAL_DIFF 2
79: #define ED_DIFF 3
80: #define NEW_CONTEXT_DIFF 4
81: #define UNI_DIFF 5
82:
1.19 otto 83: extern int diff_type;
84: extern char *revision; /* prerequisite revision, if any */
85: extern LINENUM input_lines; /* how long is input file in lines */
86:
1.1 deraadt 87: