/***********************************************************************
 *
 Copyright © 1995 - 1998, 3Com Corporation or its subsidiaries ("3Com").  
 All rights reserved.
   
 This software may be copied and used solely for developing products for 
 the Palm Computing platform and for archival and backup purposes.  Except 
 for the foregoing, no part of this software may be reproduced or transmitted 
 in any form or by any means or used to make any derivative work (such as 
 translation, transformation or adaptation) without express written consent 
 from 3Com.

 3Com reserves the right to revise this software and to make changes in content 
 from time to time without obligation on the part of 3Com to provide notification 
 of such revision or changes.  
 3COM MAKES NO REPRESENTATIONS OR WARRANTIES THAT THE SOFTWARE IS FREE OF ERRORS 
 OR THAT THE SOFTWARE IS SUITABLE FOR YOUR USE.  THE SOFTWARE IS PROVIDED ON AN 
 "AS IS" BASIS.  3COM MAKES NO WARRANTIES, TERMS OR CONDITIONS, EXPRESS OR IMPLIED, 
 EITHER IN FACT OR BY OPERATION OF LAW, STATUTORY OR OTHERWISE, INCLUDING WARRANTIES, 
 TERMS, OR CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND 
 SATISFACTORY QUALITY.

 TO THE FULL EXTENT ALLOWED BY LAW, 3COM ALSO EXCLUDES FOR ITSELF AND ITS SUPPLIERS 
 ANY LIABILITY, WHETHER BASED IN CONTRACT OR TORT (INCLUDING NEGLIGENCE), FOR 
 DIRECT, INCIDENTAL, CONSEQUENTIAL, INDIRECT, SPECIAL, OR PUNITIVE DAMAGES OF 
 ANY KIND, OR FOR LOSS OF REVENUE OR PROFITS, LOSS OF BUSINESS, LOSS OF INFORMATION 
 OR DATA, OR OTHER FINANCIAL LOSS ARISING OUT OF OR IN CONNECTION WITH THIS SOFTWARE, 
 EVEN IF 3COM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

 3Com, HotSync, Palm Computing, and Graffiti are registered trademarks, and 
 Palm III and Palm OS are trademarks of 3Com Corporation or its subsidiaries.

 IF THIS SOFTWARE IS PROVIDED ON A COMPACT DISK, THE OTHER SOFTWARE AND 
 DOCUMENTATION ON THE COMPACT DISK ARE SUBJECT TO THE LICENSE AGREEMENT 
 ACCOMPANYING THE COMPACT DISK.
 
 ****************************************************************************
 *
 * PROJECT:  Pilot TCP/IP Library
 * FILE:     unix/stdio.h
 *
 * DESCRIPTION:
 *	  This module contains the interface definitions that are 
 *	typically found in the unix header <stdio.h> for use by 
 * Pilot applications that wish to use the sockets API calls.
 *
 **********************************************************************/


#ifndef __stdio_h
#define __stdio_h

#include <stdarg.h>

#define		EOF					-1
#define		STDIN_FILENO		sysFileDescStdIn


// The following macros are only included if we're building without the
//  help of the standard ANSI C library, i.e. Native Pilot code only.
// Essentially, if you include <stdlib.h> above this header, this stuff
//  does not get used.
#ifndef		_STDLIB
	#define		sprintf				StrPrintF
	#define		vsprintf(x,y,z)	StrVPrintF(x,(const CharPtr)y,z)

#else
	int vsprintf(char *, const char *, _Va_list);

#endif



// The following are macros that simply substitute an error code
//  for functions which have no equivalent in the PilotOS. To
//  ignore these, #define IGNORE_STDIO_STUBS ahead of this header
#ifndef	IGNORE_STDIO_STUBS
#define		stderr				((unsigned char*)-1)
#define		stdout				((unsigned char*)-1)
#define		stdin					((char*)-1)
#define		STDOUT_FILENO		-1	
		 
#define		fclose(x)			(-1)
#define		fopen(x,y)			(0)
#define		tmpnam(x)			(0)
#define		S_ISREG(x)			(0)

#define		fflush(x)			0
#define		fread(a,b,c,d)		(0)
#define		fwrite(a,b,c,d)	(0)
#define		ferror(x)			(-1)

#define		unlink(s)			(-1)
#define		rmdir(x)				(-1)
#define		mkdir(x)				(-1)
#define		rename(x,y)			(-1)
#define		open(x,y)			(-1)
#define		getcwd(x,y)			(0)

#endif	//IGNORE_STDIO_STUBS


// Function prototypes
int sscanf(const char *, const char *, ...);


#endif  /* !__stdio_h */