diff options
| author | DrNuget <drnuget@outlook.com> | 2025-10-29 19:56:06 +0200 |
|---|---|---|
| committer | DrNuget <drnuget@outlook.com> | 2025-10-29 19:56:06 +0200 |
| commit | 14bea573767bfe37d536929c16dedceb06bbd5cf (patch) | |
| tree | ed8b8f3fbcfeef51858b40c0662bda02f2806fd1 /brailleboi.c | |
| parent | 77afd633c610e8bfde1b66384e9309cdf249ccbb (diff) | |
| download | brailleboi-14bea573767bfe37d536929c16dedceb06bbd5cf.tar.gz | |
add braille character printing, change c standard to c23 and pedantic compiler warnings
Diffstat (limited to 'brailleboi.c')
| -rw-r--r-- | brailleboi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/brailleboi.c b/brailleboi.c index a892dfa..e04d17c 100644 --- a/brailleboi.c +++ b/brailleboi.c @@ -1,15 +1,34 @@ #include <stdlib.h> +#include <stdio.h> +#include <wchar.h> +#include <locale.h> #include "brailleboi.h" int brailleInit(int width, int height, image_buffer* buf) { + setlocale(LC_ALL, ""); buf->contents = malloc((width * height) * sizeof(int)); buf->width = width; buf->height = height; + return 0; } int brailleStop(image_buffer* buf) { free(buf->contents); + return 0; +} + +int brailleReorganizeBits(int old) +{ + int new = (old&0b10000111) | + (old&0b01110000)>>1 | + (old&0b00001000)<<3; + return new; +} + +void braillePrint(int data) +{ + wprintf(L"%lc", (0x2800|data)); } |
