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,