summaryrefslogtreecommitdiffstatshomepage
path: root/ui-ssdiff.h
blob: 88627e297c8b2091919e6274010d2bb7812ca067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef UI_SSDIFF_H
#define UI_SSDIFF_H

/*
 * ssdiff line limits
 */
#ifndef MAX_SSDIFF_M
#define MAX_SSDIFF_M 128
#endif

#ifndef MAX_SSDIFF_N
#define MAX_SSDIFF_N 128
#endif
#define MAX_SSDIFF_SIZE ((MAX_SSDIFF_M) * (MAX_SSDIFF_N))

extern void cgit_ssdiff_print_deferred_lines();

extern void cgit_ssdiff_line_cb(char *line, int len);

extern void cgit_ssdiff_header_begin();
extern void cgit_ssdiff_header_end();

extern void cgit_ssdiff_footer();

#endif /* UI_SSDIFF_H */
span class="p">(!new_alloc) new_alloc = 8; new_data = realloc(vec->data, new_alloc * vec->size); if (!new_data) { if (gently) return ENOMEM; perror("vector.c:grow()"); exit(1); } vec->data = new_data; vec->alloc = new_alloc; return 0; } int vector_push(struct vector *vec, const void *data, int gently) { int rc; if (vec->count == vec->alloc && (rc = grow(vec, gently))) return rc; if (data) memmove(vec->data + vec->count * vec->size, data, vec->size); else memset(vec->data + vec->count * vec->size, 0, vec->size); vec->count++; return 0; }