aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--brailleboi.c15
-rw-r--r--brailleboi.h13
-rw-r--r--main.c10
4 files changed, 50 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ba61ab3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+CC = gcc
+
+CFLAGS = -std=c99
+
+SRC = main.c brailleboi.c brailleboi.h
+
+TARGET = main
+
+.PHONY: build
+
+build:
+ $(CC) $(CFLAGS) -o $(TARGET) $(SRC)
diff --git a/brailleboi.c b/brailleboi.c
new file mode 100644
index 0000000..a892dfa
--- /dev/null
+++ b/brailleboi.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+
+#include "brailleboi.h"
+
+int brailleInit(int width, int height, image_buffer* buf)
+{
+ buf->contents = malloc((width * height) * sizeof(int));
+ buf->width = width;
+ buf->height = height;
+}
+
+int brailleStop(image_buffer* buf)
+{
+ free(buf->contents);
+}
diff --git a/brailleboi.h b/brailleboi.h
new file mode 100644
index 0000000..87d3e35
--- /dev/null
+++ b/brailleboi.h
@@ -0,0 +1,13 @@
+#ifndef BRAILLEBOI_H
+#define BRAILLEBOI_H
+
+typedef struct image_buffer {
+ int width, height;
+ int* contents;
+} image_buffer;
+
+int brailleInit(int, int, image_buffer*);
+
+int brailleStop(image_buffer*);
+
+#endif
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..1ba0f64
--- /dev/null
+++ b/main.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include "brailleboi.h"
+
+int main()
+{
+ image_buffer buf;
+ brailleInit(20, 20, &buf);
+ brailleStop(&buf);
+ return 0;
+}