• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) Huawei Technologies Co., Ltd. 2014-2021. 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  * Create: 2014-02-25
14  */
15 
16 #define SECUREC_FORMAT_OUTPUT_INPUT 1
17 #ifdef SECUREC_FOR_WCHAR
18 #undef SECUREC_FOR_WCHAR
19 #endif
20 
21 #include "secinput.h"
22 
23 #include "input.inl"
24 
SecIsDigit(SecInt ch)25 SECUREC_INLINE int SecIsDigit(SecInt ch)
26 {
27     /* SecInt to unsigned char clear  571, use bit mask to clear negative return of ch */
28     return isdigit((int)((unsigned int)(unsigned char)(ch) & 0xffU));
29 }
SecIsXdigit(SecInt ch)30 SECUREC_INLINE int SecIsXdigit(SecInt ch)
31 {
32     return isxdigit((int)((unsigned int)(unsigned char)(ch) & 0xffU));
33 }
SecIsSpace(SecInt ch)34 SECUREC_INLINE int SecIsSpace(SecInt ch)
35 {
36     return isspace((int)((unsigned int)(unsigned char)(ch) & 0xffU));
37 }
38 
39