Rev 1787 | Rev 2071 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 2069 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | 34 | ||
35 | #include <screenbuffer.h> |
35 | #include <screenbuffer.h> |
36 | #include <malloc.h> |
36 | #include <malloc.h> |
37 | #include <unistd.h> |
37 | #include <unistd.h> |
38 | 38 | ||
39 | /** Store one character to screenbuffer. Its position is determined by scr->position_x and scr->position_y. |
39 | /** Store one character to screenbuffer. Its position is determined by |
- | 40 | * scr->position_x and scr->position_y. |
|
- | 41 | * |
|
40 | * @param scr screenbuffer |
42 | * @param scr screenbuffer |
41 | * @param c stored character |
43 | * @param c stored character |
42 | */ |
44 | */ |
43 | void screenbuffer_putchar(screenbuffer_t *scr, char c) |
45 | void screenbuffer_putchar(screenbuffer_t *scr, char c) |
44 | { |
46 | { |
Line 56... | Line 58... | ||
56 | * @param size_y height in characters |
58 | * @param size_y height in characters |
57 | * @return pointer to screenbuffer (same as scr parameter) or NULL |
59 | * @return pointer to screenbuffer (same as scr parameter) or NULL |
58 | */ |
60 | */ |
59 | screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y) |
61 | screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y) |
60 | { |
62 | { |
61 | if ((scr->buffer = (keyfield_t *)malloc(sizeof(keyfield_t) * size_x * size_y)) == NULL) { |
63 | scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y); |
- | 64 | if (!scr->buffer) { |
|
62 | return NULL; |
65 | return NULL; |
63 | } |
66 | } |
64 | 67 | ||
65 | scr->size_x = size_x; |
68 | scr->size_x = size_x; |
66 | scr->size_y = size_y; |
69 | scr->size_y = size_y; |
Line 140... | Line 143... | ||
140 | } |
143 | } |
141 | 144 | ||
142 | 145 | ||
143 | /** @} |
146 | /** @} |
144 | */ |
147 | */ |
145 | - |