// Rowley C Compiler, runtime support.
//
// Copyright (c) 2001, 2002 Rowley Associates Limited.
//
// This file may be distributed under the terms of the License Agreement
// provided with this software.
//
// THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

#ifndef __stdio_h
#define __stdio_h

// Again, can't just #include <stddef.h> to get a tranche of common
// definitions, nor #include <stdarg.h> to get va_list, so #include
// "__crossworks.h" to get the private versions of all.
#include "__crossworks.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef NULL
#define NULL 0
#endif

#ifndef EOF
#define EOF (-1)
#endif

#ifndef __SIZE_T_DEFINED
#define __SIZE_T_DEFINED
typedef __SIZE_T size_t;
#endif

int puts(const char *);
int putchar(int);
int getchar(void);
int sprintf(char *, const char *, ...);
int snprintf(char *, size_t, const char *, ...);
int vsnprintf(char *, size_t, const char *, __va_list);

int printf(const char *, ...);
int vprintf(const char *, __va_list);
int vsprintf(char *, const char *, __va_list);

int scanf(const char *, ...);
int sscanf(const char *, const char *, ...);
int vscanf(const char *, __va_list);
int vsscanf(const char *, const char *, __va_list);
char *gets(char *);

// Macro version of putchar.
#define putchar(x) __putchar(x)

#ifdef __cplusplus
}
#endif

#endif
