From 300c0e45ba3681fc77409d7ba8d480d839872d16 Mon Sep 17 00:00:00 2001 From: James Benton Date: Tue, 5 Jan 2016 15:24:54 -0800 Subject: [PATCH] Update include layout. --- include/coreinit/debug.h | 22 +++++++++++++++++++ include/{coreinit_crt.h => coreinit/exit.h} | 3 +++ include/coreinit_debug.h | 12 ----------- include/gx2/state.h | 24 +++++++++++++++++++++ include/gx2_init.h | 15 ------------- rpl/libcoreinit/exports.h | 11 ++++++++-- rpl/libgx2/exports.h | 1 + samples/helloworld/src/main.c | 4 ++-- 8 files changed, 61 insertions(+), 31 deletions(-) create mode 100644 include/coreinit/debug.h rename include/{coreinit_crt.h => coreinit/exit.h} (81%) delete mode 100644 include/coreinit_debug.h create mode 100644 include/gx2/state.h delete mode 100644 include/gx2_init.h diff --git a/include/coreinit/debug.h b/include/coreinit/debug.h new file mode 100644 index 0000000..f16687a --- /dev/null +++ b/include/coreinit/debug.h @@ -0,0 +1,22 @@ +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void +OSConsoleWrite(const char *msg, uint32_t size); + +void +OSReport(const char *fmt, ...); + +void +OSPanic(const char *file, uint32_t line, const char *fmt, ...); + +void +OSFatal(const char *msg); + +#ifdef __cplusplus +} +#endif diff --git a/include/coreinit_crt.h b/include/coreinit/exit.h similarity index 81% rename from include/coreinit_crt.h rename to include/coreinit/exit.h index 49d7706..cdf1bd9 100644 --- a/include/coreinit_crt.h +++ b/include/coreinit/exit.h @@ -4,6 +4,9 @@ extern "C" { #endif +void +exit(int code); + void _Exit(); diff --git a/include/coreinit_debug.h b/include/coreinit_debug.h deleted file mode 100644 index 661a627..0000000 --- a/include/coreinit_debug.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -void -OSFatal(const char *msg); - -#ifdef __cplusplus -} -#endif diff --git a/include/gx2/state.h b/include/gx2/state.h new file mode 100644 index 0000000..6e3047a --- /dev/null +++ b/include/gx2/state.h @@ -0,0 +1,24 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +enum GX2InitAttributes +{ + GX2_INIT_END = 0, + GX2_INIT_CMD_BUF_BASE = 1, + GX2_INIT_CMD_BUF_POOL_SIZE = 2, + GX2_INIT_ARGC = 7, + GX2_INIT_ARGV = 8, +}; + +void +GX2Init(uint32_t *attributes); + +void +GX2Shutdown(); + +#ifdef __cplusplus +} +#endif diff --git a/include/gx2_init.h b/include/gx2_init.h deleted file mode 100644 index 3caa9f9..0000000 --- a/include/gx2_init.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -void -GX2Init(); - -void -GX2Shutdown(); - -#ifdef __cplusplus -} -#endif diff --git a/rpl/libcoreinit/exports.h b/rpl/libcoreinit/exports.h index 7a6d1a0..8506b54 100644 --- a/rpl/libcoreinit/exports.h +++ b/rpl/libcoreinit/exports.h @@ -1,2 +1,9 @@ -EXPORT(_Exit); -EXPORT(OSFatal); \ No newline at end of file +// coreinit/debug.h +EXPORT(OSConsoleWrite); +EXPORT(OSReport); +EXPORT(OSPanic); +EXPORT(OSFatal); + +// coreinit/exit.h +EXPORT(exit); +EXPORT(_Exit); \ No newline at end of file diff --git a/rpl/libgx2/exports.h b/rpl/libgx2/exports.h index a566a03..3249192 100644 --- a/rpl/libgx2/exports.h +++ b/rpl/libgx2/exports.h @@ -1,2 +1,3 @@ +// gx2/state.h EXPORT(GX2Init); EXPORT(GX2Shutdown); \ No newline at end of file diff --git a/samples/helloworld/src/main.c b/samples/helloworld/src/main.c index 58c893c..f07115c 100644 --- a/samples/helloworld/src/main.c +++ b/samples/helloworld/src/main.c @@ -1,8 +1,8 @@ -#include -#include +#include int main(int argc, char **argv) { + OSReport("Testing var args %d", argc); OSFatal("my first rpx"); return 0; }