1 //===- not-null-terminated-result-cxx.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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This header helps to maintain every function call checked by the 10 // NotNullTerminatedResult checker. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #pragma clang system_header 15 16 #include "not-null-terminated-result-c.h" 17 18 namespace std { 19 template <typename T> 20 struct basic_string { 21 basic_string(); 22 const T *data() const; 23 unsigned long size() const; 24 unsigned long length() const; 25 }; 26 typedef basic_string<char> string; 27 } // namespace std 28 29 size_t wcslen(const wchar_t *str); 30 31 template <size_t size> 32 char *strcpy(char (&dest)[size], const char *src); 33 template <size_t size> 34 wchar_t *wcscpy(wchar_t (&dest)[size], const wchar_t *src); 35 wchar_t *wcscpy(wchar_t *dest, const wchar_t *src); 36 37 template <size_t size> 38 errno_t strcpy_s(char (&dest)[size], const char *src); 39 template <size_t size> 40 errno_t wcscpy_s(wchar_t (&dest)[size], const wchar_t *src); 41 errno_t wcscpy_s(wchar_t *dest, size_t destSize, const wchar_t *src); 42 43 template <size_t size> 44 char *strncpy(char (&dest)[size], const char *src, size_t count); 45 template <size_t size> 46 wchar_t *wcsncpy(wchar_t (&dest)[size], const wchar_t *src, size_t count); 47 wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t count); 48 49 template <size_t size> 50 errno_t strncpy_s(char (&dest)[size], const char *src, size_t count); 51 template <size_t size> 52 errno_t wcsncpy_s(wchar_t (&dest)[size], const wchar_t *src, size_t length); 53 errno_t wcsncpy_s(wchar_t *dest, size_t destSize, const wchar_t *src, size_t c); 54 55 wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, size_t count); 56 errno_t wmemcpy_s(wchar_t *dest, size_t destSize, const wchar_t *src, size_t c); 57 58 wchar_t *wcschr(const wchar_t *str, int c); 59 int wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t count); 60 size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t count); 61 62 void *wmemchr(const void *buffer, int c, size_t count); 63 void *wmemmove(void *dest, const void *src, size_t count); 64 errno_t wmemmove_s(void *dest, size_t destSize, const void *src, size_t count); 65 void *wmemset(void *dest, int c, size_t count); 66