-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinter.h
More file actions
32 lines (20 loc) · 807 Bytes
/
printer.h
File metadata and controls
32 lines (20 loc) · 807 Bytes
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
#pragma once
#include "colors.h"
struct _printer
{
struct _printer *(*pos)(struct _printer *, int, int);
struct _printer *(*text)(struct _printer *, const char *, ...);
struct _printer *(*color)(struct _printer *, color_t, color_t);
struct _printer *(*underline_on)(struct _printer *);
struct _printer *(*underline_off)(struct _printer *);
struct _printer *(*bold_on)(struct _printer *);
struct _printer *(*bold_off)(struct _printer *);
void (*flush)(struct _printer *);
};
typedef struct _printer printer_t;
printer_t *printer_pos(printer_t *, int, int);
printer_t *printer_text(printer_t *, const char *, ...);
printer_t *printer_color(printer_t *, color_t, color_t);
void printer_flush(printer_t *);
printer_t *new_printer();
void delete_printer(printer_t *);