From 618b028da4461994c16d39a649f54bf1f8c72fa7 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 21 Feb 2020 11:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_util.h | 8 ++++---- api/source/mk_util.cpp | 8 ++++---- api/tests/server.c | 4 ++-- api/tests/websocket.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/include/mk_util.h b/api/include/mk_util.h index 99d7084c..e87599f8 100644 --- a/api/include/mk_util.h +++ b/api/include/mk_util.h @@ -45,20 +45,20 @@ API_EXPORT char* API_CALL mk_util_get_exe_path(); * @param relative_path 同目录下文件的路径相对,可以为null * @return 文件路径,使用完后需要自己free */ -API_EXPORT char* API_CALL mk_uitl_get_exe_dir(const char *relative_path); +API_EXPORT char* API_CALL mk_util_get_exe_dir(const char *relative_path); /** * 获取unix标准的系统时间戳 * @return 当前系统时间戳 */ -API_EXPORT uint64_t API_CALL mk_uitl_get_current_millisecond(); +API_EXPORT uint64_t API_CALL mk_util_get_current_millisecond(); /** * 获取时间字符串 * @param fmt 时间格式,譬如%Y-%m-%d %H:%M:%S * @return 时间字符串,使用完后需要自己free */ -API_EXPORT char* API_CALL mk_uitl_get_current_time_string(const char *fmt); +API_EXPORT char* API_CALL mk_util_get_current_time_string(const char *fmt); /** * 打印二进制为字符串 @@ -66,7 +66,7 @@ API_EXPORT char* API_CALL mk_uitl_get_current_time_string(const char *fmt); * @param len 数据长度 * @return 可打印的调试信息,使用完后需要自己free */ -API_EXPORT char* API_CALL mk_uitl_hex_dump(const void *buf, int len); +API_EXPORT char* API_CALL mk_util_hex_dump(const void *buf, int len); ///////////////////////////////////////////日志///////////////////////////////////////////// /** diff --git a/api/source/mk_util.cpp b/api/source/mk_util.cpp index 860af2a3..97bd9158 100644 --- a/api/source/mk_util.cpp +++ b/api/source/mk_util.cpp @@ -35,23 +35,23 @@ API_EXPORT char* API_CALL mk_util_get_exe_path(){ return strdup(exePath().data()); } -API_EXPORT char* API_CALL mk_uitl_get_exe_dir(const char *relative_path){ +API_EXPORT char* API_CALL mk_util_get_exe_dir(const char *relative_path){ if(relative_path){ return strdup((exeDir() + relative_path).data()); } return strdup(exeDir().data()); } -API_EXPORT uint64_t API_CALL mk_uitl_get_current_millisecond(){ +API_EXPORT uint64_t API_CALL mk_util_get_current_millisecond(){ return getCurrentMillisecond(); } -API_EXPORT char* API_CALL mk_uitl_get_current_time_string(const char *fmt){ +API_EXPORT char* API_CALL mk_util_get_current_time_string(const char *fmt){ assert(fmt); return strdup(getTimeStr(fmt).data()); } -API_EXPORT char* API_CALL mk_uitl_hex_dump(const void *buf, int len){ +API_EXPORT char* API_CALL mk_util_hex_dump(const void *buf, int len){ assert(buf && len > 0); return strdup(hexdump(buf,len).data()); } diff --git a/api/tests/server.c b/api/tests/server.c index af203e90..575313bb 100644 --- a/api/tests/server.c +++ b/api/tests/server.c @@ -396,8 +396,8 @@ static void s_on_exit(int sig){ flag = 0; } int main(int argc, char *argv[]) { - char *ini_path = mk_uitl_get_exe_dir("c_api.ini"); - char *ssl_path = mk_uitl_get_exe_dir("ssl.p12"); + char *ini_path = mk_util_get_exe_dir("c_api.ini"); + char *ssl_path = mk_util_get_exe_dir("ssl.p12"); mk_config config = { .ini = ini_path, diff --git a/api/tests/websocket.c b/api/tests/websocket.c index 845a78d6..7a95e586 100644 --- a/api/tests/websocket.c +++ b/api/tests/websocket.c @@ -195,8 +195,8 @@ void test_client(){ } int main(int argc, char *argv[]) { - char *ini_path = mk_uitl_get_exe_dir("c_api.ini"); - char *ssl_path = mk_uitl_get_exe_dir("ssl.p12"); + char *ini_path = mk_util_get_exe_dir("c_api.ini"); + char *ssl_path = mk_util_get_exe_dir("ssl.p12"); mk_config config = { .ini = ini_path,