1 #ifndef _CORE_STRING_H_ 2 #define _CORE_STRING_H_ 3 4 #if defined(__cplusplus) 5 extern "C" { 6 #endif 7 8 #include "core_stdinc.h" 9 #include "aiot_state_api.h" 10 #include "aiot_sysdep_api.h" 11 12 typedef struct { 13 uint32_t year; 14 uint32_t mon; 15 uint32_t day; 16 uint32_t hour; 17 uint32_t min; 18 uint32_t sec; 19 uint32_t msec; 20 } core_date_t; 21 22 int32_t core_str2uint(char *input, uint8_t input_len, uint32_t *output); 23 int32_t core_str2uint64(char *input, uint8_t input_len, uint64_t *output); 24 int32_t core_uint2str(uint32_t input, char *output, uint8_t *output_len); 25 int32_t core_uint642str(uint64_t input, char *output, uint8_t *output_len); 26 int32_t core_int2str(int32_t input, char *output, uint8_t *output_len); 27 int32_t core_hex2str(uint8_t *input, uint32_t input_len, char *output, uint8_t lowercase); 28 int32_t core_str2hex(char *input, uint32_t input_len, uint8_t *output); 29 int32_t core_strdup(aiot_sysdep_portfile_t *sysdep, char **dest, char *src, char *module_name); 30 int32_t core_sprintf(aiot_sysdep_portfile_t *sysdep, char **dest, char *fmt, char *src[], uint8_t count, 31 char *module_name); 32 int32_t core_json_value(const char *input, uint32_t input_len, const char *key, uint32_t key_len, char **value, 33 uint32_t *value_len); 34 int32_t core_utc2date(uint64_t utc, int8_t zone, core_date_t *date); 35 int32_t core_strcat(aiot_sysdep_portfile_t *sysdep, char **dest, char *src1, char *src2, char *module_name); 36 37 #if defined(__cplusplus) 38 } 39 #endif 40 41 #endif 42 43