aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-07-23 13:29:24 -0700
committerTrumeet <yuuta@yuuta.moe>2022-07-23 13:29:24 -0700
commitdf85b736cea32bd04e4a80042b9b3c67642d57ba (patch)
tree002d2aa14a31ac7e2cd210e78157a449ac96fb35
parent34c53bc3d396934df94431f7b76972180b1b0a8c (diff)
downloadacron-df85b736cea32bd04e4a80042b9b3c67642d57ba.tar
acron-df85b736cea32bd04e4a80042b9b3c67642d57ba.tar.gz
acron-df85b736cea32bd04e4a80042b9b3c67642d57ba.tar.bz2
acron-df85b736cea32bd04e4a80042b9b3c67642d57ba.zip
refactor(acronc): rename acronc to helloworld
Signed-off-by: Trumeet <yuuta@yuuta.moe>
-rw-r--r--client/libacron/CMakeLists.txt15
-rw-r--r--client/libacron/README.md10
-rw-r--r--client/libacron/apps/helloworld/main.c (renamed from client/libacron/acronc/main.c)2
-rw-r--r--client/libacron/apps/helloworld/net.c (renamed from client/libacron/acronc/net.c)0
-rw-r--r--client/libacron/apps/helloworld/net.h (renamed from client/libacron/acronc/net.h)0
5 files changed, 14 insertions, 13 deletions
diff --git a/client/libacron/CMakeLists.txt b/client/libacron/CMakeLists.txt
index 223b259..c87063e 100644
--- a/client/libacron/CMakeLists.txt
+++ b/client/libacron/CMakeLists.txt
@@ -89,18 +89,19 @@ target_link_libraries(ac ${LIBAC_DEPS})
target_include_directories(ac-static PUBLIC ${LIBAC_INCLUDES})
target_link_libraries(ac-static ${LIBAC_DEPS})
-add_executable(acronc
- acronc/main.c
- acronc/net.c
- acronc/net.h)
+add_executable(helloworld
+ apps/helloworld/main.c
+ apps/helloworld/net.c
+ apps/helloworld/net.h
+ )
if(WIN32)
set(ACRONC_DEPS ws2_32)
endif()
set(ACRONC_DEPS ${ACRON_DEPS} ac)
-target_link_libraries(acronc ac)
-target_include_directories(acronc PUBLIC "${PROJECT_BINARY_DIR}" include/)
+target_link_libraries(helloworld ac)
+target_include_directories(helloworld PUBLIC "${PROJECT_BINARY_DIR}" include/)
-install(TARGETS ac ac-static acronc
+install(TARGETS ac ac-static helloworld
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/client/libacron/README.md b/client/libacron/README.md
index d52a4c3..4514e21 100644
--- a/client/libacron/README.md
+++ b/client/libacron/README.md
@@ -177,8 +177,8 @@ The client also needs to supply its own `on_send` function. libac will call that
needs to write anything to the socket. When calling that function, the socket pointer will be passed
as-is.
-No worries, `acronc/net.c` provides a ready-to-use example of cross-platform (Unix and Windows) blocking
-socket client. See `acronc/main.c` for more details.
+No worries, `apps/helloworld/net.c` provides a ready-to-use example of cross-platform (Unix and Windows) blocking
+socket client. See `apps/helloworld/main.c` for more details.
```c
void *connection = NULL;
@@ -231,7 +231,7 @@ The program can make requests using `ac_request()`:
```c
ac_config_t conf = {
- .name = "acronc"
+ .name = "helloworld"
};
ac_request_cmd_t req = {
.type = AC_REQUEST_CMD,
@@ -252,7 +252,7 @@ The client must manually close its socket after calling `ac_disconnect()`.
> on the roadmap.
-Read more: `acronc/main.c` example client.
+Read more: `apps/helloworld/main.c` example client.
#### Connection Threading
@@ -261,7 +261,7 @@ it is the caller's responsibility to guard the whole connection with a mutex. li
provide that because this may limit the flexibility. After locking, it is safe to call the
connection-related functions from any threads.
-Example `acronc/main.c` has a naive cross-platform example of how to guard the connection using
+Example `apps/helloworld/main.c` has a naive cross-platform example of how to guard the connection using
a mutex.
## Roadmap
diff --git a/client/libacron/acronc/main.c b/client/libacron/apps/helloworld/main.c
index dfd1668..6201fac 100644
--- a/client/libacron/acronc/main.c
+++ b/client/libacron/apps/helloworld/main.c
@@ -208,7 +208,7 @@ static int on_send(const void *sock,
static int say(void *connection) {
int r;
ac_config_t conf = {
- .name = "acronc"
+ .name = "helloworld"
};
ac_request_cmd_t req = {
.type = AC_REQUEST_CMD,
diff --git a/client/libacron/acronc/net.c b/client/libacron/apps/helloworld/net.c
index 83192e0..83192e0 100644
--- a/client/libacron/acronc/net.c
+++ b/client/libacron/apps/helloworld/net.c
diff --git a/client/libacron/acronc/net.h b/client/libacron/apps/helloworld/net.h
index 1a49709..1a49709 100644
--- a/client/libacron/acronc/net.h
+++ b/client/libacron/apps/helloworld/net.h