-
Notifications
You must be signed in to change notification settings - Fork 1
/
line_break_alg.h
41 lines (31 loc) · 933 Bytes
/
line_break_alg.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LINE_BREAK_ALG_H
#define LINE_BREAK_ALG_H
/*
* line_break_alg.h
*
* Line breaking algorithms
*/
struct lb_prepare_args
{
// Line itself that we are to prepare
const char *line, *line_end;
// The length of the line we wish to produce
unsigned length;
// Bytes to skip at start of line
unsigned offset;
// Length to skip at start of line
unsigned skip;
// Number of initial indentation characters (written to buffer)
unsigned indent;
// Number of "hanging" indentation characters (not actually written to
// resulting string, but instead is factored into line widths)
unsigned hang;
};
void line_break_init(void);
void line_break_deinit(void);
void line_break_prepare(const struct lb_prepare_args *);
ssize_t line_break_get(char *, size_t);
bool line_break_has_data(void);
void line_break_compute_greedy(void);
void line_break_compute_knuth_plass(void);
#endif