2 dtl-1.12 -- Diff Template Library
4 In short, Diff Template Library is distributed under so called "BSD license",
6 Copyright (c) 2008-2011 Tatsuhiko Kubo <cubicdaiya@gmail.com>
9 Redistribution and use in source and binary forms, with or without modification,
10 are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 this list of conditions and the following disclaimer in the documentation
17 and/or other materials provided with the distribution.
19 * Neither the name of the authors nor the names of its contributors
20 may be used to endorse or promote products derived from this software
21 without specific prior written permission.
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 /* If you use this library, you must include dtl.hpp only. */
38 #ifndef DTL_VARIABLES_H
39 #define DTL_VARIABLES_H
64 * type of edit for SES
67 const edit_t SES_DELETE = -1;
68 const edit_t SES_COMMON = 0;
69 const edit_t SES_ADD = 1;
74 #define SES_MARK_DELETE "-"
75 #define SES_MARK_COMMON " "
76 #define SES_MARK_ADD "+"
79 * info for Unified Format
81 typedef struct eleminfo {
82 long long beforeIdx; // index of prev sequence
83 long long afterIdx; // index of after sequence
84 edit_t type; // type of edit(Add, Delete, Common)
87 const long long DTL_SEPARATE_SIZE = 3;
88 const long long DTL_CONTEXT_SIZE = 3;
91 * cordinate for registering route
93 typedef struct Point {
94 long long x; // x cordinate
95 long long y; // y cordinate
96 long long k; // vertex
100 * limit of cordinate size
102 const unsigned long long MAX_CORDINATES_SIZE = 2000000;
104 typedef vector< long long > editPath;
105 typedef vector< P > editPathCordinates;
108 * Structure of Unified Format Hunk
110 template <typename sesElem>
112 long long a, b, c, d; // @@ -a,b +c,d @@
113 vector< sesElem > common[2]; // anteroposterior commons on changes
114 vector< sesElem > change; // changes
115 long long inc_dec_count; // count of increace and decrease
118 #define dtl_typedefs(elem, sequence) \
119 typedef pair< elem, elemInfo > sesElem; \
120 typedef vector< sesElem > sesElemVec; \
121 typedef vector< uniHunk< sesElem > > uniHunkVec; \
122 typedef list< elem > elemList; \
123 typedef vector< elem > elemVec; \
124 typedef typename uniHunkVec::iterator uniHunkVec_iter; \
125 typedef typename sesElemVec::iterator sesElemVec_iter; \
126 typedef typename elemList::iterator elemList_iter; \
127 typedef typename sequence::iterator sequence_iter; \
128 typedef typename sequence::const_iterator sequence_const_iter; \
129 typedef typename elemVec::iterator elemVec_iter;
134 #endif // DTL_VARIABLES_H