Add errno to System.carp

+ Error values included are those that can be set from calling `fopen`
+ Change order of imports so that the System module is available before the IO module
This commit is contained in:
sdilts 2019-11-01 17:26:56 -06:00
parent 0386971f00
commit 77614b21d9
2 changed files with 22 additions and 1 deletions

View File

@ -31,8 +31,8 @@
(load "Array.carp")
(load "Char.carp")
(load "String.carp")
(load "IO.carp")
(load "System.carp")
(load "IO.carp")
(load "Pattern.carp")
(load "Debug.carp")
(load "Format.carp")

View File

@ -1,4 +1,5 @@
(system-include "carp_system.h")
(system-include "errno.h")
(defmodule System
(doc free "Frees an object. Should not be called except in direst circumstances.")
@ -28,4 +29,24 @@
(register signal-segv Int "SIGSEGV")
(register signal-term Int "SIGTERM")
(register abort (Fn [] ()) "abort")
(register errno Int "errno")
(register EACCES Int "EACCES")
(register EEXIST Int "EEXIST")
(register EINVAL Int "EINVAL")
(register EIO Int "EIO")
(register EISDIR Int "EISDIR")
(register ELOOP Int "ELOOP")
(register EMFILE Int "EMFILE")
(register ENAMETOOLONG Int "ENAMETOOLONG")
(register ENOENT Int "ENOENT")
(register ENOMEM Int "EINVAL")
(register ENOSPC Int "ENOSPC")
(register ENOSR Int "ENOSR")
(register ENOTDIR Int "ENOTDIR")
(register ENXIO Int "ENXIO")
(register EOVERFLOW Int "EOVERFLOW")
(register EROFS Int "EROFS")
(register EINTR Int "EINTR")
)