Browse code

Add re_ui.c stub, fix Makefile

Dario Rodriguez authored on 07/08/2020 21:30:22
Showing 3 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 CC=gcc
2
-CFLAGS=-g -Wall -Ideps -I/usr/include/SDL2
2
+CFLAGS=-g -Wall -Wformat-truncation=0 -Ideps -I/usr/include/SDL2
3 3
 LDFLAGS=-lSDL2 -lSDL2_image
4 4
 
5 5
 all: re tests
... ...
@@ -10,16 +10,18 @@ re_data.o: re_data.c re_data.h
10 10
 
11 11
 re_plugin_unsaved.o: re_plugin_unsaved.c re_plugin_unsaved.h re_data.h
12 12
 
13
+re_ui.o: re_ui.c re_ui.h
14
+
13 15
 re_tests.o: re_tests.c re_data.h
14 16
 
15 17
 sha3.o: sha3/sha3.c sha3/sha3.h
16 18
 	$(CC) $(CFLAGS) -Isha3 -c -o sha3.o sha3/sha3.c
17 19
 
18
-re: recenteditor.o re_data.o re_plugin_unsaved.o sha3.o
19
-	$(CC) $(LDFLAGS) -o re recenteditor.o re_data.o re_plugin_unsaved.o sha3.o
20
+re: recenteditor.o re_data.o re_plugin_unsaved.o sha3.o re_ui.o
21
+	$(CC) $(LDFLAGS) -o re recenteditor.o re_data.o re_plugin_unsaved.o sha3.o re_ui.o
20 22
 
21 23
 tests: re_tests.o re_data.o sha3.o
22 24
 	$(CC) $(LDFLAGS) -o tests re_tests.o re_data.o sha3.o
23 25
 
24 26
 clean:
25
-	rm -f recenteditor.o re_data.o re_tests.o re_plugin_unsaved.o sha3.o re tests
27
+	rm -f recenteditor.o re_data.o re_tests.o re_plugin_unsaved.o sha3.o re_ui.o re tests 
26 28
new file mode 100644
... ...
@@ -0,0 +1,36 @@
1
+/*
2
+ * re_ui.c
3
+ *
4
+ * A programmers editor
5
+ *
6
+ * Simple UI in SDL2
7
+ *
8
+ * Author: Dario Rodriguez dario@softhome.net
9
+ * This program is licensed under the terms of GNU GPL v2.1+
10
+ */
11
+
12
+#include <stdio.h>
13
+#include <stdlib.h>
14
+#include <unistd.h>
15
+#include <string.h>
16
+#include "re_ui.h"
17
+
18
+reui_t *
19
+reui_init()
20
+{
21
+        reui_t *ui;
22
+        if((ui=malloc(sizeof(reui_t)))==NULL)
23
+                return(NULL);
24
+        memset(ui,0,sizeof(reui_t));
25
+        return(ui);
26
+}
27
+
28
+
29
+void
30
+reui_fini(reui_t *ui)
31
+{
32
+        if(ui==NULL)
33
+                return;
34
+        free(ui),ui=NULL;
35
+}
36
+
0 37
new file mode 100644
... ...
@@ -0,0 +1,21 @@
1
+/*
2
+ * re_ui.c
3
+ *
4
+ * A programmers editor
5
+ *
6
+ * Simple UI in SDL2
7
+ *
8
+ * HEADER FILE
9
+ *
10
+ * Author: Dario Rodriguez dario@softhome.net
11
+ * This program is licensed under the terms of GNU GPL v2.1+
12
+ */
13
+
14
+
15
+typedef struct reui_t {
16
+        int dummy;
17
+} reui_t;
18
+
19
+reui_t *reui_init();
20
+void reui_fini(reui_t *ui);
21
+