Refactor strings functions to common static library.

This commit is contained in:
Roger A. Light
2024-03-17 07:46:42 +00:00
parent 6eb56dc6f1
commit 1204a7a6f7
14 changed files with 7 additions and 17 deletions

View File

@@ -46,7 +46,6 @@ set(C_SRC
send_mosq.c send_mosq.h
socks_mosq.c
srv_mosq.c
strings_mosq.c
thread_mosq.c
../common/time_mosq.c ../common/time_mosq.h
tls_mosq.c

View File

@@ -78,7 +78,6 @@ OBJS= \
send_unsubscribe.o \
socks_mosq.o \
srv_mosq.o \
strings_mosq.o \
thread_mosq.o \
tls_mosq.o \
util_mosq.o \

View File

@@ -1,4 +1,5 @@
set(C_SRC
strings_common.c
utf8_common.c
)

View File

@@ -12,6 +12,7 @@ LOCAL_LIBADD+=
.PHONY : really clean install
OBJS= \
strings_common.o \
utf8_common.o
all : libmosquitto_common.a

View File

@@ -70,7 +70,6 @@ set (MOSQ_SRCS
send_unsuback.c
../lib/send_unsubscribe.c
session_expiry.c
../lib/strings_mosq.c
subs.c
sys_tree.c sys_tree.h
../common/time_mosq.c ../common/time_mosq.h

View File

@@ -136,7 +136,6 @@ OBJS_EXTERNAL= \
send_publish.o \
send_subscribe.o \
send_unsubscribe.o \
strings_mosq.o \
time_mosq.o \
tls_mosq.o \
util_mosq.o \
@@ -231,9 +230,6 @@ send_subscribe.o : ${R}/lib/send_subscribe.c ${R}/lib/send_mosq.h
send_unsubscribe.o : ${R}/lib/send_unsubscribe.c ${R}/lib/send_mosq.h
${CROSS_COMPILE}${CC} $(LOCAL_CPPFLAGS) $(LOCAL_CFLAGS) -c $< -o $@
strings_mosq.o : ${R}/lib/strings_mosq.c mosquitto_broker_internal.h
${CROSS_COMPILE}${CC} $(LOCAL_CPPFLAGS) $(LOCAL_CFLAGS) -c $< -o $@
time_mosq.o : ${R}/common/time_mosq.c ${R}/common/time_mosq.h
${CROSS_COMPILE}${CC} $(LOCAL_CPPFLAGS) $(LOCAL_CFLAGS) -c $< -o $@

View File

@@ -7,7 +7,6 @@ add_executable(lib-test
property_user_read.c
property_write.c
property_value.c
strings_test.c
stubs.c
util_topic_test.c
# main test files
@@ -17,7 +16,6 @@ add_executable(lib-test
../../../lib/packet_datatypes.c
../../../lib/packet_mosq.c
../../../lib/property_mosq.c
../../../lib/strings_mosq.c
../../../lib/util_mosq.c
../../../lib/util_topic.c
)

View File

@@ -22,7 +22,6 @@ TEST_OBJS = \
property_user_read.o \
property_write.o \
property_value.o \
strings_test.o \
stubs.o \
util_topic_test.o
@@ -32,7 +31,6 @@ LIB_OBJS = \
${R}/lib/packet_datatypes.o \
${R}/lib/packet_mosq.o \
${R}/lib/property_mosq.o \
${R}/lib/strings_mosq.o \
${R}/lib/util_mosq.o \
${R}/lib/util_topic.o
@@ -65,9 +63,6 @@ ${R}/lib/packet_mosq.o : ${R}/lib/packet_mosq.c
${R}/lib/property_mosq.o : ${R}/lib/property_mosq.c
$(MAKE) -C ${R}/lib/ property_mosq.o
${R}/lib/strings_mosq.o : ${R}/lib/strings_mosq.c
$(MAKE) -C ${R}/lib/ strings_mosq.o
${R}/lib/util_mosq.o : ${R}/lib/util_mosq.c
$(MAKE) -C ${R}/lib/ util_mosq.o

View File

@@ -11,7 +11,6 @@ int init_property_read_tests(void);
int init_property_user_read_tests(void);
int init_property_write_tests(void);
int init_property_value_tests(void);
int init_strings_tests(void);
int init_util_topic_tests(void);
int init_misc_trim_tests(void);
@@ -37,7 +36,6 @@ int main(int argc, char *argv[])
|| init_property_value_tests()
|| init_util_topic_tests()
|| init_misc_trim_tests()
|| init_strings_tests()
){
CU_cleanup_registry();

View File

@@ -1,6 +1,7 @@
add_executable(libcommon-test
utf8.c
strings_test.c
test.c
utf8.c
)
target_link_libraries(libcommon-test

View File

@@ -13,6 +13,7 @@ ifeq ($(WITH_TLS),yes)
endif
TEST_OBJS = \
strings_test.o \
test.o \
utf8.o \

View File

@@ -4,6 +4,7 @@
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
int init_strings_tests(void);
int init_utf8_tests(void);
int main(int argc, char *argv[])
@@ -19,6 +20,7 @@ int main(int argc, char *argv[])
}
if(0
|| init_strings_tests()
|| init_utf8_tests()
){