40 lines · c
1//===- not-null-terminated-result-c.h - Helper header -------------*- C -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This header helps to maintain every function call checked by the10// NotNullTerminatedResult checker.11//12//===----------------------------------------------------------------------===//13 14#pragma clang system_header15 16typedef __typeof__(sizeof(int)) size_t;17typedef int errno_t;18 19size_t strlen(const char *str);20void *malloc(size_t size);21char *strerror(int errnum);22errno_t strerror_s(char *buffer, size_t bufferSize, int errnum);23 24char *strcpy(char *dest, const char *src);25errno_t strcpy_s(char *dest, size_t destSize, const char *src);26char *strncpy(char *dest, const char *src, size_t count);27errno_t strncpy_s(char *dest, size_t destSize, const char *src, size_t count);28 29void *memcpy(void *dest, const void *src, size_t count);30errno_t memcpy_s(void *dest, size_t destSize, const void *src, size_t count);31 32char *strchr(char *str, int c);33int strncmp(const char *str1, const char *str2, size_t count);34size_t strxfrm(char *dest, const char *src, size_t count);35 36void *memchr(const void *buffer, int c, size_t count);37void *memmove(void *dest, const void *src, size_t count);38errno_t memmove_s(void *dest, size_t destSize, const void *src, size_t count);39void *memset(void *dest, int c, size_t count);40