2016-12-06 17:05:56 +00:00
|
|
|
|
#ifndef __LIB_EX_UTIL_H__
|
|
|
|
|
#define __LIB_EX_UTIL_H__
|
|
|
|
|
|
|
|
|
|
#include <ex/ex_types.h>
|
2017-01-08 15:53:37 +00:00
|
|
|
|
#include <ex/ex_str.h>
|
|
|
|
|
|
|
|
|
|
#ifdef EX_OS_WIN32
|
|
|
|
|
# include <time.h>
|
|
|
|
|
//# include <io.h>
|
|
|
|
|
//# include <stdio.h>
|
|
|
|
|
// #include <direct.h>
|
|
|
|
|
#else
|
|
|
|
|
// #include <dirent.h>
|
2017-01-11 12:04:11 +00:00
|
|
|
|
# include <dlfcn.h>
|
2017-01-08 15:53:37 +00:00
|
|
|
|
# include <sys/time.h>
|
|
|
|
|
#endif
|
2016-12-06 17:05:56 +00:00
|
|
|
|
|
|
|
|
|
EX_BOOL ex_initialize(const char* lc_ctype);
|
|
|
|
|
|
|
|
|
|
void ex_free(void* buffer);
|
|
|
|
|
|
2017-01-08 15:53:37 +00:00
|
|
|
|
// <20><>haystack<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊhaystacklen<65>ֽڣ<D6BD><DAA3>в<EFBFBD><D0B2><EFBFBD>needle<6C><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊneedlelen<65><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL<4C><4C>ʾû<CABE><C3BB><EFBFBD>ҵ<EFBFBD>
|
|
|
|
|
const ex_u8* ex_memmem(const ex_u8* haystack, size_t haystacklen, const ex_u8* needle, size_t needlelen);
|
2016-12-06 17:05:56 +00:00
|
|
|
|
|
|
|
|
|
void ex_printf(const char* fmt, ...);
|
|
|
|
|
void ex_wprintf(const wchar_t* fmt, ...);
|
|
|
|
|
|
|
|
|
|
ex_u64 ex_get_tick_count(void);
|
|
|
|
|
void ex_sleep_ms(int ms);
|
|
|
|
|
|
2017-01-08 15:53:37 +00:00
|
|
|
|
EX_BOOL ex_localtime_now(int* t, struct tm* dt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FILE* ex_fopen(const ex_wstr& filename, const wchar_t* mode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EX_DYLIB_HANDLE ex_dlopen(const wchar_t* dylib_path);
|
|
|
|
|
void ex_dlclose(EX_DYLIB_HANDLE dylib);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// inet...
|
|
|
|
|
int ex_ip4_name(const struct sockaddr_in* src, char* dst, size_t size);
|
2016-12-06 17:05:56 +00:00
|
|
|
|
|
|
|
|
|
#endif // __LIB_EX_UTIL_H__
|