1e3514079Sopenharmony_ci/* 2e3514079Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3e3514079Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e3514079Sopenharmony_ci * you may not use this file except in compliance with the License. 5e3514079Sopenharmony_ci * You may obtain a copy of the License at 6e3514079Sopenharmony_ci * 7e3514079Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e3514079Sopenharmony_ci * 9e3514079Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e3514079Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e3514079Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e3514079Sopenharmony_ci * See the License for the specific language governing permissions and 13e3514079Sopenharmony_ci * limitations under the License. 14e3514079Sopenharmony_ci */ 15e3514079Sopenharmony_ci 16e3514079Sopenharmony_ci#ifndef OHOS_GLOBAL_H 17e3514079Sopenharmony_ci#define OHOS_GLOBAL_H 18e3514079Sopenharmony_ci 19e3514079Sopenharmony_ci#include <stdint.h> 20e3514079Sopenharmony_ci 21e3514079Sopenharmony_ci#ifdef __cplusplus 22e3514079Sopenharmony_ci#if __cplusplus 23e3514079Sopenharmony_ciextern "C" { 24e3514079Sopenharmony_ci#endif 25e3514079Sopenharmony_ci#endif // __cplusplus 26e3514079Sopenharmony_ci 27e3514079Sopenharmony_ci#define RES_CONFIG_NUM_OFFSET 132 28e3514079Sopenharmony_ci#define INDEX_DEFAULT_OFFSET 4 29e3514079Sopenharmony_ci#define VALUE_LENGTH_OFFSET 2 30e3514079Sopenharmony_ci#define OFFSET_VALUE_STEP 8 31e3514079Sopenharmony_ci#define ALL_PARAM_LENGTH 4 32e3514079Sopenharmony_ci#define INVALID_OFFSET 0 33e3514079Sopenharmony_ci#define MAX_LANGUAGE_LENGTH 4 34e3514079Sopenharmony_ci#define MAX_REGION_LENGTH 4 35e3514079Sopenharmony_ci 36e3514079Sopenharmony_ciint32_t GLOBAL_GetValueById(uint32_t id, const char *path, char **value); 37e3514079Sopenharmony_ciint32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value); 38e3514079Sopenharmony_civoid GLOBAL_ConfigLanguage(const char *appLanguage); 39e3514079Sopenharmony_ciint32_t GLOBAL_GetLanguage(char *language, uint8_t len); 40e3514079Sopenharmony_ciint32_t GLOBAL_GetRegion(char *region, uint8_t len); 41e3514079Sopenharmony_ciint32_t GLOBAL_IsRTL(void); 42e3514079Sopenharmony_ci 43e3514079Sopenharmony_ci#ifdef __cplusplus 44e3514079Sopenharmony_ci#if __cplusplus 45e3514079Sopenharmony_ci} 46e3514079Sopenharmony_ci#endif 47e3514079Sopenharmony_ci#endif // __cplusplus 48e3514079Sopenharmony_ci 49e3514079Sopenharmony_ci#endif // OHOS_GLOBAL_H 50