From 2518f1c0e900d4c0a640c47235928f2c6d8228fa Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 10 Oct 2011 23:09:49 -0700 Subject: [PATCH] io.streams.c: Document fputc primitive --- core/io/streams/c/c-docs.factor | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/io/streams/c/c-docs.factor b/core/io/streams/c/c-docs.factor index f3801ba941..7208c7bdc8 100644 --- a/core/io/streams/c/c-docs.factor +++ b/core/io/streams/c/c-docs.factor @@ -14,6 +14,7 @@ ARTICLE: "io.streams.c" "ANSI C streams" fwrite fflush fclose + fputc fgetc fread-unsafe } @@ -56,15 +57,15 @@ HELP: fclose ( alien -- ) { $values { "alien" "a C FILE* handle" } } { $description "Closes a C FILE* handle." } ; -HELP: fgetc ( alien -- ch/f ) -{ $values { "alien" "a C FILE* handle" } { "ch/f" "a character or " { $link f } } } +HELP: fgetc ( alien -- byte/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." } { $errors "Throws an error if the input operation failed." } ; -HELP: fputc ( alien -- ch/f ) -{ $values { "alien" "a C FILE* handle" } { "ch/f" "a character or " { $link f } } } -{ $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." } ; +HELP: fputc ( byte alien -- ch/f ) +{ $values { "byte" "an integer from 0 to 255" } { "alien" "a C FILE* handle" } } +{ $description "Writes a single byte to a C FILE* handle." } +{ $errors "Throws an error if the output operation failed." } ; HELP: fread-unsafe ( n buf alien -- str/f ) { $values { "n" "a positive integer" } { "buf" c-ptr } { "alien" "a C FILE* handle" } { "count" integer } }