arm-trusted-firmware/include/lib/libc/string.h
Jit Loon Lim f328bff667 feat(lib): implement memcpy_s in lib
To support memcpy_s for better security purpose
to avoid overflowing the dest while copy from src.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I63c3ea6a3e99c10d69be6bce04843c14b0a28a4d
2023-06-13 11:25:48 +08:00

34 lines
1.1 KiB
C

/*
* Copyright (c) 2012-2017 Roberto E. Vargas Caballero
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/*
* Portions copyright (c) 2018-2020, ARM Limited and Contributors.
* Portions copyright (c) 2023, Intel Corporation. All rights reserved.
* All rights reserved.
*/
#ifndef STRING_H
#define STRING_H
#include <stddef.h>
void *memcpy(void *dst, const void *src, size_t len);
int memcpy_s(void *dst, size_t dsize, void *src, size_t ssize);
void *memmove(void *dst, const void *src, size_t len);
int memcmp(const void *s1, const void *s2, size_t len);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
void *memchr(const void *src, int c, size_t len);
void *memrchr(const void *src, int c, size_t len);
char *strchr(const char *s, int c);
void *memset(void *dst, int val, size_t count);
size_t strlen(const char *s);
size_t strnlen(const char *s, size_t maxlen);
char *strrchr(const char *p, int ch);
size_t strlcpy(char * dst, const char * src, size_t dsize);
size_t strlcat(char * dst, const char * src, size_t dsize);
char *strtok_r(char *s, const char *delim, char **last);
#endif /* STRING_H */