1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef BASE_INTERFACE_H 17 #define BASE_INTERFACE_H 18 19 #include <stdint.h> 20 #include <stdbool.h> 21 22 #if __cplusplus 23 extern "C" { 24 #endif 25 26 HI_S32 ConfBaseInit(const char* cfgFilePath); 27 bool IsMainThrd(void); 28 void ConfBaseExt(void); 29 30 int GetCfgInt(const char* key, int defVal); 31 double GetCfgDouble(const char* key, double defVal); 32 bool GetCfgBool(const char* key, bool defVal); 33 const char* GetCfgStr(const char* key, const char* defVal); 34 35 int SectGetCfgInt(const char* section, const char* field, int defVal); 36 double SectGetCfgDouble(const char* section, const char* field, double defVal); 37 bool SectGetCfgBool(const char* section, const char* field, bool defVal); 38 const char* SectGetCfgStr(const char* section, const char* field, const char* defVal); 39 40 int HiStrincmp(const char *s1, const char *s2, size_t n); 41 int HiStrxfrm(char *s1, char *s2, int n); 42 43 #ifdef __cplusplus 44 } 45 #endif 46 #endif 47