ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.78 by root, Fri May 16 17:09:38 2008 UTC vs.
Revision 1.107 by root, Sat Nov 17 23:33:17 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 5 *
8 * Deliantra is free software: you can redistribute it and/or modify 6 * Deliantra is free software: you can redistribute it and/or modify it under
9 * it under the terms of the GNU General Public License as published by 7 * the terms of the Affero GNU General Public License as published by the
10 * the Free Software Foundation, either version 3 of the License, or 8 * Free Software Foundation, either version 3 of the License, or (at your
11 * (at your option) any later version. 9 * option) any later version.
12 * 10 *
13 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 14 * GNU General Public License for more details.
17 * 15 *
18 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the Affero GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * and the GNU General Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>.
20 * 19 *
21 * The authors can be reached via e-mail to <support@deliantra.net> 20 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 21 */
23 22
24/* 23/*
25 * General convenience functions for crossfire. 24 * General convenience functions for deliantra.
26 */ 25 */
27 26
28#include <cstdlib> 27#include <cstdlib>
29#include <sys/types.h> 28#include <sys/types.h>
30#include <unistd.h> 29#include <unistd.h>
32#include <time.h> 31#include <time.h>
33#include <signal.h> 32#include <signal.h>
34 33
35#include <global.h> 34#include <global.h>
36#include <material.h> 35#include <material.h>
36#include <object.h>
37
38#include <sys/time.h>
39#include <sys/resource.h>
37 40
38#include <glib.h> 41#include <glib.h>
39 42
40refcnt_base::refcnt_t refcnt_dummy; 43refcnt_base::refcnt_t refcnt_dummy;
41ssize_t slice_alloc; 44ssize_t slice_alloc;
42rand_gen rndm, rmg_rndm;
43 45
44void 46/******************************************************************************/
45tausworthe_random_generator::seed (uint32_t seed)
46{
47 state [0] = seed * 69069U; if (state [0] < 2U) state [0] += 2U;
48 state [1] = state [0] * 69069U; if (state [0] < 8U) state [0] += 8U;
49 state [2] = state [1] * 69069U; if (state [0] < 16U) state [0] += 16U;
50 state [3] = state [2] * 69069U; if (state [0] < 128U) state [0] += 128U;
51 47
52 for (int i = 11; --i; ) 48/* Checks a player-provided string which will become the msg property of
53 operator ()(); 49 * an object for dangerous input.
54}
55
56uint32_t
57tausworthe_random_generator::next ()
58{
59 state [0] = ((state [0] & 0xFFFFFFFEU) << 18U) ^ (((state [0] << 6U) ^ state [0]) >> 13U);
60 state [1] = ((state [1] & 0xFFFFFFF8U) << 2U) ^ (((state [1] << 2U) ^ state [1]) >> 27U);
61 state [2] = ((state [2] & 0xFFFFFFF0U) << 7U) ^ (((state [2] << 13U) ^ state [2]) >> 21U);
62 state [3] = ((state [3] & 0xFFFFFF80U) << 13U) ^ (((state [3] << 3U) ^ state [3]) >> 12U);
63
64 return state [0] ^ state [1] ^ state [2] ^ state [3];
65}
66
67uint32_t
68tausworthe_random_generator::get_range (uint32_t num)
69{
70 return (next () * (uint64_t)num) >> 32U;
71}
72
73// return a number within (min .. max)
74int
75tausworthe_random_generator::get_range (int r_min, int r_max)
76{
77 return r_min + get_range (max (r_max - r_min + 1, 0));
78}
79
80/*
81 * The random functions here take luck into account when rolling random
82 * dice or numbers. This function has less of an impact the larger the
83 * difference becomes in the random numbers. IE, the effect is lessened
84 * on a 1-1000 roll, vs a 1-6 roll. This can be used by crafty programmers,
85 * to specifically disable luck in certain rolls, simply by making the
86 * numbers larger (ie, 1d1000 > 500 vs 1d6 > 3)
87 */ 50 */
88 51bool
89/* 52msg_is_safe (const char *msg)
90 * Roll a random number between min and max. Uses op to determine luck,
91 * and if goodbad is non-zero, luck increases the roll, if zero, it decreases.
92 * Generally, op should be the player/caster/hitter requesting the roll,
93 * not the recipient (ie, the poor slob getting hit). [garbled 20010916]
94 */
95int
96random_roll (int r_min, int r_max, const object *op, int goodbad)
97{ 53{
98 r_max = max (r_min, r_max); 54 bool safe = true;
99 55
100 int base = r_max - r_min > 1 ? 20 : 50; /* d2 and d3 are corner cases */ 56 /* Trying to cheat by getting data into the object */
57 if (!strncmp (msg, "endmsg", sizeof ("endmsg") - 1)
58 || strstr (msg, "\nendmsg"))
59 safe = false;
101 60
102 if (op->type == PLAYER) 61 /* Trying to make the object talk, and potentially access arbitrary code */
103 { 62 if (object::msg_has_dialogue (msg))
104 int luck = op->stats.luck; 63 safe = false;
105 64
106 if (rndm (base) < min (10, abs (luck)))
107 {
108 //TODO: take luck into account
109 }
110 }
111
112 return rndm (r_min, r_max);
113}
114
115/*
116 * This is a 64 bit version of random_roll above. This is needed
117 * for exp loss calculations for players changing religions.
118 */
119sint64
120random_roll64 (sint64 r_min, sint64 r_max, const object *op, int goodbad)
121{
122 sint64 omin = r_min;
123 sint64 range = max (0, r_max - r_min + 1);
124 int base = range > 2 ? 20 : 50; /* d2 and d3 are corner cases */
125
126 /*
127 * Make a call to get two 32 bit unsigned random numbers, and just to
128 * a little bitshifting.
129 */
130 sint64 ran = (sint64) rndm.next () ^ ((sint64) rndm.next () << 31);
131
132 if (op->type != PLAYER)
133 return ((ran % range) + r_min);
134
135 int luck = op->stats.luck;
136
137 if (rndm (base) < min (10, abs (luck)))
138 {
139 /* we have a winner */
140 ((luck > 0) ? (luck = 1) : (luck = -1));
141 range -= luck;
142 if (range < 1)
143 return (omin); /*check again */
144
145 ((goodbad) ? (r_min += luck) : (range));
146
147 return (max (omin, min (r_max, (ran % range) + r_min)));
148 }
149
150 return ran % range + r_min;
151}
152
153/*
154 * Roll a number of dice (2d3, 4d6). Uses op to determine luck,
155 * If goodbad is non-zero, luck increases the roll, if zero, it decreases.
156 * Generally, op should be the player/caster/hitter requesting the roll,
157 * not the recipient (ie, the poor slob getting hit).
158 * The args are num D size (ie 4d6) [garbled 20010916]
159 */
160int
161die_roll (int num, int size, const object *op, int goodbad)
162{
163 int min, luck, total, i, gotlucky;
164
165 int diff = size;
166 min = 1;
167 luck = total = gotlucky = 0;
168 int base = diff > 2 ? 20 : 50; /* d2 and d3 are corner cases */
169
170 if (size < 2 || diff < 1)
171 {
172 LOG (llevError, "Calling die_roll with num=%d size=%d\n", num, size);
173 return num; /* avoids a float exception */
174 }
175
176 if (op->type == PLAYER)
177 luck = op->stats.luck;
178
179 for (i = 0; i < num; i++)
180 {
181 if (rndm (base) < MIN (10, abs (luck)) && !gotlucky)
182 {
183 /* we have a winner */
184 gotlucky++;
185 ((luck > 0) ? (luck = 1) : (luck = -1));
186 diff -= luck;
187 if (diff < 1)
188 return (num); /*check again */
189 ((goodbad) ? (min += luck) : (diff));
190 total += MAX (1, MIN (size, rndm (diff) + min));
191 }
192 else
193 total += rndm (size) + 1;
194 }
195
196 return total;
197}
198
199/* convert materialname to materialtype_t */
200
201materialtype_t *
202name_to_material (const shstr &name)
203{
204 for (materialtype_t *mt = materialt; mt && mt->next; mt = mt->next)
205 if (name == mt->name)
206 return mt;
207
208 return 0; 65 return safe;
209}
210
211/* when doing transmutation of objects, we have to recheck the resistances,
212 * as some that did not apply previously, may apply now.
213 */
214void
215transmute_materialname (object *op, const object *change)
216{
217 materialtype_t *mt;
218 int j;
219
220 if (op->materialname == NULL)
221 return;
222
223 if (change->materialname != NULL && strcmp (op->materialname, change->materialname))
224 return;
225
226 if (!op->is_armor ())
227 return;
228
229 mt = name_to_material (op->materialname);
230 if (!mt)
231 {
232 LOG (llevError, "archetype '%s>%s' uses nonexistent material '%s'\n", &op->arch->archname, &op->name, &op->materialname);
233 return;
234 }
235
236 for (j = 0; j < NROFATTACKS; j++)
237 if (op->resist[j] == 0 && change->resist[j] != 0)
238 {
239 op->resist[j] += mt->mod[j];
240 if (op->resist[j] > 100)
241 op->resist[j] = 100;
242 if (op->resist[j] < -100)
243 op->resist[j] = -100;
244 }
245}
246
247/* set the materialname and type for an item */
248void
249set_materialname (object *op, int difficulty, materialtype_t *nmt)
250{
251 materialtype_t *mt, *lmt;
252
253 if (op->materialname != NULL)
254 return;
255
256 if (nmt == NULL)
257 {
258 lmt = NULL;
259
260 for (mt = materialt; mt && mt->next; mt = mt->next)
261 if (op->materials & mt->material && rndm (1, 100) <= mt->chance &&
262 difficulty >= mt->difficulty && (op->magic >= mt->magic || mt->magic == 0))
263 {
264 lmt = mt;
265 if (!(op->is_weapon () || op->is_armor ()))
266 break;
267 }
268 }
269 else
270 lmt = nmt;
271
272 if (lmt != NULL)
273 {
274 if (op->stats.dam && op->is_weapon ())
275 {
276 op->stats.dam += lmt->damage;
277 if (op->stats.dam < 1)
278 op->stats.dam = 1;
279 }
280
281 if (op->stats.sp && op->type == BOW)
282 op->stats.sp += lmt->sp;
283 if (op->stats.wc && op->is_weapon ())
284 op->stats.wc += lmt->wc;
285 if (op->is_armor ())
286 {
287 if (op->stats.ac)
288 op->stats.ac += lmt->ac;
289
290 for (int j = 0; j < NROFATTACKS; j++)
291 if (op->resist[j] != 0)
292 {
293 op->resist[j] += lmt->mod[j];
294 if (op->resist[j] > 100)
295 op->resist[j] = 100;
296 if (op->resist[j] < -100)
297 op->resist[j] = -100;
298 }
299 }
300
301 op->materialname = lmt->name;
302 /* dont make it unstackable if it doesn't need to be */
303 if (op->is_weapon () || op->is_armor ())
304 {
305 op->weight = (op->weight * lmt->weight) / 100;
306 op->value = (op->value * lmt->value) / 100;
307 }
308 }
309}
310
311/*
312 * Strip out the media tags from a String.
313 * Warning the input string will contain the result string
314 */
315void
316strip_media_tag (char *message)
317{
318 int in_tag = 0;
319 char *dest;
320 char *src;
321
322 src = dest = message;
323 while (*src != '\0')
324 {
325 if (*src == '[')
326 {
327 in_tag = 1;
328 }
329 else if (in_tag && (*src == ']'))
330 in_tag = 0;
331 else if (!in_tag)
332 {
333 *dest = *src;
334 dest++;
335 }
336 src++;
337 }
338 *dest = '\0';
339}
340
341const char *
342strrstr (const char *haystack, const char *needle)
343{
344 const char *lastneedle;
345
346 lastneedle = NULL;
347 while ((haystack = strstr (haystack, needle)) != NULL)
348 {
349 lastneedle = haystack;
350 haystack++;
351 }
352 return lastneedle;
353
354}
355
356#define EOL_SIZE (sizeof("\n")-1)
357void
358strip_endline (char *buf)
359{
360 if (strlen (buf) < sizeof ("\n"))
361 {
362 return;
363 }
364 if (!strcmp (buf + strlen (buf) - EOL_SIZE, "\n"))
365 buf[strlen (buf) - EOL_SIZE] = '\0';
366}
367
368/**
369 * Replace in string src all occurrences of key by replacement. The resulting
370 * string is put into result; at most resultsize characters (including the
371 * terminating null character) will be written to result.
372 */
373void
374replace (const char *src, const char *key, const char *replacement, char *result, size_t resultsize)
375{
376 size_t resultlen;
377 size_t keylen;
378
379 /* special case to prevent infinite loop if key==replacement=="" */
380 if (strcmp (key, replacement) == 0)
381 {
382 snprintf (result, resultsize, "%s", src);
383 return;
384 }
385
386 keylen = strlen (key);
387
388 resultlen = 0;
389 while (*src != '\0' && resultlen + 1 < resultsize)
390 {
391 if (strncmp (src, key, keylen) == 0)
392 {
393 snprintf (result + resultlen, resultsize - resultlen, "%s", replacement);
394 resultlen += strlen (result + resultlen);
395 src += keylen;
396 }
397 else
398 {
399 result[resultlen++] = *src++;
400 }
401 }
402 result[resultlen] = '\0';
403}
404
405/**
406 * Taking a string as an argument, mutate it into a string that looks like a list.
407 * a 'list' for the purposes here, is a string of items, seperated by commas, except
408 * for the last entry, which has an 'and' before it, and a full stop (period) after it.
409 * This function will also strip all trailing non alphanumeric characters.
410 * It does not insert an oxford comma.
411 */
412void
413make_list_like (char *input)
414{
415 char *p, tmp[MAX_BUF];
416 int i;
417
418 if (!input || strlen (input) > MAX_BUF - 5)
419 return;
420 /* bad stuff would happen if we continued here, the -5 is to make space for ' and ' */
421
422 strncpy (tmp, input, MAX_BUF - 5);
423 /*trim all trailing commas, spaces etc. */
424 for (i = strlen (tmp); !isalnum (tmp[i]) && i >= 0; i--)
425 tmp[i] = '\0';
426
427 strcat (tmp, ".");
428
429 p = strrchr (tmp, ',');
430 if (p)
431 {
432 *p = '\0';
433 strcpy (input, tmp);
434 p++;
435 strcat (input, " and");
436 strcat (input, p);
437 }
438 else
439 strcpy (input, tmp);
440
441 return;
442} 66}
443 67
444///////////////////////////////////////////////////////////////////////////// 68/////////////////////////////////////////////////////////////////////////////
445 69
446void 70void
447fork_abort (const char *msg) 71fork_abort (const char *msg)
448{ 72{
449 if (!fork ()) 73 if (!fork ())
450 { 74 {
75 signal (SIGINT , SIG_IGN);
76 signal (SIGTERM, SIG_IGN);
451 signal (SIGABRT, SIG_DFL); 77 signal (SIGABRT, SIG_IGN);
78
79 signal (SIGSEGV, SIG_DFL);
80 signal (SIGFPE , SIG_DFL);
81#ifdef SIGBUS
82 signal (SIGBUS , SIG_DFL);
83#endif
84 signal (SIGILL , SIG_DFL);
85 signal (SIGTRAP, SIG_DFL);
86
452 // try to put corefiles into a subdirectory, if existing, to allow 87 // try to put corefiles into a subdirectory, if existing, to allow
453 // an administrator to reduce the I/O load. 88 // an administrator to reduce the I/O load.
454 chdir ("cores"); 89 chdir ("cores");
90
91 // try to detach us from as many external dependencies as possible
92 // as coredumping can take time by closing all fd's.
93 {
94 struct rlimit lim;
95
96 if (getrlimit (RLIMIT_NOFILE, &lim))
97 lim.rlim_cur = 1024;
98
99 for (int i = 0; i < lim.rlim_cur; ++i)
100 close (i);
101 }
102
103 {
104 sigset_t empty;
105 sigemptyset (&empty);
106 sigprocmask (SIG_SETMASK, &empty, 0);
107 }
108
109 // try to coredump with SIGTRAP
110 kill (getpid (), SIGTRAP);
455 abort (); 111 abort ();
456 } 112 }
457 113
458 LOG (llevError, "fork abort: %s\n", msg); 114 LOG (llevError, "fork abort: %s\n", msg);
459} 115}
460 116
461void *salloc_ (int n) throw (std::bad_alloc) 117void *
118salloc_ (int n)
462{ 119{
463 void *ptr = g_slice_alloc (n); 120 void *ptr = g_slice_alloc (n);
464 121
465 if (!ptr) 122 if (!ptr)
466 throw std::bad_alloc (); 123 throw std::bad_alloc ();
467 124
468 slice_alloc += n; 125 slice_alloc += n;
469 return ptr; 126 return ptr;
470} 127}
471 128
472void *salloc_ (int n, void *src) throw (std::bad_alloc) 129void *
130salloc_ (int n, void *src)
473{ 131{
474 void *ptr = salloc_ (n); 132 void *ptr = salloc_ (n);
475 133
476 if (src) 134 if (src)
477 memcpy (ptr, src, n); 135 memcpy (ptr, src, n);
485 143
486#if DEBUG_SALLOC 144#if DEBUG_SALLOC
487 145
488#define MAGIC 0xa1b2c35543deadLL 146#define MAGIC 0xa1b2c35543deadLL
489 147
148void *
490void *g_slice_alloc (unsigned long size) 149g_slice_alloc (unsigned long size)
491{ 150{
492 unsigned long *p = (unsigned long *) (g_slice_alloc)(size + sizeof (unsigned long)); 151 unsigned long *p = (unsigned long *) (g_slice_alloc)(size + sizeof (unsigned long));
493 *p++ = size ^ MAGIC; 152 *p++ = size ^ MAGIC;
494 //fprintf (stderr, "g_slice_alloc %ld %p\n", size, p);//D 153 //fprintf (stderr, "g_slice_alloc %ld %p\n", size, p);//D
495 return (void *)p; 154 return (void *)p;
496} 155}
497 156
157void *
498void *g_slice_alloc0 (unsigned long size) 158g_slice_alloc0 (unsigned long size)
499{ 159{
500 return memset (g_slice_alloc (size), 0, size); 160 return memset (g_slice_alloc (size), 0, size);
501} 161}
502 162
163void
503void g_slice_free1 (unsigned long size, void *ptr) 164g_slice_free1 (unsigned long size, void *ptr)
504{ 165{
505 //fprintf (stderr, "g_slice_free %ld %p\n", size, ptr);//D 166 //fprintf (stderr, "g_slice_free %ld %p\n", size, ptr);//D
506 if (expect_true (ptr)) 167 if (expect_true (ptr))
507 { 168 {
508 unsigned long *p = (unsigned long *)ptr; 169 unsigned long *p = (unsigned long *)ptr;
522 183
523#endif 184#endif
524 185
525/******************************************************************************/ 186/******************************************************************************/
526 187
188refcnt_buf::refcnt_buf (size_t size)
189{
190 static uint32_t empty_buf [2] = { 0, 1 }; // 2 == never deallocated
191 data = (char *)empty_buf + overhead;
192 assert (overhead == sizeof (empty_buf));
193 inc ();
194}
195
196refcnt_buf::refcnt_buf (void *data, size_t size)
197{
198 _alloc (size);
199 memcpy (this->data, data, size);
200}
201
202refcnt_buf::~refcnt_buf ()
203{
204 dec ();
205}
206
207void
208refcnt_buf::_dealloc ()
209{
210 sfree<char> (data - overhead, size () + overhead);
211}
212
213refcnt_buf &
214refcnt_buf::operator =(const refcnt_buf &src)
215{
216 dec ();
217 data = src.data;
218 inc ();
219 return *this;
220}
221
222/******************************************************************************/
223
224int
527void assign (char *dst, const char *src, int maxlen) 225assign (char *dst, const char *src, int maxsize)
528{ 226{
529 if (!src) 227 if (!src)
530 src = ""; 228 src = "";
531 229
532 int len = strlen (src); 230 int len = strlen (src);
533 231
534 if (len >= maxlen - 1) 232 if (len >= maxsize)
535 { 233 {
536 if (maxlen <= 4) 234 if (maxsize <= 4)
537 { 235 {
538 memset (dst, '.', maxlen - 1); 236 memset (dst, '.', maxsize - 2);
539 dst [maxlen - 1] = 0; 237 dst [maxsize - 1] = 0;
540 } 238 }
541 else 239 else
542 { 240 {
543 memcpy (dst, src, maxlen - 4); 241 memcpy (dst, src, maxsize - 4);
544 memcpy (dst + maxlen - 4, "...", 4); 242 memcpy (dst + maxsize - 4, "...", 4);
545 } 243 }
244
245 len = maxsize;
546 } 246 }
547 else 247 else
548 memcpy (dst, src, len + 1); 248 memcpy (dst, src, ++len);
549}
550 249
551const char * 250 return len;
251}
252
253char *
254vformat (const char *format, va_list ap)
255{
256 static dynbuf_text bufs[8];
257 static int bufidx;
258
259 dynbuf_text &buf = bufs [++bufidx & 7];
260
261 buf.clear ();
262 buf.vprintf (format, ap);
263 return buf;
264}
265
266char *
552format (const char *format, ...) 267format (const char *format, ...)
553{ 268{
554 static dynbuf_text buf;
555
556 buf.clear ();
557
558 va_list ap; 269 va_list ap;
559 va_start (ap, format); 270 va_start (ap, format);
560 buf.vprintf (format, ap); 271 char *buf = vformat (format, ap);
561 va_end (ap); 272 va_end (ap);
562 273
563 return buf; 274 return buf;
564} 275}
565 276
566tstamp now () 277tstamp
278now ()
567{ 279{
568 struct timeval tv; 280 struct timeval tv;
569 281
570 gettimeofday (&tv, 0); 282 gettimeofday (&tv, 0);
571 return tstamp (tv.tv_sec) + tstamp (tv.tv_usec) * tstamp (1e-6); 283 return tstamp (tv.tv_sec) + tstamp (tv.tv_usec) * tstamp (1e-6);
636 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, 348 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
637 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, 349 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
638 0x2d02ef8dL 350 0x2d02ef8dL
639}; 351};
640 352
353void
641void thread::start (void *(*start_routine)(void *), void *arg) 354thread::start (void *(*start_routine)(void *), void *arg)
642{ 355{
643 pthread_attr_t attr; 356 pthread_attr_t attr;
644 357
645 pthread_attr_init (&attr); 358 pthread_attr_init (&attr);
646 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); 359 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines