1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2014-2020. All rights reserved. 3 * Licensed under Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 8 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 9 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 * Description: By defining data type for ANSI string and including "input.inl", 12 * this file generates real underlying function used by scanf family API. 13 * Author: lishunda 14 * Create: 2014-02-25 15 */ 16 17 #define SECUREC_FORMAT_OUTPUT_INPUT 1 18 #ifdef SECUREC_FOR_WCHAR 19 #undef SECUREC_FOR_WCHAR 20 #endif 21 22 #include "secinput.h" 23 24 #include "input.inl" 25 SecIsDigit(SecInt ch)26SECUREC_INLINE int SecIsDigit(SecInt ch) 27 { 28 /* SecInt to unsigned char clear 571, use bit mask to clear negative return of ch */ 29 return isdigit((int)((unsigned int)(unsigned char)(ch) & 0xffU)); 30 } SecIsXdigit(SecInt ch)31SECUREC_INLINE int SecIsXdigit(SecInt ch) 32 { 33 return isxdigit((int)((unsigned int)(unsigned char)(ch) & 0xffU)); 34 } SecIsSpace(SecInt ch)35SECUREC_INLINE int SecIsSpace(SecInt ch) 36 { 37 return isspace((int)((unsigned int)(unsigned char)(ch) & 0xffU)); 38 } 39 40