diff --git a/Makefile b/Makefile index a86b85f..3f191d9 100644 --- a/Makefile +++ b/Makefile @@ -108,21 +108,21 @@ tui bot_echo pingpong: | build-waku-librln build-waku-nat nim_chat_poc.nims # Determine shared library extension based on OS ifeq ($(shell uname -s),Darwin) - LIBCHAT_EXT := dylib + LIBLOGOSCHAT_EXT := dylib else ifeq ($(shell uname -s),Linux) - LIBCHAT_EXT := so + LIBLOGOSCHAT_EXT := so else - LIBCHAT_EXT := dll + LIBLOGOSCHAT_EXT := dll endif -LIBCHAT := build/libchat.$(LIBCHAT_EXT) +LIBLOGOSCHAT := build/liblogoschat.$(LIBLOGOSCHAT_EXT) -.PHONY: libchat -libchat: | build-waku-librln build-waku-nat nim_chat_poc.nims - echo -e $(BUILD_MSG) "$(LIBCHAT)" && \ - $(ENV_SCRIPT) nim libchat $(NIM_PARAMS) --path:src nim_chat_poc.nims && \ +.PHONY: liblogoschat +liblogoschat: | build-waku-librln build-waku-nat nim_chat_poc.nims + echo -e $(BUILD_MSG) "$(LIBLOGOSCHAT)" && \ + $(ENV_SCRIPT) nim liblogoschat $(NIM_PARAMS) --path:src nim_chat_poc.nims && \ echo -e "\n\x1B[92mLibrary built successfully:\x1B[39m" && \ - echo " $(shell pwd)/$(LIBCHAT)" + echo " $(shell pwd)/$(LIBLOGOSCHAT)" endif diff --git a/examples/cbindings/README.md b/examples/cbindings/README.md index a2c42d8..b6df51b 100644 --- a/examples/cbindings/README.md +++ b/examples/cbindings/README.md @@ -1,13 +1,13 @@ # C Bindings Example - Chat TUI -A simple terminal user interface that demonstrates how to use libchat from C. +A simple terminal user interface that demonstrates how to use liblogoschat from C. ## Build -1. First, build libchat from the root folder: +1. First, build liblogoschat from the root folder: ```bash - make libchat + make liblogoschat ``` 2. Then build the C example: diff --git a/examples/cbindings/cbindings_chat_tui.c b/examples/cbindings/cbindings_chat_tui.c index faffbe4..16c4a9e 100644 --- a/examples/cbindings/cbindings_chat_tui.c +++ b/examples/cbindings/cbindings_chat_tui.c @@ -1,5 +1,5 @@ /** - * Simple Terminal UI for libchat.c + * Simple Terminal UI for liblogoschat.c * Commands: * /join - Join a conversation * /bundle - Show your intro bundle @@ -17,7 +17,7 @@ #include #include -#include "libchat.h" +#include "liblogoschat.h" // Constants static const int LOG_PANEL_HEIGHT = 6; diff --git a/library/libchat.h b/library/libchat.h index a2bf02a..d0aac93 100644 --- a/library/libchat.h +++ b/library/libchat.h @@ -1,6 +1,6 @@ // Generated manually -#ifndef __libchat__ -#define __libchat__ +#ifndef __liblogoschat__ +#define __liblogoschat__ #include #include @@ -104,4 +104,4 @@ int chat_create_intro_bundle(void *ctx, FFICallBack callback, void *userData); } #endif -#endif /* __libchat__ */ +#endif /* __liblogoschat__ */ diff --git a/library/libchat.nim b/library/libchat.nim index 816419f..5d86a6e 100644 --- a/library/libchat.nim +++ b/library/libchat.nim @@ -1,4 +1,4 @@ -## libchat - C bindings for the Chat SDK +## liblogoschat - C bindings for the Chat SDK ## Main entry point for the shared library ## ## This library exposes the Chat SDK functionality through a C-compatible FFI interface. @@ -89,7 +89,7 @@ proc chat_destroy( checkParams(ctx, callback, userData) ffi.destroyFFIContext(ctx).isOkOr: - let msg = "libchat error: " & $error + let msg = "liblogoschat error: " & $error callback(RET_ERR, unsafeAddr msg[0], cast[csize_t](len(msg)), userData) return RET_ERR diff --git a/nim_chat_poc.nimble b/nim_chat_poc.nimble index 3d63a0a..6a027c2 100644 --- a/nim_chat_poc.nimble +++ b/nim_chat_poc.nimble @@ -76,6 +76,6 @@ task pingpong, "Build the Pingpong example": let name = "pingpong" buildBinary name, "examples/", "-d:chronicles_log_level='INFO' -d:chronicles_disabled_topics='waku node' " -task libchat, "Build the Chat SDK shared library (C bindings)": +task liblogoschat, "Build the Chat SDK shared library (C bindings)": buildLibrary "chat", "library/", "-d:chronicles_log_level='INFO' -d:chronicles_enabled=on --path:src --path:vendor/nim-ffi"