/****************************************************************************/
/* Copyright 2016 MBARI                                                     */
/****************************************************************************/
/* Summary  : Simplified, integer-only standard I/O for OASIS5 on PIC32		*/
/* Filename : istdio.h                                                      */
/* Author   : Robert Herlien (rah)                                          */
/* Project  : OASIS Mooring Replacement (OASIS5)                            */
/* Revision: 1.0                                                            */
/* Created  : 06/28/2016                                                    */
/*                                                                          */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*                                                                          */
/****************************************************************************/
/* Modification History:                                                    */
/* 28jun2016 rah - created                                                  */
/****************************************************************************/

#ifndef	_STDIO_H_
#define	_STDIO_H_

#ifndef	_STDDEF_H_
#include <stddef.h>
#endif /* _STDDEF_H_ */

#ifndef	_STDARG_H_
#include <stdarg.h>
#endif /* _STDARG_H_ */

#if 0
extern	struct	_iobuf {
	char *		_ptr;
	int		_cnt;
	char *		_base;
	unsigned short	_flag;
	short		_file;
	size_t		_size;
} _iob[_NFILE];


#define	FILE		struct _iobuf

#define	EOF		(-1)

#define	SEEK_SET	0
#define	SEEK_CUR	1
#define	SEEK_END	2
#define	TMP_MAX		255
#endif

#define FILE		void

int			printf(const char *format, ...);
int			sprintf(char *, const char *, ...);
int			snprintf(char *str, size_t size, const char * fmt, ...);

extern FILE *fopen(const char *, const char *);
extern int	fclose(FILE *);
extern int	fflush(FILE *);
extern int	fgetc(FILE *);
extern int	ungetc(int, FILE *);
extern int	fputc(int, FILE *);
extern int	getw(FILE *);
extern int	putw(int, FILE *);
extern int	fputs(const char *, FILE *);
extern int	fread(void *, size_t, size_t, FILE *);
extern size_t	fwrite(const void *, size_t, size_t, FILE *);
extern int	fseek(FILE *, long, int);
extern int	rewind(FILE *);
extern int	fprintf(FILE *, const char *, ...);
extern int	fscanf(FILE *, const char *, ...);
extern int	vfprintf(FILE *, const char *, va_list);
extern int	vfscanf(FILE *, const char *, va_list);
extern int	rename(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern FILE *fdopen(int, const char *);
extern long	ftell(FILE *);
extern char *fgets(char *, int, FILE *);
extern void	perror(const char *);


extern char *gets(char *);
extern int	puts(const char *);
extern int	scanf(const char *, ...);
extern int	sscanf(const char *, const char *, ...);
extern int 	vprintf(const char *, va_list);
extern int	vsprintf(char *, const char *, va_list);
extern int	vsnprintf(char *str, size_t size, const char *format, va_list ap);
extern int	vscanf(const char *, va_list ap);
extern int	vsscanf(const char *, const char *, va_list);


#endif	/* _STDIO_H_ */
