mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
feat: add fputc wrapper to IO (#1417)
* feat: add fputc wrapper to IO fputc is a low-level function that writes a single C character to a file. We can use this as a basis for more elegant APIs. The signature matches that of the C standard library function for compatibility, which takes an Int instead of a char. However, the documentation notes that the int argument is converted to an unsigned char. * doc: fix typos for fgetc and fputc docs
This commit is contained in:
parent
5d530b7491
commit
9d9f982ce8
@ -16,8 +16,10 @@ module are wrappers around the C standard library.")
|
|||||||
(register stderr (Ptr FILE) "stderr")
|
(register stderr (Ptr FILE) "stderr")
|
||||||
(doc get-char "gets a character from stdin (thin wrapper for getchar() from C standard library).")
|
(doc get-char "gets a character from stdin (thin wrapper for getchar() from C standard library).")
|
||||||
(register get-char (Fn [] Int) "getchar")
|
(register get-char (Fn [] Int) "getchar")
|
||||||
(doc fgetc "gets a character from file (thin wrapper for the from C standard library).")
|
(doc fgetc "gets a character from file (thin wrapper for fgetc from the C standard library).")
|
||||||
(register fgetc (Fn [(Ptr FILE)] Int) "fgetc")
|
(register fgetc (Fn [(Ptr FILE)] Int) "fgetc")
|
||||||
|
(doc fputc "writes a character to a file (thin wrapper for fputc from the C standard library).")
|
||||||
|
(register fputc (Fn [Int (Ptr FILE)] Int) "fputc")
|
||||||
(doc EOF "the End-Of-File character as a literal (thin wrapper for the C standard library)")
|
(doc EOF "the End-Of-File character as a literal (thin wrapper for the C standard library)")
|
||||||
(register EOF Int "EOF")
|
(register EOF Int "EOF")
|
||||||
(private fopen-)
|
(private fopen-)
|
||||||
|
Loading…
Reference in New Issue
Block a user