build system 3
[henge/webcc.git] / src / henge / core / io.c
diff --git a/src/henge/core/io.c b/src/henge/core/io.c
new file mode 100644 (file)
index 0000000..dba85ae
--- /dev/null
@@ -0,0 +1,46 @@
+/*!@file
+  \brief   I/O system
+  \details Transpilable I/O system for web and native, including log abstraction
+  \author  K
+  \date    2016
+  ------------------------------------------------------------------------------*/
+#ifdef __EMSCRIPTEN__
+/* Web Environment */
+#include <SDL_ttf.h>
+#include <emscripten/emscripten.h>
+#else
+/* Traditional Environment */
+#ifdef __Win32
+#include <windows.h>
+#endif //__Win32
+#include <SDL2/SDL_ttf.h>
+#endif
+/* ENVIRONMENT-AGNOSTIC DEFINES */
+#include <SDL2/SDL.h>
+#include <SDL2/SDL_image.h>
+#include <stdint.h>
+#include <setjmp.h>
+#include <stdio.h>
+
+/* exposed functions */
+int         io_init(void);
+const char* io_get_error(void);
+void        io_quit(void);
+
+/** IO initializer */
+int
+io_init()
+{ return 0;
+}
+
+const char*
+io_get_error()
+{ static char err[5] = "Ass!";
+  return (const char*)&err;
+}
+
+void
+io_quit()
+{
+}
+