xref: /llvm-project/libc/src/stdio/gpu/vfprintf.cpp (revision 03dcefe08ecb68a3fedb7e9de6277df77371e9fc)
140effc7aSJoseph Huber //===-- GPU Implementation of vfprintf ------------------------------------===//
240effc7aSJoseph Huber //
340effc7aSJoseph Huber // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
440effc7aSJoseph Huber // See https://llvm.org/LICENSE.txt for license information.
540effc7aSJoseph Huber // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
640effc7aSJoseph Huber //
740effc7aSJoseph Huber //===----------------------------------------------------------------------===//
840effc7aSJoseph Huber 
940effc7aSJoseph Huber #include "src/stdio/vfprintf.h"
1040effc7aSJoseph Huber 
11c63112a9Slntue #include "hdr/types/FILE.h"
1240effc7aSJoseph Huber #include "src/__support/CPP/string_view.h"
1340effc7aSJoseph Huber #include "src/__support/arg_list.h"
1440effc7aSJoseph Huber #include "src/errno/libc_errno.h"
1540effc7aSJoseph Huber #include "src/stdio/gpu/vfprintf_utils.h"
1640effc7aSJoseph Huber 
17*03dcefe0SJoseph Huber namespace LIBC_NAMESPACE_DECL {
1840effc7aSJoseph Huber 
1940effc7aSJoseph Huber LLVM_LIBC_FUNCTION(int, vfprintf,
2040effc7aSJoseph Huber                    (::FILE *__restrict stream, const char *__restrict format,
2140effc7aSJoseph Huber                     va_list vlist)) {
2240effc7aSJoseph Huber   cpp::string_view str_view(format);
2340effc7aSJoseph Huber   int ret_val = vfprintf_internal(stream, format, str_view.size() + 1, vlist);
2440effc7aSJoseph Huber   return ret_val;
2540effc7aSJoseph Huber }
2640effc7aSJoseph Huber 
27*03dcefe0SJoseph Huber } // namespace LIBC_NAMESPACE_DECL
28