// Standard C++ <cstdio> header
// Copyright (C) Florian Negele

// This file is part of the Eigen Compiler Suite.

// The ECS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// The ECS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of the GNU General Public License version 3,
// the copyright holder grants you additional permissions to use
// this file as described in the ECS Runtime Support Exception.

// You should have received a copy of the GNU General Public License
// and a copy of the ECS Runtime Support Exception along with
// the ECS.  If not, see <https://www.gnu.org/licenses/>.

#ifndef ECS_CPP_CSTDIO_HEADER_INCLUDED
#define ECS_CPP_CSTDIO_HEADER_INCLUDED

#define EOF (-1)
#define NULL nullptr

namespace std
{
	struct FILE {};

	using size_t = decltype (sizeof 0);

	extern "C" FILE*const stderr;
	extern "C" FILE*const stdin;
	extern "C" FILE*const stdout;

	extern "C" auto fclose (FILE*) -> int;
	extern "C" auto fflush (FILE*) -> int;
	extern "C" auto fgetc (FILE*) -> int;
	extern "C" auto fopen (const char*, const char*) -> FILE*;
	extern "C" auto fputc (int, FILE*) -> int;
	extern "C" auto fputs (const char*, FILE*) -> int;
	extern "C" auto fread (void*, size_t, size_t, FILE*) -> size_t;
	extern "C" auto fwrite (const void*, size_t, size_t, FILE*) -> size_t;
	extern "C" auto getchar () -> int;
	extern "C" auto printf (const char*, ...) -> int;
	extern "C" auto putchar (int) -> int;
	extern "C" auto puts (const char*) -> int;
	extern "C" auto remove (const char*) -> int;
	extern "C" auto rename (const char*, const char*) -> int;
}

#endif // ECS_CPP_CSTDIO_HEADER_INCLUDED
