1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef HDF_CSTRING_H 10 #define HDF_CSTRING_H 11 12 #include "hdf_base.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif /* __cplusplus */ 17 18 struct HdfCString { 19 int size; 20 char value[0]; 21 }; 22 23 uint32_t HdfStringMakeHashKey(const char *key, uint32_t mask); 24 struct HdfCString *HdfCStringObtain(const char *str); 25 void HdfCStringRecycle(struct HdfCString *inst); 26 char *HdfStringCopy(const char *src); 27 28 #ifdef __cplusplus 29 } 30 #endif /* __cplusplus */ 31 32 #endif /* HDF_CSTRING_H */ 33