[MLton-commit] r4305
Matthew Fluet
MLton@mlton.org
Tue, 24 Jan 2006 17:57:01 -0800
More unified c-side/ml-side basis functions
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ST.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY.c
U mlton/branches/on-20050822-x86_64-branch/runtime/TODO
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-25 01:56:56 UTC (rev 4305)
@@ -69,6 +69,7 @@
-Wnested-externs \
-Wmissing-prototypes \
-Wmissing-declarations
+# -Wconversion
# -Wshadow
OPTWARNFLAGS = $(WARNFLAGS) -Winline -Wdisabled-optimization
DEBUGWARNFLAGS = $(WARNFLAGS) -Wunused
@@ -170,16 +171,17 @@
types.h: gen/gen-types.c util.h $(UTILOFILES)
rm -f types.h
- $(CC) $(OPTCFLAGS) $(WARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
- ./gen-types
- rm -f gen-types
+ $(CC) $(OPTCFLAGS) $(WARNFLAGS) -o gen/gen-types gen/gen-types.c $(UTILOFILES)
+ cd gen && ./gen-types
+ cp gen/types.h types.h
+ rm -f gen/gen-types
basis-ffi.h: gen/gen-basis-ffi.sml gen/basis-ffi.def
- rm -f basis-ffi.def
+ rm -f basis-ffi.h
cd gen && mlton gen-basis-ffi.sml
cd gen && ./gen-basis-ffi
cp gen/basis-ffi.h basis-ffi.h
- rm -f gen/gen-basis-ffi gen/basis-ffi.h gen/basis-ffi.sml
+ rm -f gen/gen-basis-ffi
gc-gdb.o: gc.c $(GCCFILES) $(HFILES)
$(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -c -o $@ $<
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -0,0 +1,81 @@
+#include "platform.h"
+
+const C_Int_t Posix_Error_E2BIG = E2BIG;
+const C_Int_t Posix_Error_EACCES = EACCES;
+const C_Int_t Posix_Error_EADDRINUSE = EADDRINUSE;
+const C_Int_t Posix_Error_EADDRNOTAVAIL = EADDRNOTAVAIL;
+const C_Int_t Posix_Error_EAFNOSUPPORT = EAFNOSUPPORT;
+const C_Int_t Posix_Error_EAGAIN = EAGAIN;
+const C_Int_t Posix_Error_EALREADY = EALREADY;
+const C_Int_t Posix_Error_EBADF = EBADF;
+const C_Int_t Posix_Error_EBADMSG = EBADMSG;
+const C_Int_t Posix_Error_EBUSY = EBUSY;
+const C_Int_t Posix_Error_ECANCELED = ECANCELED;
+const C_Int_t Posix_Error_ECHILD = ECHILD;
+const C_Int_t Posix_Error_ECONNABORTED = ECONNABORTED;
+const C_Int_t Posix_Error_ECONNREFUSED = ECONNREFUSED;
+const C_Int_t Posix_Error_ECONNRESET = ECONNRESET;
+const C_Int_t Posix_Error_EDEADLK = EDEADLK;
+const C_Int_t Posix_Error_EDESTADDRREQ = EDESTADDRREQ;
+const C_Int_t Posix_Error_EDOM = EDOM;
+const C_Int_t Posix_Error_EDQUOT = EDQUOT;
+const C_Int_t Posix_Error_EEXIST = EEXIST;
+const C_Int_t Posix_Error_EFAULT = EFAULT;
+const C_Int_t Posix_Error_EFBIG = EFBIG;
+const C_Int_t Posix_Error_EHOSTUNREACH = EHOSTUNREACH;
+const C_Int_t Posix_Error_EIDRM = EIDRM;
+const C_Int_t Posix_Error_EILSEQ = EILSEQ;
+const C_Int_t Posix_Error_EINPROGRESS = EINPROGRESS;
+const C_Int_t Posix_Error_EINTR = EINTR;
+const C_Int_t Posix_Error_EINVAL = EINVAL;
+const C_Int_t Posix_Error_EIO = EIO;
+const C_Int_t Posix_Error_EISCONN = EISCONN;
+const C_Int_t Posix_Error_EISDIR = EISDIR;
+const C_Int_t Posix_Error_ELOOP = ELOOP;
+const C_Int_t Posix_Error_EMFILE = EMFILE;
+const C_Int_t Posix_Error_EMLINK = EMLINK;
+const C_Int_t Posix_Error_EMSGSIZE = EMSGSIZE;
+const C_Int_t Posix_Error_EMULTIHOP = EMULTIHOP;
+const C_Int_t Posix_Error_ENAMETOOLONG = ENAMETOOLONG;
+const C_Int_t Posix_Error_ENETDOWN = ENETDOWN;
+const C_Int_t Posix_Error_ENETRESET = ENETRESET;
+const C_Int_t Posix_Error_ENETUNREACH = ENETUNREACH;
+const C_Int_t Posix_Error_ENFILE = ENFILE;
+const C_Int_t Posix_Error_ENOBUFS = ENOBUFS;
+const C_Int_t Posix_Error_ENODATA = ENODATA;
+const C_Int_t Posix_Error_ENODEV = ENODEV;
+const C_Int_t Posix_Error_ENOENT = ENOENT;
+const C_Int_t Posix_Error_ENOEXEC = ENOEXEC;
+const C_Int_t Posix_Error_ENOLCK = ENOLCK;
+const C_Int_t Posix_Error_ENOLINK = ENOLINK;
+const C_Int_t Posix_Error_ENOMEM = ENOMEM;
+const C_Int_t Posix_Error_ENOMSG = ENOMSG;
+const C_Int_t Posix_Error_ENOPROTOOPT = ENOPROTOOPT;
+const C_Int_t Posix_Error_ENOSPC = ENOSPC;
+const C_Int_t Posix_Error_ENOSR = ENOSR;
+const C_Int_t Posix_Error_ENOSTR = ENOSTR;
+const C_Int_t Posix_Error_ENOSYS = ENOSYS;
+const C_Int_t Posix_Error_ENOTCONN = ENOTCONN;
+const C_Int_t Posix_Error_ENOTDIR = ENOTDIR;
+const C_Int_t Posix_Error_ENOTEMPTY = ENOTEMPTY;
+const C_Int_t Posix_Error_ENOTSOCK = ENOTSOCK;
+const C_Int_t Posix_Error_ENOTSUP = ENOTSUP;
+const C_Int_t Posix_Error_ENOTTY = ENOTTY;
+const C_Int_t Posix_Error_ENXIO = ENXIO;
+const C_Int_t Posix_Error_EOPNOTSUPP = EOPNOTSUPP;
+const C_Int_t Posix_Error_EOVERFLOW = EOVERFLOW;
+const C_Int_t Posix_Error_EPERM = EPERM;
+const C_Int_t Posix_Error_EPIPE = EPIPE;
+const C_Int_t Posix_Error_EPROTO = EPROTO;
+const C_Int_t Posix_Error_EPROTONOSUPPORT = EPROTONOSUPPORT;
+const C_Int_t Posix_Error_EPROTOTYPE = EPROTOTYPE;
+const C_Int_t Posix_Error_ERANGE = ERANGE;
+const C_Int_t Posix_Error_EROFS = EROFS;
+const C_Int_t Posix_Error_ESPIPE = ESPIPE;
+const C_Int_t Posix_Error_ESRCH = ESRCH;
+const C_Int_t Posix_Error_ESTALE = ESTALE;
+const C_Int_t Posix_Error_ETIME = ETIME;
+const C_Int_t Posix_Error_ETIMEDOUT = ETIMEDOUT;
+const C_Int_t Posix_Error_ETXTBSY = ETXTBSY;
+const C_Int_t Posix_Error_EWOULDBLOCK = EWOULDBLOCK;
+const C_Int_t Posix_Error_EXDEV = EXDEV;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -1,14 +1,14 @@
#include "platform.h"
void Posix_Error_clearErrno (void) {
- errno = 0;
+ errno = 0;
}
-int Posix_Error_getErrno (void) {
- return errno;
+C_Int_t Posix_Error_getErrno (void) {
+ return errno;
}
-Cstring Posix_Error_strerror (Int n) {
- char *res = strerror (n);
- return (Cstring)res;
+C_String_t Posix_Error_strError (C_Int_t n) {
+ char *res = strerror (n);
+ return (C_String_t)res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -1,38 +1,23 @@
#include "platform.h"
-enum {
- DEBUG_DIRSTREAM = FALSE,
-};
-
-Int Posix_FileSys_Dirstream_closedir (Cpointer p) {
- Int res;
-
- res = (Int)(closedir ((DIR *) p));
- if (DEBUG_DIRSTREAM)
- fprintf (stderr, "%d = closedir (0x%08"PRIxPTR")\n", res, (uintptr_t)p);
- return res;
+C_Errno_t(C_Int_t) Posix_FileSys_Dirstream_closeDir (C_DirP_t p) {
+ return closedir ((DIR *) p);
}
-Cpointer Posix_FileSys_Dirstream_opendir (Pointer p) {
- DIR *res = opendir ((char *) p);
- return (Cpointer)res;
+C_Errno_t(C_DirP_t) Posix_FileSys_Dirstream_openDir (NullString8_t p) {
+ DIR *res = opendir ((char *) p);
+ return (C_Errno_t(C_DirP_t))res;
}
-Cstring Posix_FileSys_Dirstream_readdir (Cpointer d) {
- struct dirent *e;
- Cstring res;
+C_Errno_t(C_String_t) Posix_FileSys_Dirstream_readDir (C_DirP_t d) {
+ struct dirent *e;
+ char *res;
- e = readdir ((DIR *) d);
- res = (Cstring)((NULL == e) ? NULL : e->d_name);
- if (DEBUG_DIRSTREAM)
- fprintf (stderr, "%s = readdir (0x%08"PRIxPTR")\n",
- ((Cstring)NULL == res) ? "NULL": (char*)res,
- (uintptr_t)d);
- return res;
+ e = readdir ((DIR *) d);
+ res = (NULL == e) ? NULL : e->d_name;
+ return (C_Errno_t(C_String_t))res;
}
-void Posix_FileSys_Dirstream_rewinddir (Cpointer p) {
- if (DEBUG_DIRSTREAM)
- fprintf (stderr, "rewinddir (0x%08"PRIxPTR")\n", (uintptr_t)p);
- rewinddir ((DIR *) p);
+void Posix_FileSys_Dirstream_rewindDir (C_DirP_t p) {
+ rewinddir ((DIR *) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ST.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ST.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ST.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -1,29 +1,29 @@
#include "platform.h"
-Bool Posix_FileSys_ST_isBlk (Word w) {
- return S_ISBLK(w);
+Bool_t Posix_FileSys_ST_isBlk (C_Mode_t m) {
+ return S_ISBLK(m);
}
-Bool Posix_FileSys_ST_isChr (Word w) {
- return S_ISCHR (w);
+Bool_t Posix_FileSys_ST_isChr (C_Mode_t m) {
+ return S_ISCHR(m);
}
-Bool Posix_FileSys_ST_isDir (Word w) {
- return S_ISDIR (w);
+Bool_t Posix_FileSys_ST_isDir (C_Mode_t m) {
+ return S_ISDIR(m);
}
-Bool Posix_FileSys_ST_isFIFO (Word w) {
- return S_ISFIFO (w);
+Bool_t Posix_FileSys_ST_isFIFO (C_Mode_t m) {
+ return S_ISFIFO(m);
}
-Bool Posix_FileSys_ST_isLink (Word w) {
- return S_ISLNK (w);
+Bool_t Posix_FileSys_ST_isLink (C_Mode_t m) {
+ return S_ISLNK(m);
}
-Bool Posix_FileSys_ST_isReg (Word w) {
- return S_ISREG (w);
+Bool_t Posix_FileSys_ST_isReg (C_Mode_t m) {
+ return S_ISREG(m);
}
-Bool Posix_FileSys_ST_isSock (Word w) {
- return S_ISSOCK (w);
+Bool_t Posix_FileSys_ST_isSock (C_Mode_t m) {
+ return S_ISSOCK(m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -2,58 +2,58 @@
static struct stat statbuf;
-Word Posix_FileSys_Stat_dev () {
- return statbuf.st_dev;
+C_Dev_t Posix_FileSys_Stat_getDev (void) {
+ return statbuf.st_dev;
}
-Int Posix_FileSys_Stat_ino () {
- return statbuf.st_ino;
+C_INo_t Posix_FileSys_Stat_getINo (void) {
+ return statbuf.st_ino;
}
-Word Posix_FileSys_Stat_mode () {
- return statbuf.st_mode;
+C_Mode_t Posix_FileSys_Stat_getMode (void) {
+ return statbuf.st_mode;
}
-Int Posix_FileSys_Stat_nlink () {
- return statbuf.st_nlink;
+C_NLink_t Posix_FileSys_Stat_getNLink (void) {
+ return statbuf.st_nlink;
}
-Word Posix_FileSys_Stat_uid () {
- return statbuf.st_uid;
+C_UId_t Posix_FileSys_Stat_getUId (void) {
+ return statbuf.st_uid;
}
-Word Posix_FileSys_Stat_gid () {
- return statbuf.st_gid;
+C_GId_t Posix_FileSys_Stat_getGId (void) {
+ return statbuf.st_gid;
}
-Word Posix_FileSys_Stat_rdev () {
- return statbuf.st_rdev;
+C_Dev_t Posix_FileSys_Stat_getRDev (void) {
+ return statbuf.st_rdev;
}
-Position Posix_FileSys_Stat_size () {
- return statbuf.st_size;
+C_Off_t Posix_FileSys_Stat_getSize (void) {
+ return statbuf.st_size;
}
-Int Posix_FileSys_Stat_atime () {
- return statbuf.st_atime;
+C_Time_t Posix_FileSys_Stat_getATime (void) {
+ return statbuf.st_atime;
}
-Int Posix_FileSys_Stat_mtime () {
- return statbuf.st_mtime;
+C_Time_t Posix_FileSys_Stat_getMTime (void) {
+ return statbuf.st_mtime;
}
-Int Posix_FileSys_Stat_ctime () {
- return statbuf.st_ctime;
+C_Time_t Posix_FileSys_Stat_getCTime (void) {
+ return statbuf.st_ctime;
}
-Int Posix_FileSys_Stat_fstat (Fd f) {
- return fstat (f, &statbuf);
+C_Errno_t(C_Int_t) Posix_FileSys_Stat_fstat (C_Fd_t f) {
+ return fstat (f, &statbuf);
}
-Int Posix_FileSys_Stat_lstat (Pointer f) {
- return lstat ((char*)f, &statbuf);
+C_Errno_t(C_Int_t) Posix_FileSys_Stat_lstat (NullString8_t f) {
+ return lstat ((char*)f, &statbuf);
}
-Int Posix_FileSys_Stat_stat (Pointer f) {
- return stat ((char*)f, &statbuf);
+C_Errno_t(C_Int_t) Posix_FileSys_Stat_stat (NullString8_t f) {
+ return stat ((char*)f, &statbuf);
}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY-consts.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY-consts.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -0,0 +1,109 @@
+#include "platform.h"
+
+const C_Int_t Posix_TTY_V_NCCS = NCCS;
+
+const C_Int_t Posix_TTY_V_VEOF = VEOF;
+const C_Int_t Posix_TTY_V_VEOL = VEOL;
+const C_Int_t Posix_TTY_V_VERASE = VERASE;
+const C_Int_t Posix_TTY_V_VINTR = VINTR;
+const C_Int_t Posix_TTY_V_VKILL = VKILL;
+const C_Int_t Posix_TTY_V_VMIN = VMIN;
+const C_Int_t Posix_TTY_V_VQUIT = VQUIT;
+const C_Int_t Posix_TTY_V_VSTART = VSTART;
+const C_Int_t Posix_TTY_V_VSTOP = VSTOP;
+const C_Int_t Posix_TTY_V_VSUSP = VSUSP;
+const C_Int_t Posix_TTY_V_VTIME = VTIME;
+
+const C_TCFlag_t Posix_TTY_I_BRKINT = BRKINT;
+const C_TCFlag_t Posix_TTY_I_ICRNL = ICRNL;
+const C_TCFlag_t Posix_TTY_I_IGNBRK = IGNBRK;
+const C_TCFlag_t Posix_TTY_I_IGNCR = IGNCR;
+const C_TCFlag_t Posix_TTY_I_IGNPAR = IGNPAR;
+const C_TCFlag_t Posix_TTY_I_INLCR = INLCR;
+const C_TCFlag_t Posix_TTY_I_INPCK = INPCK;
+const C_TCFlag_t Posix_TTY_I_ISTRIP = ISTRIP;
+const C_TCFlag_t Posix_TTY_I_IXANY = IXANY;
+const C_TCFlag_t Posix_TTY_I_IXOFF = IXOFF;
+const C_TCFlag_t Posix_TTY_I_IXON = IXON;
+const C_TCFlag_t Posix_TTY_I_PARMRK = PARMRK;
+
+const C_TCFlag_t Posix_TTY_O_OPOST = OPOST;
+const C_TCFlag_t Posix_TTY_O_ONLCR = ONLCR;
+const C_TCFlag_t Posix_TTY_O_OCRNL = OCRNL;
+const C_TCFlag_t Posix_TTY_O_ONOCR = ONOCR;
+const C_TCFlag_t Posix_TTY_O_ONLRET = ONLRET;
+const C_TCFlag_t Posix_TTY_O_OFILL = OFILL;
+const C_TCFlag_t Posix_TTY_O_NLDLY = NLDLY;
+const C_TCFlag_t Posix_TTY_O_NL0 = NL0;
+const C_TCFlag_t Posix_TTY_O_NL1 = NL1;
+const C_TCFlag_t Posix_TTY_O_CRDLY = CRDLY;
+const C_TCFlag_t Posix_TTY_O_CR0 = CR0;
+const C_TCFlag_t Posix_TTY_O_CR1 = CR1;
+const C_TCFlag_t Posix_TTY_O_CR2 = CR2;
+const C_TCFlag_t Posix_TTY_O_CR3 = CR3;
+const C_TCFlag_t Posix_TTY_O_TABDLY = TABDLY;
+const C_TCFlag_t Posix_TTY_O_TAB0 = TAB0;
+const C_TCFlag_t Posix_TTY_O_TAB1 = TAB1;
+const C_TCFlag_t Posix_TTY_O_TAB2 = TAB2;
+const C_TCFlag_t Posix_TTY_O_TAB3 = TAB3;
+const C_TCFlag_t Posix_TTY_O_BSDLY = BSDLY;
+const C_TCFlag_t Posix_TTY_O_BS0 = BS0;
+const C_TCFlag_t Posix_TTY_O_BS1 = BS1;
+const C_TCFlag_t Posix_TTY_O_VTDLY = VTDLY;
+const C_TCFlag_t Posix_TTY_O_VT0 = VT0;
+const C_TCFlag_t Posix_TTY_O_VT1 = VT1;
+const C_TCFlag_t Posix_TTY_O_FFDLY = FFDLY;
+const C_TCFlag_t Posix_TTY_O_FF0 = FF0;
+const C_TCFlag_t Posix_TTY_O_FF1 = FF1;
+
+const C_TCFlag_t Posix_TTY_C_CSIZE = CSIZE;
+const C_TCFlag_t Posix_TTY_C_CS5 = CS5;
+const C_TCFlag_t Posix_TTY_C_CS6 = CS6;
+const C_TCFlag_t Posix_TTY_C_CS7 = CS7;
+const C_TCFlag_t Posix_TTY_C_CS8 = CS8;
+const C_TCFlag_t Posix_TTY_C_CSTOPB = CSTOPB;
+const C_TCFlag_t Posix_TTY_C_CREAD = CREAD;
+const C_TCFlag_t Posix_TTY_C_PARENB = PARENB;
+const C_TCFlag_t Posix_TTY_C_PARODD = PARODD;
+const C_TCFlag_t Posix_TTY_C_HUPCL = HUPCL;
+const C_TCFlag_t Posix_TTY_C_CLOCAL = CLOCAL;
+
+const C_TCFlag_t Posix_TTY_L_ECHO = ECHO;
+const C_TCFlag_t Posix_TTY_L_ECHOE = ECHOE;
+const C_TCFlag_t Posix_TTY_L_ECHOK = ECHOK;
+const C_TCFlag_t Posix_TTY_L_ECHONL = ECHONL;
+const C_TCFlag_t Posix_TTY_L_ICANON = ICANON;
+const C_TCFlag_t Posix_TTY_L_IEXTEN = IEXTEN;
+const C_TCFlag_t Posix_TTY_L_ISIG = ISIG;
+const C_TCFlag_t Posix_TTY_L_NOFLSH = NOFLSH;
+const C_TCFlag_t Posix_TTY_L_TOSTOP = TOSTOP;
+
+const C_Speed_t Posix_TTY_B0 = B0;
+const C_Speed_t Posix_TTY_B50 = B50;
+const C_Speed_t Posix_TTY_B75 = B75;
+const C_Speed_t Posix_TTY_B110 = B110;
+const C_Speed_t Posix_TTY_B134 = B134;
+const C_Speed_t Posix_TTY_B150 = B150;
+const C_Speed_t Posix_TTY_B200 = B200;
+const C_Speed_t Posix_TTY_B300 = B300;
+const C_Speed_t Posix_TTY_B600 = B600;
+const C_Speed_t Posix_TTY_B1200 = B1200;
+const C_Speed_t Posix_TTY_B1800 = B1800;
+const C_Speed_t Posix_TTY_B2400 = B2400;
+const C_Speed_t Posix_TTY_B4800 = B4800;
+const C_Speed_t Posix_TTY_B9600 = B9600;
+const C_Speed_t Posix_TTY_B19200 = B19200;
+const C_Speed_t Posix_TTY_B38400 = B38400;
+
+const C_Int_t Posix_TTY_TC_TCSADRAIN = TCSADRAIN;
+const C_Int_t Posix_TTY_TC_TCSAFLUSH = TCSAFLUSH;
+const C_Int_t Posix_TTY_TC_TCSANOW = TCSANOW;
+
+const C_Int_t Posix_TTY_TC_TCIOFF = TCIOFF;
+const C_Int_t Posix_TTY_TC_TCION = TCION;
+const C_Int_t Posix_TTY_TC_TCOOFF = TCOOFF;
+const C_Int_t Posix_TTY_TC_TCOON = TCOON;
+
+const C_Int_t Posix_TTY_TC_TCIFLUSH = TCIFLUSH;
+const C_Int_t Posix_TTY_TC_TCIOFLUSH = TCIOFLUSH;
+const C_Int_t Posix_TTY_TC_TCOFLUSH = TCOFLUSH;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/TTY.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -2,86 +2,90 @@
static struct termios termios;
-Flag Posix_TTY_Termios_iflag () {
- return termios.c_iflag;
+C_TCFlag_t Posix_TTY_Termios_getIFlag (void) {
+ return termios.c_iflag;
}
-Flag Posix_TTY_Termios_oflag () {
- return termios.c_oflag;
+C_TCFlag_t Posix_TTY_Termios_getOFlag (void) {
+ return termios.c_oflag;
}
-Flag Posix_TTY_Termios_cflag () {
- return termios.c_cflag;
+C_TCFlag_t Posix_TTY_Termios_getCFlag (void) {
+ return termios.c_cflag;
}
-Flag Posix_TTY_Termios_lflag () {
- return termios.c_lflag;
+C_TCFlag_t Posix_TTY_Termios_getLFlag (void) {
+ return termios.c_lflag;
}
-Cstring Posix_TTY_Termios_cc () {
- return (Cstring)termios.c_cc;
+C_CC_t Posix_TTY_Termios_getCCN (C_Int_t n) {
+ return termios.c_cc[n];
}
-Speed Posix_TTY_Termios_cfgetospeed () {
- return cfgetospeed (&termios);
+C_Speed_t Posix_TTY_Termios_cfGetOSpeed (void) {
+ return cfgetospeed (&termios);
}
-Speed Posix_TTY_Termios_cfgetispeed () {
- return cfgetispeed (&termios);
+C_Speed_t Posix_TTY_Termios_cfGetISpeed () {
+ return cfgetispeed (&termios);
}
-void Posix_TTY_Termios_setiflag (Flag f) {
- termios.c_iflag = f;
+void Posix_TTY_Termios_setIFlag (C_TCFlag_t f) {
+ termios.c_iflag = f;
}
-void Posix_TTY_Termios_setoflag (Flag f) {
- termios.c_oflag = f;
+void Posix_TTY_Termios_setOFlag (C_TCFlag_t f) {
+ termios.c_oflag = f;
}
-void Posix_TTY_Termios_setcflag (Flag f) {
- termios.c_cflag = f;
+void Posix_TTY_Termios_setCFlag (C_TCFlag_t f) {
+ termios.c_cflag = f;
}
-void Posix_TTY_Termios_setlflag (Flag f) {
- termios.c_lflag = f;
+void Posix_TTY_Termios_setLFlag (C_TCFlag_t f) {
+ termios.c_lflag = f;
}
-Int Posix_TTY_Termios_setospeed (Speed s) {
- return cfsetospeed (&termios, s);
+void Posix_TTY_Termios_setCCN (C_Int_t n, C_CC_t c) {
+ termios.c_cc[n] = c;
}
-Int Posix_TTY_Termios_setispeed (Speed s) {
- return cfsetispeed (&termios, s);
+C_Errno_t(C_Int_t) Posix_TTY_Termios_cfSetOSpeed (C_Speed_t s) {
+ return cfsetospeed (&termios, s);
}
-Int Posix_TTY_drain (Fd f) {
- return tcdrain (f);
+C_Errno_t(C_Int_t) Posix_TTY_Termios_cfSetISpeed (C_Speed_t s) {
+ return cfsetispeed (&termios, s);
}
-Int Posix_TTY_flow (Fd f, Int i) {
- return tcflow (f, i);
+C_Errno_t(C_Int_t) Posix_TTY_TC_drain (C_Fd_t f) {
+ return tcdrain (f);
}
-Int Posix_TTY_flush (Fd f, Int i) {
- return tcflush (f, i);
+C_Errno_t(C_Int_t) Posix_TTY_TC_flow (C_Fd_t f, C_Int_t i) {
+ return tcflow (f, i);
}
-Int Posix_TTY_getattr (Fd f) {
- return tcgetattr (f, &termios);
+C_Errno_t(C_Int_t) Posix_TTY_TC_flush (C_Fd_t f, C_Int_t i) {
+ return tcflush (f, i);
}
-Int Posix_TTY_getpgrp (Fd f) {
- return tcgetpgrp (f);
+C_Errno_t(C_Int_t) Posix_TTY_TC_getattr (C_Fd_t f) {
+ return tcgetattr (f, &termios);
}
-Int Posix_TTY_sendbreak (Fd f, Int i) {
- return tcsendbreak (f, i);
+C_Errno_t(C_PId_t) Posix_TTY_TC_getpgrp (C_Fd_t f) {
+ return tcgetpgrp (f);
}
-Int Posix_TTY_setattr (Fd f, Int i) {
- return tcsetattr (f, i, &termios);
+C_Errno_t(C_Int_t) Posix_TTY_TC_sendbreak (C_Fd_t f, C_Int_t i) {
+ return tcsendbreak (f, i);
}
-Int Posix_TTY_setpgrp (Fd f, Pid p) {
- return tcsetpgrp (f, p);
+C_Errno_t(C_Int_t) Posix_TTY_TC_setattr (C_Fd_t f, C_Int_t i) {
+ return tcsetattr (f, i, &termios);
}
+
+C_Errno_t(C_Int_t) Posix_TTY_TC_setpgrp (C_Fd_t f, C_PId_t p) {
+ return tcsetpgrp (f, p);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/TODO
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-25 01:56:56 UTC (rev 4305)
@@ -5,10 +5,6 @@
* Use C99 <assert.h> instead of util/assert.{c,h}
-Posix/Error.c
-Posix/FileSys/Dirstream.c
-Posix/FileSys/ST.c
-Posix/FileSys/Stat.c
Posix/FileSys/Utimbuf.c
Posix/FileSys/access.c
Posix/FileSys/chdir.c
@@ -74,27 +70,14 @@
Posix/Signal.c
Posix/SysDB/Group.c
Posix/SysDB/Passwd.c
-Posix/TTY.c
-basis/IEEEReal.c
basis/Int/Word.c
basis/Int/Word8Array.c
basis/Int/Word8Vector.c
basis/IntInf.c
-basis/Itimer/set.c
basis/MLton/allocTooLarge.c
basis/MLton/bug.c
-basis/MLton/rlimit.c
-basis/MLton/rusage.c
basis/MLton/spawne.c
basis/MLton/spawnp.c
-basis/Net/Net.c
-basis/Net/NetHostDB.c
-basis/Net/NetProtDB.c
-basis/Net/NetServDB.c
-basis/Net/Socket/GenericSock.c
-basis/Net/Socket/INetSock.c
-basis/Net/Socket/Socket.c
-basis/Net/Socket/UnixSock.c
basis/PackReal.c
basis/Ptrace.c
basis/Real/Math.c
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -35,11 +35,11 @@
#endif
-Int IEEEReal_getRoundingMode () {
- return fegetround ();
+C_Int_t IEEEReal_getRoundingMode () {
+ return fegetround ();
}
-void IEEEReal_setRoundingMode (Int m) {
- assert (m != FE_NOSUPPORT);
- fesetround (m);
+void IEEEReal_setRoundingMode (C_Int_t m) {
+ assert (m != IEEEReal_RoundingMode_FE_NOSUPPORT);
+ fesetround (m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -3,4 +3,4 @@
/* Manual initialization is a work-around for a Darwin linker issue. */
C_Int_t CommandLine_argc = 0;
C_StringArray_t CommandLine_argv = (C_StringArray_t)NULL;
-C_String_t CommandLine_commandName = (C_StringArray_t)NULL;
+C_String_t CommandLine_commandName = (C_String_t)NULL;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-25 01:56:56 UTC (rev 4305)
@@ -24,6 +24,13 @@
Date.localTime = _import : C.Time.t ref -> C.Int.t C.Errno.t
Date.mkTime = _import : unit -> C.Time.t C.Errno.t
Date.strfTime = _import : String8.t * C.Size.t * NullString8.t -> C.Size.t
+IEEEReal.RoundingMode.FE_DOWNWARD = _const : C.Int.t
+IEEEReal.RoundingMode.FE_NOSUPPORT = _const : C.Int.t
+IEEEReal.RoundingMode.FE_TONEAREST = _const : C.Int.t
+IEEEReal.RoundingMode.FE_TOWARDZERO = _const : C.Int.t
+IEEEReal.RoundingMode.FE_UPWARD = _const : C.Int.t
+IEEEReal.getRoundingMode = _import : unit -> C.Int.t
+IEEEReal.setRoundingMode = _import : C.Int.t -> unit
MLton.Itimer.PROF = _const : C.Int.t
MLton.Itimer.REAL = _const : C.Int.t
MLton.Itimer.VIRTUAL = _const : C.Int.t
@@ -88,6 +95,208 @@
OS.IO.POLLOUT = _const : C.Short.t
OS.IO.POLLPRI = _const : C.Short.t
OS.IO.poll = _import : C.Fd.t vector * C.Short.t vector * C.NFds.t * C.Int.t * C.Short.t array -> C.Int.t C.Errno.t
+Posix.Error.E2BIG = _const : C.Int.t
+Posix.Error.EACCES = _const : C.Int.t
+Posix.Error.EADDRINUSE = _const : C.Int.t
+Posix.Error.EADDRNOTAVAIL = _const : C.Int.t
+Posix.Error.EAFNOSUPPORT = _const : C.Int.t
+Posix.Error.EAGAIN = _const : C.Int.t
+Posix.Error.EALREADY = _const : C.Int.t
+Posix.Error.EBADF = _const : C.Int.t
+Posix.Error.EBADMSG = _const : C.Int.t
+Posix.Error.EBUSY = _const : C.Int.t
+Posix.Error.ECANCELED = _const : C.Int.t
+Posix.Error.ECHILD = _const : C.Int.t
+Posix.Error.ECONNABORTED = _const : C.Int.t
+Posix.Error.ECONNREFUSED = _const : C.Int.t
+Posix.Error.ECONNRESET = _const : C.Int.t
+Posix.Error.EDEADLK = _const : C.Int.t
+Posix.Error.EDESTADDRREQ = _const : C.Int.t
+Posix.Error.EDOM = _const : C.Int.t
+Posix.Error.EDQUOT = _const : C.Int.t
+Posix.Error.EEXIST = _const : C.Int.t
+Posix.Error.EFAULT = _const : C.Int.t
+Posix.Error.EFBIG = _const : C.Int.t
+Posix.Error.EHOSTUNREACH = _const : C.Int.t
+Posix.Error.EIDRM = _const : C.Int.t
+Posix.Error.EILSEQ = _const : C.Int.t
+Posix.Error.EINPROGRESS = _const : C.Int.t
+Posix.Error.EINTR = _const : C.Int.t
+Posix.Error.EINVAL = _const : C.Int.t
+Posix.Error.EIO = _const : C.Int.t
+Posix.Error.EISCONN = _const : C.Int.t
+Posix.Error.EISDIR = _const : C.Int.t
+Posix.Error.ELOOP = _const : C.Int.t
+Posix.Error.EMFILE = _const : C.Int.t
+Posix.Error.EMLINK = _const : C.Int.t
+Posix.Error.EMSGSIZE = _const : C.Int.t
+Posix.Error.EMULTIHOP = _const : C.Int.t
+Posix.Error.ENAMETOOLONG = _const : C.Int.t
+Posix.Error.ENETDOWN = _const : C.Int.t
+Posix.Error.ENETRESET = _const : C.Int.t
+Posix.Error.ENETUNREACH = _const : C.Int.t
+Posix.Error.ENFILE = _const : C.Int.t
+Posix.Error.ENOBUFS = _const : C.Int.t
+Posix.Error.ENODATA = _const : C.Int.t
+Posix.Error.ENODEV = _const : C.Int.t
+Posix.Error.ENOENT = _const : C.Int.t
+Posix.Error.ENOEXEC = _const : C.Int.t
+Posix.Error.ENOLCK = _const : C.Int.t
+Posix.Error.ENOLINK = _const : C.Int.t
+Posix.Error.ENOMEM = _const : C.Int.t
+Posix.Error.ENOMSG = _const : C.Int.t
+Posix.Error.ENOPROTOOPT = _const : C.Int.t
+Posix.Error.ENOSPC = _const : C.Int.t
+Posix.Error.ENOSR = _const : C.Int.t
+Posix.Error.ENOSTR = _const : C.Int.t
+Posix.Error.ENOSYS = _const : C.Int.t
+Posix.Error.ENOTCONN = _const : C.Int.t
+Posix.Error.ENOTDIR = _const : C.Int.t
+Posix.Error.ENOTEMPTY = _const : C.Int.t
+Posix.Error.ENOTSOCK = _const : C.Int.t
+Posix.Error.ENOTSUP = _const : C.Int.t
+Posix.Error.ENOTTY = _const : C.Int.t
+Posix.Error.ENXIO = _const : C.Int.t
+Posix.Error.EOPNOTSUPP = _const : C.Int.t
+Posix.Error.EOVERFLOW = _const : C.Int.t
+Posix.Error.EPERM = _const : C.Int.t
+Posix.Error.EPIPE = _const : C.Int.t
+Posix.Error.EPROTO = _const : C.Int.t
+Posix.Error.EPROTONOSUPPORT = _const : C.Int.t
+Posix.Error.EPROTOTYPE = _const : C.Int.t
+Posix.Error.ERANGE = _const : C.Int.t
+Posix.Error.EROFS = _const : C.Int.t
+Posix.Error.ESPIPE = _const : C.Int.t
+Posix.Error.ESRCH = _const : C.Int.t
+Posix.Error.ESTALE = _const : C.Int.t
+Posix.Error.ETIME = _const : C.Int.t
+Posix.Error.ETIMEDOUT = _const : C.Int.t
+Posix.Error.ETXTBSY = _const : C.Int.t
+Posix.Error.EWOULDBLOCK = _const : C.Int.t
+Posix.Error.EXDEV = _const : C.Int.t
+Posix.Error.clearErrno = _import : unit -> unit
+Posix.Error.getErrno = _import : unit -> C.Int.t
+Posix.Error.strError = _import : C.Int.t -> C.String.t
+Posix.TTY.B0 = _const : C.Speed.t
+Posix.TTY.B110 = _const : C.Speed.t
+Posix.TTY.B1200 = _const : C.Speed.t
+Posix.TTY.B134 = _const : C.Speed.t
+Posix.TTY.B150 = _const : C.Speed.t
+Posix.TTY.B1800 = _const : C.Speed.t
+Posix.TTY.B19200 = _const : C.Speed.t
+Posix.TTY.B200 = _const : C.Speed.t
+Posix.TTY.B2400 = _const : C.Speed.t
+Posix.TTY.B300 = _const : C.Speed.t
+Posix.TTY.B38400 = _const : C.Speed.t
+Posix.TTY.B4800 = _const : C.Speed.t
+Posix.TTY.B50 = _const : C.Speed.t
+Posix.TTY.B600 = _const : C.Speed.t
+Posix.TTY.B75 = _const : C.Speed.t
+Posix.TTY.B9600 = _const : C.Speed.t
+Posix.TTY.C.CLOCAL = _const : C.TCFlag.t
+Posix.TTY.C.CREAD = _const : C.TCFlag.t
+Posix.TTY.C.CS5 = _const : C.TCFlag.t
+Posix.TTY.C.CS6 = _const : C.TCFlag.t
+Posix.TTY.C.CS7 = _const : C.TCFlag.t
+Posix.TTY.C.CS8 = _const : C.TCFlag.t
+Posix.TTY.C.CSIZE = _const : C.TCFlag.t
+Posix.TTY.C.CSTOPB = _const : C.TCFlag.t
+Posix.TTY.C.HUPCL = _const : C.TCFlag.t
+Posix.TTY.C.PARENB = _const : C.TCFlag.t
+Posix.TTY.C.PARODD = _const : C.TCFlag.t
+Posix.TTY.I.BRKINT = _const : C.TCFlag.t
+Posix.TTY.I.ICRNL = _const : C.TCFlag.t
+Posix.TTY.I.IGNBRK = _const : C.TCFlag.t
+Posix.TTY.I.IGNCR = _const : C.TCFlag.t
+Posix.TTY.I.IGNPAR = _const : C.TCFlag.t
+Posix.TTY.I.INLCR = _const : C.TCFlag.t
+Posix.TTY.I.INPCK = _const : C.TCFlag.t
+Posix.TTY.I.ISTRIP = _const : C.TCFlag.t
+Posix.TTY.I.IXANY = _const : C.TCFlag.t
+Posix.TTY.I.IXOFF = _const : C.TCFlag.t
+Posix.TTY.I.IXON = _const : C.TCFlag.t
+Posix.TTY.I.PARMRK = _const : C.TCFlag.t
+Posix.TTY.L.ECHO = _const : C.TCFlag.t
+Posix.TTY.L.ECHOE = _const : C.TCFlag.t
+Posix.TTY.L.ECHOK = _const : C.TCFlag.t
+Posix.TTY.L.ECHONL = _const : C.TCFlag.t
+Posix.TTY.L.ICANON = _const : C.TCFlag.t
+Posix.TTY.L.IEXTEN = _const : C.TCFlag.t
+Posix.TTY.L.ISIG = _const : C.TCFlag.t
+Posix.TTY.L.NOFLSH = _const : C.TCFlag.t
+Posix.TTY.L.TOSTOP = _const : C.TCFlag.t
+Posix.TTY.O.BS0 = _const : C.TCFlag.t
+Posix.TTY.O.BS1 = _const : C.TCFlag.t
+Posix.TTY.O.BSDLY = _const : C.TCFlag.t
+Posix.TTY.O.CR0 = _const : C.TCFlag.t
+Posix.TTY.O.CR1 = _const : C.TCFlag.t
+Posix.TTY.O.CR2 = _const : C.TCFlag.t
+Posix.TTY.O.CR3 = _const : C.TCFlag.t
+Posix.TTY.O.CRDLY = _const : C.TCFlag.t
+Posix.TTY.O.FF0 = _const : C.TCFlag.t
+Posix.TTY.O.FF1 = _const : C.TCFlag.t
+Posix.TTY.O.FFDLY = _const : C.TCFlag.t
+Posix.TTY.O.NL0 = _const : C.TCFlag.t
+Posix.TTY.O.NL1 = _const : C.TCFlag.t
+Posix.TTY.O.NLDLY = _const : C.TCFlag.t
+Posix.TTY.O.OCRNL = _const : C.TCFlag.t
+Posix.TTY.O.OFILL = _const : C.TCFlag.t
+Posix.TTY.O.ONLCR = _const : C.TCFlag.t
+Posix.TTY.O.ONLRET = _const : C.TCFlag.t
+Posix.TTY.O.ONOCR = _const : C.TCFlag.t
+Posix.TTY.O.OPOST = _const : C.TCFlag.t
+Posix.TTY.O.TAB0 = _const : C.TCFlag.t
+Posix.TTY.O.TAB1 = _const : C.TCFlag.t
+Posix.TTY.O.TAB2 = _const : C.TCFlag.t
+Posix.TTY.O.TAB3 = _const : C.TCFlag.t
+Posix.TTY.O.TABDLY = _const : C.TCFlag.t
+Posix.TTY.O.VT0 = _const : C.TCFlag.t
+Posix.TTY.O.VT1 = _const : C.TCFlag.t
+Posix.TTY.O.VTDLY = _const : C.TCFlag.t
+Posix.TTY.TC.TCIFLUSH = _const : C.Int.t
+Posix.TTY.TC.TCIOFF = _const : C.Int.t
+Posix.TTY.TC.TCIOFLUSH = _const : C.Int.t
+Posix.TTY.TC.TCION = _const : C.Int.t
+Posix.TTY.TC.TCOFLUSH = _const : C.Int.t
+Posix.TTY.TC.TCOOFF = _const : C.Int.t
+Posix.TTY.TC.TCOON = _const : C.Int.t
+Posix.TTY.TC.TCSADRAIN = _const : C.Int.t
+Posix.TTY.TC.TCSAFLUSH = _const : C.Int.t
+Posix.TTY.TC.TCSANOW = _const : C.Int.t
+Posix.TTY.TC.drain = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.flow = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.flush = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.getattr = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.getpgrp = _import : C.Fd.t -> C.PId.t C.Errno.t
+Posix.TTY.TC.sendbreak = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.setattr = _import : C.Fd.t * C.Int.t -> C.Int.t C.Errno.t
+Posix.TTY.TC.setpgrp = _import : C.Fd.t * C.PId.t -> C.Int.t C.Errno.t
+Posix.TTY.Termios.cfGetISpeed = _import : unit -> C.Speed.t
+Posix.TTY.Termios.cfGetOSpeed = _import : unit -> C.Speed.t
+Posix.TTY.Termios.cfSetISpeed = _import : C.Speed.t -> C.Int.t C.Errno.t
+Posix.TTY.Termios.cfSetOSpeed = _import : C.Speed.t -> C.Int.t C.Errno.t
+Posix.TTY.Termios.getCCN = _import : C.Int.t -> C.CC.t
+Posix.TTY.Termios.getCFlag = _import : unit -> C.TCFlag.t
+Posix.TTY.Termios.getIFlag = _import : unit -> C.TCFlag.t
+Posix.TTY.Termios.getLFlag = _import : unit -> C.TCFlag.t
+Posix.TTY.Termios.getOFlag = _import : unit -> C.TCFlag.t
+Posix.TTY.Termios.setCCN = _import : C.Int.t * C.CC.t -> unit
+Posix.TTY.Termios.setCFlag = _import : C.TCFlag.t -> unit
+Posix.TTY.Termios.setIFlag = _import : C.TCFlag.t -> unit
+Posix.TTY.Termios.setLFlag = _import : C.TCFlag.t -> unit
+Posix.TTY.Termios.setOFlag = _import : C.TCFlag.t -> unit
+Posix.TTY.V.NCCS = _const : C.Int.t
+Posix.TTY.V.VEOF = _const : C.Int.t
+Posix.TTY.V.VEOL = _const : C.Int.t
+Posix.TTY.V.VERASE = _const : C.Int.t
+Posix.TTY.V.VINTR = _const : C.Int.t
+Posix.TTY.V.VKILL = _const : C.Int.t
+Posix.TTY.V.VMIN = _const : C.Int.t
+Posix.TTY.V.VQUIT = _const : C.Int.t
+Posix.TTY.V.VSTART = _const : C.Int.t
+Posix.TTY.V.VSTOP = _const : C.Int.t
+Posix.TTY.V.VSUSP = _const : C.Int.t
+Posix.TTY.V.VTIME = _const : C.Int.t
Socket.AF.INET = _const : C.Int.t
Socket.AF.INET6 = _const : C.Int.t
Socket.AF.UNIX = _const : C.Int.t
@@ -149,3 +358,28 @@
Time.getTimeOfDay = _import : unit -> C.Int.t
Time.sec = _import : unit -> C.Time.t
Time.usec = _import : unit -> C.SUSeconds.t
+Posix.FileSys.Dirstream.closeDir = _import : C.DirP.t -> C.Int.t C.Errno.t
+Posix.FileSys.Dirstream.openDir = _import : NullString8.t -> C.DirP.t C.Errno.t
+Posix.FileSys.Dirstream.readDir = _import : C.DirP.t -> C.String.t C.Errno.t
+Posix.FileSys.Dirstream.rewindDir = _import : C.DirP.t -> unit
+Posix.FileSys.ST.isDir = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isChr = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isBlk = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isReg = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isFIFO = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isLink = _import : C.Mode.t -> Bool.t
+Posix.FileSys.ST.isSock = _import : C.Mode.t -> Bool.t
+Posix.FileSys.Stat.getDev = _import : unit -> C.Dev.t
+Posix.FileSys.Stat.getINo = _import : unit -> C.INo.t
+Posix.FileSys.Stat.getMode = _import : unit -> C.Mode.t
+Posix.FileSys.Stat.getNLink = _import : unit -> C.NLink.t
+Posix.FileSys.Stat.getUId = _import : unit -> C.UId.t
+Posix.FileSys.Stat.getGId = _import : unit -> C.GId.t
+Posix.FileSys.Stat.getRDev = _import : unit -> C.Dev.t
+Posix.FileSys.Stat.getSize = _import : unit -> C.Off.t
+Posix.FileSys.Stat.getATime = _import : unit -> C.Time.t
+Posix.FileSys.Stat.getCTime = _import : unit -> C.Time.t
+Posix.FileSys.Stat.getMTime = _import : unit -> C.Time.t
+Posix.FileSys.Stat.fstat = _import : C.Fd.t -> C.Int.t C.Errno.t
+Posix.FileSys.Stat.lstat = _import : NullString8.t -> C.Int.t C.Errno.t
+Posix.FileSys.Stat.stat = _import : NullString8.t -> C.Int.t C.Errno.t
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-25 01:56:56 UTC (rev 4305)
@@ -224,9 +224,11 @@
";"]
| Symbol {name, ty} =>
String.concat
- ["val ",
+ ["val (",
Name.last name,
- " = #2 (_symbol \"",
+ "Get, ",
+ Name.last name,
+ "Set) = _symbol \"",
Name.toC name,
"\": (",
Type.toML ty,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-25 01:56:56 UTC (rev 4305)
@@ -158,19 +158,16 @@
"typedef C_SSize_t Ssize;",
"typedef C_String_t Cstring;",
"typedef C_StringArray_t CstringArray;",
- "typedef C_Off Position;"
+ "typedef C_Off_t Position;"
"",
"typedef C_Fd_t Fd;",
- "typedef C_TCFlag Flag;",
- "typedef C_GId Gid;",
- "typedef C_Mode Mode;",
- "typedef C_PId Pid;",
+ "typedef C_GId_t Gid;",
+ "typedef C_Mode_t Mode;",
+ "typedef C_PId_t Pid;",
"typedef C_Resource Resource;",
- "typedef C_RLim_t Rlimit;",
"typedef C_Signal Signal;",
- "typedef C_Speed Speed;",
"typedef C_Status Status;",
- "typedef C_UId Uid;",
+ "typedef C_UId_t Uid;",
"",
"#endif /* _MLTON_TYPES_H_ */",
NULL
@@ -215,7 +212,7 @@
writeNewline (fd);
systype(_Bool, "Word", "C_Bool_t");
systype(intmax_t, "Int", "C_Intmax_t");
- systype(uintmax_t, "Word", "C_Uintmax_t");
+ systype(uintmax_t, "Word", "C_UIntmax_t");
systype(intptr_t, "Int", "C_Intptr_t");
systype(uintptr_t, "Word", "C_UIntptr_t");
writeNewline (fd);
@@ -224,6 +221,10 @@
systype(int, "Int", "C_Fd_t");
systype(int, "Int", "C_Sock_t");
writeNewline (fd);
+ writeString (fd, "/* from <dirent.h> */");
+ writeNewline (fd);
+ systype(DIR*, "Word", "C_DirP_t");
+ writeNewline (fd);
writeString (fd, "/* from <poll.h> */");
writeNewline (fd);
systype(nfds_t, "Word", "C_NFds_t");
@@ -235,15 +236,18 @@
writeString (fd, "/* from <sys/types.h> */");
writeNewline (fd);
chknumsystype(clock_t, "C_Clock");
- chkintsystype(gid_t, "C_GId");
+ chknumsystype(dev_t, "C_Dev_t");
+ chkintsystype(gid_t, "C_GId_t");
chkintsystype(id_t, "C_Id");
- chkintsystype(mode_t, "C_Mode");
- systype(off_t, "Int", "C_Off");
- systype(pid_t, "Int", "C_PId");
+ systype(ino_t, "Word", "C_INo_t");
+ chkintsystype(mode_t, "C_Mode_t");
+ chkintsystype(nlink_t, "C_NLink_t");
+ systype(off_t, "Int", "C_Off_t");
+ systype(pid_t, "Int", "C_PId_t");
systype(ssize_t, "Int", "C_SSize_t");
systype(suseconds_t, "Int", "C_SUSeconds_t");
chknumsystype(time_t, "C_Time_t");
- chkintsystype(uid_t, "C_UId");
+ chkintsystype(uid_t, "C_UId_t");
systype(useconds_t, "Word", "C_USeconds_t");
writeNewline (fd);
writeString (fd, "/* from <sys/types.h> */");
@@ -252,8 +256,9 @@
writeNewline (fd);
writeString (fd, "/* from <termios.h> */");
writeNewline (fd);
- systype(tcflag_t, "Word", "C_TCFlag");
- systype(speed_t, "Word", "C_Speed");
+ systype(cc_t, "Word", "C_CC_t");
+ systype(speed_t, "Word", "C_Speed_t");
+ systype(tcflag_t, "Word", "C_TCFlag_t");
writeNewline (fd);
writeString (fd, "/* Misc */");
writeNewline (fd);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-24 02:49:37 UTC (rev 4304)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-25 01:56:56 UTC (rev 4305)
@@ -81,21 +81,6 @@
#define EXECVE execve
#endif
-#if not HAS_FEROUND
-#ifndef FE_TONEAREST
-#define FE_TONEAREST 0
-#endif
-#ifndef FE_DOWNWARD
-#define FE_DOWNWARD 1
-#endif
-#ifndef FE_UPWARD
-#define FE_UPWARD 2
-#endif
-#ifndef FE_TOWARDZERO
-#define FE_TOWARDZERO 3
-#endif
-#endif
-
#if not HAS_FPCLASSIFY
#ifndef FP_INFINITE
#define FP_INFINITE 1
@@ -179,22 +164,6 @@
/* ---------------------------------------------------------------- */
/* ------------------------------------------------- */
-/* IEEEReal */
-/* ------------------------------------------------- */
-
-#define FE_NOSUPPORT -1
-/* Can't handle undefined rounding modes with code like the following.
- * #ifndef FE_TONEAREST
- * #define FE_TONEAREST FE_NOSUPPORT
- * #endif
- * On some platforms, FE_* are defined via an enum, not the preprocessor,
- * and hence don't show up as #defined. In that case, the above code
- * overwrites them.
- */
-void IEEEReal_setRoundingMode (Int mode);
-Int IEEEReal_getRoundingMode (void);
-
-/* ------------------------------------------------- */
/* IntInf */
/* ------------------------------------------------- */
@@ -292,67 +261,6 @@
/* ------------------------------------------------- */
/* ---------------------------------- */
-/* Posix.Error */
-/* ---------------------------------- */
-
-void Posix_Error_clearErrno (void);
-int Posix_Error_getErrno (void);
-Cstring Posix_Error_strerror (Int n);
-
-#define Posix_Error_acces EACCES
-#define Posix_Error_again EAGAIN
-#define Posix_Error_badf EBADF
-#ifndef EBADMSG
-#define EBADMSG 0
-#endif
-#define Posix_Error_badmsg EBADMSG
-#define Posix_Error_busy EBUSY
-#ifndef ECANCELED
-#define ECANCELED 0
-#endif
-#define Posix_Error_canceled ECANCELED
-#define Posix_Error_child ECHILD
-#define Posix_Error_deadlk EDEADLK
-#define Posix_Error_dom EDOM
-#define Posix_Error_exist EEXIST
-#define Posix_Error_fault EFAULT
-#define Posix_Error_fbig EFBIG
-#define Posix_Error_inprogress EINPROGRESS
-#define Posix_Error_intr EINTR
-#define Posix_Error_inval EINVAL
-#define Posix_Error_io EIO
-#define Posix_Error_isdir EISDIR
-#define Posix_Error_loop ELOOP
-#define Posix_Error_mfile EMFILE
-#define Posix_Error_mlink EMLINK
-#define Posix_Error_msgsize EMSGSIZE
-#define Posix_Error_nametoolong ENAMETOOLONG
-#define Posix_Error_nfile ENFILE
-#define Posix_Error_nodev ENODEV
-#define Posix_Error_noent ENOENT
-#define Posix_Error_noexec ENOEXEC
-#define Posix_Error_nolck ENOLCK
-#define Posix_Error_nomem ENOMEM
-#define Posix_Error_nospc ENOSPC
-#define Posix_Error_nosys ENOSYS
-#define Posix_Error_notdir ENOTDIR
-#define Posix_Error_notempty ENOTEMPTY
-#ifndef ENOTSUP
-#define ENOTSUP 0
-#endif
-#define Posix_Error_notsup ENOTSUP
-#define Posix_Error_notty ENOTTY
-#define Posix_Error_nxio ENXIO
-#define Posix_Error_perm EPERM
-#define Posix_Error_pipe EPIPE
-#define Posix_Error_range ERANGE
-#define Posix_Error_rofs EROFS
-#define Posix_Error_spipe ESPIPE
-#define Posix_Error_srch ESRCH
-#define Posix_Error_toobig E2BIG
-#define Posix_Error_xdev EXDEV
-
-/* ---------------------------------- */
/* Posix.FileSys */
/* ---------------------------------- */
@@ -438,26 +346,6 @@
#define Posix_FileSys_PRIO_IO 0
#endif
-Int Posix_FileSys_Dirstream_closedir (Cpointer d);
-Cpointer Posix_FileSys_Dirstream_opendir (Pointer p);
-Cstring Posix_FileSys_Dirstream_readdir (Cpointer d);
-void Posix_FileSys_Dirstream_rewinddir (Cpointer p);
-
-Int Posix_FileSys_Stat_fstat (Fd f);
-Int Posix_FileSys_Stat_lstat (Pointer f);
-Int Posix_FileSys_Stat_stat (Pointer f);
-Word Posix_FileSys_Stat_dev (void);
-Int Posix_FileSys_Stat_ino (void);
-Word Posix_FileSys_Stat_mode (void);
-Int Posix_FileSys_Stat_nlink (void);
-Word Posix_FileSys_Stat_uid (void);
-Word Posix_FileSys_Stat_gid (void);
-Word Posix_FileSys_Stat_rdev (void);
-Position Posix_FileSys_Stat_size (void);
-Int Posix_FileSys_Stat_atime (void);
-Int Posix_FileSys_Stat_mtime (void);
-Int Posix_FileSys_Stat_ctime (void);
-
void Posix_FileSys_Utimbuf_setActime (Int x);
void Posix_FileSys_Utimbuf_setModTime (Int x);
Int Posix_FileSys_Utimbuf_utime (Pointer s);
@@ -483,14 +371,6 @@
Word Posix_FileSys_umask (Word w);
Word Posix_FileSys_unlink (Pointer p);
-Bool Posix_FileSys_ST_isDir (Word w);
-Bool Posix_FileSys_ST_isChr (Word w);
-Bool Posix_FileSys_ST_isBlk (Word w);
-Bool Posix_FileSys_ST_isReg (Word w);
-Bool Posix_FileSys_ST_isFIFO (Word w);
-Bool Posix_FileSys_ST_isLink (Word w);
-Bool Posix_FileSys_ST_isSock (Word w);
-
/* ---------------------------------- */
/* Posix.IO */
/* ---------------------------------- */
@@ -704,103 +584,6 @@
Gid Posix_SysDB_Group_gid (void);
CstringArray Posix_SysDB_Group_mem (void);
-/* ---------------------------------- */
-/* Posix.TTY */
-/* ---------------------------------- */
-
-#define Posix_TTY_b0 B0
-#define Posix_TTY_b110 B110
-#define Posix_TTY_b1200 B1200
-#define Posix_TTY_b134 B134
-#define Posix_TTY_b150 B150
-#define Posix_TTY_b1800 B1800
-#define Posix_TTY_b19200 B19200
-#define Posix_TTY_b200 B200
-#define Posix_TTY_b2400 B2400
-#define Posix_TTY_b300 B300
-#define Posix_TTY_b38400 B38400
-#define Posix_TTY_b4800 B4800
-#define Posix_TTY_b50 B50
-#define Posix_TTY_b600 B600
-#define Posix_TTY_b75 B75
-#define Posix_TTY_b9600 B9600
-#define Posix_TTY_V_eof VEOF
-#define Posix_TTY_V_eol VEOL
-#define Posix_TTY_V_erase VERASE
-#define Posix_TTY_V_intr VINTR
-#define Posix_TTY_V_kill VKILL
-#define Posix_TTY_V_min VMIN
-#define Posix_TTY_V_nccs NCCS
-#define Posix_TTY_V_quit VQUIT
-#define Posix_TTY_V_start VSTART
-#define Posix_TTY_V_stop VSTOP
-#define Posix_TTY_V_susp VSUSP
-#define Posix_TTY_V_time VTIME
-#define Posix_TTY_I_brkint BRKINT
-#define Posix_TTY_I_icrnl ICRNL
-#define Posix_TTY_I_ignbrk IGNBRK
-#define Posix_TTY_I_igncr IGNCR
-#define Posix_TTY_I_ignpar IGNPAR
-#define Posix_TTY_I_inlcr INLCR
-#define Posix_TTY_I_inpck INPCK
-#define Posix_TTY_I_istrip ISTRIP
-#define Posix_TTY_I_ixoff IXOFF
-#define Posix_TTY_I_ixon IXON
-#define Posix_TTY_I_parmrk PARMRK
-#define Posix_TTY_O_opost OPOST
-#define Posix_TTY_C_clocal CLOCAL
-#define Posix_TTY_C_cread CREAD
-#define Posix_TTY_C_cs5 CS5
-#define Posix_TTY_C_cs6 CS6
-#define Posix_TTY_C_cs7 CS7
-#define Posix_TTY_C_cs8 CS8
-#define Posix_TTY_C_csize CSIZE
-#define Posix_TTY_C_cstopb CSTOPB
-#define Posix_TTY_C_hupcl HUPCL
-#define Posix_TTY_C_parenb PARENB
-#define Posix_TTY_C_parodd PARODD
-#define Posix_TTY_L_echo ECHO
-#define Posix_TTY_L_echoe ECHOE
-#define Posix_TTY_L_echok ECHOK
-#define Posix_TTY_L_echonl ECHONL
-#define Posix_TTY_L_icanon ICANON
-#define Posix_TTY_L_iexten IEXTEN
-#define Posix_TTY_L_isig ISIG
-#define Posix_TTY_L_noflsh NOFLSH
-#define Posix_TTY_L_tostop TOSTOP
-#define Posix_TTY_TC_sadrain TCSADRAIN
-#define Posix_TTY_TC_saflush TCSAFLUSH
-#define Posix_TTY_TC_sanow TCSANOW
-#define Posix_TTY_TC_ion TCION
-#define Posix_TTY_TC_ioff TCIOFF
-#define Posix_TTY_TC_ooff TCOOFF
-#define Posix_TTY_TC_oon TCOON
-#define Posix_TTY_TC_iflush TCIFLUSH
-#define Posix_TTY_TC_ioflush TCIOFLUSH
-#define Posix_TTY_TC_oflush TCOFLUSH
-
-Flag Posix_TTY_Termios_iflag (void);
-Flag Posix_TTY_Termios_oflag (void);
-Flag Posix_TTY_Termios_cflag (void);
-Flag Posix_TTY_Termios_lflag (void);
-Cstring Posix_TTY_Termios_cc (void);
-Speed Posix_TTY_Termios_cfgetospeed (void);
-Speed Posix_TTY_Termios_cfgetispeed (void);
-void Posix_TTY_Termios_setiflag (Flag f);
-void Posix_TTY_Termios_setoflag (Flag f);
-void Posix_TTY_Termios_setcflag (Flag f);
-void Posix_TTY_Termios_setlflag (Flag f);
-Int Posix_TTY_Termios_setospeed (Speed s);
-Int Posix_TTY_Termios_setispeed (Speed s);
-Int Posix_TTY_getattr (Fd f);
-Int Posix_TTY_setattr (Fd f, Int i);
-Int Posix_TTY_sendbreak (Fd f, Int i);
-Int Posix_TTY_drain (Fd f);
-Int Posix_TTY_flush (Fd f, Int i);
-Int Posix_TTY_flow (Fd f, Int i);
-Int Posix_TTY_getpgrp (Fd f);
-Int Posix_TTY_setpgrp (Fd f, Pid p);
-
/* ------------------------------------------------- */
/* Ptrace */
/* ------------------------------------------------- */