ID_CELLS,
/* DELETE-FILE */
ID_FILE_DELETE,
+ ID_FILE_FLUSH, /* FLUSH-FILE */
/* If you add a word here, take away one reserved word below. */
#ifdef PF_SUPPORT_FP
/* Only reserve space if we are adding FP so that we can detect
ID_RESERVED10,
ID_RESERVED11,
ID_RESERVED12,
- ID_RESERVED13,
ID_FP_D_TO_F,
ID_FP_FSTORE,
ID_FP_FTIMES,
#define THROW_PAIRS (-22)
#define THROW_FLOAT_STACK_UNDERFLOW ( -45)
#define THROW_QUIT (-56)
+#define THROW_FLUSH_FILE (-68)
/* THROW codes unique to pForth */
#define THROW_BYE (-256) /* Exit program. */
TOS = TOS | PF_FAM_BINARY_FLAG;
endcase;
+ case ID_FILE_FLUSH: /* ( fileid -- ior ) */
+ {
+ FileStream *Stream = (FileStream *) TOS;
+ TOS = (sdFlushFile( Stream ) == 0) ? 0 : THROW_FLUSH_FILE;
+ }
+ endcase;
+
case ID_FILL: /* ( caddr num charval -- ) */
{
register char *DstPtr;
CreateDicEntryC( ID_FILE_WRITE, "WRITE-FILE", 0 );
CreateDicEntryC( ID_FILE_POSITION, "FILE-POSITION", 0 );
CreateDicEntryC( ID_FILE_REPOSITION, "REPOSITION-FILE", 0 );
+ CreateDicEntryC( ID_FILE_FLUSH, "FLUSH-FILE", 0 );
CreateDicEntryC( ID_FILE_RO, "R/O", 0 );
CreateDicEntryC( ID_FILE_RW, "R/W", 0 );
CreateDicEntryC( ID_FILE_WO, "W/O", 0 );
: s= compare 0= ;
: $" state IF postpone s" else ['] s" execute THEN ; immediate
-
-\ FIXME: stubs for missing definition
-: flush-file drop -1 ;
+\ FIXME: stubs for missing definitions
: resize-file drop 2drop -1 ;
: rename-file 2drop 2drop -1 ;
: file-status 2drop 0 -1 ;
-
TESTING File Access word set
DECIMAL