common.h (cfe30d02adda7c3b5c76156ac52d50d8cab325d9) common.h (b1a409863f4784ab8a7a9fa04b3e9b3c92e7fd72)
1/*-
2 * Copyright 1986, Larry Wall
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following condition is met:
6 * 1. Redistributions of source code must retain the above copyright notice,
7 * this condition and the following disclaimer.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * $FreeBSD$
28 */
29
30#include <sys/types.h>
31
32#include <stdbool.h>
33#include <stdint.h>
34
1/*-
2 * Copyright 1986, Larry Wall
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following condition is met:
6 * 1. Redistributions of source code must retain the above copyright notice,
7 * this condition and the following disclaimer.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * $FreeBSD$
28 */
29
30#include <sys/types.h>
31
32#include <stdbool.h>
33#include <stdint.h>
34
35#define DEBUGGING
35#define DEBUGGING
36
37/* constants */
38
36
37/* constants */
38
39#define MAXHUNKSIZE 200000 /* is this enough lines? */
40#define INITHUNKMAX 125 /* initial dynamic allocation size */
41#define INITLINELEN 4096
42#define BUFFERSIZE 4096
39#define MAXHUNKSIZE 200000 /* is this enough lines? */
40#define INITHUNKMAX 125 /* initial dynamic allocation size */
41#define INITLINELEN 4096
42#define BUFFERSIZE 4096
43
43
44#define SCCSPREFIX "s."
45#define GET "get -e %s"
46#define SCCSDIFF "get -p %s | diff - %s >/dev/null"
44#define SCCSPREFIX "s."
45#define GET "get -e %s"
46#define SCCSDIFF "get -p %s | diff - %s >/dev/null"
47
47
48#define RCSSUFFIX ",v"
49#define CHECKOUT "co -l %s"
50#define RCSDIFF "rcsdiff %s > /dev/null"
48#define RCSSUFFIX ",v"
49#define CHECKOUT "co -l %s"
50#define RCSDIFF "rcsdiff %s > /dev/null"
51
51
52#define ORIGEXT ".orig"
53#define REJEXT ".rej"
52#define ORIGEXT ".orig"
53#define REJEXT ".rej"
54
55/* handy definitions */
56
54
55/* handy definitions */
56
57#define strNE(s1,s2) (strcmp(s1, s2))
58#define strEQ(s1,s2) (!strcmp(s1, s2))
59#define strnNE(s1,s2,l) (strncmp(s1, s2, l))
60#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l))
57#define strNE(s1,s2) (strcmp(s1, s2))
58#define strEQ(s1,s2) (!strcmp(s1, s2))
59#define strnNE(s1,s2,l) (strncmp(s1, s2, l))
60#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l))
61
62/* typedefs */
63
64typedef long LINENUM; /* must be signed */
65
66/* globals */
67
68extern mode_t filemode;
69
70extern char *buf; /* general purpose buffer */
71extern size_t buf_size; /* size of general purpose buffer */
72
73extern bool using_plan_a; /* try to keep everything in memory */
74extern bool out_of_mem; /* ran out of memory in plan a */
75
61
62/* typedefs */
63
64typedef long LINENUM; /* must be signed */
65
66/* globals */
67
68extern mode_t filemode;
69
70extern char *buf; /* general purpose buffer */
71extern size_t buf_size; /* size of general purpose buffer */
72
73extern bool using_plan_a; /* try to keep everything in memory */
74extern bool out_of_mem; /* ran out of memory in plan a */
75
76#define MAXFILEC 2
76#define MAXFILEC 2
77
78extern char *filearg[MAXFILEC];
79extern bool ok_to_create_file;
80extern char *outname;
81extern char *origprae;
82
83extern char *TMPOUTNAME;
84extern char *TMPINNAME;

--- 15 unchanged lines hidden (view full) ---

100extern int strippath;
101extern bool canonicalize;
102/* TRUE if -C was specified on command line. */
103extern bool check_only;
104extern bool warn_on_invalid_line;
105extern bool last_line_missing_eol;
106
107
77
78extern char *filearg[MAXFILEC];
79extern bool ok_to_create_file;
80extern char *outname;
81extern char *origprae;
82
83extern char *TMPOUTNAME;
84extern char *TMPINNAME;

--- 15 unchanged lines hidden (view full) ---

100extern int strippath;
101extern bool canonicalize;
102/* TRUE if -C was specified on command line. */
103extern bool check_only;
104extern bool warn_on_invalid_line;
105extern bool last_line_missing_eol;
106
107
108#define CONTEXT_DIFF 1
109#define NORMAL_DIFF 2
110#define ED_DIFF 3
111#define NEW_CONTEXT_DIFF 4
112#define UNI_DIFF 5
108#define CONTEXT_DIFF 1
109#define NORMAL_DIFF 2
110#define ED_DIFF 3
111#define NEW_CONTEXT_DIFF 4
112#define UNI_DIFF 5
113
114extern int diff_type;
115extern char *revision; /* prerequisite revision, if any */
116extern LINENUM input_lines; /* how long is input file in lines */
117
118extern int posix;
119
113
114extern int diff_type;
115extern char *revision; /* prerequisite revision, if any */
116extern LINENUM input_lines; /* how long is input file in lines */
117
118extern int posix;
119