Carp/core
Scott Olsen bf6df6405c
feat: add IO.fgetc (#1405)
* feat: add feof and ferror

These are C stdio functions that enable programmers to determine if a
file read resulted in an error or EOF encounter.

We can use these to power a definition of IO.fgetc, which is currently
not defined.

* feat: implement missing IO.fgetc

IO defined a function, fgetc (distinct from IO.Raw.fgetc) which actually
produced invalid code, since the name was not overridden and C does not
define IO_fgetc.

There was also a TODO to handle EOF conditions; so, I've implemented the
function, checking for EOF and error conditions using the Raw stdio
wrappers. IO.fgetc returns a Char in Success on success and an error
string on failure.

* refactor: distinguish EOF from errors in IO.fgetc

We now report whether or not the error encountered in fgetc was EOF.
Note that we don't yet report on the contents of other errors.
2022-03-28 10:16:51 +02:00
..
Array.carp feat: scan functions (#1339) 2021-10-22 06:59:40 +02:00
ArrayExt.carp core: update dcostring for range-or-default 2020-05-24 12:51:11 +02:00
Bench.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Binary.carp feat: add bytes->hex-string (#1354) 2021-11-06 11:24:17 +01:00
Blitable.carp feat: Remove address (#1223) 2021-05-27 22:04:46 +02:00
Bool.carp core: add Bool.zero 2020-06-23 12:26:53 +02:00
BoolExtras.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Box.carp feat: add box type (#1358) 2021-11-30 10:35:22 +01:00
Byte.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
carp_bench.h Replace return by pure. (#1009) 2020-11-24 06:09:15 +01:00
carp_binary.h all: various long fixes 2020-04-23 21:50:30 +02:00
carp_bool.h core: do not have short functions on single lines 2019-10-30 11:07:32 +01:00
carp_byte.h core: fix #688 by using the correct formatting macros\n\n(and pray that windows does c99) 2020-02-21 12:28:34 +01:00
carp_char.h feat: add Char.to-byte and Char.from-byte (#1187) 2021-03-16 11:14:16 +01:00
carp_debug.h Preserve includes order in generated output. 2019-10-03 00:23:27 +02:00
carp_double.h Long type to ensure longs are actually 64 bits. 2020-04-22 10:40:06 +02:00
carp_float.h fix: run ormolu and clang-format (#1312) 2021-09-15 19:49:20 +02:00
carp_int.h core: do not have short functions on single lines 2019-10-30 11:07:32 +01:00
carp_io.h IO.Raw (#1243) 2021-06-17 17:33:10 +02:00
carp_long.h Detect __builtin_x_overflow() based on __GNUC__ macro. 2020-05-23 19:03:07 +02:00
carp_memory.h all: various long fixes 2020-04-23 21:50:30 +02:00
carp_pattern.h fix: run ormolu and clang-format (#1312) 2021-09-15 19:49:20 +02:00
carp_safe_int.h Detect __builtin_x_overflow() based on __GNUC__ macro. 2020-05-23 19:03:07 +02:00
carp_stdbool.h core: remove stdbool dependency 2018-11-17 15:42:36 +01:00
carp_stdint.h fix: remove unused vars in carp_stdint.h (#1165) 2021-02-04 08:35:17 +01:00
carp_string.h fix: escape quotes in String.prn (#1287) 2021-07-29 08:30:42 +02:00
carp_system.h IO.Raw (#1243) 2021-06-17 17:33:10 +02:00
carp_utf8.h Unicode fixes (#994) 2020-11-22 06:45:26 +01:00
Char.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Color.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Control.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
ControlMacros.carp Update ControlMacros.carp (#1336) 2021-10-14 10:24:59 +02:00
Core.carp feat: add box type (#1358) 2021-11-30 10:35:22 +01:00
core.h fix: added missing definitions so Carp can be used with TCC 32bit on Windows (#1267) 2021-07-01 10:20:42 +02:00
Debug.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Derive.carp docs: fix typo in make-deriver and add implementor note (#1155) 2021-01-27 19:00:31 +01:00
Double.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Dynamic.carp feat: add Dynamic.Debug.trace (#1279) 2021-07-14 08:14:07 +02:00
Filepath.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Float.carp feat: Add Float.round (#1301) 2021-08-23 20:31:29 +02:00
Format.carp fix: fix leading % format in fmt (#1380) 2022-01-24 13:05:27 +01:00
Function.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Generics.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Gensym.carp feat: allow for multibranches in case (#1276) 2021-07-08 20:43:48 +02:00
Geometry.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
GLFW.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Heap.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Int.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Interfaces.carp feat: make empty? an interface (#1139) 2021-01-20 09:54:08 +01:00
Introspect.carp feat: add Introspect.arguments (#1163) 2021-02-01 17:03:38 +01:00
IO.carp feat: add IO.fgetc (#1405) 2022-03-28 10:16:51 +02:00
List.carp feat: add Dynamic.List.find-index (#1316) 2021-09-17 05:58:39 +02:00
Long.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Macros.carp feat: add c-name meta field (#1398) 2022-03-18 09:34:45 +01:00
Map.carp fix: Unify aupdate and aupdate! with other update functions (#1220) 2021-05-25 12:11:31 +02:00
Maybe.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Opaque.carp Update Opaque docs; fix typos 2020-06-18 09:57:28 -04:00
OpenGL.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Pattern.carp fix: ensure registered types with fields emit path (#1364) 2021-12-16 21:31:16 +01:00
Phantom.carp core: add docs for phantom 2020-06-17 19:06:49 +02:00
Platform.carp feat: Recognize the NetBSD platform. (#1109) 2021-01-03 13:22:56 +01:00
Pointer.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Project.carp feat: Emit docs for top level bindings (#1253) 2021-06-28 19:56:59 +02:00
Quasiquote.carp (and) and (or) now handle any number of parameters (#1251) 2021-06-20 21:44:04 +02:00
Random.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Result.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
SafeInt.carp Added --compile-fast to compile with tcc. 2020-05-21 20:04:54 +02:00
SDL_gfx.carp Refactored flags handling (add-pkg). 2019-06-17 09:02:34 +02:00
SDL_image.carp Add support for cross-compilation. 2020-10-10 20:01:18 +02:00
SDL_mixer.carp Merge 2020-05-11 16:10:35 +02:00
SDL_ttf.carp Merge 2020-05-11 16:10:35 +02:00
SDL.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
SDLHelper.h core: fix SDL for newer versions 2020-10-15 13:14:31 +02:00
Sort.carp core: add sort flavors with custom comparators 2018-11-13 11:11:21 +01:00
StaticArray.carp feat: scan functions (#1339) 2021-10-22 06:59:40 +02:00
Statistics.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
StdInt.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
String.carp feat: add Dynamic.String.to-array (#1382) 2022-02-14 09:31:13 +01:00
System.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Test.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Tuples.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Unit.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Unsafe.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Vector.carp docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00