#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
浏览源代码.
|
| #define | SECUREC_USING_STD_SECURE_LIB 0 |
| |
| #define | SECUREC_DISABLE_CRT_FUNC 0 |
| |
| #define | SECUREC_DISABLE_CRT_IMP 0 |
| |
| #define | SECUREC_IN_KERNEL 0 |
| |
| #define | SECUREC_EXPORT_KERNEL_SYMBOL 0 |
| |
| #define | SECUREC_ENABLE_SCANF_FILE 1 |
| |
| #define | SECUREC_ENABLE_WCHAR_FUNC 1 |
| |
| #define | SECUREC_SNPRINTF_TRUNCATED 1 |
| |
| #define | SECUREC_ENABLE_MEMSET 1 |
| |
| #define | SECUREC_ENABLE_MEMMOVE 1 |
| |
| #define | SECUREC_ENABLE_MEMCPY 1 |
| |
| #define | SECUREC_ENABLE_STRCPY 1 |
| |
| #define | SECUREC_ENABLE_STRNCPY 1 |
| |
| #define | SECUREC_ENABLE_STRCAT 1 |
| |
| #define | SECUREC_ENABLE_STRNCAT 1 |
| |
| #define | SECUREC_ENABLE_SPRINTF 1 |
| |
| #define | SECUREC_ENABLE_VSPRINTF 1 |
| |
| #define | SECUREC_ENABLE_SNPRINTF 1 |
| |
| #define | SECUREC_ENABLE_VSNPRINTF 1 |
| |
| #define | SECUREC_ENABLE_SSCANF 1 |
| |
| #define | SECUREC_ENABLE_VSSCANF 1 |
| |
| #define | SECUREC_ENABLE_SCANF 1 |
| |
| #define | SECUREC_ENABLE_VSCANF 1 |
| |
| #define | SECUREC_ENABLE_FSCANF 1 |
| |
| #define | SECUREC_ENABLE_VFSCANF 1 |
| |
| #define | SECUREC_ENABLE_STRTOK 1 |
| |
| #define | SECUREC_ENABLE_GETS 1 |
| |
| #define | SECUREC_HAVE_STDIO_H 1 |
| |
| #define | SECUREC_HAVE_STRING_H 1 |
| |
| #define | SECUREC_HAVE_STDLIB_H 1 |
| |
| #define | SECUREC_WITH_PERFORMANCE_ADDONS 1 |
| |
| #define | SECUREC_COMPATIBLE_LINUX_FORMAT |
| |
| #define | SECUREC_HAVE_STDDEF_H 1 |
| |
| #define | SECUREC_SUPPORT_FORMAT_WARNING 0 |
| |
| #define | SECUREC_ATTRIBUTE(x, y) |
| |
| #define | SECUREC_SUPPORT_BUILTIN_EXPECT 1 |
| |
| #define | SECUREC_LIKELY(x) (x) |
| |
| #define | SECUREC_UNLIKELY(x) (x) |
| |
| #define | SECUREC_STRING_MAX_LEN 0x7fffffffUL |
| |
| #define | SECUREC_WCHAR_STRING_MAX_LEN (SECUREC_STRING_MAX_LEN / sizeof(wchar_t)) |
| |
| #define | SECUREC_MEM_MAX_LEN 0x7fffffffUL |
| |
| #define | SECUREC_WCHAR_MEM_MAX_LEN (SECUREC_MEM_MAX_LEN / sizeof(wchar_t)) |
| |
| #define | SECUREC_SUPPORT_STRTOLD 0 |
| |
| #define | SECUREC_TWO_MIN(a, b) ((a) < (b) ? (a) : (b)) |
| |
| #define | SECUREC_STRNCPY_SM(dest, destMax, src, count) |
| |
| #define | SECUREC_STRCPY_SM(dest, destMax, src) |
| |
| #define | SECUREC_STRCAT_SM(dest, destMax, src) strcat_s((dest), (destMax), (src)) |
| |
| #define | SECUREC_STRNCAT_SM(dest, destMax, src, count) strncat_s((dest), (destMax), (src), (count)) |
| |
| #define | SECUREC_MEMCPY_SM(dest, destMax, src, count) |
| |
| #define | SECUREC_MEMSET_SM(dest, destMax, c, count) |
| |
◆ SECUREC_ATTRIBUTE
| #define SECUREC_ATTRIBUTE |
( |
|
x, |
|
|
|
y |
|
) |
| |
◆ SECUREC_COMPATIBLE_LINUX_FORMAT
| #define SECUREC_COMPATIBLE_LINUX_FORMAT |
◆ SECUREC_DISABLE_CRT_FUNC
| #define SECUREC_DISABLE_CRT_FUNC 0 |
◆ SECUREC_DISABLE_CRT_IMP
| #define SECUREC_DISABLE_CRT_IMP 0 |
◆ SECUREC_ENABLE_FSCANF
| #define SECUREC_ENABLE_FSCANF 1 |
◆ SECUREC_ENABLE_GETS
| #define SECUREC_ENABLE_GETS 1 |
◆ SECUREC_ENABLE_MEMCPY
| #define SECUREC_ENABLE_MEMCPY 1 |
◆ SECUREC_ENABLE_MEMMOVE
| #define SECUREC_ENABLE_MEMMOVE 1 |
◆ SECUREC_ENABLE_MEMSET
| #define SECUREC_ENABLE_MEMSET 1 |
◆ SECUREC_ENABLE_SCANF
| #define SECUREC_ENABLE_SCANF 1 |
◆ SECUREC_ENABLE_SCANF_FILE
| #define SECUREC_ENABLE_SCANF_FILE 1 |
◆ SECUREC_ENABLE_SNPRINTF
| #define SECUREC_ENABLE_SNPRINTF 1 |
◆ SECUREC_ENABLE_SPRINTF
| #define SECUREC_ENABLE_SPRINTF 1 |
◆ SECUREC_ENABLE_SSCANF
| #define SECUREC_ENABLE_SSCANF 1 |
◆ SECUREC_ENABLE_STRCAT
| #define SECUREC_ENABLE_STRCAT 1 |
◆ SECUREC_ENABLE_STRCPY
| #define SECUREC_ENABLE_STRCPY 1 |
◆ SECUREC_ENABLE_STRNCAT
| #define SECUREC_ENABLE_STRNCAT 1 |
◆ SECUREC_ENABLE_STRNCPY
| #define SECUREC_ENABLE_STRNCPY 1 |
◆ SECUREC_ENABLE_STRTOK
| #define SECUREC_ENABLE_STRTOK 1 |
◆ SECUREC_ENABLE_VFSCANF
| #define SECUREC_ENABLE_VFSCANF 1 |
◆ SECUREC_ENABLE_VSCANF
| #define SECUREC_ENABLE_VSCANF 1 |
◆ SECUREC_ENABLE_VSNPRINTF
| #define SECUREC_ENABLE_VSNPRINTF 1 |
◆ SECUREC_ENABLE_VSPRINTF
| #define SECUREC_ENABLE_VSPRINTF 1 |
◆ SECUREC_ENABLE_VSSCANF
| #define SECUREC_ENABLE_VSSCANF 1 |
◆ SECUREC_ENABLE_WCHAR_FUNC
| #define SECUREC_ENABLE_WCHAR_FUNC 1 |
◆ SECUREC_EXPORT_KERNEL_SYMBOL
| #define SECUREC_EXPORT_KERNEL_SYMBOL 0 |
◆ SECUREC_HAVE_STDDEF_H
| #define SECUREC_HAVE_STDDEF_H 1 |
◆ SECUREC_HAVE_STDIO_H
| #define SECUREC_HAVE_STDIO_H 1 |
◆ SECUREC_HAVE_STDLIB_H
| #define SECUREC_HAVE_STDLIB_H 1 |
◆ SECUREC_HAVE_STRING_H
| #define SECUREC_HAVE_STRING_H 1 |
◆ SECUREC_IN_KERNEL
| #define SECUREC_IN_KERNEL 0 |
◆ SECUREC_LIKELY
| #define SECUREC_LIKELY |
( |
|
x | ) |
(x) |
◆ SECUREC_MEM_MAX_LEN
| #define SECUREC_MEM_MAX_LEN 0x7fffffffUL |
◆ SECUREC_MEMCPY_SM
| #define SECUREC_MEMCPY_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
src, |
|
|
|
count |
|
) |
| |
值: (!(((
size_t)(destMax) == 0) || \
((
size_t)(count) > (
size_t)(destMax)) || ((
void *)(dest)) ==
NULL || ((
const void *)(src) ==
NULL)) ? \
(memcpy((dest), (src), (count)),
EOK) : \
(
memcpy_s((dest), (destMax), (src), (count))))
#define NULL
Definition common_def.h:21
UINT32 size_t
Definition los_typedef.h:78
errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count)
#define EOK
Definition securec.h:57
#define SECUREC_MEM_MAX_LEN
Definition securectype.h:423
◆ SECUREC_MEMSET_SM
| #define SECUREC_MEMSET_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
c, |
|
|
|
count |
|
) |
| |
值:
((
void *)(dest) ==
NULL) || ((
size_t)(count) > (
size_t)(destMax))) ? \
(memset((dest), (c), (count)),
EOK) : \
(
memset_s((dest), (destMax), (c), (count))))
errno_t memset_s(void *dest, size_t destMax, int c, size_t count)
◆ SECUREC_SNPRINTF_TRUNCATED
| #define SECUREC_SNPRINTF_TRUNCATED 1 |
◆ SECUREC_STRCAT_SM
| #define SECUREC_STRCAT_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
src |
|
) |
| strcat_s((dest), (destMax), (src)) |
◆ SECUREC_STRCPY_SM
| #define SECUREC_STRCPY_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
src |
|
) |
| |
值: (((
void *)(dest) !=
NULL && (
const void *)(src) !=
NULL && (
size_t)(destMax) > 0 && \
(strlen(src) + 1) <= (
size_t)(destMax)) ? (memcpy((dest), (src), strlen(src) + 1),
EOK) : \
errno_t strcpy_error(char *strDest, size_t destMax, const char *strSrc)
#define SECUREC_STRING_MAX_LEN
Definition securectype.h:417
◆ SECUREC_STRING_MAX_LEN
| #define SECUREC_STRING_MAX_LEN 0x7fffffffUL |
◆ SECUREC_STRNCAT_SM
| #define SECUREC_STRNCAT_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
src, |
|
|
|
count |
|
) |
| strncat_s((dest), (destMax), (src), (count)) |
◆ SECUREC_STRNCPY_SM
| #define SECUREC_STRNCPY_SM |
( |
|
dest, |
|
|
|
destMax, |
|
|
|
src, |
|
|
|
count |
|
) |
| |
值: (((
void *)(dest) !=
NULL && (
const void *)(src) !=
NULL && (
size_t)(destMax) > 0 && \
(
SECUREC_TWO_MIN((
size_t)(count), strlen(src)) + 1) <= (
size_t)(destMax)) ? \
(((
size_t)(count) < strlen(src)) ? (memcpy((dest), (src), (count)), *((
char *)(dest) + (count)) =
'\0',
EOK) : \
(memcpy((dest), (src), strlen(src) + 1),
EOK)) : (
strncpy_error((dest), (destMax), (src), (count))))
errno_t strncpy_error(char *strDest, size_t destMax, const char *strSrc, size_t count)
#define SECUREC_TWO_MIN(a, b)
Definition securectype.h:483
◆ SECUREC_SUPPORT_BUILTIN_EXPECT
| #define SECUREC_SUPPORT_BUILTIN_EXPECT 1 |
◆ SECUREC_SUPPORT_FORMAT_WARNING
| #define SECUREC_SUPPORT_FORMAT_WARNING 0 |
◆ SECUREC_SUPPORT_STRTOLD
| #define SECUREC_SUPPORT_STRTOLD 0 |
◆ SECUREC_TWO_MIN
| #define SECUREC_TWO_MIN |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) < (b) ? (a) : (b)) |
◆ SECUREC_UNLIKELY
| #define SECUREC_UNLIKELY |
( |
|
x | ) |
(x) |
◆ SECUREC_USING_STD_SECURE_LIB
| #define SECUREC_USING_STD_SECURE_LIB 0 |
◆ SECUREC_WCHAR_MEM_MAX_LEN
◆ SECUREC_WCHAR_STRING_MAX_LEN
◆ SECUREC_WITH_PERFORMANCE_ADDONS
| #define SECUREC_WITH_PERFORMANCE_ADDONS 1 |