9 void register_release(Register
*reg
) {
10 buffer_release((Buffer
*)reg
);
13 bool register_put(Register
*reg
, Text
*txt
, Filerange
*range
) {
14 size_t len
= range
->end
- range
->start
;
15 if (!buffer_grow((Buffer
*)reg
, len
))
17 reg
->len
= text_bytes_get(txt
, range
->start
, len
, reg
->data
);
21 bool register_append(Register
*reg
, Text
*txt
, Filerange
*range
) {
22 size_t rem
= reg
->size
- reg
->len
;
23 size_t len
= range
->end
- range
->start
;
24 if (len
> rem
&& !buffer_grow((Buffer
*)reg
, reg
->size
+ len
- rem
))
26 reg
->len
+= text_bytes_get(txt
, range
->start
, len
, reg
->data
+ reg
->len
);