summaryrefslogtreecommitdiff
path: root/examples/redis-unstable/src/lolwut.h
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
commit5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch)
tree1acdfa5220cd13b7be43a2a01368e80d306473ca /examples/redis-unstable/src/lolwut.h
parentc7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff)
downloadcrep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz
Add Redis source code for testing
Diffstat (limited to 'examples/redis-unstable/src/lolwut.h')
-rw-r--r--examples/redis-unstable/src/lolwut.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/redis-unstable/src/lolwut.h b/examples/redis-unstable/src/lolwut.h
new file mode 100644
index 0000000..914db0d
--- /dev/null
+++ b/examples/redis-unstable/src/lolwut.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2018-Present, Redis Ltd.
3 * All rights reserved.
4 *
5 * Licensed under your choice of (a) the Redis Source Available License 2.0
6 * (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the
7 * GNU Affero General Public License v3 (AGPLv3).
8 */
9
10/* This structure represents our canvas. Drawing functions will take a pointer
11 * to a canvas to write to it. Later the canvas can be rendered to a string
12 * suitable to be printed on the screen, using unicode Braille characters. */
13
14/* This represents a very simple generic canvas in order to draw stuff.
15 * It's up to each LOLWUT versions to translate what they draw to the
16 * screen, depending on the result to accomplish. */
17
18#ifndef __LOLWUT_H
19#define __LOLWUT_H
20
21typedef struct lwCanvas {
22 int width;
23 int height;
24 char *pixels;
25} lwCanvas;
26
27/* Drawing functions implemented inside lolwut.c. */
28lwCanvas *lwCreateCanvas(int width, int height, int bgcolor);
29void lwFreeCanvas(lwCanvas *canvas);
30void lwDrawPixel(lwCanvas *canvas, int x, int y, int color);
31int lwGetPixel(lwCanvas *canvas, int x, int y);
32void lwDrawLine(lwCanvas *canvas, int x1, int y1, int x2, int y2, int color);
33void lwDrawSquare(lwCanvas *canvas, int x, int y, float size, float angle, int color);
34
35#endif