#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_VFPRINTF_INTERNAL_H
#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_VFPRINTF_INTERNAL_H
#include "src/__support/File/file.h"
#include "src/__support/arg_list.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/stdio/printf_core/core_structs.h"
#include "src/stdio/printf_core/printf_main.h"
#include "src/stdio/printf_core/writer.h"
#include "hdr/types/FILE.h"
namespace LIBC_NAMESPACE_DECL {
namespace internal {
#ifndef LIBC_COPT_STDIO_USE_SYSTEM_FILE
LIBC_INLINE int ferror_unlocked(FILE *f) {
return reinterpret_cast<LIBC_NAMESPACE::File *>(f)->error_unlocked();
}
LIBC_INLINE void flockfile(FILE *f) {
reinterpret_cast<LIBC_NAMESPACE::File *>(f)->lock();
}
LIBC_INLINE void funlockfile(FILE *f) {
reinterpret_cast<LIBC_NAMESPACE::File *>(f)->unlock();
}
LIBC_INLINE size_t fwrite_unlocked(const void *ptr, size_t size, size_t nmemb,
FILE *f) {
return reinterpret_cast<LIBC_NAMESPACE::File *>(f)->write_unlocked(
ptr, size * nmemb);
}
#else
LIBC_INLINE int ferror_unlocked(::FILE *f) { … }
LIBC_INLINE void flockfile(::FILE *f) { … }
LIBC_INLINE void funlockfile(::FILE *f) { … }
LIBC_INLINE size_t fwrite_unlocked(const void *ptr, size_t size, size_t nmemb,
::FILE *f) { … }
#endif
}
namespace printf_core {
LIBC_INLINE int file_write_hook(cpp::string_view new_str, void *fp) { … }
LIBC_INLINE int vfprintf_internal(::FILE *__restrict stream,
const char *__restrict format,
internal::ArgList &args) { … }
}
}
#endif