lib_LTLIBRARIES = libplp.la
libplp_la_SOURCES = \
- retval.h \
+ config.c config.h \
log.h \
log_config.c \
- config.c config.h
+ str_util.c str_util.h \
+ retval.h
libplp_la_LDFLAGS = $(SRC_LIBS) $(all_libraries) -version-info 1:0:0 -no-undefined
AM_CPPFLAGS = $(SRC_CFLAGS)
DISTCLEANFILES = Makefile.in
libplpincludedir=$(includedir)/plp
libplpinclude_HEADERS = \
- retval.h \
+ config.h \
log.h \
- config.h
+ retval.h \
+ str_util.h
#include <stdio.h>
#include "../src/config.h"
-int main(int argc, char** argv) {
+void test_config() {
char work_dir[FILENAME_MAX];
getcwd(work_dir, sizeof(work_dir));
"mysection_name",
"myoption_name",
"my_option_value2");
+}
+
+int main(int argc, char** argv) {
+ test_config();
return 0;
}
#include "log.h"
-int main(int argc, char** argv)
-{
+#include "../src/str_util.h"
+
+void test_logging() {
log_debug("debug");
log_debug("debug v%d\n", 2);
log_info("info\n");
log_warning("warning v%d\n", 2);
log_error("error\n");
log_error("error v%d\n", 2);
+}
+
+void test_str_util() {
+ char *res_str;
+ char b_arr[] = {0x1, 0x11, 0x21, 0x31};
+
+ res_str = get_as_hex_str(b_arr, 4);
+ log_info("bytes: %s\n", res_str);
+ free(res_str);
+}
+
+int main(int argc, char** argv)
+{
+ test_logging();
+ test_str_util();
return 0;
}