/* @(#) pf_io.c 96/12/23 1.12 */
/***************************************************************
** I/O subsystem for PForth based on 'C'
** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
** The pForth software code is dedicated to the public domain,
** and any third party may reproduce, distribute and modify
** the pForth software code or any derivative works thereof
** without any compensation or license. The pForth software
** code is provided on an "as is" basis without any warranty
** of any kind, including, without limitation, the implied
** warranties of merchantability and fitness for a particular
** purpose and their equivalents under the laws of any jurisdiction.
****************************************************************
** 941004 PLB Extracted IO calls from pforth_main.c
***************************************************************/
/***************************************************************
** Initialize I/O system.
/* System dependant terminal initialization. */
/***************************************************************
** Send single character to output stream.
Result
= sdTerminalOut(c
);
if( Result
< 0 ) EXIT(1);
gCurrentTask
->td_OUT
= 0;
/***************************************************************
** Send an entire string..
void ioType( const char *s
, int32 n
)
/***************************************************************
** Return single character from input device, always keyboard.
/**************************************************************
** Receive line from keyboard.
** Return number of characters enterred.
cell
ioAccept( char *buffer
, cell maxChars
)
DBUGX(("ioAccept(0x%x, 0x%x)\n", buffer
, len
));
if( len
> 0 ) /* Don't go beyond beginning of line. */
sdTerminalEcho( (char) c
);
/* NUL terminate line to simplify printing when debugging. */
if( len
< maxChars
) p
[len
] = '\0';
#define UNIMPLEMENTED(name) { MSG(name); MSG("is unimplemented!\n"); }
/***********************************************************************************/
/*********** File I/O **************************************************************/
/***********************************************************************************/
/* Provide stubs for standard file I/O */
int32
sdInputChar( FileStream
*stream
)
UNIMPLEMENTED("sdInputChar");
FileStream
*sdOpenFile( const char *FileName
, const char *Mode
)
UNIMPLEMENTED("sdOpenFile");
int32
sdFlushFile( FileStream
* Stream
)
int32
sdReadFile( void *ptr
, int32 Size
, int32 nItems
, FileStream
* Stream
)
UNIMPLEMENTED("sdReadFile");
int32
sdWriteFile( void *ptr
, int32 Size
, int32 nItems
, FileStream
* Stream
)
UNIMPLEMENTED("sdWriteFile");
int32
sdSeekFile( FileStream
* Stream
, int32 Position
, int32 Mode
)
UNIMPLEMENTED("sdSeekFile");
int32
sdTellFile( FileStream
* Stream
)
UNIMPLEMENTED("sdTellFile");
int32
sdCloseFile( FileStream
* Stream
)
UNIMPLEMENTED("sdCloseFile");