// // Created by xajhu on 2021/7/2 0002. // #ifndef DAEMON_AGENT_MISC_MISC_H #define DAEMON_AGENT_MISC_MISC_H #ifdef __cplusplus extern "C" { #endif const char *get_cur_process_dir(); const char *get_cur_process_name(); int file_exists(const char *pPath); const char *basename_v2(const char *path); int dirname_v2(const char *path, char *dir); unsigned long long get_partition_free_size(const char *pPartPath); int copy_file(const char *pSrc, const char *pDest); char *bin2hex(char *p, const unsigned char *cp, unsigned int count); int shell_with_output(const char *pCmd, char **pResult); int str_to_mac(const char *str, unsigned char mac[6]); int get_nic_info(const char *pName, unsigned int *pIp, unsigned int *pNetmask, unsigned int *pGateway, unsigned char *pMac); int str_to_ipaddr(const char *pIp, unsigned int *ipAddr); unsigned long long get_current_time_ms(); int process_lock_pidfile(char *pFilePath); void process_unlock_pidfile(); #ifdef __cplusplus } #endif #endif //DAEMON_AGENT_MISC_MISC_H