Angband
z-textblock.h
Go to the documentation of this file.
1 
19 #ifndef INCLUDED_Z_TEXTBLOCK_H
20 #define INCLUDED_Z_TEXTBLOCK_H
21 
22 #include "z-file.h"
23 
25 typedef struct textblock textblock;
26 
27 
29 void textblock_free(textblock *tb);
30 
31 
32 void textblock_append(textblock *tb, const char *fmt, ...);
33 void textblock_append_c(textblock *tb, byte attr, const char *fmt, ...);
34 void textblock_append_pict(textblock *tb, byte attr, int c);
35 void textblock_append_utf8(textblock *tb, const char *utf8_string);
36 
37 const wchar_t *textblock_text(textblock *tb);
38 const byte *textblock_attrs(textblock *tb);
39 
40 size_t textblock_calculate_lines(textblock *tb, size_t **line_starts,
41  size_t **line_lengths, size_t width);
42 
43 void textblock_to_file(textblock *tb, ang_file *f, int indent, int wrap_at);
44 
45 extern ang_file *text_out_file;
46 extern void (*text_out_hook)(byte a, const char *str);
47 extern int text_out_wrap;
48 extern int text_out_indent;
49 extern int text_out_pad;
50 
51 extern void text_out_to_file(byte attr, const char *str);
52 extern void text_out(const char *fmt, ...);
53 extern void text_out_c(byte a, const char *fmt, ...);
54 extern void text_out_e(const char *fmt, ...);
55 
56 typedef void (*text_writer)(ang_file *f);
57 errr text_lines_to_file(const char *path, text_writer writer);
58 
59 #endif /* INCLUDED_Z_TEXTBLOCK_H */