io.streams.c: Document fputc primitive
parent
5a072c57a6
commit
2518f1c0e9
|
@ -14,6 +14,7 @@ ARTICLE: "io.streams.c" "ANSI C streams"
|
||||||
fwrite
|
fwrite
|
||||||
fflush
|
fflush
|
||||||
fclose
|
fclose
|
||||||
|
fputc
|
||||||
fgetc
|
fgetc
|
||||||
fread-unsafe
|
fread-unsafe
|
||||||
}
|
}
|
||||||
|
@ -56,15 +57,15 @@ HELP: fclose ( alien -- )
|
||||||
{ $values { "alien" "a C FILE* handle" } }
|
{ $values { "alien" "a C FILE* handle" } }
|
||||||
{ $description "Closes a C FILE* handle." } ;
|
{ $description "Closes a C FILE* handle." } ;
|
||||||
|
|
||||||
HELP: fgetc ( alien -- ch/f )
|
HELP: fgetc ( alien -- byte/f )
|
||||||
{ $values { "alien" "a C FILE* handle" } { "ch/f" "a character or " { $link f } } }
|
{ $values { "alien" "a C FILE* handle" } { "byte/f" "an integer from 0 to 255 or " { $link f } } }
|
||||||
{ $description "Reads a single byte from a C FILE* handle, and outputs " { $link f } " on end of file." }
|
{ $description "Reads a single byte from a C FILE* handle, and outputs " { $link f } " on end of file." }
|
||||||
{ $errors "Throws an error if the input operation failed." } ;
|
{ $errors "Throws an error if the input operation failed." } ;
|
||||||
|
|
||||||
HELP: fputc ( alien -- ch/f )
|
HELP: fputc ( byte alien -- ch/f )
|
||||||
{ $values { "alien" "a C FILE* handle" } { "ch/f" "a character or " { $link f } } }
|
{ $values { "byte" "an integer from 0 to 255" } { "alien" "a C FILE* handle" } }
|
||||||
{ $description "Reads a single byte from a C FILE* handle, and outputs " { $link f } " on end of file." }
|
{ $description "Writes a single byte to a C FILE* handle." }
|
||||||
{ $errors "Throws an error if the input operation failed." } ;
|
{ $errors "Throws an error if the output operation failed." } ;
|
||||||
|
|
||||||
HELP: fread-unsafe ( n buf alien -- str/f )
|
HELP: fread-unsafe ( n buf alien -- str/f )
|
||||||
{ $values { "n" "a positive integer" } { "buf" c-ptr } { "alien" "a C FILE* handle" } { "count" integer } }
|
{ $values { "n" "a positive integer" } { "buf" c-ptr } { "alien" "a C FILE* handle" } { "count" integer } }
|
||||||
|
|
Loading…
Reference in New Issue