From 78c38133ac918546601fc6af783d01cf0e36510b Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 17 Apr 2020 23:07:21 +0300 Subject: [PATCH] introduce sdk.h --- .gitignore | 1 + sdk/allocator.h | 2 +- sdk/logger.h | 2 +- sdk/sdk.h | 8 ++++++++ sdk/side_module_api.h | 6 +++--- src/main.c | 4 +--- 6 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 sdk/sdk.h diff --git a/.gitignore b/.gitignore index 59967b3..bd4f9df 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ # compiled wasm files *.wasm +*.wat diff --git a/sdk/allocator.h b/sdk/allocator.h index 690a90b..e05a364 100644 --- a/sdk/allocator.h +++ b/sdk/allocator.h @@ -24,4 +24,4 @@ void *allocate(size_t size); */ void deallocate(void *ptr, size_t size); -#endif //FLUENCE_C_SDK_ALLOCATOR_H +#endif // FLUENCE_C_SDK_ALLOCATOR_H diff --git a/sdk/logger.h b/sdk/logger.h index 78eaed2..0b93d39 100644 --- a/sdk/logger.h +++ b/sdk/logger.h @@ -12,4 +12,4 @@ */ void log_utf8_string(const char *str, int len) __LOGGER_IMPORT(log_utf8_string); -#endif //FLUENCE_C_SDK_LOGGER_H +#endif // FLUENCE_C_SDK_LOGGER_H diff --git a/sdk/sdk.h b/sdk/sdk.h new file mode 100644 index 0000000..12173b5 --- /dev/null +++ b/sdk/sdk.h @@ -0,0 +1,8 @@ +#ifndef FLUENCE_C_SDK_H +#define FLUENCE_C_SDK_H + +#include "allocator.h" +#include "logger.h" +#include "side_module_api.h" + +#endif // FLUENCE_C_SDK_H diff --git a/sdk/side_module_api.h b/sdk/side_module_api.h index 9f8ed62..c8e12eb 100644 --- a/sdk/side_module_api.h +++ b/sdk/side_module_api.h @@ -1,5 +1,5 @@ -#ifndef C_TEMPLATE_SIDE_MODULE_API_H -#define C_TEMPLATE_SIDE_MODULE_API_H +#ifndef FLUENCE_C_SDK_SIDE_MODULE_API_H +#define FLUENCE_C_SDK_SIDE_MODULE_API_H #include #include @@ -59,4 +59,4 @@ char * module_name ## _call(const char *ptr, int length) { \ return result_out;\ } -#endif //C_TEMPLATE_SIDE_MODULE_API_H +#endif // FLUENCE_C_SDK_SIDE_MODULE_API_H diff --git a/src/main.c b/src/main.c index 14a5126..f329cb4 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,4 @@ -#include "../sdk/allocator.h" -#include "../sdk/logger.h" -#include "../sdk/side_module_api.h" +#include "../sdk/sdk.h" char *invoke(const char *str, int length) {