You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matthew F. <fl...@ml...> - 2006-01-26 15:35:31
|
Simplified IntInf initialization. - eliminated hex representation - mutate string rep in place for mpn_set_str Generalized IntInf initialization to 64-bit case and objptr size. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/mlton/backend/rep-type.fun U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/mlton/backend/rep-type.fun =================================================================== --- mlton/branches/on-20050822-x86_64-branch/mlton/backend/rep-type.fun 2006-01-26 03:06:35 UTC (rev 4307) +++ mlton/branches/on-20050822-x86_64-branch/mlton/backend/rep-type.fun 2006-01-26 23:35:22 UTC (rev 4308) @@ -384,6 +384,7 @@ * WORD8_VECTOR_TYPE_INDEX, * WORD16_VECTOR_TYPE_INDEX, * WORD32_VECTOR_TYPE_INDEX. + * WORD64_VECTOR_TYPE_INDEX. *) val basic = let @@ -402,7 +403,8 @@ (PointerTycon.weakGone, WeakGone), wordVec 8, wordVec 32, - wordVec 16] + wordVec 16, + wordVec 64] end local Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c 2006-01-26 03:06:35 UTC (rev 4307) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c 2006-01-26 23:35:22 UTC (rev 4308) @@ -17,9 +17,10 @@ total = 0; for (i = 0; i < s->intInfInitsLength; ++i) { + /* A slight overestimate. */ numBytes = - sizeof(uint32_t) // for the sign - + strlen (s->intInfInits[i].mlstr); + sizeof(mp_limb_t) // for the sign + + (align(strlen (s->intInfInits[i].mlstr), sizeof(mp_limb_t))); total += align (GC_ARRAY_HEADER_SIZE + numBytes, s->alignment); @@ -41,12 +42,11 @@ struct GC_intInfInit *inits; pointer frontier; char *str; - size_t slen, llen; + size_t slen; mp_size_t alen; uint32_t i, j; - bool neg, hex; + bool neg; GC_intInf bp; - unsigned char *cp; assert (isFrontierAligned (s, s->frontier)); frontier = s->frontier; @@ -58,30 +58,18 @@ if (neg) str++; slen = strlen (str); - hex = str[0] == '0' && str[1] == 'x'; - if (hex) { - str += 2; - slen -= 2; - llen = (slen + 7) / 8; - } else - llen = (slen + 8) / 9; assert (slen > 0); + bp = (GC_intInf)frontier; - cp = (unsigned char *)(&(bp->limbs[llen])); - for (j = 0; j != slen; j++) - if ('0' <= str[j] && str[j] <= '9') - cp[j] = str[j] - '0' + 0; - else if ('a' <= str[j] && str[j] <= 'f') - cp[j] = str[j] - 'a' + 0xa; - else { - assert('A' <= str[j] && str[j] <= 'F'); - cp[j] = str[j] - 'A' + 0xA; - } - alen = mpn_set_str ((mp_limb_t*)(bp->limbs), cp, slen, hex ? 0x10 : 10); - assert ((size_t)alen <= llen); + for (j = 0; j != slen; j++) { + assert('0' <= str[j] && str[j] <= '9'); + unsigned char c = str[j] - '0' + 0; + str[j] = c; + } + alen = mpn_set_str ((mp_limb_t*)(bp->limbs), (unsigned char*)str, slen, 10); if (alen <= 1) { - uint32_t val, ans; + uintmax_t val, ans; if (alen == 0) val = 0; @@ -89,16 +77,16 @@ val = bp->limbs[0]; if (neg) { /* - * We only fit if val in [1, 2^30]. + * We only fit if val in [1, 2^(8 * OBJPTR_SIZE - 1)]. */ ans = - val; val = val - 1; } else /* - * We only fit if val in [0, 2^30 - 1]. + * We only fit if val in [0, 2^(8 * OBJPTR_SIZE - 1) - 1]. */ ans = val; - if (val < (uint32_t)1<<30) { + if (val < (uintmax_t)1<<(8 * OBJPTR_SIZE - 1)) { s->globals[inits->globalIndex] = (objptr)(ans<<1 | 1); continue; } @@ -106,7 +94,7 @@ s->globals[inits->globalIndex] = pointerToObjptr((pointer)(&bp->isneg), s->heap.start); bp->counter = 0; bp->length = alen + 1; - bp->header = buildHeaderFromTypeIndex (WORD32_VECTOR_TYPE_INDEX); + bp->header = GC_INTINF_HEADER; bp->isneg = neg; frontier = alignFrontier (s, (pointer)&bp->limbs[alen]); } @@ -152,6 +140,9 @@ case 4: typeIndex = WORD32_VECTOR_TYPE_INDEX; break; + case 8: + typeIndex = WORD64_VECTOR_TYPE_INDEX; + break; default: die ("unknown bytes per element in vectorInit: %zu", bytesPerElement); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.h 2006-01-26 03:06:35 UTC (rev 4307) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.h 2006-01-26 23:35:22 UTC (rev 4308) @@ -15,8 +15,8 @@ * * The strings pointed to by the mlstr fields consist of * an optional ~ - * either one or more of [0-9] or - * 0x followed by one or more of [0-9a-fA-F] + * one of [1-9] + * zero or more of [0-9] * a trailing EOS */ struct GC_intInfInit { Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2006-01-26 03:06:35 UTC (rev 4307) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2006-01-26 23:35:22 UTC (rev 4308) @@ -15,15 +15,21 @@ GC_arrayCounter counter; GC_arrayLength length; GC_header header; - uint32_t isneg; - uint32_t limbs[1]; + mp_limb_t isneg; + mp_limb_t limbs[1]; } *GC_intInf; #endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */ #if (defined (MLTON_GC_INTERNAL_FUNCS)) -#define GC_INTINF_HEADER GC_WORD32_VECTOR_HEADER +COMPILE_TIME_ASSERT(sizeof_mp_limb_t__is_four_or_eight, + (sizeof(mp_limb_t) == 4 || sizeof(mp_limb_t) == 8)); +#define GC_INTINF_HEADER ( \ + CHAR_BIT * sizeof(mp_limb_t) == 32 ? \ + GC_WORD32_VECTOR_HEADER : ( \ + CHAR_BIT * sizeof(mp_limb_t) == 64 ? \ + GC_WORD64_VECTOR_HEADER : ( 0 ) ) ) #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2006-01-26 03:06:35 UTC (rev 4307) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2006-01-26 23:35:22 UTC (rev 4308) @@ -132,6 +132,7 @@ WORD8_VECTOR_TYPE_INDEX = 3, WORD32_VECTOR_TYPE_INDEX = 4, WORD16_VECTOR_TYPE_INDEX = 5, + WORD64_VECTOR_TYPE_INDEX = 6, }; #endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */ @@ -144,6 +145,7 @@ #define GC_WORD8_VECTOR_HEADER buildHeaderFromTypeIndex (WORD8_VECTOR_TYPE_INDEX) #define GC_WORD16_VECTOR_HEADER buildHeaderFromTypeIndex (WORD16_VECTOR_TYPE_INDEX) #define GC_WORD32_VECTOR_HEADER buildHeaderFromTypeIndex (WORD32_VECTOR_TYPE_INDEX) +#define GC_WORD64_VECTOR_HEADER buildHeaderFromTypeIndex (WORD64_VECTOR_TYPE_INDEX) static inline void splitHeader (GC_state s, GC_header header, GC_objectTypeTag *tagRet, bool *hasIdentityRet, |
From: Matthew F. <fl...@ml...> - 2006-01-25 19:07:11
|
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/FileSys/FileSys-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c D mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ttyname.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/alarm.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exit.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exitStatus.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/fork.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifExited.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifSignaled.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/ifStopped.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/kill.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/nanosleep.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/pause.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/sleep.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/stopSig.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/system.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/termSig.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/waitpid.c A mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Passwd.c U mlton/branches/on-20050822-x86_64-branch/runtime/TODO U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 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/cygwin.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h U mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.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-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-26 03:06:35 UTC (rev 4307) @@ -51,7 +51,7 @@ endif CC = gcc -std=gnu99 -CFLAGS = -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS) +CFLAGS = -Wall -I. -Iplatform $(FLAGS) OPTCFLAGS = $(CFLAGS) -O2 $(OPTFLAGS) DEBUGCFLAGS = $(CFLAGS) -gstabs+ -g2 -O1 -DASSERT=1 WARNFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \ Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/FileSys-consts.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,75 @@ +#include "platform.h" + +const C_Int_t Posix_FileSys_A_F_OK = F_OK; +const C_Int_t Posix_FileSys_A_R_OK = R_OK; +const C_Int_t Posix_FileSys_A_W_OK = W_OK; +const C_Int_t Posix_FileSys_A_X_OK = X_OK; + +const C_Int_t Posix_FileSys_O_RDONLY = O_RDONLY; +const C_Int_t Posix_FileSys_O_RDWR = O_RDWR; +const C_Int_t Posix_FileSys_O_WRONLY = O_WRONLY; + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#ifndef O_TEXT +#define O_TEXT 0 +#endif + +const C_Int_t Posix_FileSys_O_APPEND = O_APPEND; +const C_Int_t Posix_FileSys_O_BINARY = O_BINARY; +const C_Int_t Posix_FileSys_O_CREAT = O_CREAT; +const C_Int_t Posix_FileSys_O_DSYNC = O_DSYNC; +const C_Int_t Posix_FileSys_O_EXCL = O_EXCL; +const C_Int_t Posix_FileSys_O_NOCTTY = O_NOCTTY; +const C_Int_t Posix_FileSys_O_NONBLOCK = O_NONBLOCK; +const C_Int_t Posix_FileSys_O_RSYNC = O_RSYNC; +const C_Int_t Posix_FileSys_O_SYNC = O_SYNC; +const C_Int_t Posix_FileSys_O_TEXT = O_TEXT; +const C_Int_t Posix_FileSys_O_TRUNC = O_TRUNC; + +const C_Int_t Posix_FileSys_PC_FILESIZEBITS = _PC_FILESIZEBITS; +const C_Int_t Posix_FileSys_PC_LINK_MAX = _PC_LINK_MAX; +const C_Int_t Posix_FileSys_PC_MAX_CANON = _PC_MAX_CANON; +const C_Int_t Posix_FileSys_PC_MAX_INPUT = _PC_MAX_INPUT; +const C_Int_t Posix_FileSys_PC_NAME_MAX = _PC_NAME_MAX; +const C_Int_t Posix_FileSys_PC_PATH_MAX = _PC_PATH_MAX; +const C_Int_t Posix_FileSys_PC_PIPE_BUF = _PC_PIPE_BUF; +const C_Int_t Posix_FileSys_PC_2_SYMLINKS = _PC_2_SYMLINKS; +const C_Int_t Posix_FileSys_PC_ALLOC_SIZE_MIN = _PC_ALLOC_SIZE_MIN; +const C_Int_t Posix_FileSys_PC_REC_INCR_XFER_SIZE = _PC_REC_INCR_XFER_SIZE; +const C_Int_t Posix_FileSys_PC_REC_MAX_XFER_SIZE = _PC_REC_MAX_XFER_SIZE; +const C_Int_t Posix_FileSys_PC_REC_MIN_XFER_SIZE = _PC_REC_MIN_XFER_SIZE; +const C_Int_t Posix_FileSys_PC_REC_XFER_ALIGN = _PC_REC_XFER_ALIGN; +const C_Int_t Posix_FileSys_PC_SYMLINK_MAX = _PC_SYMLINK_MAX; +const C_Int_t Posix_FileSys_PC_CHOWN_RESTRICTED = _PC_CHOWN_RESTRICTED; +const C_Int_t Posix_FileSys_PC_NO_TRUNC = _PC_NO_TRUNC; +const C_Int_t Posix_FileSys_PC_VDISABLE = _PC_VDISABLE; +const C_Int_t Posix_FileSys_PC_ASYNC_IO = _PC_ASYNC_IO; +const C_Int_t Posix_FileSys_PC_PRIO_IO = _PC_PRIO_IO; +const C_Int_t Posix_FileSys_PC_SYNC_IO = _PC_SYNC_IO; + +const C_Mode_t Posix_FileSys_S_IFBLK = S_IFBLK; +const C_Mode_t Posix_FileSys_S_IFCHR = S_IFCHR; +const C_Mode_t Posix_FileSys_S_IFDIR = S_IFDIR; +const C_Mode_t Posix_FileSys_S_IFIFO = S_IFIFO; +const C_Mode_t Posix_FileSys_S_IFLNK = S_IFLNK; +const C_Mode_t Posix_FileSys_S_IFMT = S_IFMT; +const C_Mode_t Posix_FileSys_S_IFREG = S_IFREG; +const C_Mode_t Posix_FileSys_S_IFSOCK = S_IFSOCK; +const C_Mode_t Posix_FileSys_S_IRGRP = S_IRGRP; +const C_Mode_t Posix_FileSys_S_IROTH = S_IROTH; +const C_Mode_t Posix_FileSys_S_IRUSR = S_IRUSR; +const C_Mode_t Posix_FileSys_S_IRWXG = S_IRWXG; +const C_Mode_t Posix_FileSys_S_IRWXO = S_IRWXO; +const C_Mode_t Posix_FileSys_S_IRWXU = S_IRWXU; +const C_Mode_t Posix_FileSys_S_ISGID = S_ISGID; +const C_Mode_t Posix_FileSys_S_ISUID = S_ISUID; +const C_Mode_t Posix_FileSys_S_ISVTX = S_ISVTX; +const C_Mode_t Posix_FileSys_S_IWGRP = S_IWGRP; +const C_Mode_t Posix_FileSys_S_IWOTH = S_IWOTH; +const C_Mode_t Posix_FileSys_S_IWUSR = S_IWUSR; +const C_Mode_t Posix_FileSys_S_IXGRP = S_IXGRP; +const C_Mode_t Posix_FileSys_S_IXOTH = S_IXOTH; +const C_Mode_t Posix_FileSys_S_IXUSR = S_IXUSR; 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-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -46,6 +46,7 @@ return statbuf.st_ctime; } +/* C_BlkSize_t Posix_FileSys_Stat_getBlkSize (void) { return statbuf.st_blksize; } @@ -53,6 +54,7 @@ C_BlkCnt_t Posix_FileSys_Stat_getBlkCnt (void) { return statbuf.st_blocks; } +*/ C_Errno_t(C_Int_t) Posix_FileSys_Stat_fstat (C_Fd_t f) { return fstat (f, &statbuf); @@ -63,5 +65,5 @@ } C_Errno_t(C_Int_t) Posix_FileSys_Stat_stat (NullString8_t f) { - return stat ((char*)f, &statbuf); + return stat ((const char*)f, &statbuf); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -2,14 +2,14 @@ static struct utimbuf utimbuf; -void Posix_FileSys_Utimbuf_setActime (Int i) { - utimbuf.actime = i; +void Posix_FileSys_Utimbuf_setAcTime (C_Time_t t) { + utimbuf.actime = t; } -void Posix_FileSys_Utimbuf_setModTime (Int i) { - utimbuf.modtime = i; +void Posix_FileSys_Utimbuf_setModTime (C_Time_t t) { + utimbuf.modtime = t; } -Int Posix_FileSys_Utimbuf_utime (Pointer s) { - return (Int)utime((char *)s, &utimbuf); +C_Errno_t(C_Int_t) Posix_FileSys_Utimbuf_utime (NullString8_t s) { + return utime((const char *)s, &utimbuf); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_access (Pointer f, Word w) { - return access ((char *) f, w); +C_Errno_t(C_Int_t) Posix_FileSys_access (NullString8_t f, C_Int_t i) { + return access ((const char *) f, i); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_chdir(Pointer p) { - return chdir((char *) p); +C_Errno_t(C_Int_t) Posix_FileSys_chdir(NullString8_t p) { + return chdir((const char *) p); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_chmod (Pointer p, Mode m) { - return chmod ((char *) p, m); +C_Errno_t(C_Int_t) Posix_FileSys_chmod (NullString8_t p, C_Mode_t m) { + return chmod ((const char *) p, m); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_chown (Pointer p, Uid u, Gid g) { - return chown ((char *) p, u, g); +C_Errno_t(C_Int_t) Posix_FileSys_chown (NullString8_t p, C_UId_t u, C_GId_t g) { + return chown ((const char *) p, u, g); } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2006-01-24 02:49:37 UTC (rev 4304) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchdir.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +C_Errno_t(C_Int_t) Posix_FileSys_fchdir(C_Fd_t f) { + return fchdir(f); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchmod.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_fchmod (Fd f, Mode m) { - return fchmod (f, m); +C_Errno_t(C_Int_t) Posix_FileSys_fchmod (C_Fd_t f, C_Mode_t m) { + return fchmod (f, m); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fchown.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_fchown (Fd f, Uid u, Gid g) { - return fchown (f, u, g); +C_Errno_t(C_Int_t) Posix_FileSys_fchown (C_Fd_t f, C_UId_t u, C_GId_t g) { + return fchown (f, u, g); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/fpathconf.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_fpathconf (Fd f, Int n) { - return fpathconf (f, n); +C_Errno_t(C_Long_t) Posix_FileSys_fpathconf (C_Fd_t f, C_Int_t n) { + return fpathconf (f, n); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_ftruncate (Fd f, Position n) { - return ftruncate (f, n); +C_Errno_t(C_Int_t) Posix_FileSys_ftruncate (C_Fd_t f, C_Off_t n) { + return ftruncate (f, n); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,6 +1,6 @@ #include "platform.h" -Cstring Posix_FileSys_getcwd (Pointer buf, Size n) { - char *res = getcwd ((char*)buf, n); - return (Cstring)res; +C_String_t Posix_FileSys_getcwd (Array(Char8_t) buf, C_Size_t n) { + char *res = getcwd ((char*)buf, n); + return (C_String_t)res; } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_link (Pointer p1, Pointer p2) { - return link ((char *) p1, (char *) p2); +C_Errno_t(C_Int_t) Posix_FileSys_link (NullString8_t p1, NullString8_t p2) { + return link ((const char *) p1, (const char *) p2); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_mkdir (Pointer p, Word w) { - return mkdir2 ((char *) p, w); +C_Errno_t(C_Int_t) Posix_FileSys_mkdir (NullString8_t p, C_Mode_t m) { + return mkdir ((const char *) p, m); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_mkfifo (Pointer p, Word w) { - return mkfifo ((char *) p, w); +C_Errno_t(C_Int_t) Posix_FileSys_mkfifo (NullString8_t p, C_Mode_t m) { + return mkfifo ((const char *) p, m); } Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,19 +0,0 @@ -#include "platform.h" - -#ifndef DEBUG -#define DEBUG FALSE -#endif - -Int Posix_FileSys_open (Pointer p, Word w, Mode m) { - Int res; - - res = open ((char *) p, w, m); - - if (DEBUG) - fprintf (stderr, "%d = Posix_FileSys_open (%s, 0x%08x, 0x%08x)\n", - (int)res, - (char *)p, - (unsigned int)w, - (unsigned int)m); - return res; -} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-24 02:49:37 UTC (rev 4304) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open2.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +C_Errno_t(C_Fd_t) Posix_FileSys_open2 (NullString8_t p, C_Int_t i) { + return open ((const char*)p, i); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2006-01-24 02:49:37 UTC (rev 4304) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open3.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +C_Errno_t(C_Fd_t) Posix_FileSys_open3 (NullString8_t p, C_Int_t i, C_Mode_t m) { + return open ((const char*)p, i, (mode_t)m); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_pathconf (Pointer p, Int n) { - return pathconf ((char *)p, n); +C_Errno_t(C_Long_t) Posix_FileSys_pathconf (NullString8_t p, C_Int_t n) { + return pathconf ((const char *)p, n); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_readlink (Pointer p, Pointer b, Int n) { - return readlink ((char*)p, (char*)b, n); +C_Errno_t(C_SSize_t) Posix_FileSys_readlink (NullString8_t p, Array(Char8_t) b, C_Size_t n) { + return readlink ((const char*)p, (char*)b, n); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_rename (Pointer p1, Pointer p2) { - return rename ((char *) p1, (char *) p2); +C_Errno_t(C_Int_t) Posix_FileSys_rename (NullString8_t p1, NullString8_t p2) { + return rename ((const char*) p1, (const char*) p2); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_rmdir (Pointer p) { - return rmdir ((char *) p); +C_Errno_t(C_Int_t) Posix_FileSys_rmdir (NullString8_t p) { + return rmdir ((const char*) p); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_FileSys_symlink (Pointer p1, Pointer p2) { - return symlink ((char *) p1, (char *) p2); +C_Errno_t(C_Int_t) Posix_FileSys_symlink (NullString8_t p1, NullString8_t p2) { + return symlink ((const char*) p1, (const char*) p2); } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/ftruncate.c 2006-01-24 02:49:37 UTC (rev 4304) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/truncate.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +C_Errno_t(C_Int_t) Posix_FileSys_truncate (NullString8_t p, C_Off_t n) { + return truncate ((const char*)p, n); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/umask.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Word Posix_FileSys_umask (Word w) { - return umask (w); +C_Mode_t Posix_FileSys_umask (C_Mode_t m) { + return umask (m); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Word Posix_FileSys_unlink (Pointer p) { - return unlink ((char *) p); +C_Errno_t(C_Int_t) Posix_FileSys_unlink (NullString8_t p) { + return unlink ((const char*) p); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +const C_Int_t Posix_IO_FLock_F_GETLK = F_GETLK; +const C_Int_t Posix_IO_FLock_F_SETLK = F_SETLK; +const C_Int_t Posix_IO_FLock_F_SETLKW = F_SETLKW; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -2,46 +2,46 @@ static struct flock s_flock; -Int Posix_IO_FLock_fcntl (Fd f, Int cmd) { - return fcntl (f, cmd, (int)&s_flock); +C_Errno_t(C_Int_t) Posix_IO_FLock_fcntl (C_Fd_t f, C_Int_t cmd) { + return fcntl (f, cmd, &s_flock); } -Int Posix_IO_FLock_type () { - return s_flock.l_type; +C_Short_t Posix_IO_FLock_getType (void) { + return s_flock.l_type; } -Int Posix_IO_FLock_whence () { - return s_flock.l_whence; +C_Short_t Posix_IO_FLock_getWhence (void) { + return s_flock.l_whence; } -Position Posix_IO_FLock_start () { - return s_flock.l_start; +C_Off_t Posix_IO_FLock_getStart (void) { + return s_flock.l_start; } -Position Posix_IO_FLock_len () { +C_Off_t Posix_IO_FLock_getLen (void) { return s_flock.l_len; } -Int Posix_IO_FLock_pid () { +C_PId_t Posix_IO_FLock_getPId (void) { return s_flock.l_pid; } -void Posix_IO_FLock_setType (Int x) { - s_flock.l_type = x; +void Posix_IO_FLock_setType (C_Short_t x) { + s_flock.l_type = x; } -void Posix_IO_FLock_setWhence (Int x) { - s_flock.l_whence = x; +void Posix_IO_FLock_setWhence (C_Short_t x) { + s_flock.l_whence = x; } -void Posix_IO_FLock_setStart (Position x) { - s_flock.l_start = x; +void Posix_IO_FLock_setStart (C_Off_t x) { + s_flock.l_start = x; } -void Posix_IO_FLock_setLen (Position x) { - s_flock.l_len = x; +void Posix_IO_FLock_setLen (C_Off_t x) { + s_flock.l_len = x; } -void Posix_IO_FLock_setPid (Int x) { - s_flock.l_pid = x; +void Posix_IO_FLock_setPId (C_PId_t x) { + s_flock.l_pid = x; } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/close.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_IO_close (Fd f) { - return close (f); +C_Errno_t(C_Int_t) Posix_IO_close (C_Fd_t f) { + return close (f); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Fd Posix_IO_dup (Fd f) { - return dup( f); +C_Errno_t(C_Fd_t) Posix_IO_dup (C_Fd_t f) { + return dup (f); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/dup2.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Fd Posix_IO_dup2 (Fd f1, Fd f2) { - return dup2 (f1, f2); +C_Errno_t(C_Fd_t) Posix_IO_dup2 (C_Fd_t f1, C_Fd_t f2) { + return dup2 (f1, f2); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl-consts.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,13 @@ +#include "platform.h" + +const C_Int_t Posix_IO_F_DUPFD = F_DUPFD; +const C_Int_t Posix_IO_F_GETFD = F_GETFD; +const C_Int_t Posix_IO_F_SETFD = F_SETFD; +const C_Int_t Posix_IO_F_GETFL = F_GETFL; +const C_Int_t Posix_IO_F_SETFL = F_SETFL; +const C_Int_t Posix_IO_F_GETOWN = F_GETOWN; +const C_Int_t Posix_IO_F_SETOWN = F_SETOWN; + +const C_Fd_t Posix_IO_FD_CLOEXEC = FD_CLOEXEC; + +const C_Int_t Posix_IO_O_ACCMODE = O_ACCMODE; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl2.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_IO_fcntl2 (Fd f, Int i) { - return fcntl (f, i); +C_Errno_t(C_Int_t) Posix_IO_fcntl2 (C_Fd_t f, C_Int_t i) { + return fcntl (f, i); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fcntl3.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_IO_fcntl3 (Fd f, Int i, Int j) { - return fcntl (f, i, j); +C_Errno_t(C_Int_t) Posix_IO_fcntl3 (C_Fd_t f, C_Int_t i, C_Int_t j) { + return fcntl (f, i, j); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/fsync.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_IO_fsync (Fd f) { - return fsync (f); +C_Errno_t(C_Int_t) Posix_IO_fsync (C_Fd_t f) { + return fsync (f); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek-consts.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,5 @@ +#include "platform.h" + +const C_Int_t Posix_IO_SEEK_CUR = SEEK_CUR; +const C_Int_t Posix_IO_SEEK_END = SEEK_END; +const C_Int_t Posix_IO_SEEK_SET = SEEK_SET; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/lseek.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Position Posix_IO_lseek (Fd f, Position i, Int j) { - return lseek (f, i, j); +C_Errno_t(C_Off_t) Posix_IO_lseek (C_Fd_t f, C_Off_t i, C_Int_t j) { + return lseek (f, i, j); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/pipe.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_IO_pipe (Pointer fds) { - return pipe ((int *) fds); +C_Errno_t(C_Int_t) Posix_IO_pipe (Vector(C_Fd_t) fds) { + return pipe ((int *) fds); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/read.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,18 @@ #include "platform.h" -Ssize Posix_IO_read (Fd fd, Pointer b, Int i, Size s) { - return (Ssize)(read (fd, (void *) ((char *) b + i), s)); +static inline C_Errno_t(C_SSize_t) +Posix_IO_read (C_Fd_t fd, Pointer b, + C_Int_t i, C_Size_t s) { + return read (fd, (void *) ((char *) b + i), s); } + +C_Errno_t(C_SSize_t) +Posix_IO_readChar8 (C_Fd_t fd, Array(Char8) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_read (fd, (Pointer)b, i, s); +} +C_Errno_t(C_SSize_t) +Posix_IO_readWord8 (C_Fd_t fd, Array(Word8) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_read (fd, (Pointer)b, i, s); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,15 +1,28 @@ #include "platform.h" -enum { - DEBUG_WRITE = FALSE, -}; +static inline C_Errno_t(C_SSize_t) +Posix_IO_write (C_Fd_t fd, Pointer b, + C_Int_t i, C_Size_t s) { + return write (fd, (void *) ((char *) b + i), s); +} -Ssize Posix_IO_write (Fd fd, Pointer b, Int i, Size s) { - Ssize res; - - res = (Ssize)(write (fd, (void *) ((char *) b + i), s)); - if (DEBUG_WRITE) - fprintf (stderr, "%d = Posix_IO_write (%d, "FMTPTR", %d, %d)\n", - (int)res, (int)fd, (uintptr_t)b, (int)i, (int)s); - return res; +C_Errno_t(C_SSize_t) +Posix_IO_writeChar8Arr (C_Fd_t fd, Array(Char8_t) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_write (fd, (Pointer)b, i, s); } +C_Errno_t(C_SSize_t) +Posix_IO_writeChar8Vec (C_Fd_t fd, Vector(Char8_t) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_write (fd, (Pointer)b, i, s); +} +C_Errno_t(C_SSize_t) +Posix_IO_writeWord8Arr (C_Fd_t fd, Array(Word8_t) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_write (fd, (Pointer)b, i, s); +} +C_Errno_t(C_SSize_t) +Posix_IO_writeWord8Vec (C_Fd_t fd, Vector(Word8_t) b, + C_Int_t i, C_Size_t s) { + return Posix_IO_write (fd, (Pointer)b, i, s); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/ProcEnv.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,46 +1,50 @@ #include "platform.h" -Cstring Posix_ProcEnv_ctermid () { - char *res = ctermid (NULL); - return (Cstring)res; +C_String_t Posix_ProcEnv_ctermid () { + char *res = ctermid (NULL); + return (C_String_t)res; } -Gid Posix_ProcEnv_getegid () { - return getegid (); +C_GId_t Posix_ProcEnv_getegid (void) { + return getegid (); } -Uid Posix_ProcEnv_geteuid () { - return geteuid (); +C_UId_t Posix_ProcEnv_geteuid (void) { + return geteuid (); } -Gid Posix_ProcEnv_getgid () { - return getgid (); +C_GId_t Posix_ProcEnv_getgid (void) { + return getgid (); } -Pid Posix_ProcEnv_getpid () { - return getpid (); +C_PId_t Posix_ProcEnv_getpid (void) { + return getpid (); } -Pid Posix_ProcEnv_getppid () { - return getppid (); +C_PId_t Posix_ProcEnv_getppid (void) { + return getppid (); } -Uid Posix_ProcEnv_getuid () { - return getuid (); +C_PId_t Posix_ProcEnv_getpgrp (void) { + return getpgrp (); } -Int Posix_ProcEnv_setgid (Gid g) { - return setgid (g); +C_UId_t Posix_ProcEnv_getuid (void) { + return getuid (); } -Int Posix_ProcEnv_setpgid (Pid p, Gid g) { - return setpgid (p, g); +C_Errno_t(C_Int_t) Posix_ProcEnv_setgid (C_GId_t g) { + return setgid (g); } -Pid Posix_ProcEnv_setsid () { - return setsid (); +C_Errno_t(C_Int_t) Posix_ProcEnv_setpgid (C_PId_t p, C_GId_t g) { + return setpgid (p, g); } -Int Posix_ProcEnv_setuid (Uid u) { - return setuid (u); +C_Errno_t(C_PId_t) Posix_ProcEnv_setsid (void) { + return setsid (); } + +C_Errno_t(C_Int_t) Posix_ProcEnv_setuid (C_UId_t u) { + return setuid (u); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c (from rev 4304, mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-24 02:49:37 UTC (rev 4304) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Times.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,23 @@ +#include "platform.h" + +static struct tms tms; + +C_Clock_t Posix_ProcEnv_Times_getUTime() { + return tms.tms_utime; +} + +C_Clock_t Posix_ProcEnv_Times_getSTime() { + return tms.tms_stime; +} + +C_Clock_t Posix_ProcEnv_Times_getCUTime() { + return tms.tms_cutime; +} + +C_Clock_t Posix_ProcEnv_Times_getCSTime() { + return tms.tms_cstime; +} + +C_Errno_t(C_Clock_t) Posix_ProcEnv_times(void) { + return times(&tms); +} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Tms.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,23 +0,0 @@ -#include "platform.h" - -static struct tms tms; - -Int Posix_ProcEnv_Tms_utime() { - return tms.tms_utime; -} - -Int Posix_ProcEnv_Tms_stime() { - return tms.tms_stime; -} - -Int Posix_ProcEnv_Tms_cutime() { - return tms.tms_cutime; -} - -Int Posix_ProcEnv_Tms_cstime() { - return tms.tms_cstime; -} - -Int Posix_ProcEnv_times() { - return times(&tms); -} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/Uname.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,37 +1,27 @@ #include "platform.h" -#ifndef DEBUG -#define DEBUG FALSE -#endif - static struct utsname utsname; -Int Posix_ProcEnv_Uname_uname () { - Int res; - - res = uname (&utsname); - if (DEBUG) - fprintf (stderr, "%d = Posix_ProcEnv_Uname_uname ()\n", - (int)res); - return res; +C_String_t Posix_ProcEnv_Uname_getSysName () { + return (C_String_t)utsname.sysname; } -Cstring Posix_ProcEnv_Uname_sysname () { - return (Cstring)utsname.sysname; +C_String_t Posix_ProcEnv_Uname_getNodeName () { + return (C_String_t)utsname.nodename; } -Cstring Posix_ProcEnv_Uname_nodename () { - return (Cstring)utsname.nodename; +C_String_t Posix_ProcEnv_Uname_getRelease () { + return (C_String_t)utsname.release; } -Cstring Posix_ProcEnv_Uname_release () { - return (Cstring)utsname.release; +C_String_t Posix_ProcEnv_Uname_getVersion () { + return (C_String_t)utsname.version; } -Cstring Posix_ProcEnv_Uname_version () { - return (Cstring)utsname.version; +C_String_t Posix_ProcEnv_Uname_getMachine () { + return (C_String_t)utsname.machine; } -Cstring Posix_ProcEnv_Uname_machine () { - return (Cstring)utsname.machine; +C_Errno_t(C_Int_t) Posix_ProcEnv_uname () { + return uname (&utsname); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/environ.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,4 @@ #include "platform.h" /* Manual initialization is a work-around for a Darwin linker issue. */ -CstringArray Posix_ProcEnv_environ = 0; - +C_StringArray_t Posix_ProcEnv_environ = (C_StringArray_t)NULL; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,6 +1,6 @@ #include "platform.h" -Cstring Posix_ProcEnv_getenv(Pointer s) { - char *res = getenv((char *)s); - return (Cstring)res; +C_String_t Posix_ProcEnv_getenv (NullString8_t s) { + char *res = getenv((const char*)s); + return (C_String_t)res; } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getgroups.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,20 +1,5 @@ #include "platform.h" -/* It's easier to let the basis library deal with an array of known-size - * words than to deal with a gid_t size that varies from platform to platform. - * So, this code copies the array of gid_t's to the array of words passed by the - * basis. - */ - -Int Posix_ProcEnv_getgroups (Pointer groups) { - int i; - int result; - gid_t groupList[Posix_ProcEnv_numgroups]; - - result = getgroups (Posix_ProcEnv_numgroups, groupList); - - for (i = 0; i < result; i++) - ((Word *) groups)[i] = groupList[i]; - - return result; +C_Errno_t(C_Int_t) Posix_ProcEnv_getgroups (C_Int_t i, Array(C_GId_t) a) { + return getgroups (i, (gid_t*)a); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getlogin.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,6 +1,6 @@ #include "platform.h" -Cstring Posix_ProcEnv_getlogin () { - char *res = getlogin (); - return (Cstring)(res); +C_Errno_t(C_String_t) Posix_ProcEnv_getlogin (void) { + char *res = getlogin (); + return (C_Errno_t(C_String_t))res; } Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getpgrp.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +0,0 @@ -#include "platform.h" - -Pid Posix_ProcEnv_getpgrp () { - return getpgrp (); -} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/isatty.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Bool Posix_ProcEnv_isatty (Fd f) { - return isatty (f); +Bool_t Posix_ProcEnv_isatty (C_Fd_t f) { + return isatty (f); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,5 +1,5 @@ #include "platform.h" -Int Posix_ProcEnv_setenv (Pointer s, Pointer v) { - return setenv ((char*)s, (char*)v, 1); +C_Errno_t(C_Int_t) Posix_ProcEnv_setenv (NullString8_t s, NullString8_t v) { + return setenv ((const char*)s, (const char*)v, 1); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -1,16 +1,5 @@ #include "platform.h" -Int Posix_ProcEnv_setgroups (Pointer groups) { - unsigned int i; - gid_t *list; - int res; - uintmax_t size; - - size = GC_getArrayLength (groups); - list = (gid_t*)(calloc_safe (size, sizeof(*list))); - for (i = 0; i < size; ++i) - list[i] = ((Word*)groups)[i]; - res = setgroups (size, list); - free (list); - return res; +C_Errno_t(C_Int_t) Posix_ProcEnv_setgroups (C_Int_t i, Vector(C_GId_t) v) { + return setgroups (i, (gid_t*)v); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c 2006-01-25 03:19:07 UTC (rev 4306) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf-consts.c 2006-01-26 03:06:35 UTC (rev 4307) @@ -0,0 +1,143 @@ +#include "platform.h" + +const C_Int_t Posix_ProcEnv_SC_AIO_LISTIO_MAX = _SC_AIO_LISTIO_MAX; +const C_Int_t Posix_ProcEnv_SC_AIO_MAX = _SC_AIO_MAX; +const C_Int_t Posix_ProcEnv_SC_AIO_PRIO_DELTA_MAX = _SC_AIO_PRIO_DELTA_MAX; +const C_Int_t Posix_ProcEnv_SC_ARG_MAX = _SC_ARG_MAX; +const C_Int_t Posix_ProcEnv_SC_ATEXIT_MAX = _SC_ATEXIT_MAX; +const C_Int_t Posix_ProcEnv_SC_BC_BASE_MAX = _SC_BC_BASE_MAX; +const C_Int_t Posix_ProcEnv_SC_BC_DIM_MAX = _SC_BC_DIM_MAX; +const C_Int_t Posix_ProcEnv_SC_BC_SCALE_MAX = _SC_BC_SCALE_MAX; +const C_Int_t Posix_ProcEnv_SC_BC_STRING_MAX = _SC_BC_STRING_MAX; +const C_Int_t Posix_ProcEnv_SC_CHILD_MAX = _SC_CHILD_MAX; +const C_Int_t Posix_ProcEnv_SC_CLK_TCK = _SC_CLK_TCK; +const C_Int_t Posix_ProcEnv_SC_COLL_WEIGHTS_MAX = _SC_COLL_WEIGHTS_MAX; +const C_Int_t Posix_ProcEnv_SC_DELAYTIMER_MAX = _SC_DELAYTIMER_MAX; +const C_Int_t Posix_ProcEnv_SC_EXPR_NEST_MAX = _SC_EXPR_NEST_MAX; +const C_Int_t Posix_ProcEnv_SC_HOST_NAME_MAX = _SC_HOST_NAME_MAX; +const C_Int_t Posix_ProcEnv_SC_IOV_MAX = _SC_IOV_MAX; +const C_Int_t Posix_ProcEnv_SC_LINE_MAX = _SC_LINE_MAX; +const C_Int_t Posix_ProcEnv_SC_LOGIN_NAME_MAX = _SC_LOGIN_NAME_MAX; +const C_Int_t Posix_ProcEnv_SC_NGROUPS_MAX = _SC_NGROUPS_MAX; +const C_Int_t Posix_ProcEnv_SC_GETGR_R_SIZE_MAX = _SC_GETGR_R_SIZE_MAX; +const C_Int_t Posix_ProcEnv_SC_GETPW_R_SIZE_MAX = _SC_GETPW_R_SIZE_MAX; +const C_Int_t Posix_ProcEnv_SC_MQ_OPEN_MAX = _SC_MQ_OPEN_MAX; +const C_Int_t Posix_ProcEnv_SC_MQ_PRIO_MAX = _SC_MQ_PRIO_MAX; +const C_Int_t Posix_ProcEnv_SC_OPEN_MAX = _SC_OPEN_MAX; +const C_Int_t Posix_ProcEnv_SC_ADVISORY_INFO = _SC_ADVISORY_INFO; +const C_Int_t Posix_ProcEnv_SC_BARRIERS = _SC_BARRIERS; +const C_Int_t Posix_ProcEnv_SC_ASYNCHRONOUS_IO = _SC_ASYNCHRONOUS_IO; +const C_Int_t Posix_ProcEnv_SC_CLOCK_SELECTION = _SC_CLOCK_SELECTION; +const C_Int_t Posix_ProcEnv_SC_CPUTIME = _SC_CPUTIME; +const C_Int_t Posix_ProcEnv_SC_FSYNC = _SC_FSYNC; +const C_Int_t Posix_ProcEnv_SC_IPV6 = _SC_IPV6; +const C_Int_t Posix_ProcEnv_SC_JOB_CONTROL = _SC_JOB_CONTROL; +const C_Int_t Posix_ProcEnv_SC_MAPPED_FILES = _SC_MAPPED_FILES; +const C_Int_t Posix_ProcEnv_SC_MEMLOCK = _SC_MEMLOCK; +const C_Int_t Posix_ProcEnv_SC_MEMLOCK_RANGE = _SC_MEMLOCK_RANGE; +const C_Int_t Posix_ProcEnv_SC_MEMORY_PROTECTION = _SC_MEMORY_PROTECTION; +const C_Int_t Posix_ProcEnv_SC_MESSAGE_PASSING = _SC_MESSAGE_PASSING; +const C_Int_t Posix_ProcEnv_SC_MONOTONIC_CLOCK = _SC_MONOTONIC_CLOCK; +const C_Int_t Posix_ProcEnv_SC_PRIORITIZED_IO = _SC_PRIORITIZED_IO; +const C_Int_t Posix_ProcEnv_SC_PRIORITY_SCHEDULING = _SC_PRIORITY_SCHEDULING; +const C_Int_t Posix_ProcEnv_SC_RAW_SOCKETS = _SC_RAW_SOCKETS; +const C_Int_t Posix_ProcEnv_SC_READER_WRITER_LOCKS = _SC_READER_WRITER_LOCKS; +const C_Int_t Posix_ProcEnv_SC_REALTIME_SIGNALS = _SC_REALTIME_SIGNALS; +const C_Int_t Posix_ProcEnv_SC_REGEXP = _SC_REGEXP; +const C_Int_t Posix_ProcEnv_SC_SAVED_IDS = _SC_SAVED_IDS; +const C_Int_t Posix_ProcEnv_SC_SEMAPHORES = _SC_SEMAPHORES; +const C_Int_t Posix_ProcEnv_SC_SHARED_MEMORY_OBJECTS = _SC_SHARED_MEMORY_OBJECTS; +const C_Int_t Posix_ProcEnv_SC_SHELL = _SC_SHELL; +const C_Int_t Posix_ProcEnv_SC_SPAWN = _SC_SPAWN; +const C_Int_t Posix_ProcEnv_SC_SPIN_LOCKS = _SC_SPIN_LOCKS; +const C_Int_t Posix_ProcEnv_SC_SPORADIC_SERVER = _SC_SPORADIC_SERVER; +#ifndef _SC_SS_REPL_MAX +#define _SC_SS_REPL_MAX -1 +#endif +const C_Int_t Posix_ProcEnv_SC_SS_REPL_MAX = _SC_SS_REPL_MAX; +const C_Int_t Posix_ProcEnv_SC_SYNCHRONIZED_IO = _SC_SYNCHRONIZED_IO; +const C_Int_t Posix_ProcEnv_SC_THREAD_ATTR_STACKADDR = _SC_THREAD_ATTR_STACKADDR; +const C_Int_t Posix_ProcEnv_SC_THREAD_ATTR_STACKSIZE = _SC_THREAD_ATTR_STACKSIZE; +const C_Int_t Posix_ProcEnv_SC_THREAD_CPUTIME = _SC_THREAD_CPUTIME; +const C_Int_t Posix_ProcEnv_SC_THREAD_PRIO_INHERIT = _SC_THREAD_PRIO_INHERIT; +const C_Int_t Posix_ProcEnv_SC_THREAD_PRIO_PROTECT = _SC_THREAD_PRIO_PROTECT; +const C_Int_t Posix_ProcEnv_SC_THREAD_PRIORITY_SCHEDULING = _SC_THREAD_PRIORITY_SCHEDULING; +const C_Int_t Posix_ProcEnv_SC_THREAD_PROCESS_SHARED = _SC_THREAD_PROCESS_SHARED; +const C_Int_t Posix_ProcEnv_SC_THREAD_SAFE_FUNCTIONS = _SC_THREAD_SAFE_FUNCTIONS; +const C_Int_t Posix_ProcEnv_SC_THREAD_SPORADIC_SERVER = _SC_THREAD_SPORADIC_SERVER; +const C_Int_t Posix_ProcEnv_SC_THREADS = _SC_THREADS; +const C_Int_t Posix_ProcEnv_SC_TIMEOUTS = _SC_TIMEOUTS; +const C_Int_t Posix_ProcEnv_SC_TIMERS = _SC_TIMERS; +const C_Int_t Posix_ProcEnv_SC_TRACE = _SC_TRACE; +const C_Int_t Posix_ProcEnv_SC_TRACE_EVENT_FILTER = _SC_TRACE_EVENT_FILTER; +#ifndef _SC_TRACE_EVENT_NAME_MAX +#define _SC_TRACE_EVENT_NAME_MAX -1 +#endif +const C_Int_t Posix_ProcEnv_SC_TRACE_EVENT_NAME_MAX = _SC_TRACE_EVENT_NAME_MAX; +const C_Int_t Posix_ProcEnv_SC_TRACE_INHERIT = _SC_TRACE_INHERIT; +const C_Int_t Posix_ProcEnv_SC_TRACE_LOG = _SC_TRACE_LOG; +#ifndef _SC_TRACE_NAME_MAX +#define _SC_TRACE_NAME_MAX -1 +#endif +const C_Int_t Posix_ProcEnv_SC_TRACE_NAME_MAX = _SC_TRACE_NAME_MAX; +#ifndef _SC_TRACE_SYS_MAX +#define _SC_TRACE_SYS_MAX -1 +#endif +const C_Int_t Posix_ProcEnv_SC_TRACE_SYS_MAX = _SC_TRACE_SYS_MAX; +#ifndef _SC_TRACE_USER_EVENT_MAX +#define _SC_TRACE_USER_EVENT_MAX -1 +#endif +const C_Int_t Posix_ProcEnv_SC_TRACE_USER_EVENT_MAX = _SC_TRACE_USER_EVENT_MAX; +const C_Int_t Posix_ProcEnv_SC_TYPED_MEMORY_OBJECTS = _SC_TYPED_MEMORY_OBJECTS; +const C_Int_t Posix_ProcEnv_SC_VERSION = _SC_VERSION; +const C_Int_t Posix_ProcEnv_SC_V6_ILP32_OFF32 = _SC_V6_ILP32_OFF32; +const C_Int_t Posix_ProcEnv_SC_V6_ILP32_OFFBIG = _SC_V6_ILP32_OFFBIG; +const C_Int_t Posix_ProcEnv_SC_V6_LP64_OFF64 = _SC_V6_LP64_OFF64; +const C_Int_t Posix_ProcEnv_SC_V6_LPBIG_OFFBIG = _SC_V6_LPBIG_OFFBIG; +const C_Int_t Posix_ProcEnv_SC_2_C_BIND = _SC_2_C_BIND; +const C_Int_t Posix_ProcEnv_SC_2_C_DEV = _SC_2_C_DEV; +const C_Int_t Posix_ProcEnv_SC_2_CHAR_TERM = _SC_2_CHAR_TERM; +const C_Int_t Posix_ProcEnv_SC_2_FORT_DEV = _SC_2_FORT_DEV; +const C_Int_t Posix_ProcEnv_SC_2_FORT_RUN = _SC_2_FORT_RUN; +const C_Int_t Posix_ProcEnv_SC_2_LOCALEDEF = _SC_2_LOCALEDEF; +const C_Int_t Posix_ProcEnv_SC_2_PBS = _SC_2_PBS; +const C_Int_t Posix_ProcEnv_SC_2_PBS_ACCOUNTING = _SC_2_PBS_ACCOUNTING; +const C_Int_t Posix_ProcEnv_SC_2_PBS_CHECKPOINT = _SC_2_PBS_CHECKPOINT; +const C_Int_t Posix_ProcEnv_SC_2_PBS_LOCATE = _SC_2_PBS_LOCATE; +const C_Int_t Posix_ProcEnv_SC_2_PBS_MESSAGE = _SC_2_PBS_MESSAGE; +const C_Int_t Posix_ProcEnv_SC_2_PBS_TRACK = _SC_2_PBS_TRACK; +const C_Int_t Posix_ProcEnv_SC_2_SW_DEV = _SC_2_SW_DEV; +const C_Int_t Posix_ProcEnv_SC_2_UPE = _SC_2_UPE; +const C_Int_t Posix_ProcEnv_SC_2_VERSION = _SC_2_VERSION; +const C_Int_t Posix_ProcEnv_SC_PAGE_SIZE = _SC_PAGE_SIZE; +const C_Int_t Posix_ProcEnv_SC_PAGESIZE = _SC_PAGESIZE; +const C_Int_t Posix_ProcEnv_SC_THREAD_DESTRUCTOR_ITERATIONS = _SC_THREAD_DESTRUCTOR_ITERATIONS; +const C_Int_t Posix_ProcEnv_SC_THREAD_KEYS_MAX = _SC_THREAD_KEYS_MAX; +const C_Int_t Posix_ProcEnv_SC_THREAD_STACK_MIN = _SC_THREAD_STACK_MIN; +const C_Int_t Posix_ProcEnv_SC_THREAD_THREADS_MAX = _SC_THREAD_THREADS_MAX; +const C_Int_t Posix_ProcEnv_SC_RE_DUP_MAX = _SC_RE_DUP_MAX; +const C_Int_t Posix_ProcEnv_SC_RTSIG_MAX = _SC_RTSIG_MAX; +const C_Int_t Posix_ProcEnv_SC_SEM_NSEMS_MAX = _SC_SEM_NSEMS_MAX; +const C_Int_t Posix_ProcEnv_SC_SEM_VALUE_MAX = _SC_SEM_VALUE_MAX; +const C_Int_t Posix_ProcEnv_SC_SIGQUEUE_MAX = _SC_SIGQUEUE_MAX; +const C_Int_t Posix_ProcEnv_SC_STREAM_MAX = _SC_STREAM_MAX; +const C_Int_t Posix_ProcEnv_SC_SYMLOOP_MAX = _SC_SYMLOOP_MAX; +const C_Int_t Posix_ProcEnv_SC_TIMER_MAX = _SC_TIMER_MAX; +const C_Int_t Posix_ProcEnv_SC_TTY_NAME_MAX = _SC_TTY_NAME_MAX; +const C_Int_t Posix_ProcEnv_SC_TZNAME_MAX = _SC_TZNAME_MAX; +const C_Int_t Posix_ProcEnv_SC_XBS5_ILP32_OFF32 = _SC_XBS5_ILP32_OFF32; +const C_Int_t Posix_ProcEnv_SC_XBS5_ILP32_OFFBIG = _SC_XBS5_ILP32_OFFBIG; +const C_Int_t Posix_ProcEnv_SC_XBS5_LP64_OFF64 = _SC_XBS5_LP64_OFF64; +const C_Int_t Posix_ProcEnv_SC_XBS5_LPBIG_OFFBIG = _SC_XBS5_LPBIG_OFFBIG; +const C_Int_t Posix_ProcEnv_SC_XOPEN_CRYPT = _SC_XOPEN_CRYPT; +const C_Int_t Posix_ProcEnv_SC_XOPEN_ENH_I18N = _SC_XOPEN_ENH_I18N; +const C_Int_t Posix_ProcEnv_SC_XOPEN_LEGACY = _SC_XOPEN_LEGACY; +const C_Int_t Posix_ProcEnv_SC_XOPEN_REALTIME = _SC_XOPEN_REALTIME; +const C_Int_t Posix_ProcEnv_SC_XOPEN_REALTIME_THREADS = _SC_XOPEN_REALTIME_THREADS; +const C_Int_t Posix_ProcEnv_SC_XOPEN_SHM = _SC_XOPEN_SHM; +#ifndef __SC_XOPEN_STREAMS +#define _SC_XOPEN_STREAMS -1 +#endif +const C_Int_t Posix_ProcEnv_SC_XOPEN_STREAMS = _SC_XOPEN_STREAMS; +const C_Int_t Posix_ProcEnv_SC_XOPEN_UNIX = _SC_XOPEN_UNIX; +const C_Int_t Posix_ProcEnv_SC_XOPEN_VERSION = _SC_XOPEN_VERSION; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/sysconf.c 2006-01-25... [truncated message content] |
From: Matthew F. <fl...@ml...> - 2006-01-24 19:19:11
|
More unified c-side/ml-side basis functions ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c ---------------------------------------------------------------------- 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-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-01-25 03:19:07 UTC (rev 4306) @@ -46,6 +46,14 @@ return statbuf.st_ctime; } +C_BlkSize_t Posix_FileSys_Stat_getBlkSize (void) { + return statbuf.st_blksize; +} + +C_BlkCnt_t Posix_FileSys_Stat_getBlkCnt (void) { + return statbuf.st_blocks; +} + C_Errno_t(C_Int_t) Posix_FileSys_Stat_fstat (C_Fd_t f) { return fstat (f, &statbuf); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c 2006-01-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c 2006-01-25 03:19:07 UTC (rev 4306) @@ -0,0 +1,33 @@ +#include "platform.h" + +#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 below code overwrites them. + */ + +#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 + +const C_Int_t IEEEReal_RoundingMode_FE_TONEAREST = FE_TONEAREST; +const C_Int_t IEEEReal_RoundingMode_FE_DOWNWARD = FE_DOWNWARD; +const C_Int_t IEEEReal_RoundingMode_FE_NOSUPPORT = FE_NOSUPPORT; +const C_Int_t IEEEReal_RoundingMode_FE_UPWARD = FE_UPWARD; +const C_Int_t IEEEReal_RoundingMode_FE_TOWARDZERO = FE_TOWARDZERO; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-25 03:19:07 UTC (rev 4306) @@ -58,6 +58,6 @@ return mktime(&tm_in); } -C_Size_t Date_strfTime(String_t buf, C_Size_t n, NullString_t fmt) { +C_Size_t Date_strfTime(Array(Char8_t) buf, C_Size_t n, NullString_t fmt) { return strftime((char*)(buf), n, (char*)(fmt), &tm_in); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-25 03:19:07 UTC (rev 4306) @@ -12,7 +12,7 @@ /* GNU C Library Feature Macros */ #define _ISOC99_SOURCE #define _BSD_SOURCE -// #define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE 600 /* Only enable _POSIX_C_SOURCE on platforms that don't have broken * system headers. */ 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-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-25 03:19:07 UTC (rev 4306) @@ -23,7 +23,7 @@ Date.localOffset = _import : unit -> C.Double.t 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 +Date.strfTime = _import : Char8.t array * 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 @@ -383,3 +383,5 @@ 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 +Posix.FileSys.Stat.getBlkSize = _import : unit -> C.BlkSize.t +Posix.FileSys.Stat.getBlkCnt = _import : unit -> C.BlkCnt.t 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-25 01:56:56 UTC (rev 4305) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-25 03:19:07 UTC (rev 4306) @@ -123,12 +123,12 @@ #define systype(t, bt, name) \ do { \ writeString (fd, "typedef "); \ - writeString (fd, "/* "); \ writeString (fd, #t); \ - writeString (fd, " */ "); \ + writeString (fd, " /* "); \ writeString (fd, bt); \ writeUintmaxU (fd, CHAR_BIT * sizeof(t));\ writeString (fd, "_t "); \ + writeString (fd, "*/ "); \ writeString (fd, name); \ writeString (fd, ";"); \ writeNewline (fd); \ @@ -235,6 +235,8 @@ writeNewline (fd); writeString (fd, "/* from <sys/types.h> */"); writeNewline (fd); + systype(blkcnt_t, "Int", "C_BlkCnt_t"); + systype(blksize_t, "Int", "C_BlkSize_t"); chknumsystype(clock_t, "C_Clock"); chknumsystype(dev_t, "C_Dev_t"); chkintsystype(gid_t, "C_GId_t"); |
From: Matthew F. <fl...@ml...> - 2006-01-24 17:57:02
|
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 */ /* ------------------------------------------------- */ |
From: Matthew F. <fl...@ml...> - 2006-01-23 18:49:39
|
Typos ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def ---------------------------------------------------------------------- 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 00:27:14 UTC (rev 4303) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-24 02:49:37 UTC (rev 4304) @@ -24,9 +24,9 @@ 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 -MLton.Itimer.PROF = _const : int -MLton.Itimer.REAL = _const : int -MLton.Itimer.VIRTUAL = _const : int +MLton.Itimer.PROF = _const : C.Int.t +MLton.Itimer.REAL = _const : C.Int.t +MLton.Itimer.VIRTUAL = _const : C.Int.t MLton.Itimer.set = _import : C.Int.t * C.Time.t * C.SUSeconds.t * C.Time.t * C.SUSeconds.t -> C.Int.t C.Errno.t MLton.Rlimit.AS = _const : C.Int.t MLton.Rlimit.CORE = _const : C.Int.t |
From: Matthew F. <fl...@ml...> - 2006-01-23 16:27:26
|
More unified c-side/ml-side basis functions ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Itimer/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/itimer-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/set.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rusage/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rusage/rusage.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Net.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/GenericSock.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll-consts.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 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.c U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2006-01-24 00:27:14 UTC (rev 4303) @@ -22,6 +22,7 @@ structure Bool = struct datatype bool = datatype bool + type t = bool end structure Char = Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/Itimer) Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/itimer-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Itimer/itimer-consts.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/itimer-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,5 @@ +#include "platform.h" + +const C_Int_t MLton_Itimer_PROF = ITIMER_PROF; +const C_Int_t MLton_Itimer_REAL = ITIMER_REAL; +const C_Int_t MLton_Itimer_VIRTUAL = ITIMER_VIRTUAL; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/set.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Itimer/set.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Itimer/set.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,15 +1,16 @@ #include "platform.h" -void Itimer_set (Int which, - Int interval_tv_sec, Int interval_tv_usec, - Int value_tv_sec, Int value_tv_usec) { - struct itimerval v; - int i; - - v.it_interval.tv_sec = interval_tv_sec; - v.it_interval.tv_usec = interval_tv_usec; - v.it_value.tv_sec = value_tv_sec; - v.it_value.tv_usec = value_tv_usec; - i = setitimer (which, &v, (struct itimerval *)NULL); - assert(i == 0); +C_Errno_t(C_Int_t) +MLton_Itimer_set (C_Int_t which, + C_Time_t interval_tv_sec, + C_SUSeconds_t interval_tv_usec, + C_Time_t value_tv_sec, + C_SUSeconds_t value_tv_usec) { + struct itimerval v; + + v.it_interval.tv_sec = interval_tv_sec; + v.it_interval.tv_usec = interval_tv_usec; + v.it_value.tv_sec = value_tv_sec; + v.it_value.tv_usec = value_tv_usec; + return setitimer (which, &v, (struct itimerval *)NULL); } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c) Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c) Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,10 @@ +#include "platform.h" + +const C_Int_t MLton_Rlimit_AS = RLIMIT_AS; +const C_Int_t MLton_Rlimit_CORE = RLIMIT_CORE; +const C_Int_t MLton_Rlimit_CPU = RLIMIT_CPU; +const C_Int_t MLton_Rlimit_DATA = RLIMIT_DATA; +const C_Int_t MLton_Rlimit_FSIZE = RLIMIT_FSIZE; +const C_Int_t MLton_Rlimit_NOFILE = RLIMIT_NOFILE; +const C_Int_t MLton_Rlimit_STACK = RLIMIT_STACK; +const C_RLim_t MLton_Rlimit_INFINITY = RLIM_INFINITY; Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,21 @@ +#include "platform.h" + +static struct rlimit rlimit; + +C_Errno_t(C_Int_t) MLton_Rlimit_get (C_Int_t r) { + return getrlimit (r, &rlimit); +} + +C_RLim_t MLton_Rlimit_getHard () { + return rlimit.rlim_max; +} + +C_RLim_t MLton_Rlimit_getSoft () { + return rlimit.rlim_cur; +} + +C_Errno_t(C_Int_t) MLton_Rlimit_set (C_Int_t r, C_RLim_t hard, C_RLim_t soft) { + rlimit.rlim_max = hard; + rlimit.rlim_cur = soft; + return setrlimit (r, &rlimit); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rusage/rusage.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rusage/rusage.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,59 @@ +#include "platform.h" + +static struct rusage self; +static struct rusage children; +static struct rusage gc; + +C_Time_t MLton_Rusage_self_utime_sec (void) { + return self.ru_utime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_self_utime_usec (void) { + return self.ru_utime.tv_usec; +} + +C_Time_t MLton_Rusage_self_stime_sec (void) { + return self.ru_stime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_self_stime_usec (void) { + return self.ru_stime.tv_usec; +} + +C_Time_t MLton_Rusage_children_utime_sec (void) { + return children.ru_utime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_children_utime_usec (void) { + return children.ru_utime.tv_usec; +} + +C_Time_t MLton_Rusage_children_stime_sec (void) { + return children.ru_stime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_children_stime_usec (void) { + return children.ru_stime.tv_usec; +} + +C_Time_t MLton_Rusage_gc_utime_sec (void) { + return gc.ru_utime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_gc_utime_usec (void) { + return gc.ru_utime.tv_usec; +} + +C_Time_t MLton_Rusage_gc_stime_sec (void) { + return gc.ru_stime.tv_sec; +} + +C_SUSeconds_t MLton_Rusage_gc_stime_usec (void) { + return gc.ru_stime.tv_usec; +} + +void MLton_Rusage_getrusage (GC_state s) { + gc = *(GC_getRusageGCAddr (s)); + getrusage (RUSAGE_SELF, &self); + getrusage (RUSAGE_CHILDREN, &children); +} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rlimit.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,21 +0,0 @@ -#include "platform.h" - -static struct rlimit rlimit; - -Int MLton_Rlimit_get (Resource r) { - return getrlimit (r, &rlimit); -} - -Rlimit MLton_Rlimit_getHard () { - return rlimit.rlim_max; -} - -Rlimit MLton_Rlimit_getSoft () { - return rlimit.rlim_cur; -} - -Int MLton_Rlimit_set (Resource r, Rlimit hard, Rlimit soft) { - rlimit.rlim_max = hard; - rlimit.rlim_cur = soft; - return setrlimit (r, &rlimit); -} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,59 +0,0 @@ -#include "platform.h" - -static struct rusage self; -static struct rusage children; -static struct rusage gc; - -Int MLton_Rusage_self_utime_sec (void) { - return self.ru_utime.tv_sec; -} - -Int MLton_Rusage_self_utime_usec (void) { - return self.ru_utime.tv_usec; -} - -Int MLton_Rusage_self_stime_sec (void) { - return self.ru_stime.tv_sec; -} - -Int MLton_Rusage_self_stime_usec (void) { - return self.ru_stime.tv_usec; -} - -Int MLton_Rusage_children_utime_sec (void) { - return children.ru_utime.tv_sec; -} - -Int MLton_Rusage_children_utime_usec (void) { - return children.ru_utime.tv_usec; -} - -Int MLton_Rusage_children_stime_sec (void) { - return children.ru_stime.tv_sec; -} - -Int MLton_Rusage_children_stime_usec (void) { - return children.ru_stime.tv_usec; -} - -Int MLton_Rusage_gc_utime_sec (void) { - return gc.ru_utime.tv_sec; -} - -Int MLton_Rusage_gc_utime_usec (void) { - return gc.ru_utime.tv_usec; -} - -Int MLton_Rusage_gc_stime_sec (void) { - return gc.ru_stime.tv_sec; -} - -Int MLton_Rusage_gc_stime_usec (void) { - return gc.ru_stime.tv_usec; -} - -void MLton_Rusage_ru (GC_state s) { - gc = *(GC_getRusageGCAddr (s)); - getrusage (RUSAGE_SELF, &self); - getrusage (RUSAGE_CHILDREN, &children); -} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,36 +0,0 @@ -#include "platform.h" - -#if HAS_SPAWN -Int MLton_Process_spawne (NullString p, Pointer a, Pointer e) { - char *path; - char *asaved; - char *esaved; - char **args; - char **env; - int an; - int en; - int result; - - path = (char *) p; - args = (char **) a; - env = (char **) e; - an = GC_arrayNumElements(a) - 1; - asaved = args[an]; - en = GC_arrayNumElements(e) - 1; - esaved = env[en]; - args[an] = (char *) NULL; - env[en] = (char *) NULL; - result = spawnve (SPAWN_MODE, path, - (const char * const *)args, - (const char * const *)env); - args[an] = asaved; - env[en] = esaved; - return result; -} -#else -Int MLton_Process_spawne (__attribute__ ((unused)) Pointer p, - __attribute__ ((unused)) Pointer a, - __attribute__ ((unused)) Pointer e) { - die ("MLton_Process_spawne not implemented"); -} -#endif Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,25 +0,0 @@ -#include "platform.h" - -#if HAS_SPAWN -Int MLton_Process_spawnp (NullString p, Pointer a) { - char *path; - char *asaved; - char **args; - int an; - int result; - - path = (char *) p; - args = (char **) a; - an = GC_arrayNumElements(a) - 1; - asaved = args[an]; - args[an] = (char *) NULL; - result = spawnvp (SPAWN_MODE, path, (const char * const *)args); - args[an] = asaved; - return result; -} -#else -Int MLton_Process_spawnp (__attribute__ ((unused)) Pointer p, - __attribute__ ((unused)) Pointer a) { - die ("MLton_Process_spawnp not implemented"); -} -#endif Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Net.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Net.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Net.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,20 +1,17 @@ -#define _ISOC99_SOURCE -#define _BSD_SOURCE - #include "platform.h" -Int Net_htonl (Int i) { - return htonl (i); +Word32_t Net_htonl (Word32_t w) { + return htonl (w); } -Int Net_ntohl (Int i) { - return ntohl (i); +Word32_t Net_ntohl (Word32_t w) { + return ntohl (w); } -Int Net_htons (Int i) { - return htons (i); +Word16_t Net_htons (Word16_t w) { + return htons (w); } -Int Net_ntohs (Int i) { - return ntohs (i); +Word16_t Net_ntohs (Word16_t w) { + return ntohs (w); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB-consts.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,4 @@ +#include "platform.h" + +const C_Size_t NetHostDB_inAddrLen = sizeof (struct in_addr); +const C_Int_t NetHostDB_INADDR_ANY = INADDR_ANY; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -2,52 +2,52 @@ static struct hostent *hostent; -Cstring NetHostDB_Entry_name(void) { - return (Cstring)hostent->h_name; +C_String_t NetHostDB_getEntryName(void) { + return (C_String_t)(hostent->h_name); } -Int NetHostDB_Entry_numAliases(void) { - int num = 0; - while (hostent->h_aliases[num] != NULL) num++; - return num; +C_Int_t NetHostDB_getEntryAliasesNum(void) { + int num = 0; + while (hostent->h_aliases[num] != NULL) num++; + return num; } -Cstring NetHostDB_Entry_aliasesN(Int n) { - return (Cstring)hostent->h_aliases[n]; +C_String_t NetHostDB_getEntryAliasesN(C_Int_t n) { + return (C_String_t)(hostent->h_aliases[n]); } -Int NetHostDB_Entry_addrType(void) { - return hostent->h_addrtype; +C_Int_t NetHostDB_getEntryAddrType(void) { + return hostent->h_addrtype; } -Int NetHostDB_Entry_length(void) { - return hostent->h_length; +C_Int_t NetHostDB_getEntryLength(void) { + return hostent->h_length; } -Int NetHostDB_Entry_numAddrs(void) { - int num = 0; - while (hostent->h_addr_list[num] != NULL) num++; - return num; +C_Int_t NetHostDB_getEntryAddrsNum(void) { + int num = 0; + while (hostent->h_addr_list[num] != NULL) num++; + return num; } -void NetHostDB_Entry_addrsN(Int n, Pointer addr) { - int i; - for (i = 0; i < hostent->h_length; i++) { - addr[i] = hostent->h_addr_list[n][i]; - } - return; +void NetHostDB_getEntryAddrsN(C_Int_t n, Array(C_Char_t) addr) { + int i; + for (i = 0; i < hostent->h_length; i++) { + ((char*)addr)[i] = hostent->h_addr_list[n][i]; + } + return; } -Bool NetHostDB_getByAddress(Pointer addr, Int len) { - hostent = gethostbyaddr(addr, len, AF_INET); - return (hostent != NULL and hostent->h_name != NULL); +Bool_t NetHostDB_getByAddress(Vector(C_Char_t) addr, C_Socklen_t len) { + hostent = gethostbyaddr((void*)addr, len, AF_INET); + return (hostent != NULL and hostent->h_name != NULL); } -Bool NetHostDB_getByName(Cstring name) { - hostent = gethostbyname((char*)name); - return (hostent != NULL and hostent->h_name != NULL); +Bool_t NetHostDB_getByName(NullString8_t name) { + hostent = gethostbyname((char*)name); + return (hostent != NULL and hostent->h_name != NULL); } -Int NetHostDB_getHostName(Pointer buf, Int len) { - return (gethostname ((char*) buf, len)); +C_Errno_t(C_Int_t) NetHostDB_getHostName(Array(Char8_t) buf, C_Size_t len) { + return gethostname ((char*)buf, len); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -2,30 +2,30 @@ static struct protoent *protoent; -Cstring NetProtDB_Entry_name(void) { - return (Cstring)protoent->p_name; +C_String_t NetProtDB_getEntryName(void) { + return (C_String_t)(protoent->p_name); } -Int NetProtDB_Entry_numAliases(void) { - int num = 0; - while (protoent->p_aliases[num] != NULL) num++; - return num; +C_Int_t NetProtDB_getEntryAliasesNum(void) { + int num = 0; + while (protoent->p_aliases[num] != NULL) num++; + return num; } -Cstring NetProtDB_Entry_aliasesN(Int n) { - return (Cstring)protoent->p_aliases[n]; +C_String_t NetProtDB_getEntryAliasesN(C_Int_t n) { + return (C_String_t)(protoent->p_aliases[n]); } -Int NetProtDB_Entry_protocol(void) { - return protoent->p_proto; +C_Int_t NetProtDB_getEntryProto(void) { + return protoent->p_proto; } -Int NetProtDB_getByName(Cstring name) { - protoent = getprotobyname((char*)name); - return (protoent != NULL and protoent->p_name != NULL); +Bool_t NetProtDB_getByName(NullString8_t name) { + protoent = getprotobyname((char*)name); + return (protoent != NULL and protoent->p_name != NULL); } -Int NetProtDB_getByNumber(Int proto) { - protoent = getprotobynumber(proto); - return (protoent != NULL and protoent->p_name != NULL); +Bool_t NetProtDB_getByNumber(C_Int_t proto) { + protoent = getprotobynumber(proto); + return (protoent != NULL and protoent->p_name != NULL); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -5,42 +5,42 @@ static struct servent *servent; -Cstring NetServDB_Entry_name(void) { - return (Cstring)servent->s_name; +C_String_t NetServDB_getEntryName(void) { + return (C_String_t)(servent->s_name); } -Int NetServDB_Entry_numAliases(void) { - int num = 0; - while (servent->s_aliases[num] != NULL) num++; - return num; +C_Int_t NetServDB_getEntryAliasesNum(void) { + int num = 0; + while (servent->s_aliases[num] != NULL) num++; + return num; } -Cstring NetServDB_Entry_aliasesN(Int n) { - return (Cstring)servent->s_aliases[n]; +C_String_t NetServDB_getEntryAliasesN(C_Int_t n) { + return (C_String_t)(servent->s_aliases[n]); } -Int NetServDB_Entry_port(void) { - return servent->s_port; +C_Int_t NetServDB_getEntryPort(void) { + return servent->s_port; } -Cstring NetServDB_Entry_protocol(void) { - return (Cstring)servent->s_proto; +C_String_t NetServDB_getEntryProto(void) { + return (C_String_t)(servent->s_proto); } -Int NetServDB_getByName(Cstring name, Cstring proto) { - servent = getservbyname((char*)name, (char*)proto); - return (servent != NULL and servent->s_name != NULL); +Bool_t NetServDB_getByName(NullString8_t name, NullString8_t proto) { + servent = getservbyname((char*)name, (char*)proto); + return (servent != NULL and servent->s_name != NULL); } -Int NetServDB_getByNameNull(Cstring name) { - return NetServDB_getByName(name, (Cstring)NULL); +Bool_t NetServDB_getByNameNull(NullString8_t name) { + return NetServDB_getByName(name, (NullString8_t)NULL); } -Int NetServDB_getByPort(Int port, Cstring proto) { - servent = getservbyport(port, (char*)proto); - return (servent != NULL and servent->s_name != NULL); +Bool_t NetServDB_getByPort(C_Int_t port, NullString8_t proto) { + servent = getservbyport(port, (char*)proto); + return (servent != NULL and servent->s_name != NULL); } -Int NetServDB_getByPortNull(Int port) { - return NetServDB_getByPort(port, (Cstring)NULL); +Bool_t NetServDB_getByPortNull(C_Int_t port) { + return NetServDB_getByPort(port, (NullString8_t)NULL); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/GenericSock.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/GenericSock.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/GenericSock.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,11 +1,13 @@ #include "platform.h" -Int GenericSock_socket (Int domain, Int type, Int protocol) { - MLton_initSockets (); - return socket (domain, type, protocol); +C_Errno_t(C_Int_t) +Socket_GenericSock_socket (C_Int_t domain, C_Int_t type, C_Int_t protocol) { + MLton_initSockets (); + return socket (domain, type, protocol); } -Int GenericSocket_socketPair (Int domain, Int type, Int protocol, Int sv[2]) { - MLton_initSockets (); - return socketpair (domain, type, protocol, (int*)sv); +C_Errno_t(C_Int_t) +Socket_GenericSock_socketPair (C_Int_t domain, C_Int_t type, C_Int_t protocol, Array(C_Int_t) sv) { + MLton_initSockets (); + return socketpair (domain, type, protocol, (int*)sv); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock-consts.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,4 @@ +#include "platform.h" + +const C_Int_t Socket_INetSock_Ctl_IPPROTO_TCP = IPPROTO_TCP; +const C_Int_t Socket_INetSock_Ctl_TCP_NODELAY = TCP_NODELAY; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/INetSock.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,29 +1,31 @@ #include "platform.h" -void INetSock_toAddr (Pointer in_addr, Int port, Char* addr, Int *addrlen) { - struct sockaddr_in *sa = (struct sockaddr_in*)addr; +void +Socket_INetSock_toAddr (Vector(Word8_t) in_addr, C_Int_t port, + Array(Word8_t) addr, Ref(C_Socklen_t) addrlen) { + struct sockaddr_in *sa = (struct sockaddr_in*)addr; - sa->sin_family = AF_INET; - sa->sin_port = port; - sa->sin_addr = *(struct in_addr*)in_addr; - *addrlen = sizeof(struct sockaddr_in); + sa->sin_family = AF_INET; + sa->sin_port = port; + sa->sin_addr = *(struct in_addr*)in_addr; + *((socklen_t*)addrlen) = sizeof(struct sockaddr_in); } static int port; static struct in_addr in_addr; -void INetSock_fromAddr (Char* addr) { - struct sockaddr_in *sa = (struct sockaddr_in*)addr; - - assert(sa->sin_family == AF_INET); - port = sa->sin_port; - in_addr = sa->sin_addr; +void Socket_INetSock_fromAddr (Vector(Word8_t) addr) { + struct sockaddr_in *sa = (struct sockaddr_in*)addr; + + assert(sa->sin_family == AF_INET); + port = sa->sin_port; + in_addr = sa->sin_addr; } -Int INetSock_getPort (void) { - return port; +Int Socket_INetSock_getPort (void) { + return port; } -void INetSock_getInAddr (Pointer addr) { - *(struct in_addr*)addr = in_addr; +void Socket_INetSock_getInAddr (Array(Word8_t) addr) { + *(struct in_addr*)addr = in_addr; } Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,39 @@ +#include "platform.h" + +const C_Size_t Socket_sockAddrStorageLen = sizeof (struct sockaddr_storage); +const C_Int_t Socket_AF_INET = AF_INET; +const C_Int_t Socket_AF_INET6 = AF_INET6; +const C_Int_t Socket_AF_UNIX = AF_UNIX; +const C_Int_t Socket_AF_UNSPEC = AF_UNSPEC; +const C_Int_t Socket_Ctl_SOL_SOCKET = SOL_SOCKET; +const C_Int_t Socket_Ctl_SO_ACCEPTCONN = SO_ACCEPTCONN; +const C_Int_t Socket_Ctl_SO_BROADCAST = SO_BROADCAST; +const C_Int_t Socket_Ctl_SO_DEBUG = SO_DEBUG; +const C_Int_t Socket_Ctl_SO_DONTROUTE = SO_DONTROUTE; +const C_Int_t Socket_Ctl_SO_ERROR = SO_ERROR; +const C_Int_t Socket_Ctl_SO_KEEPALIVE = SO_KEEPALIVE; +const C_Int_t Socket_Ctl_SO_LINGER = SO_LINGER; +const C_Int_t Socket_Ctl_SO_OOBINLINE = SO_OOBINLINE; +const C_Int_t Socket_Ctl_SO_RCVBUF = SO_RCVBUF; +const C_Int_t Socket_Ctl_SO_RCVLOWAT = SO_RCVLOWAT; +const C_Int_t Socket_Ctl_SO_RCVTIMEO = SO_RCVTIMEO; +const C_Int_t Socket_Ctl_SO_REUSEADDR = SO_REUSEADDR; +const C_Int_t Socket_Ctl_SO_SNDBUF = SO_SNDBUF; +const C_Int_t Socket_Ctl_SO_SNDLOWAT = SO_SNDLOWAT; +const C_Int_t Socket_Ctl_SO_SNDTIMEO = SO_SNDTIMEO; +const C_Int_t Socket_Ctl_SO_TYPE = SO_TYPE; +const C_Int_t Socket_MSG_CTRUNC = MSG_CTRUNC; +const C_Int_t Socket_MSG_DONTROUTE = MSG_DONTROUTE; +const C_Int_t Socket_MSG_DONTWAIT = MSG_DONTWAIT; +const C_Int_t Socket_MSG_EOR = MSG_EOR; +const C_Int_t Socket_MSG_OOB = MSG_OOB; +const C_Int_t Socket_MSG_PEEK = MSG_PEEK; +const C_Int_t Socket_MSG_TRUNC = MSG_TRUNC; +const C_Int_t Socket_MSG_WAITALL = MSG_WAITALL; +const C_Int_t Socket_SHUT_RD = SHUT_RD; +const C_Int_t Socket_SHUT_RDWR = SHUT_RDWR; +const C_Int_t Socket_SHUT_WR = SHUT_WR; +const C_Int_t Socket_SOCK_DGRAM = SOCK_DGRAM; +const C_Int_t Socket_SOCK_RAW = SOCK_RAW; +const C_Int_t Socket_SOCK_SEQPACKET = SOCK_SEQPACKET; +const C_Int_t Socket_SOCK_STREAM = SOCK_STREAM; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,85 +1,102 @@ #include "platform.h" -Int Socket_accept (Int s, Char *addr, Int *addrlen) { - MLton_initSockets (); - return accept (s, (struct sockaddr*)addr, (socklen_t*)addrlen); +C_Errno_t(C_Int_t) Socket_accept (C_Sock_t s, Array(Word8_t) addr, Ref(C_Socklen_t) addrlen) { + MLton_initSockets (); + return accept (s, (struct sockaddr*)addr, (socklen_t*)addrlen); } -Int Socket_bind (Int s, Char *addr, Int addrlen) { - MLton_initSockets (); - return bind (s, (struct sockaddr*)addr, (socklen_t)addrlen); +C_Errno_t(C_Int_t) Socket_bind (C_Sock_t s, Array(Word8_t) addr, C_Socklen_t addrlen) { + MLton_initSockets (); + return bind (s, (struct sockaddr*)addr, (socklen_t)addrlen); } -Int Socket_close(Int s) { - return close(s); +C_Errno_t(C_Int_t) Socket_close(C_Sock_t s) { + return close(s); } -Int Socket_connect (Int s, Char *addr, Int addrlen) { - MLton_initSockets (); - return connect (s, (struct sockaddr*)addr, (socklen_t)addrlen); +C_Errno_t(C_Int_t) Socket_connect (C_Sock_t s, Vector(Word8_t) addr, C_Socklen_t addrlen) { + MLton_initSockets (); + return connect (s, (struct sockaddr*)addr, (socklen_t)addrlen); } -Int Socket_familyOfAddr(Char *addr) { - return ((struct sockaddr*)addr)->sa_family; +C_Int_t Socket_familyOfAddr(Vector(Word8_t) addr) { + return ((struct sockaddr*)addr)->sa_family; } -Int Socket_listen (Int s, Int backlog) { - MLton_initSockets (); - return listen (s, backlog); +C_Errno_t(C_Int_t) Socket_listen (C_Sock_t s, C_Int_t backlog) { + MLton_initSockets (); + return listen (s, backlog); } -Int Socket_recv (Int s, Char *msg, Int start, Int len, Word flags) { - MLton_initSockets (); - return recv (s, (void*)((char *)msg + start), (size_t)len, flags); +C_Errno_t(C_SSize_t) + Socket_recv (C_Sock_t s, Array(Word8_t) msg, + C_Int_t start, C_Size_t len, C_Int_t flags) { + MLton_initSockets (); + return recv (s, (void*)((char *)msg + start), len, flags); } -Int Socket_recvFrom (Int s, Char *msg, Int start, Int len, Word flags, - Char* addr, Int *addrlen) { - MLton_initSockets (); - return recvfrom (s, (void*)((char *)msg + start), (size_t)len, flags, - (struct sockaddr*)addr, (socklen_t*)addrlen); +C_Errno_t(C_SSize_t) +Socket_recvFrom (C_Sock_t s, Array(Word8_t) msg, + C_Int_t start, C_Size_t len, C_Int_t flags, + Array(Word8_t) addr, Ref(C_Socklen_t) addrlen) { + MLton_initSockets (); + return recvfrom (s, (void*)((char *)msg + start), len, flags, + (struct sockaddr*)addr, (socklen_t*)addrlen); } -Int Socket_send (Int s, Char *msg, Int start, Int len, Word flags) { - MLton_initSockets (); - return send (s, (void*)((char *)msg + start), (size_t)len, flags); +C_Errno_t(C_SSize_t) +Socket_send (C_Sock_t s, Vector(Word8_t) msg, + C_Int_t start, C_Size_t len, C_Int_t flags) { + MLton_initSockets (); + return send (s, (void*)((char *)msg + start), len, flags); } -Int Socket_sendTo (Int s, Char *msg, Int start, Int len, Word flags, - Char* addr, Int addrlen) { - MLton_initSockets (); - return sendto (s, (void*)((char *)msg + start), (size_t)len, flags, - (struct sockaddr*)addr, (socklen_t)addrlen); +C_Errno_t(C_SSize_t) +Socket_sendTo (C_Sock_t s, Vector(Word8_t)msg, + C_Int_t start, C_Size_t len, C_Int_t flags, + Vector(Word8_t) addr, C_Socklen_t addrlen) { + MLton_initSockets (); + return sendto (s, (void*)((char *)msg + start), len, flags, + (struct sockaddr*)addr, (socklen_t)addrlen); } -Int Socket_shutdown (Int s, Int how) { - MLton_initSockets (); - return shutdown (s, how); +C_Errno_t(C_Int_t) Socket_shutdown (C_Sock_t s, C_Int_t how) { + MLton_initSockets (); + return shutdown (s, how); } -Int Socket_Ctl_getSockOpt (Int s, Int level, Int optname, Char *optval, - Int *optlen) { - MLton_initSockets (); - return getsockopt (s, level, optname, (void*)optval, (socklen_t*)optlen); +C_Errno_t(C_Int_t) +Socket_Ctl_getSockOpt (C_Sock_t s, C_Int_t level, C_Int_t optname, + Array(Word8_t) optval, Ref(C_Socklen_t) optlen) { + MLton_initSockets (); + return getsockopt (s, level, optname, (void*)optval, (socklen_t*)optlen); } -Int Socket_Ctl_setSockOpt (Int s, Int level, Int optname, Char *optval, - Int optlen) { - MLton_initSockets (); - return setsockopt (s, level, optname, (void*)optval, (socklen_t)optlen); +C_Errno_t(C_Int_t) +Socket_Ctl_setSockOpt (C_Sock_t s, C_Int_t level, C_Int_t optname, + Vector(Word8_t) optval, C_Socklen_t optlen) { + MLton_initSockets (); + return setsockopt (s, level, optname, (void*)optval, (socklen_t)optlen); } -Int Socket_Ctl_getsetIOCtl (Int s, Int request, Char* argp) { - MLton_initSockets (); - return ioctl (s, request, argp); +C_Errno_t(C_Int_t) +Socket_Ctl_getIOCtl (C_Sock_t s, C_Int_t request, Array(Word8_t) argp) { + MLton_initSockets (); + return ioctl (s, request, (void*)argp); } -Int Socket_Ctl_getPeerName (Int s, Char *name, Int *namelen) { - MLton_initSockets (); - return getpeername (s, (struct sockaddr*)name, (socklen_t*)namelen); +C_Errno_t(C_Int_t) +Socket_Ctl_setIOCtl (C_Sock_t s, C_Int_t request, Vector(Word8_t) argp) { + MLton_initSockets (); + return ioctl (s, request, (void*)argp); } -Int Socket_Ctl_getSockName (Int s, Char *name, Int *namelen) { - MLton_initSockets (); - return getsockname (s, (struct sockaddr*)name, (socklen_t*)namelen); +C_Errno_t(C_Int_t) Socket_Ctl_getPeerName (C_Sock_t s, Array(Word8_t) name, Ref(C_Socklen_t) namelen) { + MLton_initSockets (); + return getpeername (s, (struct sockaddr*)name, (socklen_t*)namelen); } + +C_Errno_t(C_Int_t) Socket_Ctl_getSockName (C_Sock_t s, Array(Word8_t) name, Ref(C_Socklen_t) namelen) { + MLton_initSockets (); + return getsockname (s, (struct sockaddr*)name, (socklen_t*)namelen); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,45 +1,47 @@ #include "platform.h" -#define UNIX_PATH_MAX 108 +#define UNIXSOCK_PATH_MAX (sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path)) -void UnixSock_toAddr (Char* path, Int pathlen, Char* addr, Int *addrlen) { - int i; - struct sockaddr_un *sa = (struct sockaddr_un*)addr; +void Socket_UnixSock_toAddr (NullString8_t path, C_Size_t pathlen, Array(Word8_t) addr, Ref(C_Socklen_t) addrlen) { + size_t i; + struct sockaddr_un *sa = (struct sockaddr_un*)addr; - sa->sun_family = AF_UNIX; - i = 0; - if (pathlen <= UNIX_PATH_MAX) { - for (i = 0; i < pathlen; i++) { - sa->sun_path[i] = path[i]; - } - } else { - for (i = 0; i < UNIX_PATH_MAX-1; i++) { - sa->sun_path[i] = path[i]; - } - sa->sun_path[UNIX_PATH_MAX-1] = '\000'; - } - *addrlen = sizeof(struct sockaddr_un); + sa->sun_family = AF_UNIX; + i = 0; + if (pathlen <= UNIXSOCK_PATH_MAX) { + for (i = 0; i < pathlen; i++) { + sa->sun_path[i] = path[i]; + } + } else { + for (i = 0; i < UNIXSOCK_PATH_MAX-1; i++) { + sa->sun_path[i] = path[i]; + } + sa->sun_path[UNIXSOCK_PATH_MAX-1] = '\000'; + } + *((socklen_t*)addrlen) = sizeof(struct sockaddr_un); } -Int UnixSock_pathLen (Char* addr) { - int i; - struct sockaddr_un *sa = (struct sockaddr_un*)addr; +C_Size_t Socket_UnixSock_pathLen (Array(Word8_t) addr) { + size_t i; + struct sockaddr_un *sa = (struct sockaddr_un*)addr; - i = 0; - if (sa->sun_path[i] == '\000') { - return UNIX_PATH_MAX; - } else { - while (i < UNIX_PATH_MAX && sa->sun_path[i] != '\000') i++; - return i; - } + i = 0; + if (sa->sun_path[i] == '\000') { + return UNIXSOCK_PATH_MAX; + } else { + while (i < UNIXSOCK_PATH_MAX && sa->sun_path[i] != '\000') i++; + return i; + } } -void UnixSock_fromAddr (Char* addr, Char* path, Int pathlen) { - int i; - struct sockaddr_un *sa = (struct sockaddr_un*)addr; +void Socket_UnixSock_fromAddr (Array(Word8_t) addr, Array(Char8_t) path, C_Size_t pathlen) { + size_t i; + struct sockaddr_un *sa = (struct sockaddr_un*)addr; + + assert (sa->sun_family == AF_UNIX); + for (i = 0; i < pathlen; i++) { + ((char*)path)[i] = sa->sun_path[i]; + } +} - assert (sa->sun_family == AF_UNIX); - for (i = 0; i < pathlen; i++) { - path[i] = sa->sun_path[i]; - } -} +#undef UNIXSOCK_PATH_MAX Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -4,35 +4,35 @@ #define DEBUG FALSE #endif -static struct tm tm; -static struct tm *tmp; +static struct tm tm_in; +static struct tm *tm_out; -C_Int_t Date_Tm_getHour(void) { return tmp->tm_hour; } -C_Int_t Date_Tm_getIsDst(void) { return tmp->tm_isdst; } -C_Int_t Date_Tm_getMDay(void) { return tmp->tm_mday; } -C_Int_t Date_Tm_getMin(void) { return tmp->tm_min; } -C_Int_t Date_Tm_getMon(void) { return tmp->tm_mon; } -C_Int_t Date_Tm_getSec(void) { return tmp->tm_sec; } -C_Int_t Date_Tm_getWDay(void) { return tmp->tm_wday; } -C_Int_t Date_Tm_getYDay(void) { return tmp->tm_yday; } -C_Int_t Date_Tm_getYear(void) { return tmp->tm_year; } +C_Int_t Date_Tm_getHour(void) { return tm_out->tm_hour; } +C_Int_t Date_Tm_getIsDst(void) { return tm_out->tm_isdst; } +C_Int_t Date_Tm_getMDay(void) { return tm_out->tm_mday; } +C_Int_t Date_Tm_getMin(void) { return tm_out->tm_min; } +C_Int_t Date_Tm_getMon(void) { return tm_out->tm_mon; } +C_Int_t Date_Tm_getSec(void) { return tm_out->tm_sec; } +C_Int_t Date_Tm_getWDay(void) { return tm_out->tm_wday; } +C_Int_t Date_Tm_getYDay(void) { return tm_out->tm_yday; } +C_Int_t Date_Tm_getYear(void) { return tm_out->tm_year; } -void Date_Tm_setHour(C_Int_t x) { tm.tm_hour = x; } -void Date_Tm_setIsDst(C_Int_t x) { tm.tm_isdst = x; } -void Date_Tm_setMDay(C_Int_t x) { tm.tm_mday = x; } -void Date_Tm_setMin(C_Int_t x) { tm.tm_min = x; } -void Date_Tm_setMon(C_Int_t x) { tm.tm_mon = x; } -void Date_Tm_setSec(C_Int_t x) { tm.tm_sec = x; } -void Date_Tm_setWDay(C_Int_t x) { tm.tm_wday = x; } -void Date_Tm_setYDay(C_Int_t x) { tm.tm_yday = x; } -void Date_Tm_setYear(C_Int_t x) { tm.tm_year = x; } +void Date_Tm_setHour(C_Int_t x) { tm_in.tm_hour = x; } +void Date_Tm_setIsDst(C_Int_t x) { tm_in.tm_isdst = x; } +void Date_Tm_setMDay(C_Int_t x) { tm_in.tm_mday = x; } +void Date_Tm_setMin(C_Int_t x) { tm_in.tm_min = x; } +void Date_Tm_setMon(C_Int_t x) { tm_in.tm_mon = x; } +void Date_Tm_setSec(C_Int_t x) { tm_in.tm_sec = x; } +void Date_Tm_setWDay(C_Int_t x) { tm_in.tm_wday = x; } +void Date_Tm_setYDay(C_Int_t x) { tm_in.tm_yday = x; } +void Date_Tm_setYear(C_Int_t x) { tm_in.tm_year = x; } C_Errno_t(C_Int_t) Date_gmTime(Ref(C_Time_t) p) { - tmp = gmtime((time_t*)p); + tm_out = gmtime((time_t*)p); if (DEBUG) fprintf (stderr, FMTPTR" = Date_gmTime ("FMTPTR")\n", - (uintptr_t)tmp, (uintptr_t)p); - if (tmp == NULL) return -1; + (uintptr_t)tm_out, (uintptr_t)p); + if (tm_out == NULL) return -1; return 0; } @@ -46,18 +46,18 @@ } C_Errno_t(C_Int_t) Date_localTime(Ref(C_Time_t) p) { - tmp = localtime((time_t*)p); + tm_out = localtime((time_t*)p); if (DEBUG) fprintf (stderr, FMTPTR" = Date_localTime ("FMTPTR")\n", - (uintptr_t)tmp, (uintptr_t)p); - if (tmp == NULL) return -1; + (uintptr_t)tm_out, (uintptr_t)p); + if (tm_out == NULL) return -1; return 0; } C_Errno_t(C_Time_t) Date_mkTime(void) { - return mktime(&tm); + return mktime(&tm_in); } C_Size_t Date_strfTime(String_t buf, C_Size_t n, NullString_t fmt) { - return strftime((char*)(buf), n, (char*)(fmt), &tm); + return strftime((char*)(buf), n, (char*)(fmt), &tm_in); } Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll-consts.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll-consts.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -0,0 +1,5 @@ +#include "platform.h" + +const C_Short_t OS_IO_POLLIN = POLLIN; +const C_Short_t OS_IO_POLLPRI = POLLPRI; +const C_Short_t OS_IO_POLLOUT = POLLOUT; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -1,11 +1,12 @@ #include "platform.h" -C_Int_t OS_IO_poll (Vector(C_Fd_t) fds, - Vector(C_Short_t) eventss, - C_NFds_t n, - C_Int_t timeout, - Array(C_Short_t) reventss) { - unsigned int i +C_Errno_t(C_Int_t) +OS_IO_poll (Vector(C_Fd_t) fds, + Vector(C_Short_t) eventss, + C_NFds_t n, + C_Int_t timeout, + Array(C_Short_t) reventss) { + unsigned int i; int res; struct pollfd ufds[n]; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -6,7 +6,7 @@ static struct timeval timeval; -C_Int_t Time_gettimeofday (void) { +C_Int_t Time_getTimeOfDay (void) { int res; res = gettimeofday (&timeval, (struct timezone*)NULL); if (DEBUG) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2006-01-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2006-01-24 00:27:14 UTC (rev 4303) @@ -17,6 +17,7 @@ struct GC_state; typedef struct GC_state *GC_state; +typedef GC_state GCState_t; #define GC_MODEL_NATIVE32 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-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-24 00:27:14 UTC (rev 4303) @@ -23,12 +23,129 @@ Date.localOffset = _import : unit -> C.Double.t 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 : String.t * C.Size.t * NullString.t -> C.Size.t +Date.strfTime = _import : String8.t * C.Size.t * NullString8.t -> C.Size.t +MLton.Itimer.PROF = _const : int +MLton.Itimer.REAL = _const : int +MLton.Itimer.VIRTUAL = _const : int +MLton.Itimer.set = _import : C.Int.t * C.Time.t * C.SUSeconds.t * C.Time.t * C.SUSeconds.t -> C.Int.t C.Errno.t +MLton.Rlimit.AS = _const : C.Int.t +MLton.Rlimit.CORE = _const : C.Int.t +MLton.Rlimit.CPU = _const : C.Int.t +MLton.Rlimit.DATA = _const : C.Int.t +MLton.Rlimit.FSIZE = _const : C.Int.t +MLton.Rlimit.INFINITY = _const : C.RLim.t +MLton.Rlimit.NOFILE = _const : C.Int.t +MLton.Rlimit.STACK = _const : C.Int.t +MLton.Rlimit.get = _import : C.Int.t -> C.Int.t C.Errno.t +MLton.Rlimit.getHard = _import : unit -> C.RLim.t +MLton.Rlimit.getSoft = _import : unit -> C.RLim.t +MLton.Rlimit.set = _import : C.Int.t * C.RLim.t * C.RLim.t -> C.Int.t C.Errno.t +MLton.Rusage.children_stime_sec = _import : unit -> C.Time.t +MLton.Rusage.children_stime_usec = _import : unit -> C.SUSeconds.t +MLton.Rusage.children_utime_sec = _import : unit -> C.Time.t +MLton.Rusage.children_utime_usec = _import : unit -> C.SUSeconds.t +MLton.Rusage.gc_stime_sec = _import : unit -> C.Time.t +MLton.Rusage.gc_stime_usec = _import : unit -> C.SUSeconds.t +MLton.Rusage.gc_utime_sec = _import : unit -> C.Time.t +MLton.Rusage.gc_utime_usec = _import : unit -> C.SUSeconds.t +MLton.Rusage.getrusage = _import : GCState.t -> unit +MLton.Rusage.self_stime_sec = _import : unit -> C.Time.t +MLton.Rusage.self_stime_usec = _import : unit -> C.SUSeconds.t +MLton.Rusage.self_utime_sec = _import : unit -> C.Time.t +MLton.Rusage.self_utime_usec = _import : unit -> C.SUSeconds.t +Net.htonl = _import : Word32.t -> Word32.t +Net.htons = _import : Word16.t -> Word16.t +Net.ntohl = _import : Word32.t -> Word32.t +Net.ntohs = _import : Word16.t -> Word16.t +NetHostDB.INADDR_ANY = _const : C.Int.t +NetHostDB.getByAddress = _import : Word8.t vector * C.Socklen.t -> Bool.t +NetHostDB.getByName = _import : NullString8.t -> C.Int.t C.HErrno.t +NetHostDB.getEntryAddrType = _import : unit -> C.Int.t +NetHostDB.getEntryAddrsN = _import : C.Int.t * Word8.t array -> unit +NetHostDB.getEntryAddrsNum = _import : unit -> C.Int.t +NetHostDB.getEntryAliasesN = _import : C.Int.t -> C.String.t +NetHostDB.getEntryAliasesNum = _import : unit -> C.Int.t +NetHostDB.getEntryLength = _import : unit -> C.Int.t +NetHostDB.getEntryName = _import : unit -> C.String.t +NetHostDB.getHostName = _import : Char8.t array * C.Size.t -> Bool.t +NetHostDB.inAddrLen = _const : C.Size.t +NetProtDB.getByName = _import : NullString8.t -> Bool.t +NetProtDB.getByNumber = _import : C.Int.t -> Bool.t +NetProtDB.getEntryAliasesN = _import : C.Int.t -> C.String.t +NetProtDB.getEntryAliasesNum = _import : unit -> C.Int.t +NetProtDB.getEntryName = _import : unit -> C.String.t +NetProtDB.getEntryProto = _import : unit -> C.Int.t +NetServDB.getByName = _import : NullString8.t * NullString8.t -> Bool.t +NetServDB.getByNameNull = _import : NullString8.t -> Bool.t +NetServDB.getByPort = _import : C.Int.t * NullString8.t -> Bool.t +NetServDB.getByPortNull = _import : C.Int.t -> Bool.t +NetServDB.getEntryAliasesN = _import : C.Int.t -> C.String.t +NetServDB.getEntryAliasesNum = _import : unit -> C.Int.t +NetServDB.getEntryName = _import : unit -> C.String.t +NetServDB.getEntryPort = _import : unit -> C.Int.t +NetServDB.getEntryProto = _import : unit -> C.String.t OS.IO.POLLIN = _const : C.Short.t 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 -Stdio.print = _import : String.t -> unit -Time.gettimeofday = _import : unit -> C.Int.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 +Socket.AF.INET = _const : C.Int.t +Socket.AF.INET6 = _const : C.Int.t +Socket.AF.UNIX = _const : C.Int.t +Socket.AF.UNSPEC = _const : C.Int.t +Socket.Clt.FIONBIO = _const : C.Int.t +Socket.Clt.FIONREAD = _const : C.Int.t +Socket.Clt.SIOCATMARK = _const : C.Int.t +Socket.Ctl.SOL_SOCKET = _const : C.Int.t +Socket.Ctl.SO_ACCEPTCONN = _const : C.Int.t +Socket.Ctl.SO_BROADCAST = _const : C.Int.t +Socket.Ctl.SO_DEBUG = _const : C.Int.t +Socket.Ctl.SO_DONTROUTE = _const : C.Int.t +Socket.Ctl.SO_ERROR = _const : C.Int.t +Socket.Ctl.SO_KEEPALIVE = _const : C.Int.t +Socket.Ctl.SO_LINGER = _const : C.Int.t +Socket.Ctl.SO_OOBINLINE = _const : C.Int.t +Socket.Ctl.SO_RCVBUF = _const : C.Int.t +Socket.Ctl.SO_RCVLOWAT = _const : C.Int.t +Socket.Ctl.SO_RCVTIMEO = _const : C.Int.t +Socket.Ctl.SO_REUSEADDR = _const : C.Int.t +Socket.Ctl.SO_SNDBUF = _const : C.Int.t +Socket.Ctl.SO_SNDLOWAT = _const : C.Int.t +Socket.Ctl.SO_SNDTIMEO = _const : C.Int.t +Socket.Ctl.SO_TYPE = _const : C.Int.t +Socket.Ctl.getIOCtl = _import : C.Sock.t * C.Int.t * Word8.t array -> C.Int.t C.Errno.t +Socket.Ctl.getPeerName = _import : C.Sock.t * Word8.t array * C.Socklen.t ref -> C.Int.t C.Errno.t +Socket.Ctl.getSockName = _import : C.Sock.t * Word8.t array * C.Socklen.t ref -> C.Int.t C.Errno.t +Socket.Ctl.getSockOpt = _import : C.Sock.t * C.Int.t * C.Int.t * Word8.t array * C.Socklen.t ref -> C.Int.t C.Errno.t +Socket.Ctl.setIOCtl = _import : C.Sock.t * C.Int.t * Word8.t vector -> C.Int.t C.Errno.t +Socket.Ctl.setSockOpt = _import : C.Sock.t * C.Int.t * C.Int.t * Word8.t vector * C.Socklen.t -> C.Int.t C.Errno.t +Socket.GenericSock.socket = _import : C.Int.t * C.Int.t * C.Int.t -> C.Int.t C.Errno.t +Socket.GenericSock.socketPair = _import : C.Int.t * C.Int.t * C.Int.t * C.Int.t array -> C.Int.t C.Errno.t +Socket.INetSock.Ctl.IPPROTO_TCP = _const : C.Int.t +Socket.INetSock.Ctl.TCP_NODELAY = _const : C.Int.t +Socket.INetSock.fromAddr = _import : Word8.t vector -> unit +Socket.INetSock.getInAddr = _import : Word8.t array -> unit +Socket.INetSock.getPort = _import : unit -> C.Int.t +Socket.INetSock.toAddr = _import : Word8.t vector * C.Int.t * Word8.t array * C.Socklen.t ref -> unit +Socket.SOCK.DGRAM = _const : C.Int.t +Socket.SOCK.RAW = _const : C.Int.t +Socket.SOCK.SEQPACKET = _const : C.Int.t +Socket.SOCK.STREAM = _const : C.Int.t +Socket.UnixSock.fromAddr = _import : Word8.t array * Char8.t array * C.Size.t -> unit +Socket.UnixSock.pathLen = _import : Word8.t array -> C.Size.t +Socket.UnixSock.toAddr = _import : NullString8.t * C.Size.t * Word8.t array * C.Socklen.t ref -> unit +Socket.accept = _import : C.Sock.t * Word8.t array * C.Socklen.t ref -> C.Int.t C.Errno.t +Socket.bind = _import : C.Sock.t * Word8.t array * C.Socklen.t -> C.Int.t C.Errno.t +Socket.close = _import : C.Sock.t -> C.Int.t C.Errno.t +Socket.connect = _import : C.Sock.t * Word8.t vector * C.Socklen.t -> C.Int.t C.Errno.t +Socket.familyOfAddr = _import : Word8.t vector -> C.Int.t +Socket.listen = _import : C.Sock.t * C.Int.t -> C.Int.t C.Errno.t +Socket.recv = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t +Socket.recvFrom = _import : C.Sock.t * Word8.t array * C.Int.t * C.Size.t * C.Int.t * Word8.t array * C.Socklen.t ref -> C.SSize.t C.Errno.t +Socket.send = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t -> C.SSize.t C.Errno.t +Socket.sendTo = _import : C.Sock.t * Word8.t vector * C.Int.t * C.Size.t * C.Int.t * Word8.t vector * C.Socklen.t -> C.SSize.t C.Errno.t +Socket.shutdown = _import : C.Sock.t * C.Int.t -> C.Int.t C.Errno.t +Socket.sockAddrStorageLen = _const : C.Size.t +Stdio.print = _import : String8.t -> unit +Time.getTimeOfDay = _import : unit -> C.Int.t Time.sec = _import : unit -> C.Time.t Time.usec = _import : unit -> C.SUSeconds.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-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-24 00:27:14 UTC (rev 4303) @@ -68,7 +68,8 @@ val ss = Substring.droplSpace ss val (names, rest) = Substring.splitl - (fn c => Char.isAlpha c orelse c = #".") + (fn c => Char.isAlphaNum c + orelse c = #"." orelse c = #"_") ss val rest = Substring.droplSpace rest in @@ -122,7 +123,7 @@ | SOME (name, rest) => loop (rest, Con (name, t)) in case Name.parse s of - NONE => raise Fail "Type.parse" + NONE => raise Fail (concat ["Type.parse: \"", Substring.string s, "\""]) | SOME (Name.T ["unit"], rest) => loop (rest, Unit) | SOME (name, rest) => loop (rest, Base name) end @@ -148,7 +149,7 @@ ret = ret}, rest) end - else raise Fail "Type.parseFn" + else raise Fail (concat ["Type.parseFn: \"", Substring.string s, "\""]) end in loop (s, []) @@ -179,9 +180,11 @@ case entry of Const {name, ty} => String.concat - ["/* ", + ["extern const ", + Type.toC ty, + " ", Name.toC name, - " */"] + ";"] | Import {name, ty = {args, ret}} => String.concat [Type.toC ret, @@ -235,11 +238,11 @@ val s = Substring.droplSpace s val s = if Substring.isPrefix ":" s then #2 (Substring.splitAt (s, 1)) - else raise Fail "Entry.parseSymbol" + else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""]) val (ret, rest) = Type.parse s val () = if Substring.isEmpty rest then () - else raise Fail "Entry.parseSymbol" + else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""]) in Const {name = name, ty = ret} @@ -251,11 +254,11 @@ val s = Substring.droplSpace s val s = if Substring.isPrefix ":" s then #2 (Substring.splitAt (s, 1)) - else raise Fail "Entry.parseImport" + else raise Fail (concat ["Entry.parseImport: \"", Substring.string s, "\""]) val ({args, ret}, rest) = Type.parseFn s val () = if Substring.isEmpty rest then () - else raise Fail "Entry.parseImport" + else raise Fail (concat ["Entry.parseImport: \"", Substring.string s, "\""]) in Import {name = name, ty = {args = args, ret = ret}} @@ -267,11 +270,11 @@ val s = Substring.droplSpace s val s = if Substring.isPrefix ":" s then #2 (Substring.splitAt (s, 1)) - else raise Fail "Entry.parseSymbol" + else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""]) val (ret, rest) = Type.parse s val () = if Substring.isEmpty rest then () - else raise Fail "Entry.parseSymbol" + else raise Fail (concat ["Entry.parseSymbol: \"", Substring.string s, "\""]) in Symbol {name = name, ty = ret} @@ -292,9 +295,9 @@ then parseImport (rest, name) else if Substring.isPrefix "_symbol" rest then parseSymbol (rest, name) - else raise Fail "Entry.parse" + else raise Fail (concat ["Entry.parse: \"", Substring.string s, "\""]) end - else raise Fail "Entry.parse" + else raise Fail (concat ["Entry.parse: \"", Substring.string s, "\""]) end val entries = 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-23 03:12:19 UTC (rev 4302) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-24 00:27:14 UTC (rev 4303) @@ -45,50 +45,78 @@ "typedef unsigned char* Pointer;", "#define Array(t) Pointer", "#define Ref(t) Pointer", - "#define Vector(t) Pointer", + "#define Vector(t) const Pointer", "", - "typedef void unit;", - "", + "typedef int8_t Int8_t;", "typedef int8_t Int8;", + "typedef int16_t Int16_t;", "typedef int16_t Int16;", + "typedef int32_t Int32_t;", "typedef int32_t Int32;", + "typedef int64_t Int64_t;", "typedef int64_t Int64;", + "typedef float Real32_t;", "typedef float Real32;", + "typedef double Real64_t;", "typedef double Real64;", + "typedef uint8_t Word8_t;", "typedef uint8_t Word8;", + "typedef uint16_t Word16_t;", "typedef uint16_t Word16;", + "typedef uint32_t Word32_t;", "typedef uint32_t Word32;", + "typedef uint64_t Word64_t;", "typedef uint64_t Word64;", "", - "typedef Int8 WordS8;", - "typedef Int16 WordS16;", - "typedef Int32 WordS32;", - "typedef Int64 WordS64;", + "typedef Int8_t WordS8_t;", + "typedef Int8_t WordS8;", + "typedef Int16_t WordS16_t;", + "typedef Int16_t WordS16;", + "typedef Int32_t WordS32_t;", + "typedef Int32_t WordS32;", + "typedef Int64_t WordS64_t;", + "typedef Int64_t WordS64;", "", - "typedef Word8 WordU8;", - "typedef Word16 WordU16;", - "typedef Word32 WordU32;", - "typedef Word64 WordU64;", + "typedef Word8_t WordU8_t;", + "typedef Word8_t WordU8;", + "typedef Word16_t WordU16_t;", + "typedef Word16_t WordU16;", + "typedef Word32_t WordU32_t;", + "typedef Word32_t WordU32;", + "typedef Word64_t WordU64_t;", + "typedef Word64_t WordU64;", "", - "typedef WordS8 Char8;", - "typedef WordS16 Char16;", - "typedef WordS32 Char32;", + "typedef WordS8_t Char8_t;", + "typedef WordS8_t Char8;", + "typedef WordS16_t Char16_t;", + "typedef WordS16_t Char16;", + "typedef WordS32_t Char32_t;", + "typedef WordS32_t Char32;", "", - "typedef Vector(Char8) String8;", - "typedef Vector(Char16) String16;", - "typedef Vector(Char32) String32;", + "typedef Vector(Char8_t) String8_t;", + "typedef Vector(Char8_t) String8;", + "typedef Vector(Char16_t) String16_t;", + "typedef Vector(Char16_t) String16;", + "typedef Vector(Char32_t) String32_t;", + "typedef Vector(Char32_t) String32;", "", - "typedef Int32 Bool;", - "typedef Char8 Char;", - "typedef Int32 Int;", - "typedef Real64 Real;", - "typedef String8 String;", - "typedef Word32 Word;", + "typedef Int32_t Bool_t;", + "typedef Int32_t Bool;", + "typedef Char8_t Char_t;", + "typedef Char8_t Char;", + "t... [truncated message content] |
From: Matthew F. <fl...@ml...> - 2006-01-22 19:12:24
|
Generate C-side/ML-side basis ffi files ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/TODO D mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Debug.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/IEEEReal.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/OS/ D mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/PackReal.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/ A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/ U mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c A mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h A mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def A 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-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-01-23 03:12:19 UTC (rev 4302) @@ -97,6 +97,7 @@ $(GCHFILES) \ gc.h \ types.h \ + basis-ffi.h \ platform.h \ platform/$(TARGET_OS).h @@ -173,6 +174,13 @@ ./gen-types rm -f gen-types +basis-ffi.h: gen/gen-basis-ffi.sml gen/basis-ffi.def + rm -f basis-ffi.def + 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 + gc-gdb.o: gc.c $(GCCFILES) $(HFILES) $(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -c -o $@ $< Modified: mlton/branches/on-20050822-x86_64-branch/runtime/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-23 03:12:19 UTC (rev 4302) @@ -3,3 +3,106 @@ * Why does hash-table use malloc/free while generational maps use mmap/munmap? * 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 +Posix/FileSys/chmod.c +Posix/FileSys/chown.c +Posix/FileSys/fchmod.c +Posix/FileSys/fchown.c +Posix/FileSys/fpathconf.c +Posix/FileSys/ftruncate.c +Posix/FileSys/getcwd.c +Posix/FileSys/link.c +Posix/FileSys/mkdir.c +Posix/FileSys/mkfifo.c +Posix/FileSys/open.c +Posix/FileSys/pathconf.c +Posix/FileSys/readlink.c +Posix/FileSys/rename.c +Posix/FileSys/rmdir.c +Posix/FileSys/symlink.c +Posix/FileSys/umask.c +Posix/FileSys/unlink.c +Posix/IO/FLock.c +Posix/IO/close.c +Posix/IO/dup.c +Posix/IO/dup2.c +Posix/IO/fcntl2.c +Posix/IO/fcntl3.c +Posix/IO/fsync.c +Posix/IO/lseek.c +Posix/IO/pipe.c +Posix/IO/read.c +Posix/IO/write.c +Posix/ProcEnv/ProcEnv.c +Posix/ProcEnv/Tms.c +Posix/ProcEnv/Uname.c +Posix/ProcEnv/environ.c +Posix/ProcEnv/getenv.c +Posix/ProcEnv/getgroups.c +Posix/ProcEnv/getlogin.c +Posix/ProcEnv/getpgrp.c +Posix/ProcEnv/isatty.c +Posix/ProcEnv/setenv.c +Posix/ProcEnv/setgroups.c +Posix/ProcEnv/sysconf.c +Posix/ProcEnv/ttyname.c +Posix/Process/alarm.c +Posix/Process/exece.c +Posix/Process/execp.c +Posix/Process/exit.c +Posix/Process/exitStatus.c +Posix/Process/fork.c +Posix/Process/ifExited.c +Posix/Process/ifSignaled.c +Posix/Process/ifStopped.c +Posix/Process/kill.c +Posix/Process/nanosleep.c +Posix/Process/pause.c +Posix/Process/sleep.c +Posix/Process/stopSig.c +Posix/Process/system.c +Posix/Process/termSig.c +Posix/Process/waitpid.c +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 +basis/Real/class.c +basis/Real/frexp.c +basis/Real/gdtoa.c +basis/Real/modf.c +basis/Real/nextAfter.c +basis/Real/real.c +basis/Real/signBit.c +basis/Real/strto.c Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,6 +0,0 @@ -#include "platform.h" - -/* Manual initialization is a work-around for a Darwin linker issue. */ -Int CommandLine_argc = 0; -CstringArray CommandLine_argv = 0; -Cstring CommandLine_commandName = 0; Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,108 +0,0 @@ -#include "platform.h" - -#ifndef DEBUG -#define DEBUG FALSE -#endif - -static struct tm tm; -static struct tm *tmp; - -Int Date_Tm_sec() { - return tmp->tm_sec; -} - -Int Date_Tm_min() { - return tmp->tm_min; -} - -Int Date_Tm_hour() { - return tmp->tm_hour; -} - -Int Date_Tm_mday() { - return tmp->tm_mday; -} - -Int Date_Tm_mon() { - return tmp->tm_mon; -} - -Int Date_Tm_year() { - return tmp->tm_year; -} - -Int Date_Tm_wday() { - return tmp->tm_wday; -} - -Int Date_Tm_yday() { - return tmp->tm_yday; -} - -Int Date_Tm_isdst() { - return tmp->tm_isdst; -} - -void Date_Tm_setSec(Int x) { - tm.tm_sec = x; -} - -void Date_Tm_setMin(Int x) { - tm.tm_min = x; -} - -void Date_Tm_setHour(Int x) { - tm.tm_hour = x; -} - -void Date_Tm_setMday(Int x) { - tm.tm_mday = x; -} - -void Date_Tm_setMon(Int x) { - tm.tm_mon = x; -} - -void Date_Tm_setYear(Int x) { - tm.tm_year = x; -} - -void Date_Tm_setWday(Int x) { - tm.tm_wday = x; -} - -void Date_Tm_setYday(Int x) { - tm.tm_yday = x; -} - -void Date_Tm_setIsdst(Int x) { - tm.tm_isdst = x; -} - -void Date_gmTime(Pointer p) { - tmp = gmtime((time_t*)p); -} - -/* The idea for Date_localOffset comes from KitV3 src/Runtime/Time.c */ -Int Date_localOffset() { - time_t t1, t2; - - t1 = time(NULL); - t2 = mktime(gmtime(&t1)); - return difftime(t2, t1); -} - -void Date_localTime(Pointer p) { - tmp = localtime((time_t*)p); - if (DEBUG) - fprintf (stderr, FMTPTR" = Date_localTime ("FMTPTR")\n", - (uintptr_t)tmp, (uintptr_t)p); -} - -Int Date_mkTime() { - return mktime(&tm); -} - -Int Date_strfTime(Pointer buf, Int n, Pointer fmt) { - return strftime((char*)(buf), n, (char*)(fmt), &tm); -} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Debug.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Debug.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Debug.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,31 +0,0 @@ -#include "platform.h" - -enum { - INDENTATION = 1, -}; - -static int depth = 0; - -static void spaces(int depth) { - int i; - - depth %= 40; - for (i = 0; i < depth; ++i) - fprintf(stderr, " "); -} - -void Debug_enter(Pointer name) { - depth += INDENTATION; - spaces(depth); - fprintf(stderr, "Entering "); - Stdio_print(name); - fprintf(stderr, "\n"); -} - -void Debug_leave(Pointer name) { - spaces(depth); - fprintf(stderr, "Leaving "); - Stdio_print(name); - fprintf(stderr, "\n"); - depth -= INDENTATION; -} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IEEEReal.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IEEEReal.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IEEEReal.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,45 +0,0 @@ -#include "platform.h" - -#if !HAS_FEROUND - -#if (defined __i386__) - -/* Macros for accessing the hardware control word. */ -#define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw)) -#define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw)) - -#define ROUNDING_CONTROL_MASK 0x0C00 -#define ROUNDING_CONTROL_SHIFT 10 - -int fegetround () { - unsigned short controlWord; - - _FPU_GETCW (controlWord); - return (controlWord & ROUNDING_CONTROL_MASK) >> ROUNDING_CONTROL_SHIFT; -} - -static inline void fesetround (int mode) { - unsigned short controlWord; - - _FPU_GETCW (controlWord); - controlWord &= ~ROUNDING_CONTROL_MASK; - controlWord |= mode << ROUNDING_CONTROL_SHIFT; - _FPU_SETCW (controlWord); -} - -#else - -#error fe{get,set}round not implemented - -#endif - -#endif - -Int IEEEReal_getRoundingMode () { - return fegetround (); -} - -void IEEEReal_setRoundingMode (Int m) { - assert (m != FE_NOSUPPORT); - fesetround (m); -} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,85 +0,0 @@ -#include "platform.h" - -Real32 PackReal32_subVec (Pointer v, Int offset) { - Real32 r; - pointer p = (pointer)&r; - pointer s = v + offset; - int i; - - for (i = 0; i < 4; ++i) - p[i] = s[i]; - return r; -} - -Real32 PackReal32_subVecRev (Pointer v, Int offset) { - Real32 r; - pointer p = (pointer)&r; - pointer s = v + offset; - int i; - - for (i = 0; i < 4; ++i) - p[i] = s[3 - i]; - return r; -} - -Real64 PackReal64_subVec (Pointer v, Int offset) { - Real64 r; - pointer p = (pointer)&r; - pointer s = v + offset; - int i; - - for (i = 0; i < 8; ++i) - p[i] = s[i]; - return r; -} - -Real64 PackReal64_subVecRev (Pointer v, Int offset) { - Real64 r; - pointer p = (pointer)&r; - pointer s = v + offset; - int i; - - for (i = 0; i < 8; ++i) - p[i] = s[7 - i]; - return r; -} - -void PackReal32_update (Pointer a, Int offset, Real32 r) { - pointer p = (pointer)&r; - pointer s = a + offset; - int i; - - for (i = 0; i < 4; ++i) { - s[i] = p[i]; - } -} - -void PackReal32_updateRev (Pointer a, Int offset, Real32 r) { - pointer p = (pointer)&r; - pointer s = a + offset; - int i; - - for (i = 0; i < 4; ++i) { - s[i] = p[3 - i]; - } -} - -void PackReal64_update (Pointer a, Int offset, Real64 r) { - pointer p = (pointer)&r; - pointer s = a + offset; - int i; - - for (i = 0; i < 8; ++i) { - s[i] = p[i]; - } -} - -void PackReal64_updateRev (Pointer a, Int offset, Real64 r) { - pointer p = (pointer)&r; - pointer s = a + offset; - int i; - - for (i = 0; i < 8; ++i) { - s[i] = p[7 - i]; - } -} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/IEEEReal.c) Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/PackReal.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,9 +1,9 @@ #include "platform.h" -void Stdio_print (Pointer s) { - uintmax_t size = GC_getArrayLength (s); - if (0 == size) - return; - while (1 != fwrite (s, (size_t)size, 1, stderr)) - /* nothing */; +void Stdio_print (String_t s) { + uintmax_t size = GC_getArrayLength (s); + if (0 == size) + return; + while (1 != fwrite (s, (size_t)size, 1, stderr)) + /* nothing */; } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/CommandLine.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/CommandLine.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -0,0 +1,6 @@ +#include "platform.h" + +/* 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; Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Date.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -0,0 +1,63 @@ +#include "platform.h" + +#ifndef DEBUG +#define DEBUG FALSE +#endif + +static struct tm tm; +static struct tm *tmp; + +C_Int_t Date_Tm_getHour(void) { return tmp->tm_hour; } +C_Int_t Date_Tm_getIsDst(void) { return tmp->tm_isdst; } +C_Int_t Date_Tm_getMDay(void) { return tmp->tm_mday; } +C_Int_t Date_Tm_getMin(void) { return tmp->tm_min; } +C_Int_t Date_Tm_getMon(void) { return tmp->tm_mon; } +C_Int_t Date_Tm_getSec(void) { return tmp->tm_sec; } +C_Int_t Date_Tm_getWDay(void) { return tmp->tm_wday; } +C_Int_t Date_Tm_getYDay(void) { return tmp->tm_yday; } +C_Int_t Date_Tm_getYear(void) { return tmp->tm_year; } + +void Date_Tm_setHour(C_Int_t x) { tm.tm_hour = x; } +void Date_Tm_setIsDst(C_Int_t x) { tm.tm_isdst = x; } +void Date_Tm_setMDay(C_Int_t x) { tm.tm_mday = x; } +void Date_Tm_setMin(C_Int_t x) { tm.tm_min = x; } +void Date_Tm_setMon(C_Int_t x) { tm.tm_mon = x; } +void Date_Tm_setSec(C_Int_t x) { tm.tm_sec = x; } +void Date_Tm_setWDay(C_Int_t x) { tm.tm_wday = x; } +void Date_Tm_setYDay(C_Int_t x) { tm.tm_yday = x; } +void Date_Tm_setYear(C_Int_t x) { tm.tm_year = x; } + +C_Errno_t(C_Int_t) Date_gmTime(Ref(C_Time_t) p) { + tmp = gmtime((time_t*)p); + if (DEBUG) + fprintf (stderr, FMTPTR" = Date_gmTime ("FMTPTR")\n", + (uintptr_t)tmp, (uintptr_t)p); + if (tmp == NULL) return -1; + return 0; +} + +/* The idea for Date_localOffset comes from KitV3 src/Runtime/Time.c */ +C_Double_t Date_localOffset(void) { + time_t t1, t2; + + t1 = time(NULL); + t2 = mktime(gmtime(&t1)); + return difftime(t2, t1); +} + +C_Errno_t(C_Int_t) Date_localTime(Ref(C_Time_t) p) { + tmp = localtime((time_t*)p); + if (DEBUG) + fprintf (stderr, FMTPTR" = Date_localTime ("FMTPTR")\n", + (uintptr_t)tmp, (uintptr_t)p); + if (tmp == NULL) return -1; + return 0; +} + +C_Errno_t(C_Time_t) Date_mkTime(void) { + return mktime(&tm); +} + +C_Size_t Date_strfTime(String_t buf, C_Size_t n, NullString_t fmt) { + return strftime((char*)(buf), n, (char*)(fmt), &tm); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/OS) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/OS/IO/poll.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/OS/IO/poll.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,16 +1,21 @@ #include "platform.h" -Int OS_IO_poll (Fd *fds, Word *eventss, Int n, Int timeout, Word *reventss) { - int i, res; - struct pollfd ufds[n]; +C_Int_t OS_IO_poll (Vector(C_Fd_t) fds, + Vector(C_Short_t) eventss, + C_NFds_t n, + C_Int_t timeout, + Array(C_Short_t) reventss) { + unsigned int i + int res; + struct pollfd ufds[n]; - for (i = 0; i < n; i++) { - ufds[i].fd = fds[i]; - ufds[i].events = eventss[i]; - } - res = poll (ufds, n, timeout); - for (i = 0; i < n; i++) { - reventss[i] = ufds[i].revents; - } - return res; + for (i = 0; i < n; i++) { + ufds[i].fd = fds[i]; + ufds[i].events = eventss[i]; + } + res = poll (ufds, n, timeout); + for (i = 0; i < n; i++) { + reventss[i] = ufds[i].revents; + } + return res; } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c (from rev 4301, mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/System/Time.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -0,0 +1,19 @@ +#include "platform.h" + +#ifndef DEBUG +#define DEBUG FALSE +#endif + +static struct timeval timeval; + +C_Int_t Time_gettimeofday (void) { + int res; + res = gettimeofday (&timeval, (struct timezone*)NULL); + if (DEBUG) + fprintf (stderr, "%d = Time_gettimeofday ()\n", res); + return res; +} + +C_Time_t Time_sec (void) { return timeval.tv_sec; } + +C_SUSeconds_t Time_usec (void) { return timeval.tv_usec; } Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Time.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -1,24 +0,0 @@ -#include "platform.h" - -#ifndef DEBUG -#define DEBUG FALSE -#endif - -static struct timeval timeval; - -Int Time_gettimeofday () { - Int res; - - res = gettimeofday (&timeval, (struct timezone*)NULL); - if (DEBUG) - fprintf (stderr, "%d = Time_gettimeofday ()\n", (int)res); - return res; -} - -Int Time_sec () { - return timeval.tv_sec; -} - -Int Time_usec () { - return timeval.tv_usec; -} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-23 03:12:19 UTC (rev 4302) @@ -46,10 +46,13 @@ // #include <wchar.h> // #include <wctype.h> + + #include <fcntl.h> #include <unistd.h> #include <dirent.h> +#include <poll.h> #include <termios.h> #include <utime.h> #include <sys/resource.h> Added: 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-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-01-23 03:12:19 UTC (rev 4302) @@ -0,0 +1,34 @@ +CommandLine.argc = _symbol : C.Int.t +CommandLine.argv = _symbol : C.StringArray.t +CommandLine.commandName = _symbol : C.String.t +Date.Tm.getHour = _import : unit -> C.Int.t +Date.Tm.getIsDst = _import : unit -> C.Int.t +Date.Tm.getMDay = _import : unit -> C.Int.t +Date.Tm.getMin = _import : unit -> C.Int.t +Date.Tm.getMon = _import : unit -> C.Int.t +Date.Tm.getSec = _import : unit -> C.Int.t +Date.Tm.getWDay = _import : unit -> C.Int.t +Date.Tm.getYDay = _import : unit -> C.Int.t +Date.Tm.getYear = _import : unit -> C.Int.t +Date.Tm.setHour = _import : C.Int.t -> unit +Date.Tm.setIsDst = _import : C.Int.t -> unit +Date.Tm.setMDay = _import : C.Int.t -> unit +Date.Tm.setMin = _import : C.Int.t -> unit +Date.Tm.setMon = _import : C.Int.t -> unit +Date.Tm.setSec = _import : C.Int.t -> unit +Date.Tm.setWDay = _import : C.Int.t -> unit +Date.Tm.setYDay = _import : C.Int.t -> unit +Date.Tm.setYear = _import : C.Int.t -> unit +Date.gmTime = _import : C.Time.t ref -> C.Int.t C.Errno.t +Date.localOffset = _import : unit -> C.Double.t +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 : String.t * C.Size.t * NullString.t -> C.Size.t +OS.IO.POLLIN = _const : C.Short.t +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 +Stdio.print = _import : String.t -> unit +Time.gettimeofday = _import : unit -> C.Int.t +Time.sec = _import : unit -> C.Time.t +Time.usec = _import : unit -> C.SUSeconds.t Added: 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-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-01-23 03:12:19 UTC (rev 4302) @@ -0,0 +1,376 @@ +(* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh + * Jagannathan, and Stephen Weeks. + * + * MLton is released under a BSD-style license. + * See the file MLton-LICENSE for details. + *) + +structure List = + struct + open List + + fun sort f l = + let + fun qsort l = + case l of + [] => [] + | hd::tl => + let + val (lt,eq,gt) = + List.foldr + (fn (x,(lt,eq,gt)) => + case f (x,hd) of + LESS => (x::lt,eq,gt) + | EQUAL => (lt,x::eq,gt) + | GREATER => (lt,eq,x::gt)) + ([],[],[]) + tl + val lt = qsort lt + val gt = qsort gt + in + lt @ (hd :: eq) @ gt + end + in + qsort l + end + end + +structure Substring = + struct + open Substring + + fun droplSpace ss = + dropl Char.isSpace ss + fun droprSpace ss = + dropr Char.isSpace ss + + end + +structure Name = + struct + datatype t = T of string list + + fun compare (T ss1, T ss2) = + List.collate + (fn (s1,s2) => + String.compare (CharVector.map Char.toLower s1, + CharVector.map Char.toLower s2)) + (ss1, ss2) + + fun last (T ss) = List.last ss + fun toC (T ss) = + String.concatWith "_" ss + fun toML (T ss) = + String.concatWith "." ss + + fun parse ss = + let + val ss = Substring.droplSpace ss + val (names, rest) = + Substring.splitl + (fn c => Char.isAlpha c orelse c = #".") + ss + val rest = Substring.droplSpace rest + in + if Substring.isEmpty names + then NONE + else let + val names = Substring.fields (fn c => #"." = c) names + val names = List.map Substring.string names + in + SOME (T names, rest) + end + end + end + + +structure Type = + struct + datatype t = + Array of t + | Base of Name.t + | Con of Name.t * t + | Ref of t + | Unit + | Vector of t + + fun toC t = + case t of + Array t => concat ["Array(", toC t, ")"] + | Base name => Name.toC name + | Con (name, t) => concat [Name.toC name, "(", toC t, ")"] + | Ref t => concat ["Ref(", toC t, ")"] + | Unit => "void" + | Vector t => concat ["Vector(", toC t, ")"] + fun toML t = + case t of + Array t => concat ["(", toML t, ") array"] + | Base name => Name.toML name + | Con (name, t) => concat ["(", toML t, ") ", Name.toML name] + | Ref t => concat ["(", toML t, ") ref"] + | Unit => "unit" + | Vector t => concat ["(", toML t, ") vector"] + + fun parse s = + let + fun loop (s, t) = + case Name.parse s of + NONE => (t, s) + | SOME (Name.T ["array"], rest) => loop (rest, Array t) + | SOME (Name.T ["ref"], rest) => loop (rest, Ref t) + | SOME (Name.T ["vector"], rest) => loop (rest, Vector t) + | SOME (name, rest) => loop (rest, Con (name, t)) + in + case Name.parse s of + NONE => raise Fail "Type.parse" + | SOME (Name.T ["unit"], rest) => loop (rest, Unit) + | SOME (name, rest) => loop (rest, Base name) + end + + fun parseFn s = + let + fun loop (s, args) = + let + val (arg, rest) = parse s + in + if Substring.isPrefix "*" rest + then let + val rest = #2 (Substring.splitAt (rest, 1)) + in + loop (rest, arg::args) + end + else if Substring.isPrefix "->" rest + then let + val rest = #2 (Substring.splitAt (rest, 2)) + val (ret, rest) = parse rest + in + ({args = List.rev (arg::args), + ret = ret}, + rest) + end + else raise Fail "Type.parseFn" + end + in + loop (s, []) + end + end + +structure Entry = + struct + datatype t = + Const of {name: Name.t, + ty: Type.t} + | Import of {name: Name.t, + ty: {args: Type.t list, + ret: Type.t}} + | Symbol of {name: Name.t, + ty: Type.t} + + fun name entry = + case entry of + Const {name,...} => name + | Import {name,...} => name + | Symbol {name,...} => name + + fun compare (entry1, entry2) = + Name.compare (name entry1, name entry2) + + fun toC entry = + case entry of + Const {name, ty} => + String.concat + ["/* ", + Name.toC name, + " */"] + | Import {name, ty = {args, ret}} => + String.concat + [Type.toC ret, + " ", + Name.toC name, + "(", + String.concatWith "," (List.map Type.toC args), + ");"] + | Symbol {name, ty} => + String.concat + ["extern ", + Type.toC ty, + " ", + Name.toC name, + ";"] + fun toML entry = + case entry of + Const {name, ty} => + String.concat + ["val ", + Name.last name, + " = _const \"", + Name.toC name, + "\" : ", + Type.toML ty, + ";"] + | Import {name, ty = {args, ret}} => + String.concat + ["val ", + Name.last name, + " = _import \"", + Name.toC name, + "\" : ", + String.concatWith " * " (List.map Type.toML args), + " -> ", + Type.toML ret, + ";"] + | Symbol {name, ty} => + String.concat + ["val ", + Name.last name, + " = #2 (_symbol \"", + Name.toC name, + "\": (", + Type.toML ty, + ") GetSet.t;"] + + fun parseConst (s, name) = + let + val s = #2 (Substring.splitAt (s, 6)) + val s = Substring.droplSpace s + val s = if Substring.isPrefix ":" s + then #2 (Substring.splitAt (s, 1)) + else raise Fail "Entry.parseSymbol" + val (ret, rest) = Type.parse s + val () = if Substring.isEmpty rest + then () + else raise Fail "Entry.parseSymbol" + in + Const {name = name, + ty = ret} + end + + fun parseImport (s, name) = + let + val s = #2 (Substring.splitAt (s, 7)) + val s = Substring.droplSpace s + val s = if Substring.isPrefix ":" s + then #2 (Substring.splitAt (s, 1)) + else raise Fail "Entry.parseImport" + val ({args, ret}, rest) = Type.parseFn s + val () = if Substring.isEmpty rest + then () + else raise Fail "Entry.parseImport" + in + Import {name = name, + ty = {args = args, ret = ret}} + end + + fun parseSymbol (s, name) = + let + val s = #2 (Substring.splitAt (s, 7)) + val s = Substring.droplSpace s + val s = if Substring.isPrefix ":" s + then #2 (Substring.splitAt (s, 1)) + else raise Fail "Entry.parseSymbol" + val (ret, rest) = Type.parse s + val () = if Substring.isEmpty rest + then () + else raise Fail "Entry.parseSymbol" + in + Symbol {name = name, + ty = ret} + end + + fun parse s = + case Name.parse s of + NONE => raise Fail "Entry.parse" + | SOME (name, rest) => + if Substring.isPrefix "=" rest + then let + val rest = #2 (Substring.splitAt (rest, 1)) + val rest = Substring.droplSpace rest + in + if Substring.isPrefix "_const" rest + then parseConst (rest, name) + else if Substring.isPrefix "_import" rest + then parseImport (rest, name) + else if Substring.isPrefix "_symbol" rest + then parseSymbol (rest, name) + else raise Fail "Entry.parse" + end + else raise Fail "Entry.parse" + end + +val entries = + let + val f = TextIO.openIn "basis-ffi.def" + fun loop entries = + case TextIO.inputLine f of + NONE => List.rev entries + | SOME s => let + val entry = Entry.parse (Substring.full s) + in + loop (entry :: entries) + end + val entries = loop [] + val () = TextIO.closeIn f + val entries = List.sort Entry.compare entries + in + entries + end + +fun outputC entries = + let + val f = TextIO.openOut "basis-ffi.h" + fun print s = TextIO.output (f, s) + fun println s = (print s; print "\n") + + val () = println "/* This file is automatically generated. Do not edit. */\n" + val () = List.app (fn entry => println (Entry.toC entry)) entries + val () = TextIO.closeOut f + in + () + end + +fun outputML entries = + let + val f = TextIO.openOut "basis-ffi.sml" + fun print s = TextIO.output (f, s) + fun println s = (print s; print "\n") + + val () = println "(* This file is automatically generated. Do not edit. *)\n" + val () = println "structure PrimitiveFFI =" + val () = println "struct" + val cur = + List.foldl + (fn (entry, cur) => + let + val Name.T names = Entry.name entry + val str = List.rev (List.tl (List.rev names)) + fun loop (cur, str) = + case (cur, str) of + ([], []) => () + | ([], str) => + List.app (fn s => + (println ("structure " ^ s ^ " = ") + ; println "struct")) + str + | (cur, []) => + List.app (fn _ => println "end") cur + | (c::cur,s::str) => + if c = s + then loop (cur, str) + else (println "end" + ; loop (cur, s::str)) + in + loop (cur, str) + ; println (Entry.toML entry) + ; str + end) + [] + entries + val () = List.app (fn _ => println "end") cur + val () = println "end" + val () = TextIO.closeOut f + in + () + end + +val () = outputC entries +val () = outputML entries 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-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-23 03:12:19 UTC (rev 4302) @@ -47,6 +47,8 @@ "#define Ref(t) Pointer", "#define Vector(t) Pointer", "", + "typedef void unit;", + "", "typedef int8_t Int8;", "typedef int16_t Int16;", "typedef int32_t Int32;", @@ -84,6 +86,9 @@ "typedef Word32 Word;", "" "typedef String NullString;", + "", + "typedef String String_t;", + "typedef String NullString_t;", NULL }; @@ -117,14 +122,16 @@ static char* suffix[] = { "", - "typedef C_Pointer Cpointer;", - "typedef C_Size Size;", + "#define C_Errno_t(t) t", + "", + "typedef C_Pointer_t Cpointer;", + "typedef C_Size_t Size;", "typedef C_SSize Ssize;", - "typedef C_String Cstring;", - "typedef C_StringArray CstringArray;", + "typedef C_String_t Cstring;", + "typedef C_StringArray_t CstringArray;", "typedef C_Off Position;" "", - "typedef C_Fd Fd;", + "typedef C_Fd_t Fd;", "typedef C_TCFlag Flag;", "typedef C_GId Gid;", "typedef C_Mode Mode;", @@ -155,34 +162,42 @@ writeNewline (fd); writeString (fd, "/* C */"); writeNewline (fd); - chkintsystype(char, "C_Char"); - systype(signed char, "Int", "C_SChar"); - systype(unsigned char, "Word", "C_UChar"); - systype(short, "Int", "C_Short"); - systype(unsigned short, "Word", "C_UShort"); - systype(int, "Int", "C_Int"); - systype(unsigned int, "Word", "C_UInt"); - systype(long, "Int", "C_Long"); - systype(unsigned long, "Word", "C_ULong"); - systype(long long, "Int", "C_LongLong"); - systype(unsigned long long, "Word", "C_ULongLong"); - systype(float, "Real", "C_Float"); - systype(double, "Real", "C_Double"); + chkintsystype(char, "C_Char_t"); + systype(signed char, "Int", "C_SChar_t"); + systype(unsigned char, "Word", "C_UChar_t"); + systype(short, "Int", "C_Short_t"); + systype(unsigned short, "Word", "C_UShort_t"); + systype(int, "Int", "C_Int_t"); + systype(unsigned int, "Word", "C_UInt_t"); + systype(long, "Int", "C_Long_t"); + systype(unsigned long, "Word", "C_ULong_t"); + systype(long long, "Int", "C_LongLong_t"); + systype(unsigned long long, "Word", "C_ULongLong_t"); + systype(float, "Real", "C_Float_t"); + systype(double, "Real", "C_Double_t"); // systype(long double, "Real", "C_LongDouble"); - systype(size_t, "Word", "C_Size"); + systype(size_t, "Word", "C_Size_t"); writeNewline (fd); - systype(void*, "Word", "C_Pointer"); - systype(char*, "Word", "C_String"); - systype(char**, "Word", "C_StringArray"); + systype(void*, "Word", "C_Pointer_t"); + systype(char*, "Word", "C_String_t"); + systype(char**, "Word", "C_StringArray_t"); writeNewline (fd); writeString (fd, "/* C99 */"); writeNewline (fd); - systype(_Bool, "Word", "C_Bool"); - systype(intmax_t, "Int", "C_Intmax"); - systype(uintmax_t, "Word", "C_Uintmax"); - systype(intptr_t, "Int", "C_Intptr"); - systype(uintptr_t, "Word", "C_UIntptr"); + systype(_Bool, "Word", "C_Bool_t"); + systype(intmax_t, "Int", "C_Intmax_t"); + systype(uintmax_t, "Word", "C_Uintmax_t"); + systype(intptr_t, "Int", "C_Intptr_t"); + systype(uintptr_t, "Word", "C_UIntptr_t"); writeNewline (fd); + writeString (fd, "/* Generic integers */"); + writeNewline (fd); + systype(int, "Int", "C_Fd_t"); + writeNewline (fd); + writeString (fd, "/* from <poll.h> */"); + writeNewline (fd); + systype(nfds_t, "Word", "C_NFds_t"); + writeNewline (fd); writeString (fd, "/* from <sys/resource.h> */"); writeNewline (fd); systype(rlim_t, "Word", "C_RLim"); @@ -196,19 +211,18 @@ systype(off_t, "Int", "C_Off"); systype(pid_t, "Int", "C_PId"); systype(ssize_t, "Int", "C_SSize"); - // systype(suseconds_t, "Int", "C_SUSeconds"); - chknumsystype(time_t, "C_Time"); + systype(suseconds_t, "Int", "C_SUSeconds_t"); + chknumsystype(time_t, "C_Time_t"); chkintsystype(uid_t, "C_UId"); - systype(useconds_t, "Word", "C_USeconds"); + systype(useconds_t, "Word", "C_USeconds_t"); writeNewline (fd); writeString (fd, "/* from <termios.h> */"); writeNewline (fd); systype(tcflag_t, "Word", "C_TCFlag"); systype(speed_t, "Word", "C_Speed"); writeNewline (fd); - writeString (fd, "/* Generic integers */"); + writeString (fd, "/* Misc */"); writeNewline (fd); - systype(int, "Int", "C_Fd"); systype(int, "Int", "C_Resource"); systype(int, "Int", "C_Signal"); systype(int, "Int", "C_Status"); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-09 22:47:28 UTC (rev 4301) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-23 03:12:19 UTC (rev 4302) @@ -119,6 +119,7 @@ #endif #include "types.h" +#include "basis-ffi.h" /* ---------------------------------------------------------------- */ /* Runtime Init/Exit */ @@ -178,52 +179,6 @@ /* ---------------------------------------------------------------- */ /* ------------------------------------------------- */ -/* CommandLine */ -/* ------------------------------------------------- */ - -/* These are initialized by MLton_init. */ -extern Int CommandLine_argc; -extern CstringArray CommandLine_argv; -extern Cstring CommandLine_commandName; - -/* ------------------------------------------------- */ -/* Date */ -/* ------------------------------------------------- */ - -Int Date_Tm_sec (void); -Int Date_Tm_min (void); -Int Date_Tm_hour (void); -Int Date_Tm_mday (void); -Int Date_Tm_mon (void); -Int Date_Tm_year (void); -Int Date_Tm_wday (void); -Int Date_Tm_yday (void); -Int Date_Tm_isdst (void); -void Date_Tm_setSec (Int x); -void Date_Tm_setMin (Int x); -void Date_Tm_setHour (Int x); -void Date_Tm_setMday (Int x); -void Date_Tm_setMon (Int x); -void Date_Tm_setYear (Int x); -void Date_Tm_setWday (Int x); -void Date_Tm_setYday (Int x); -void Date_Tm_setIsdst (Int x); - -Cstring Date_ascTime (void); -void Date_gmTime (Pointer p); -Int Date_localOffset (void); -void Date_localTime (Pointer p); -Int Date_mkTime (void); -Int Date_strfTime (Pointer buf, Int n, Pointer fmt); - -/* ------------------------------------------------- */ -/* Debug */ -/* ------------------------------------------------- */ - -void Debug_enter (Pointer name); -void Debug_leave (Pointer name); - -/* ------------------------------------------------- */ /* IEEEReal */ /* ------------------------------------------------- */ @@ -433,9 +388,6 @@ #define OS_IO_POLLPRI POLLPRI #define OS_IO_POLLOUT POLLOUT -Cstring OS_FileSys_tmpnam (void); -Int OS_IO_poll (Int *fds, Word *eventss, Int n, Int timeout, Word *reventss); - /* ------------------------------------------------- */ /* PackReal */ /* ------------------------------------------------- */ @@ -1067,26 +1019,6 @@ void INetSock_getInAddr (Pointer addr); /* ------------------------------------------------- */ -/* Stdio */ -/* ------------------------------------------------- */ - -void Stdio_print (Pointer s); - -/* ------------------------------------------------- */ -/* String */ -/* ------------------------------------------------- */ - -int String_equal (char * s1, char * s2); - -/* ------------------------------------------------- */ -/* Time */ -/* ------------------------------------------------- */ - -Int Time_gettimeofday (void); -Int Time_sec (void); -Int Time_usec (void); - -/* ------------------------------------------------- */ /* Windows */ /* ------------------------------------------------- */ @@ -1106,19 +1038,16 @@ Bool Word##size##_negCheckOverflows (WordS##size x); #define SsubCheckOverflows(size) \ Bool WordS##size##_subCheckOverflows (WordS##size x, WordS##size y); - #define all(size) \ SaddCheckOverflows (size) \ UaddCheckOverflows (size) \ - negCheckOverflows (size) \ SmulCheckOverflows (size) \ - SsubCheckOverflows (size) \ - + negCheckOverflows (size) \ + SsubCheckOverflows (size) all (8) all (16) all (32) all (64) - #undef SaddCheckOverflows #undef UaddCheckOverflows #undef SmulCheckOverflows |
From: Matthew F. <fl...@ml...> - 2006-01-09 14:47:30
|
Cygwin errors ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c U mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2006-01-06 23:19:20 UTC (rev 4300) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2006-01-09 22:47:28 UTC (rev 4301) @@ -279,14 +279,16 @@ return answer (&resmpz, bytes); } -pointer IntInf_arshift(pointer arg, uint shift, size_t bytes) { +pointer IntInf_arshift(pointer arg, Word shift_w, size_t bytes) { + uint shift = (uint)shift_w; if (DEBUG_INT_INF) fprintf (stderr, "IntInf_arshift ("FMTPTR", %u, %zu)\n", (uintptr_t)arg, shift, bytes); return shary(arg, shift, bytes, &mpz_fdiv_q_2exp); } -pointer IntInf_lshift(pointer arg, uint shift, size_t bytes) { +pointer IntInf_lshift(pointer arg, Word shift_w, size_t bytes) { + uint shift = (uint)shift_w; if (DEBUG_INT_INF) fprintf (stderr, "IntInf_lshift ("FMTPTR", %u, %zu)\n", (uintptr_t)arg, shift, bytes); 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-06 23:19:20 UTC (rev 4300) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-09 22:47:28 UTC (rev 4301) @@ -177,6 +177,7 @@ writeNewline (fd); writeString (fd, "/* C99 */"); writeNewline (fd); + systype(_Bool, "Word", "C_Bool"); systype(intmax_t, "Int", "C_Intmax"); systype(uintmax_t, "Word", "C_Uintmax"); systype(intptr_t, "Int", "C_Intptr"); @@ -195,7 +196,7 @@ systype(off_t, "Int", "C_Off"); systype(pid_t, "Int", "C_PId"); systype(ssize_t, "Int", "C_SSize"); - systype(suseconds_t, "Int", "C_SUSeconds"); + // systype(suseconds_t, "Int", "C_SUSeconds"); chknumsystype(time_t, "C_Time"); chkintsystype(uid_t, "C_UId"); systype(useconds_t, "Word", "C_USeconds"); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-01-06 23:19:20 UTC (rev 4300) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-01-09 22:47:28 UTC (rev 4301) @@ -2,33 +2,32 @@ #include "platform.h" -#include "getrusage.c" #include "mkdir2.c" #include "mmap.c" -#include "totalRam.sysconf.c" +#include "sysconf.c" #include "windows.c" -void decommit (void *base, size_t length) { +HANDLE fileDesHandle (int fd) { + return (HANDLE)(get_osfhandle (fd)); +} + +void GC_decommit (void *base, size_t length) { if (MLton_Platform_CygwinUseMmap) - smunmap (base, length); + munmap_safe (base, length); else Windows_decommit (base, length); } -HANDLE fileDesHandle (int fd) { - return (HANDLE)(get_osfhandle (fd)); -} - -void *mmapAnon (void *start, size_t length) { +void *GC_mmapAnon (void *start, size_t length) { if (MLton_Platform_CygwinUseMmap) - return mmapAnonMmap (start, length); + return mmapAnon (start, length); else return Windows_mmapAnon (start, length); } -void release (void *base, size_t length) { +void GC_release (void *base, size_t length) { if (MLton_Platform_CygwinUseMmap) - smunmap (base, length); + munmap_safe (base, length); else Windows_release (base); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-01-06 23:19:20 UTC (rev 4300) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-01-09 22:47:28 UTC (rev 4301) @@ -1,6 +1,6 @@ HANDLE fileDesHandle (int fd); -static void showMaps () { +static void displayMaps () { MEMORY_BASIC_INFORMATION buf; LPCVOID lpAddress; char *state = "<unset>"; @@ -60,7 +60,7 @@ } } -void showMem () { +void GC_displayMem () { MEMORYSTATUS ms; ms.dwLength = sizeof (MEMORYSTATUS); |
From: Matthew F. <fl...@ml...> - 2006-01-06 15:19:22
|
Playing with C-types ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-06 23:17:36 UTC (rev 4299) +++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-01-06 23:19:20 UTC (rev 4300) @@ -9,43 +9,53 @@ #ifndef _MLTON_CENV_H_ #define _MLTON_CENV_H_ +/* GNU C Library Feature Macros */ #define _ISOC99_SOURCE #define _BSD_SOURCE - -/* Only enable _POSIX_C_SOURCE on platforms that don't have broken system - * headers. +// #define _XOPEN_SOURCE 600 +/* Only enable _POSIX_C_SOURCE on platforms that don't have broken + * system headers. */ #if (defined (__linux__)) #define _POSIX_C_SOURCE 200112L #endif -/* C99-specific headers */ -#include <stddef.h> +/* C99 headers */ +// #include <assert.h> +// #include <complex.h> +// #include <ctype.h> +#include <errno.h> +// #include <fenv.h> +#include <float.h> +#include <inttypes.h> +#include <iso646.h> +#include <limits.h> +// #include <locale.h> +#include <math.h> +// #include <setjmp.h> +#include <signal.h> #include <stdarg.h> -#include <stdlib.h> #include <stdbool.h> -#include <iso646.h> +#include <stddef.h> #include <stdint.h> -#include <inttypes.h> -#include <limits.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <stdio.h> -#include <math.h> +// #include <tgmath.h> +#include <time.h> +// #include <wchar.h> +// #include <wctype.h> -#include <errno.h> #include <fcntl.h> #include <unistd.h> #include <dirent.h> -#include <signal.h> #include <termios.h> -#include <time.h> #include <utime.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/time.h> - #include "gmp.h" #endif /* _MLTON_CENV_H_ */ 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-06 23:17:36 UTC (rev 4299) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2006-01-06 23:19:20 UTC (rev 4300) @@ -5,10 +5,10 @@ * See the file MLton-LICENSE for details. */ +#include "cenv.h" #include "util.h" -#define prefixLines 26 -static char* prefix[prefixLines] = { +static char* prefix[] = { "/* Copyright (C) 2004-2005 Henry Cejtin, Matthew Fluet, Suresh", " * Jagannathan, and Stephen Weeks.", " *", @@ -16,13 +16,15 @@ " * See the file MLton-LICENSE for details.", " */", "", - "/* Can't use _TYPES_H_ because MSVCRT uses it. So, we use _MLTON_TYPES_H_. */", + "/* Can't use _TYPES_H_ because MSVCRT uses it.", + " * So, we use _MLTON_TYPES_H_.", + " */", "", "#ifndef _MLTON_TYPES_H_", "#define _MLTON_TYPES_H_", "", - "/* We need these because in header files for exported SML functions, types.h is", - " * included without platform.h.", + "/* We need these because in header files for exported SML functions, ", + " * types.h is included without cenv.h.", " */", "#ifndef _ISOC99_SOURCE", "#define _ISOC99_SOURCE", @@ -34,16 +36,21 @@ "#else", "#include <stdint.h>", "#endif", - "" + "", + NULL }; -#define stdtypesLines 21 -static char* stdtypes[stdtypesLines] = { +static char* stdtypes[] = { + "/* ML types */", + "typedef unsigned char* Pointer;", + "#define Array(t) Pointer", + "#define Ref(t) Pointer", + "#define Vector(t) Pointer", + "", "typedef int8_t Int8;", "typedef int16_t Int16;", "typedef int32_t Int32;", "typedef int64_t Int64;", - "typedef unsigned char* Pointer;", "typedef float Real32;", "typedef double Real64;", "typedef uint8_t Word8;", @@ -59,12 +66,33 @@ "typedef Word8 WordU8;", "typedef Word16 WordU16;", "typedef Word32 WordU32;", - "typedef Word64 WordU64;" + "typedef Word64 WordU64;", + "", + "typedef WordS8 Char8;", + "typedef WordS16 Char16;", + "typedef WordS32 Char32;", + "", + "typedef Vector(Char8) String8;", + "typedef Vector(Char16) String16;", + "typedef Vector(Char32) String32;", + "", + "typedef Int32 Bool;", + "typedef Char8 Char;", + "typedef Int32 Int;", + "typedef Real64 Real;", + "typedef String8 String;", + "typedef Word32 Word;", + "" + "typedef String NullString;", + NULL }; #define systype(t, bt, name) \ do { \ writeString (fd, "typedef "); \ + writeString (fd, "/* "); \ + writeString (fd, #t); \ + writeString (fd, " */ "); \ writeString (fd, bt); \ writeUintmaxU (fd, CHAR_BIT * sizeof(t));\ writeString (fd, " "); \ @@ -72,52 +100,119 @@ writeString (fd, ";"); \ writeNewline (fd); \ } while (0) +#define chkintsystype(t, name) \ + do { \ + if ((double)((t)(-1)) > 0) \ + systype(t, "Word", name); \ + else \ + systype(t, "Int", name); \ + } while (0) +#define chknumsystype(t, name) \ + do { \ + if ((double)((t)(0.25)) > 0) \ + systype(t, "Real", name); \ + else \ + chkintsystype(t, name); \ + } while (0) -#define suffixLines 2 -static char* suffix[suffixLines] = { +static char* suffix[] = { "", - "#endif /* _MLTON_TYPES_H_ */" + "typedef C_Pointer Cpointer;", + "typedef C_Size Size;", + "typedef C_SSize Ssize;", + "typedef C_String Cstring;", + "typedef C_StringArray CstringArray;", + "typedef C_Off Position;" + "", + "typedef C_Fd Fd;", + "typedef C_TCFlag Flag;", + "typedef C_GId Gid;", + "typedef C_Mode Mode;", + "typedef C_PId Pid;", + "typedef C_Resource Resource;", + "typedef C_RLim Rlimit;", + "typedef C_Signal Signal;", + "typedef C_Speed Speed;", + "typedef C_Status Status;", + "typedef C_UId Uid;", + "", + "#endif /* _MLTON_TYPES_H_ */", + NULL }; int main (int argc, char* argv[]) { int fd; fd = open_safe ("types.h", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); - for (int i = 0; i < prefixLines; i++) { + for (int i = 0; prefix[i] != NULL; i++) { writeString (fd, prefix[i]); writeNewline (fd); } - for (int i = 0; i < stdtypesLines; i++) { + for (int i = 0; stdtypes[i] != NULL; i++) { writeString (fd, stdtypes[i]); writeNewline (fd); } writeNewline (fd); - systype(char, "Word", "Char"); - systype(int, "Int", "Int"); - systype(off_t, "Int", "Position"); - systype(double, "Real", "Real"); - systype(unsigned int, "Word", "Word"); - systype(int, "Int", "Bool"); + writeString (fd, "/* C */"); writeNewline (fd); - systype(unsigned char*, "Word", "Cpointer"); - systype(char*, "Word", "Cstring"); - systype(char**, "Word", "CstringArray"); - systype(size_t, "Int", "Size"); - systype(ssize_t, "Int", "Ssize"); + chkintsystype(char, "C_Char"); + systype(signed char, "Int", "C_SChar"); + systype(unsigned char, "Word", "C_UChar"); + systype(short, "Int", "C_Short"); + systype(unsigned short, "Word", "C_UShort"); + systype(int, "Int", "C_Int"); + systype(unsigned int, "Word", "C_UInt"); + systype(long, "Int", "C_Long"); + systype(unsigned long, "Word", "C_ULong"); + systype(long long, "Int", "C_LongLong"); + systype(unsigned long long, "Word", "C_ULongLong"); + systype(float, "Real", "C_Float"); + systype(double, "Real", "C_Double"); + // systype(long double, "Real", "C_LongDouble"); + systype(size_t, "Word", "C_Size"); writeNewline (fd); - systype(int, "Int", "Fd"); - systype(tcflag_t, "Word", "Flag"); - systype(gid_t, "Word", "Gid"); - systype(mode_t, "Int", "Mode"); - systype(pid_t, "Int", "Pid"); - systype(int, "Int", "Resource"); - systype(rlim_t, "Word", "Rlimit"); - systype(int, "Int", "Signal"); - systype(speed_t, "Word", "Speed"); - systype(int, "Int", "Status"); - systype(uid_t, "Word", "Uid"); + systype(void*, "Word", "C_Pointer"); + systype(char*, "Word", "C_String"); + systype(char**, "Word", "C_StringArray"); writeNewline (fd); - for (int i = 0; i < suffixLines; i++) { + writeString (fd, "/* C99 */"); + writeNewline (fd); + systype(intmax_t, "Int", "C_Intmax"); + systype(uintmax_t, "Word", "C_Uintmax"); + systype(intptr_t, "Int", "C_Intptr"); + systype(uintptr_t, "Word", "C_UIntptr"); + writeNewline (fd); + writeString (fd, "/* from <sys/resource.h> */"); + writeNewline (fd); + systype(rlim_t, "Word", "C_RLim"); + writeNewline (fd); + writeString (fd, "/* from <sys/types.h> */"); + writeNewline (fd); + chknumsystype(clock_t, "C_Clock"); + chkintsystype(gid_t, "C_GId"); + chkintsystype(id_t, "C_Id"); + chkintsystype(mode_t, "C_Mode"); + systype(off_t, "Int", "C_Off"); + systype(pid_t, "Int", "C_PId"); + systype(ssize_t, "Int", "C_SSize"); + systype(suseconds_t, "Int", "C_SUSeconds"); + chknumsystype(time_t, "C_Time"); + chkintsystype(uid_t, "C_UId"); + systype(useconds_t, "Word", "C_USeconds"); + writeNewline (fd); + writeString (fd, "/* from <termios.h> */"); + writeNewline (fd); + systype(tcflag_t, "Word", "C_TCFlag"); + systype(speed_t, "Word", "C_Speed"); + writeNewline (fd); + writeString (fd, "/* Generic integers */"); + writeNewline (fd); + systype(int, "Int", "C_Fd"); + systype(int, "Int", "C_Resource"); + systype(int, "Int", "C_Signal"); + systype(int, "Int", "C_Status"); + writeNewline (fd); + for (int i = 0; suffix[i] != NULL; i++) { writeString (fd, suffix[i]); writeNewline (fd); } |
From: Matthew F. <fl...@ml...> - 2006-01-06 15:17:38
|
Eliminate uint. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-06 23:17:28 UTC (rev 4298) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-01-06 23:17:36 UTC (rev 4299) @@ -252,9 +252,9 @@ */ Pointer IntInf_add (Pointer lhs, Pointer rhs, size_t bytes); Pointer IntInf_andb (Pointer lhs, Pointer rhs, size_t bytes); -Pointer IntInf_arshift (Pointer arg, uint shift, size_t bytes); +Pointer IntInf_arshift (Pointer arg, Word shift, size_t bytes); Pointer IntInf_gcd (Pointer lhs, Pointer rhs, size_t bytes); -Pointer IntInf_lshift (Pointer arg, uint shift, size_t bytes); +Pointer IntInf_lshift (Pointer arg, Word shift, size_t bytes); Pointer IntInf_mul (Pointer lhs, Pointer rhs, size_t bytes); Pointer IntInf_neg (Pointer arg, size_t bytes); Pointer IntInf_notb (Pointer arg, size_t bytes); |
From: Matthew F. <fl...@ml...> - 2006-01-06 15:17:30
|
Eliminate uint. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c U mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c ---------------------------------------------------------------------- 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-06 23:16:58 UTC (rev 4297) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c 2006-01-06 23:17:28 UTC (rev 4298) @@ -9,7 +9,7 @@ res = (Int)(closedir ((DIR *) p)); if (DEBUG_DIRSTREAM) - fprintf (stderr, "%d = closedir (0x%08x)\n", (uint)res, (uint)p); + fprintf (stderr, "%d = closedir (0x%08"PRIxPTR")\n", res, (uintptr_t)p); return res; } @@ -25,14 +25,14 @@ e = readdir ((DIR *) d); res = (Cstring)((NULL == e) ? NULL : e->d_name); if (DEBUG_DIRSTREAM) - fprintf (stderr, "%s = readdir (0x%08x)\n", + fprintf (stderr, "%s = readdir (0x%08"PRIxPTR")\n", ((Cstring)NULL == res) ? "NULL": (char*)res, - (uint)d); + (uintptr_t)d); return res; } void Posix_FileSys_Dirstream_rewinddir (Cpointer p) { if (DEBUG_DIRSTREAM) - fprintf (stderr, "rewinddir (0x%08x)\n", (uint)p); + fprintf (stderr, "rewinddir (0x%08"PRIxPTR")\n", (uintptr_t)p); rewinddir ((DIR *) p); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2006-01-06 23:16:58 UTC (rev 4297) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2006-01-06 23:17:28 UTC (rev 4298) @@ -9,6 +9,7 @@ #define MLTON_GC_INTERNAL_TYPES #define MLTON_GC_INTERNAL_BASIS #include "platform.h" +typedef unsigned int uint; enum { DEBUG_INT_INF = FALSE, |
From: Matthew F. <fl...@ml...> - 2006-01-06 15:16:59
|
Quell warning ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-06 21:11:09 UTC (rev 4296) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2006-01-06 23:16:58 UTC (rev 4297) @@ -1,7 +1,7 @@ #include "platform.h" Int Posix_ProcEnv_setgroups (Pointer groups) { - int i; + unsigned int i; gid_t *list; int res; uintmax_t size; |
From: Matthew F. <fl...@ml...> - 2006-01-06 13:11:13
|
Typo ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:08:58 UTC (rev 4295) +++ mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:11:09 UTC (rev 4296) @@ -80,7 +80,7 @@ } else if (sizeof(uintmax_t) == 8) { sprintf (buf, "0x%016"PRIxMAX, u); } else { - sprintf (buf, "0x"PRIxMAX, u); + sprintf (buf, "0x%"PRIxMAX, u); } writeString (fd, buf); } |
From: Matthew F. <fl...@ml...> - 2006-01-06 13:08:59
|
Formatting ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:06:44 UTC (rev 4294) +++ mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:08:58 UTC (rev 4295) @@ -74,8 +74,14 @@ static inline void writeUintmaxX (int fd, uintmax_t u) { static char buf[BUF_SIZE]; - - sprintf (buf, "0x%08"PRIxMAX, u); + + if (sizeof(uintmax_t) == 4) { + sprintf (buf, "0x%08"PRIxMAX, u); + } else if (sizeof(uintmax_t) == 8) { + sprintf (buf, "0x%016"PRIxMAX, u); + } else { + sprintf (buf, "0x"PRIxMAX, u); + } writeString (fd, buf); } |
From: Matthew F. <fl...@ml...> - 2006-01-06 13:06:46
|
Moving TODO ---------------------------------------------------------------------- A mlton/branches/on-20050822-x86_64-branch/runtime/TODO D mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO ---------------------------------------------------------------------- Copied: mlton/branches/on-20050822-x86_64-branch/runtime/TODO (from rev 4292, mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-12-21 02:03:30 UTC (rev 4292) +++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO 2006-01-06 21:06:44 UTC (rev 4294) @@ -0,0 +1,5 @@ +* what type should be used for the size field in GC_heap? I'm using + size_t currently, since that is the type needed by malloc. +* Why does hash-table use malloc/free while generational maps use mmap/munmap? + +* Use C99 <assert.h> instead of util/assert.{c,h} Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2006-01-06 21:06:26 UTC (rev 4293) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2006-01-06 21:06:44 UTC (rev 4294) @@ -1,3 +0,0 @@ -* what type should be used for the size field in GC_heap? I'm using - size_t currently, since that is the type needed by malloc. -* Why does hash-table use malloc/free while generational maps use mmap/munmap? |
From: Matthew F. <fl...@ml...> - 2006-01-06 13:06:28
|
Extra use of (uint) ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.c 2005-12-21 02:03:30 UTC (rev 4292) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.c 2006-01-06 21:06:26 UTC (rev 4293) @@ -122,7 +122,7 @@ slot = (uint32_t)(mult * (uint64_t)hash) >> (32 - t->elementsLengthMaxLog2); probe = (1 == slot % 2) ? slot : slot - 1; if (DEBUG_SHARE) - fprintf (stderr, "probe = 0x%08x\n", (uint)probe); + fprintf (stderr, "probe = 0x%"PRIx32"\n", probe); assert (1 == probe % 2); numProbes = 0; look: |
From: Stephen W. <sw...@ml...> - 2005-12-20 18:03:34
|
Caught up to SML/NJ 110.57. ---------------------------------------------------------------------- U mlton/trunk/lib/basis-stubs/basis-2002.sml U mlton/trunk/lib/mlton-stubs/sources.cm U mlton/trunk/lib/mlton-stubs-in-smlnj/other.sml U mlton/trunk/lib/mlton-stubs-in-smlnj/pervasive.sml U mlton/trunk/lib/mlton-stubs-in-smlnj/sources.cm U mlton/trunk/lib/mlton-stubs-in-smlnj/substring.sml ---------------------------------------------------------------------- Modified: mlton/trunk/lib/basis-stubs/basis-2002.sml =================================================================== --- mlton/trunk/lib/basis-stubs/basis-2002.sml 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/basis-stubs/basis-2002.sml 2005-12-21 02:03:30 UTC (rev 4292) @@ -31,8 +31,6 @@ structure Math = Math structure OS = OS structure Option = Option - structure Pack32Big = Pack32Big - structure Pack32Little = Pack32Little structure Position = Position structure Posix = Posix structure Real = Real Modified: mlton/trunk/lib/mlton-stubs/sources.cm =================================================================== --- mlton/trunk/lib/mlton-stubs/sources.cm 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/mlton-stubs/sources.cm 2005-12-21 02:03:30 UTC (rev 4292) @@ -39,8 +39,6 @@ structure MLton structure OS structure Option -structure Pack32Big -structure Pack32Little structure Position structure Posix structure Real Modified: mlton/trunk/lib/mlton-stubs-in-smlnj/other.sml =================================================================== --- mlton/trunk/lib/mlton-stubs-in-smlnj/other.sml 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/mlton-stubs-in-smlnj/other.sml 2005-12-21 02:03:30 UTC (rev 4292) @@ -15,8 +15,6 @@ structure ListPair = ListPair structure Math = Math structure Option = Option -structure Pack32Big = Pack32Big -structure Pack32Little = Pack32Little structure SML90 = SML90 structure SMLofNJ = SMLofNJ structure Unix = Unix Modified: mlton/trunk/lib/mlton-stubs-in-smlnj/pervasive.sml =================================================================== --- mlton/trunk/lib/mlton-stubs-in-smlnj/pervasive.sml 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/mlton-stubs-in-smlnj/pervasive.sml 2005-12-21 02:03:30 UTC (rev 4292) @@ -32,8 +32,6 @@ structure Math = Math structure Option = Option structure OS = OS - structure Pack32Big = Pack32Big - structure Pack32Little = Pack32Little structure Position = Position structure Posix = Posix structure Real = Real Modified: mlton/trunk/lib/mlton-stubs-in-smlnj/sources.cm =================================================================== --- mlton/trunk/lib/mlton-stubs-in-smlnj/sources.cm 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/mlton-stubs-in-smlnj/sources.cm 2005-12-21 02:03:30 UTC (rev 4292) @@ -41,8 +41,6 @@ structure MLton structure OS structure Option -structure Pack32Big -structure Pack32Little structure Position structure Posix structure Real Modified: mlton/trunk/lib/mlton-stubs-in-smlnj/substring.sml =================================================================== --- mlton/trunk/lib/mlton-stubs-in-smlnj/substring.sml 2005-12-19 20:52:57 UTC (rev 4291) +++ mlton/trunk/lib/mlton-stubs-in-smlnj/substring.sml 2005-12-21 02:03:30 UTC (rev 4292) @@ -10,8 +10,6 @@ struct open OpenInt32 Substring - val full = all - fun base ss = let val (s, i, j) = Substring.base ss in (s, fromInt i, fromInt j) |
From: Stephen W. <sw...@ml...> - 2005-12-19 12:52:58
|
typo ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-12-14 01:45:44 UTC (rev 4290) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-12-19 20:52:57 UTC (rev 4291) @@ -192,7 +192,7 @@ #define GC_MODEL_SHIFT 0 #define GC_MODEL_USEBASE FALSE #define GC_MODEL_MINALIGN_SHIFT 2 -#elif (defined (GC_MODEL_EX)) +#elif (defined (GC_MODEL_FX)) #define GC_MODEL_BITSIZE 40 #define GC_MODEL_SHIFT 0 #define GC_MODEL_USEBASE TRUE |
From: Matthew F. <fl...@ml...> - 2005-12-13 17:46:43
|
Merge trunk revisions 4250:4289 into x86_64 branch ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/Makefile A mlton/branches/on-20050822-x86_64-branch/basis-library/default.mlb U mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/top-level.sml U mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml U mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/pointer.sig U mlton/branches/on-20050822-x86_64-branch/basis-library/sml-nj/sml-nj.sml U mlton/branches/on-20050822-x86_64-branch/bin/make-pdf-guide U mlton/branches/on-20050822-x86_64-branch/bin/mlton-script A mlton/branches/on-20050822-x86_64-branch/bin/msed U mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile U mlton/branches/on-20050822-x86_64-branch/doc/README U mlton/branches/on-20050822-x86_64-branch/doc/changelog A mlton/branches/on-20050822-x86_64-branch/doc/guide/.ignore U mlton/branches/on-20050822-x86_64-branch/doc/guide/AST U mlton/branches/on-20050822-x86_64-branch/doc/guide/AccessControl U mlton/branches/on-20050822-x86_64-branch/doc/guide/AdmitsEquality U mlton/branches/on-20050822-x86_64-branch/doc/guide/Alice U mlton/branches/on-20050822-x86_64-branch/doc/guide/AllocateRegisters U mlton/branches/on-20050822-x86_64-branch/doc/guide/AndreiFormiga U mlton/branches/on-20050822-x86_64-branch/doc/guide/BasisLibrary U mlton/branches/on-20050822-x86_64-branch/doc/guide/Bug U mlton/branches/on-20050822-x86_64-branch/doc/guide/Bugs20041109 U mlton/branches/on-20050822-x86_64-branch/doc/guide/CKitLibrary U mlton/branches/on-20050822-x86_64-branch/doc/guide/CallGraph U mlton/branches/on-20050822-x86_64-branch/doc/guide/CallingFromCToSML U mlton/branches/on-20050822-x86_64-branch/doc/guide/CallingFromSMLToC U mlton/branches/on-20050822-x86_64-branch/doc/guide/CallingFromSMLToCFunctionPointer U mlton/branches/on-20050822-x86_64-branch/doc/guide/ChrisClearwater U mlton/branches/on-20050822-x86_64-branch/doc/guide/Chunkify U mlton/branches/on-20050822-x86_64-branch/doc/guide/Closure U mlton/branches/on-20050822-x86_64-branch/doc/guide/ClosureConvert U mlton/branches/on-20050822-x86_64-branch/doc/guide/CommonArg U mlton/branches/on-20050822-x86_64-branch/doc/guide/CommonBlock U mlton/branches/on-20050822-x86_64-branch/doc/guide/CommonSubexp U mlton/branches/on-20050822-x86_64-branch/doc/guide/CompilationManager U mlton/branches/on-20050822-x86_64-branch/doc/guide/CompileTimeOptions U mlton/branches/on-20050822-x86_64-branch/doc/guide/CompilerOverview U mlton/branches/on-20050822-x86_64-branch/doc/guide/CompilerPassTemplate U mlton/branches/on-20050822-x86_64-branch/doc/guide/ConcurrentML U mlton/branches/on-20050822-x86_64-branch/doc/guide/ConcurrentMLImplementation U mlton/branches/on-20050822-x86_64-branch/doc/guide/ConstantPropagation U mlton/branches/on-20050822-x86_64-branch/doc/guide/Contact U mlton/branches/on-20050822-x86_64-branch/doc/guide/Contify U mlton/branches/on-20050822-x86_64-branch/doc/guide/CoreML U mlton/branches/on-20050822-x86_64-branch/doc/guide/CoreMLSimplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/CreatingPages U mlton/branches/on-20050822-x86_64-branch/doc/guide/Credits U mlton/branches/on-20050822-x86_64-branch/doc/guide/CrossCompiling U mlton/branches/on-20050822-x86_64-branch/doc/guide/DeadCode U mlton/branches/on-20050822-x86_64-branch/doc/guide/DeepFlatten U mlton/branches/on-20050822-x86_64-branch/doc/guide/DefineTypeBeforeUse U mlton/branches/on-20050822-x86_64-branch/doc/guide/DefinitionOfStandardML U mlton/branches/on-20050822-x86_64-branch/doc/guide/Defunctorize U mlton/branches/on-20050822-x86_64-branch/doc/guide/Developers U mlton/branches/on-20050822-x86_64-branch/doc/guide/Development U mlton/branches/on-20050822-x86_64-branch/doc/guide/Documentation U mlton/branches/on-20050822-x86_64-branch/doc/guide/Drawbacks D mlton/branches/on-20050822-x86_64-branch/doc/guide/EXene U mlton/branches/on-20050822-x86_64-branch/doc/guide/Eclipse U mlton/branches/on-20050822-x86_64-branch/doc/guide/EditingPages U mlton/branches/on-20050822-x86_64-branch/doc/guide/Elaborate U mlton/branches/on-20050822-x86_64-branch/doc/guide/Emacs U mlton/branches/on-20050822-x86_64-branch/doc/guide/Enscript U mlton/branches/on-20050822-x86_64-branch/doc/guide/EqualityType U mlton/branches/on-20050822-x86_64-branch/doc/guide/EqualityTypeVariable U mlton/branches/on-20050822-x86_64-branch/doc/guide/Experimental U mlton/branches/on-20050822-x86_64-branch/doc/guide/FAQ U mlton/branches/on-20050822-x86_64-branch/doc/guide/Features U mlton/branches/on-20050822-x86_64-branch/doc/guide/FirstClassPolymorphism U mlton/branches/on-20050822-x86_64-branch/doc/guide/Flatten U mlton/branches/on-20050822-x86_64-branch/doc/guide/ForLoops U mlton/branches/on-20050822-x86_64-branch/doc/guide/ForeignFunctionInterface U mlton/branches/on-20050822-x86_64-branch/doc/guide/ForeignFunctionInterfaceSyntax U mlton/branches/on-20050822-x86_64-branch/doc/guide/ForeignFunctionInterfaceTypes U mlton/branches/on-20050822-x86_64-branch/doc/guide/FrontEnd U mlton/branches/on-20050822-x86_64-branch/doc/guide/FunctionalRecordUpdate U mlton/branches/on-20050822-x86_64-branch/doc/guide/GarbageCollection U mlton/branches/on-20050822-x86_64-branch/doc/guide/GenerativeDatatype U mlton/branches/on-20050822-x86_64-branch/doc/guide/GenerativeException A mlton/branches/on-20050822-x86_64-branch/doc/guide/Glade U mlton/branches/on-20050822-x86_64-branch/doc/guide/Globalize U mlton/branches/on-20050822-x86_64-branch/doc/guide/GnuMP U mlton/branches/on-20050822-x86_64-branch/doc/guide/HaMLet U mlton/branches/on-20050822-x86_64-branch/doc/guide/HenryCejtin U mlton/branches/on-20050822-x86_64-branch/doc/guide/History U mlton/branches/on-20050822-x86_64-branch/doc/guide/Home U mlton/branches/on-20050822-x86_64-branch/doc/guide/HowProfilingWorks U mlton/branches/on-20050822-x86_64-branch/doc/guide/Identifier U mlton/branches/on-20050822-x86_64-branch/doc/guide/Immutable U mlton/branches/on-20050822-x86_64-branch/doc/guide/ImperativeTypeVariable U mlton/branches/on-20050822-x86_64-branch/doc/guide/ImplementExceptions U mlton/branches/on-20050822-x86_64-branch/doc/guide/ImplementHandlers U mlton/branches/on-20050822-x86_64-branch/doc/guide/ImplementProfiling U mlton/branches/on-20050822-x86_64-branch/doc/guide/ImplementSuffix U mlton/branches/on-20050822-x86_64-branch/doc/guide/Index U mlton/branches/on-20050822-x86_64-branch/doc/guide/InfixingOperators U mlton/branches/on-20050822-x86_64-branch/doc/guide/Inline U mlton/branches/on-20050822-x86_64-branch/doc/guide/InsertLimitChecks U mlton/branches/on-20050822-x86_64-branch/doc/guide/InsertSignalChecks U mlton/branches/on-20050822-x86_64-branch/doc/guide/Installation U mlton/branches/on-20050822-x86_64-branch/doc/guide/IntermediateLanguage U mlton/branches/on-20050822-x86_64-branch/doc/guide/IntroduceLoops U mlton/branches/on-20050822-x86_64-branch/doc/guide/JesperLouisAndersen U mlton/branches/on-20050822-x86_64-branch/doc/guide/JohnnyAndersen U mlton/branches/on-20050822-x86_64-branch/doc/guide/KnownCase U mlton/branches/on-20050822-x86_64-branch/doc/guide/LambdaFree U mlton/branches/on-20050822-x86_64-branch/doc/guide/LanguageChanges U mlton/branches/on-20050822-x86_64-branch/doc/guide/Lazy U mlton/branches/on-20050822-x86_64-branch/doc/guide/Libraries U mlton/branches/on-20050822-x86_64-branch/doc/guide/License U mlton/branches/on-20050822-x86_64-branch/doc/guide/LineDirective U mlton/branches/on-20050822-x86_64-branch/doc/guide/LocalFlatten U mlton/branches/on-20050822-x86_64-branch/doc/guide/LocalRef U mlton/branches/on-20050822-x86_64-branch/doc/guide/LoopInvariant U mlton/branches/on-20050822-x86_64-branch/doc/guide/ML U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasis U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisAnnotationExamples U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisAnnotations U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisAvailableLibraries U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisExamples U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisPathMap U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLBasisSyntaxAndSemantics U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLKit U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLNLFFI U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLNLFFIImplementation U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLj U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonArray U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonBinIO U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonCont U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonExn U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonFinalizable U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonGC U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonIO U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonIntInf U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonItimer U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonPlatform U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonPointer U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonProcEnv U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonProcess U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonProfile U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonRandom U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonRlimit U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonRusage U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonSignal U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonSocket U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonStructure U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonSyslog U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonTextIO U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonThread U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonVector U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonWeak U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonWord U mlton/branches/on-20050822-x86_64-branch/doc/guide/MLtonWorld U mlton/branches/on-20050822-x86_64-branch/doc/guide/Machine U mlton/branches/on-20050822-x86_64-branch/doc/guide/ManualPage U mlton/branches/on-20050822-x86_64-branch/doc/guide/MatchCompilation U mlton/branches/on-20050822-x86_64-branch/doc/guide/MatchCompile U mlton/branches/on-20050822-x86_64-branch/doc/guide/MatthewFluet U mlton/branches/on-20050822-x86_64-branch/doc/guide/MichaelNorrish U mlton/branches/on-20050822-x86_64-branch/doc/guide/MikeThomas U mlton/branches/on-20050822-x86_64-branch/doc/guide/MoinMoin U mlton/branches/on-20050822-x86_64-branch/doc/guide/Monomorphise U mlton/branches/on-20050822-x86_64-branch/doc/guide/MoscowML U mlton/branches/on-20050822-x86_64-branch/doc/guide/Multi U mlton/branches/on-20050822-x86_64-branch/doc/guide/Mutable U mlton/branches/on-20050822-x86_64-branch/doc/guide/OCaml U mlton/branches/on-20050822-x86_64-branch/doc/guide/ObjectOrientedProgramming U mlton/branches/on-20050822-x86_64-branch/doc/guide/OpenGL U mlton/branches/on-20050822-x86_64-branch/doc/guide/OperatorPrecedence U mlton/branches/on-20050822-x86_64-branch/doc/guide/OptionalArguments U mlton/branches/on-20050822-x86_64-branch/doc/guide/OrphanedPages U mlton/branches/on-20050822-x86_64-branch/doc/guide/OtherSites U mlton/branches/on-20050822-x86_64-branch/doc/guide/Overloading U mlton/branches/on-20050822-x86_64-branch/doc/guide/PackedRepresentation U mlton/branches/on-20050822-x86_64-branch/doc/guide/PageSize D mlton/branches/on-20050822-x86_64-branch/doc/guide/Papers U mlton/branches/on-20050822-x86_64-branch/doc/guide/ParallelMove U mlton/branches/on-20050822-x86_64-branch/doc/guide/Performance U mlton/branches/on-20050822-x86_64-branch/doc/guide/PhantomType U mlton/branches/on-20050822-x86_64-branch/doc/guide/PlatformSpecificNotes U mlton/branches/on-20050822-x86_64-branch/doc/guide/PolyEqual U mlton/branches/on-20050822-x86_64-branch/doc/guide/PolyML U mlton/branches/on-20050822-x86_64-branch/doc/guide/PolymorphicEquality U mlton/branches/on-20050822-x86_64-branch/doc/guide/Polyvariance U mlton/branches/on-20050822-x86_64-branch/doc/guide/Poplog U mlton/branches/on-20050822-x86_64-branch/doc/guide/PortingMLton U mlton/branches/on-20050822-x86_64-branch/doc/guide/PrecedenceParse U mlton/branches/on-20050822-x86_64-branch/doc/guide/Printf U mlton/branches/on-20050822-x86_64-branch/doc/guide/PrintfGentle U mlton/branches/on-20050822-x86_64-branch/doc/guide/ProductType U mlton/branches/on-20050822-x86_64-branch/doc/guide/Profiling U mlton/branches/on-20050822-x86_64-branch/doc/guide/ProfilingAllocation U mlton/branches/on-20050822-x86_64-branch/doc/guide/ProfilingCounts U mlton/branches/on-20050822-x86_64-branch/doc/guide/ProfilingTheStack U mlton/branches/on-20050822-x86_64-branch/doc/guide/ProfilingTime U mlton/branches/on-20050822-x86_64-branch/doc/guide/Projects U mlton/branches/on-20050822-x86_64-branch/doc/guide/Pronounce U mlton/branches/on-20050822-x86_64-branch/doc/guide/PropertyList U mlton/branches/on-20050822-x86_64-branch/doc/guide/RSSA U mlton/branches/on-20050822-x86_64-branch/doc/guide/RSSAShrink U mlton/branches/on-20050822-x86_64-branch/doc/guide/RSSASimplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/RayRacine U mlton/branches/on-20050822-x86_64-branch/doc/guide/Redundant U mlton/branches/on-20050822-x86_64-branch/doc/guide/RedundantTests U mlton/branches/on-20050822-x86_64-branch/doc/guide/RefFlatten U mlton/branches/on-20050822-x86_64-branch/doc/guide/References U mlton/branches/on-20050822-x86_64-branch/doc/guide/Regions U mlton/branches/on-20050822-x86_64-branch/doc/guide/ReleaseChecklist U mlton/branches/on-20050822-x86_64-branch/doc/guide/RemoveUnused U mlton/branches/on-20050822-x86_64-branch/doc/guide/Restore U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunTimeOptions U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnCygwin U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnDarwin U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnFreeBSD U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnLinux U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnMinGW U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnNetBSD U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnOpenBSD U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnPowerPC U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnSolaris U mlton/branches/on-20050822-x86_64-branch/doc/guide/RunningOnSparc U mlton/branches/on-20050822-x86_64-branch/doc/guide/SMLNET U mlton/branches/on-20050822-x86_64-branch/doc/guide/SMLNJ U mlton/branches/on-20050822-x86_64-branch/doc/guide/SMLNJDeviations U mlton/branches/on-20050822-x86_64-branch/doc/guide/SMLNJLibrary U mlton/branches/on-20050822-x86_64-branch/doc/guide/SMLofNJStructure U mlton/branches/on-20050822-x86_64-branch/doc/guide/SSA U mlton/branches/on-20050822-x86_64-branch/doc/guide/SSA2 U mlton/branches/on-20050822-x86_64-branch/doc/guide/SSA2Simplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/SSASimplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/SXML U mlton/branches/on-20050822-x86_64-branch/doc/guide/SXMLShrink U mlton/branches/on-20050822-x86_64-branch/doc/guide/SXMLSimplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/ScopeInference U mlton/branches/on-20050822-x86_64-branch/doc/guide/SelfCompiling U mlton/branches/on-20050822-x86_64-branch/doc/guide/Serialization U mlton/branches/on-20050822-x86_64-branch/doc/guide/ShowBasis U mlton/branches/on-20050822-x86_64-branch/doc/guide/Shrink U mlton/branches/on-20050822-x86_64-branch/doc/guide/SimplifyTypes U mlton/branches/on-20050822-x86_64-branch/doc/guide/Sources U mlton/branches/on-20050822-x86_64-branch/doc/guide/SpaceSafety U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardML U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardMLBooks U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardMLHistory U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardMLImplementations U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardMLPortability U mlton/branches/on-20050822-x86_64-branch/doc/guide/StandardMLTutorials U mlton/branches/on-20050822-x86_64-branch/doc/guide/StephenWeeks U mlton/branches/on-20050822-x86_64-branch/doc/guide/StyleGuide U mlton/branches/on-20050822-x86_64-branch/doc/guide/Subversion U mlton/branches/on-20050822-x86_64-branch/doc/guide/SureshJagannathan U mlton/branches/on-20050822-x86_64-branch/doc/guide/Survey U mlton/branches/on-20050822-x86_64-branch/doc/guide/SurveyDone U mlton/branches/on-20050822-x86_64-branch/doc/guide/Swerve U mlton/branches/on-20050822-x86_64-branch/doc/guide/SyntacticConventions U mlton/branches/on-20050822-x86_64-branch/doc/guide/SystemInfo U mlton/branches/on-20050822-x86_64-branch/doc/guide/TILT U mlton/branches/on-20050822-x86_64-branch/doc/guide/Talk U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkDiveIn U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkFolkLore U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkFromSMLTo U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkHowHigherOrder U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkHowModules U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkHowPolymorphism U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkMLtonApproach U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkMLtonFeatures U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkMLtonHistory U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkStandardML U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkTemplate U mlton/branches/on-20050822-x86_64-branch/doc/guide/TalkWholeProgram U mlton/branches/on-20050822-x86_64-branch/doc/guide/ToMachine U mlton/branches/on-20050822-x86_64-branch/doc/guide/ToRSSA U mlton/branches/on-20050822-x86_64-branch/doc/guide/ToSSA2 U mlton/branches/on-20050822-x86_64-branch/doc/guide/TomMurphy U mlton/branches/on-20050822-x86_64-branch/doc/guide/TrustedGroup U mlton/branches/on-20050822-x86_64-branch/doc/guide/TypeChecking U mlton/branches/on-20050822-x86_64-branch/doc/guide/TypeConstructor U mlton/branches/on-20050822-x86_64-branch/doc/guide/TypeVariableScope U mlton/branches/on-20050822-x86_64-branch/doc/guide/Unicode U mlton/branches/on-20050822-x86_64-branch/doc/guide/UniversalType U mlton/branches/on-20050822-x86_64-branch/doc/guide/UnresolvedBugs U mlton/branches/on-20050822-x86_64-branch/doc/guide/UnsafeStructure U mlton/branches/on-20050822-x86_64-branch/doc/guide/Useless D mlton/branches/on-20050822-x86_64-branch/doc/guide/UserGuide U mlton/branches/on-20050822-x86_64-branch/doc/guide/Users U mlton/branches/on-20050822-x86_64-branch/doc/guide/ValueRestriction U mlton/branches/on-20050822-x86_64-branch/doc/guide/Variant U mlton/branches/on-20050822-x86_64-branch/doc/guide/VesaKarvonen U mlton/branches/on-20050822-x86_64-branch/doc/guide/WantedPages U mlton/branches/on-20050822-x86_64-branch/doc/guide/WebSite U mlton/branches/on-20050822-x86_64-branch/doc/guide/WesleyTerpstra U mlton/branches/on-20050822-x86_64-branch/doc/guide/WholeProgramOptimization U mlton/branches/on-20050822-x86_64-branch/doc/guide/WikiMacros U mlton/branches/on-20050822-x86_64-branch/doc/guide/WikiName U mlton/branches/on-20050822-x86_64-branch/doc/guide/WikiTool U mlton/branches/on-20050822-x86_64-branch/doc/guide/XML U mlton/branches/on-20050822-x86_64-branch/doc/guide/XMLShrink U mlton/branches/on-20050822-x86_64-branch/doc/guide/XMLSimplify U mlton/branches/on-20050822-x86_64-branch/doc/guide/XMLSimplifyTypes U mlton/branches/on-20050822-x86_64-branch/doc/guide/ZZZOrphanedPages U mlton/branches/on-20050822-x86_64-branch/doc/guide/Zone A mlton/branches/on-20050822-x86_64-branch/doc/guide/eXene U mlton/branches/on-20050822-x86_64-branch/doc/guide/fxp U mlton/branches/on-20050822-x86_64-branch/doc/guide/index.html U mlton/branches/on-20050822-x86_64-branch/doc/guide/mGTK U mlton/branches/on-20050822-x86_64-branch/lib/ckit-lib/Makefile U mlton/branches/on-20050822-x86_64-branch/lib/smlnj-lib/Makefile U mlton/branches/on-20050822-x86_64-branch/man/mlnlffigen.1 U mlton/branches/on-20050822-x86_64-branch/man/mlprof.1 U mlton/branches/on-20050822-x86_64-branch/man/mlton.1 U mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-env.fun U mlton/branches/on-20050822-x86_64-branch/mlton/front-end/Makefile U mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun U mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun U mlton/branches/on-20050822-x86_64-branch/package/debian/changelog U mlton/branches/on-20050822-x86_64-branch/package/freebsd/Makefile A mlton/branches/on-20050822-x86_64-branch/package/freebsd/files/ U mlton/branches/on-20050822-x86_64-branch/package/rpm/mlton.spec U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/Makefile 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/Makefile 2005-12-14 01:45:44 UTC (rev 4290) @@ -35,24 +35,34 @@ GZIP = gzip --force --best RANLIB = ranlib -VERSION = $(shell date +%Y%m%d) -RELEASE = 1 +# If we're compiling with another version of MLton, then we want to do +# another round of compilation so that we get a MLton built without +# stubs. +ifeq (other, $(shell if [ ! -x $(BIN)/mlton ]; then echo other; fi)) + BOOTSTRAP_OTHER=true +else + BOOTSTRAP_OTHER=false +endif +VERSION ?= $(shell date +%Y%m%d) +RELEASE ?= 1 + .PHONY: all all: $(MAKE) docs all-no-docs .PHONY: all-no-docs all-no-docs: - $(MAKE) dirs runtime compiler world-no-check -# If we're compiling with another version of MLton, then we want to do -# another round of compilation so that we get a MLton built without -# stubs. Remove $(AOUT) so that the $(MAKE) compiler below will -# remake MLton. -ifeq (other, $(shell if [ ! -x $(BIN)/mlton ]; then echo other; fi)) + $(MAKE) dirs runtime compiler world-no-check script mlbpathmap targetmap constants libraries tools +# Remove $(AOUT) so that the $(MAKE) compiler below will remake MLton. +# We also want to re-run the just-built tools (mllex and mlyacc) +# because they may be better than those that were used for the first +# round of compilation. So, we clean out the front end. +ifeq (true, $(BOOTSTRAP_OTHER)) rm -f $(COMP)/$(AOUT)$(EXE) + $(MAKE) -C $(COMP)/front-end clean endif - $(MAKE) script mlbpathmap targetmap constants compiler world libraries tools + $(MAKE) compiler world @echo 'Build of MLton succeeded.' .PHONY: basis-no-check @@ -85,14 +95,6 @@ clean-svn: find . -type d | grep .svn | xargs rm -rf -.PHONY: cm -cm: - $(MAKE) -C $(COMP) mlton-stubs_cm - $(MAKE) -C $(LEX) mllex_cm - $(MAKE) -C $(PROF) mlprof_cm - $(MAKE) -C $(YACC) mlyacc_cm - $(MAKE) -C benchmark benchmark_cm - .PHONY: compiler compiler: $(MAKE) -C $(COMP) @@ -162,9 +164,9 @@ mkdir -p $(BSDSRC) ( cd $(SRC) && tar -cpf - . ) | ( cd $(BSDSRC) && tar -xpf - ) cd /tmp && tar -cpf - mlton-$(VERSION) | \ - $(GZIP) >/usr/ports/distfiles/mlton-$(VERSION)-1.freebsd.src.tgz - # vvvv do not change make to $(MAKE) - cd $(BSDSRC)/freebsd && make build-package + $(GZIP) >/usr/ports/distfiles/mlton-$(VERSION)-$(RELEASE).freebsd.src.tgz + # do not change "make" to "$(MAKE)" in the following line + cd $(BSDSRC)/package/freebsd && MAINTAINER_MODE=yes make build-package LIBRARIES = ckit-lib cml mlnlffi-lib mlyacc-lib smlnj-lib @@ -353,6 +355,9 @@ # puts them. DESTDIR = $(CURDIR)/install PREFIX = /usr +ifeq ($(TARGET_OS), cygwin) +PREFIX = / +endif ifeq ($(TARGET_OS), darwin) PREFIX = /usr/local endif @@ -369,6 +374,9 @@ TLIB = $(DESTDIR)$(prefix)/$(ULIB) TMAN = $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1 TDOC = $(DESTDIR)$(prefix)/share/doc/mlton +ifeq ($(TARGET_OS), cygwin) +TDOC = $(DESTDIR)$(prefix)/usr/share/doc/mlton +endif ifeq ($(TARGET_OS), solaris) TDOC = $(DESTDIR)$(prefix)/doc/mlton endif @@ -452,4 +460,4 @@ $(CP) $(SRC)/debian/$$f.doc-base $(TDOCBASE)/$$f; \ done cd $(TDOC)/ && $(GZIP) changelog changelog.Debian - chown -R root.root $(TDOC) + chown -R root.root $(TDOC) $(TLIB) Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/default.mlb (from rev 4289, mlton/trunk/basis-library/default.mlb) Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/top-level.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/top-level.sml 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/top-level.sml 2005-12-14 01:45:44 UTC (rev 4290) @@ -13,6 +13,7 @@ * * Order here matters! Do not alphabetize or otherwise reorder without thinking. *) +structure Posix = Posix structure OS = OS structure BoolArray = BoolArray structure BoolVector = BoolVector Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-12-14 01:45:44 UTC (rev 4290) @@ -1261,7 +1261,7 @@ (* val + = _prim "Pointer_add": t * t -> t; *) (* val op < = _prim "Pointer_lt": t * t -> bool; *) (* val - = _prim "Pointer_sub": t * t -> t; *) - val free = _import "free": t -> unit; +(* val free = _import "free": t -> unit; *) val getInt8 = _prim "Pointer_getWord8": t * int -> Int8.int; val getInt16 = _prim "Pointer_getWord16": t * int -> Int16.int; val getInt32 = _prim "Pointer_getWord32": t * int -> Int32.int; Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/pointer.sig =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/pointer.sig 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/pointer.sig 2005-12-14 01:45:44 UTC (rev 4290) @@ -12,7 +12,7 @@ val add: t * word -> t val compare: t * t -> order val diff: t * t -> word - val free: t -> unit +(* val free: t -> unit *) val getInt8: t * int -> Int8.int val getInt16: t * int -> Int16.int val getInt32: t * int -> Int32.int Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/sml-nj/sml-nj.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/sml-nj/sml-nj.sml 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/sml-nj/sml-nj.sml 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,20 @@ fun getHostArch () = MLton.Platform.Arch.toString MLton.Platform.Arch.host - fun getOSKind () = UNIX + fun getOSKind () = + let + open MLton.Platform.OS + in + case host of + Cygwin => UNIX + | Darwin => MACOS + | FreeBSD => UNIX + | Linux => UNIX + | MinGW => WIN32 + | NetBSD => UNIX + | OpenBSD => UNIX + | Solaris => UNIX + end fun getOSName () = MLton.Platform.OS.toString MLton.Platform.OS.host end Modified: mlton/branches/on-20050822-x86_64-branch/bin/make-pdf-guide =================================================================== --- mlton/branches/on-20050822-x86_64-branch/bin/make-pdf-guide 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/bin/make-pdf-guide 2005-12-14 01:45:44 UTC (rev 4290) @@ -5,6 +5,7 @@ name=`basename $0` dir=`dirname $0` src=`cd $dir/.. && pwd` +bin="$src/bin" die () { echo >&2 "$1" @@ -52,7 +53,7 @@ s;<td colspan = 3;<td align = right; s;<img src=\"\(http://mlton.org[^>]*\)>;<img src="moin-www.png"><a href=\"\1>image</a>;g EOF - sed -f $script <$f >.tmp + $bin/msed -f $script <$f >.tmp mv .tmp $f done @@ -127,7 +128,7 @@ ) >$book echo 'Running htmldoc.' -htmldoc --batch $book +htmldoc --batch $book || true mv $pdf $src/doc/guide Modified: mlton/branches/on-20050822-x86_64-branch/bin/mlton-script =================================================================== --- mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2005-12-14 01:45:44 UTC (rev 4290) @@ -84,6 +84,7 @@ '-m32 -mtune=opteron' \ -target-cc-opt darwin '-I/sw/include' \ + -target-cc-opt freebsd '-I/usr/local/include' \ -target-cc-opt solaris \ '-Wa,-xarch=v8plusa -mcpu=ultrasparc' \ Copied: mlton/branches/on-20050822-x86_64-branch/bin/msed (from rev 4289, mlton/trunk/bin/msed) Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile 2005-12-14 01:45:44 UTC (rev 4290) @@ -16,6 +16,10 @@ CFLAGS += -mtune=opteron -m32 endif +ifeq ($(TARGET_OS), freebsd) +CFLAGS += -I/usr/local/include +endif + interpret.o: interpret.c interpret.h opcode.h $(CC) $(CFLAGS) -c -O2 interpret.c Modified: mlton/branches/on-20050822-x86_64-branch/doc/README =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/README 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/README 2005-12-14 01:45:44 UTC (rev 4290) @@ -1,27 +1,39 @@ MLton is a whole-program optimizing compiler for the Standard ML -programming language. MLton has the following features. +programming language. MLton has the following features. - + Runs on a variety of platforms. - o HPPA: Debian - o PowerPC: Debian, Mac OSX - o X86: Linux, Cygwin/Windows, FreeBSD, MinGW/Windows, NetBSD, OpenBSD - o Sparc: Debian, Solaris. - + Generates standalone executables with excellent running times. - + Supports the full SML 97 language. - + A complete basis library matching the latest specification. - + Untagged native integers and words. - + Unboxed reals. - + Unboxed arrays - + Fast C FFI for calling from SML to C and from C to SML. - + Source-level profiling of both time and allocation. - + Multiple garbage collection strategies. - + Support for large amounts of memory (up to 4G), large arrays (up - to 2G elements), and large files (using 64-bit integers for file - positions). - + Fast IntInf based on the GNU multiprecision library (gmp). - + Libraries for C pointers, continuations, interval timers, random - numbers, resource limits, resource usage, signal handlers, - system logging, threads, and heap save and restore. + + Portability. + MLton runs on the following platforms. + o HPPA: Debian. + o PowerPC: Debian, Mac OSX. + o X86: Linux, Cygwin/Windows, FreeBSD, MinGW/Windows, NetBSD, OpenBSD. + o Sparc: Debian, Solaris. + + Robustness. + o Supports the full SML 97 language. + o Follows the Definition of SML closely. + o Has a complete implementation of the Basis Library. + o Generates standalone executables. + o Compiles large programs (hundreds of thousands of lines). + o Supports large amounts of memory (up to 4G). + o Supports large arrays (up to 2G elements). + o Supports large files (using 64-bit integers for file positions). + + Performance. + o Executables with excellent running times. + o Untagged and unboxed native integers and words. + o Unboxed reals. + o Unboxed arrays. + o Multiple garbage collection strategies. + o Fast arbitrary-precision arithmetic based on the GnuMP. + + Tools. + o Source-level profiler for both time and allocation. + o Lexer generator. + o Parser generator. + o ML-NLFFIGEN. + + Extensions. + o Fast C FFI for calling from SML to C and from C to SML. + o ML Basis system for programming in the very large. + o Libraries for C pointers, continuations, interval timers, random + numbers, resource limits, resource usage, signal handlers, + system logging, threads, and heap save and restore. For more information, go to the MLton home page. Modified: mlton/branches/on-20050822-x86_64-branch/doc/changelog =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/changelog 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/changelog 2005-12-14 01:45:44 UTC (rev 4290) @@ -1,5 +1,39 @@ -Here are the changes since version 20041109. +Here are the changes from version 20041109 to version 20051202. +Summary: + + New license: BSD-style instead of GPL. + + New platforms: + o hppa: Debian Linux. + o x86: MinGW. + + Compiler. + o improved exception history. + o Command-line switches. + * Added: -as-opt, -mlb-path-map, -target-as-opt, -target-cc-opt. + * Deprecated: none. + * Removed: -native, -sequence-unit, -warn-match, -warn-unused. + + Language. + o FFI syntax changes and extensions. + * Added: _symbol. + * Changed: _export, _import. + * Removed: _ffi. + o ML Basis annotations. + * Added: allowFFI, nonexhaustiveExnMatch, nonexhaustiveMatch, + redundantMatch, sequenceNonUnit. + * Deprecated: allowExport, allowImport, sequenceUnit, warnMatch. + + Libraries. + o Basis Library. + * Added: Int1, Word1. + o MLton structure. + * Added: Process.create, ProcEnv.setgroups, Rusage.measureGC, + Socket.fdToSock Socket.Ctl.getError. + * Changed: MLton.Platform.Arch. + o Other libraries. + * Added: ckit library, ML-NLFFI library, SML/NJ library. + + Tools. + o updates of mllex and mlyacc from SML/NJ. + o added mlnlffigen. + o profiling supports better inclusion/exclusion of code. + * 2005-11-19 - Updated SML/NJ Library and CKit Library from SML/NJ 110.57. Copied: mlton/branches/on-20050822-x86_64-branch/doc/guide/.ignore (from rev 4289, mlton/trunk/doc/guide/.ignore) Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/AST =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/AST 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/AST 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -49,28 +49,28 @@ </table> <div id="content" lang="en" dir="ltr"> -An <a href="IntermediateLanguage">IntermediateLanguage</a>, produced by the <a href="FrontEnd">FrontEnd</a> and translated by <a href="Elaborate">Elaborate</a> to <a href="CoreML">CoreML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> +AST is the <a href="IntermediateLanguage">IntermediateLanguage</a> produced by the <a href="FrontEnd">FrontEnd</a> and translated by <a href="Elaborate">Elaborate</a> to <a href="CoreML">CoreML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> <p> The abstract syntax tree produced by the <a href="FrontEnd">FrontEnd</a>. </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-programs.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-programs.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-programs.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-programs.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-modules.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-modules.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-modules.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-modules.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-core.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-core.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast/ast-core.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast/ast-core.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/ast"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/ast"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast</a> <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2> <p> The AST <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. Type inference is performed on an AST program as part of <a href="Elaborate">Elaborate</a>. @@ -82,5 +82,5 @@ <p> <hr> -Last edited on 2005-08-19 15:43:32 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-11-30 19:55:04 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/AccessControl =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/AccessControl 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/AccessControl 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -50,7 +50,7 @@ </table> <div id="content" lang="en" dir="ltr"> <a href="MoinMoin">MoinMoin</a> supports a lot of <a class="external" href="http://moinmaster.wikiwikiweb.de/HelpOnAccessControlLists"><img src="moin-www.png" alt="[WWW]" height="11" width="11">access control features</a>. <p> -Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we only allow editing of some pages (in particular, <a href="http://mlton.org/Download"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) by <a href="TrustedGroup">TrustedGroup</a> members. +Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we allow editing of some pages (in particular, <a href="http://mlton.org/Download"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) only by <a href="TrustedGroup">TrustedGroup</a> members. </p> <p> All other pages are freely editable by any user with an account. @@ -61,5 +61,5 @@ <p> <hr> -Last edited on 2004-10-29 22:30:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. +Last edited on 2005-11-30 19:54:23 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/AdmitsEquality =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/AdmitsEquality 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/AdmitsEquality 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -113,7 +113,7 @@ </p> <p> -type constructor <tt>t</tt> does not admit equality becuase <tt>real * int</tt> is not equality type. +type constructor <tt>t</tt> does not admit equality because <tt>real * int</tt> is not equality type. </p> <p> We can check that a type constructor admits equality using an <tt>eqtype</tt> specification. @@ -141,7 +141,7 @@ <p> On <tt>structure Bad</tt>, MLton reports the following error. <pre>Type t admits equality in signature but not in structure. - not equality: real * _ * _ + not equality: [real] * _ * _ </pre>The <tt>not equality</tt> section provides an explanation of why the type did not admit equality, highlighting the problematic component (<tt>real</tt>). </p> <h2 id="head-c494234542affd2943bc7247d524477b03bc18bc">Datatype declarations</h2> @@ -214,7 +214,7 @@ </p> <pre>Type t admits equality in signature but not in structure. - not equality: B of real * _ + not equality: B of [real] * _ </pre><p> MLton indicates the problematic constructor (<tt>B</tt>), as well as the problematic component of the constructor's argument. </p> @@ -270,20 +270,20 @@ </p> <p> -Unfortunately, due to a bug in error reporting, MLton 20041109 prints an obscure internal bug message (<tt>Type.deArrow</tt>) and exits. The problem has been fixed, and MLton now reports +MLton reports the following error. </p> <pre>Error: z.sml 1.16. Type t admits equality in signature but not in structure. - not equality: B of u * real + not equality: B of [u] * [real] Error: z.sml 1.16. Type u admits equality in signature but not in structure. - not equality: D of t + not equality: D of [t] </pre></div> <p> <hr> -Last edited on 2005-01-26 20:48:53 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-12-02 06:44:43 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/Alice =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/Alice 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/Alice 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/AllocateRegisters =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/AllocateRegisters 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/AllocateRegisters 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -49,15 +49,15 @@ </table> <div id="content" lang="en" dir="ltr"> -An analysis pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToMachine">ToMachine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> +AllocateRegisters is an analysis pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToMachine">ToMachine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> <p> Computes an allocation of <a href="RSSA">RSSA</a> variables as <a href="Machine">Machine</a> register or stack operands. </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/backend/allocate-registers.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">allocate-registers.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/backend/allocate-registers.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">allocate-registers.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/mlton/backend/allocate-registers.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">allocate-registers.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/mlton/backend/allocate-registers.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">allocate-registers.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> @@ -65,5 +65,5 @@ <p> <hr> -Last edited on 2005-11-14 23:11:30 by <span title="fox.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-11-30 19:54:55 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/AndreiFormiga =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/AndreiFormiga 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/AndreiFormiga 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/BasisLibrary =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/BasisLibrary 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/BasisLibrary 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -99,7 +99,18 @@ </p> <h2 id="head-f3c583ffa7ae975564fe862325a230f0750a322b">Top-level exception constructors</h2> <p> -<tt>Bind</tt>, <tt>Chr</tt>, <tt>Div</tt>, <tt>Domain</tt>, <tt>Empty</tt>, <tt>Fail</tt>, <tt>Match</tt>, <tt>Option</tt>, <tt>Overflow</tt>, <tt>Size</tt>, <tt>Span</tt>, <tt>Subscript</tt>. +<tt>Bind</tt> <br> +<tt>Chr</tt> <br> +<tt>Div</tt> <br> +<tt>Domain</tt> <br> +<tt>Empty</tt> <br> +<tt>Fail of string</tt> <br> +<tt>Match</tt> <br> +<tt>Option</tt> <br> +<tt>Overflow</tt> <br> +<tt>Size</tt> <br> +<tt>Span</tt> <br> +<tt>Subscript</tt> </p> <h2 id="head-ee76afd3593ec7eebc14e2997b54ea6c04a954e4">Top-level values</h2> <p> @@ -202,7 +213,6 @@ <p> -<br> <tt>structure CharArray: MONO_ARRAY</tt> <br> <tt>structure CharArray2: MONO_ARRAY2</tt> <br> <tt>structure CharArraySlice: MONO_ARRAY_SLICE</tt> <br> @@ -226,6 +236,7 @@ <tt>structure INetSock: INET_SOCK</tt> <br> <tt>structure IO: IO</tt> <br> <tt>structure Int: INTEGER</tt> <br> +<tt>structure Int1: INTEGER</tt> <br> <tt>structure Int2: INTEGER</tt> <br> <tt>structure Int3: INTEGER</tt> <br> <tt>structure Int4: INTEGER</tt> <br> @@ -337,7 +348,6 @@ <p> -<br> <tt>structure String: STRING</tt> </p> @@ -348,7 +358,6 @@ <p> -<br> <tt>structure StringCvt: STRING_CVT</tt> <br> <tt>structure Substring: SUBSTRING</tt> <br> <tt>structure SysWord: WORD</tt> <br> @@ -362,6 +371,7 @@ <tt>structure Vector: VECTOR</tt> <br> <tt>structure VectorSlice: VECTOR_SLICE</tt> <br> <tt>structure Word: WORD</tt> <br> +<tt>structure Word1: WORD</tt> <br> <tt>structure Word2: WORD</tt> <br> <tt>structure Word3: WORD</tt> <br> <tt>structure Word4: WORD</tt> <br> @@ -425,5 +435,5 @@ <p> <hr> -Last edited on 2005-09-06 23:28:14 by <span title="cfs34.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-11-30 23:04:45 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/Bug =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/Bug 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/Bug 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -49,7 +49,7 @@ </table> <div id="content" lang="en" dir="ltr"> -To report a bug, please send mail to <a class="external" href="mailto:ML...@ml..."><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">mailto:ML...@ml...</a>. Please include the complete SML program that caused the problem and a log of a compile of the program with <tt>-verbose 2</tt>. For large messages (over 512K), please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TemporaryUpload</a> page for uploading large files. <p> +To report a bug, please send mail to <a class="external" href="mailto:ML...@ml..."><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">ML...@ml...</a>. Please include the complete SML program that caused the problem and a log of a compile of the program with <tt>-verbose 2</tt>. For large messages (over 256K), please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TemporaryUpload</a> page for uploading large files. <p> There are some <a href="UnresolvedBugs">UnresolvedBugs</a> that we don't plan to fix. </p> <p> @@ -71,5 +71,5 @@ <p> <hr> -Last edited on 2005-09-06 23:18:45 by <span title="cfs34.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-11-30 23:04:27 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/Bugs20041109 =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/Bugs20041109 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/Bugs20041109 2005-12-14 01:45:44 UTC (rev 4290) @@ -25,7 +25,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -50,6 +50,24 @@ </table> <div id="content" lang="en" dir="ltr"> Here are the known bugs in MLton 20041109, listed in reverse chronological order of date reported. <p> +<a id="17"></a> +</p> + + <ul> + + <li> +<p> + <tt>MLton.Finalizable.touch</tt> doesn't necessarily keep values alive long enough. Our SVN has a patch to the compiler. You must rebuild the compiler in order for the patch to take effect. +</p> +<p> + Thanks to Florian Weimer for reporting this bug. +</p> +</li> + + </ul> + + +<p> <a id="16"></a> </p> @@ -60,7 +78,7 @@ A bug in an optimization pass may incorrectly transform a program to flatten ref cells into their containing data structure, yielding a type-error in the transformed program. Our CVS has a <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/ssa/ref-flatten.fun.diff?r1=1.35&r2=1.37"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a> to the compiler. You must rebuild the compiler in order for the patch to take effect. </p> <p> - Thanks to Vesa Karvonen for reporting this bug. + Thanks to <a href="VesaKarvonen">VesaKarvonen</a> for reporting this bug. </p> </li> @@ -348,5 +366,5 @@ <p> <hr> -Last edited on 2005-07-28 16:28:29 by <span title="adsl-64-166-225-145.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. +Last edited on 2005-12-01 05:16:27 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/CKitLibrary =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/CKitLibrary 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branch/doc/guide/CKitLibrary 2005-12-14 01:45:44 UTC (rev 4290) @@ -27,7 +27,7 @@ color: darkblue; font-size: 150%; text-align: left;"> - <a class = mltona href="Home">MLton 20051115</a> + <a class = mltona href="Home">MLton 20051202</a> <td style = " border: 0px; font-size: 150%; @@ -51,8 +51,8 @@ </table> <div id="content" lang="en" dir="ltr"> -The <a class="external" href="http://www.smlnj.org/doc/ckit"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit Library</a> is a C front end written in SML that translates C source code (after preprocessing) into abstract syntax represented as a set of SML datatypes and is distributed with SML/NJ. Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton. <p> -MLton ???????? includes a port of the ckit Library (from SML/NJ version 110.55). +The <a class="external" href="http://www.smlnj.org/doc/ckit"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit Library</a> is a C front end written in SML that translates C source code (after preprocessing) into abstract syntax represented as a set of SML datatypes. The ckit Library is distributed with SML/NJ. Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton. <p> +As of 20050818, MLton includes a port of the ckit Library synchronized with SML/NJ version 110.57. </p> <h2 id="head-0bb18642b70b9f8a9c12ccf39487328f306b8e19">Usage</h2> @@ -60,34 +60,14 @@ <li> <p> - You can import the ckit Library by referencing the appropriate <tt>.mlb</tt> file: + You can import the ckit Library into an MLB file with <tt>$(SML_LIB)/ckit-lib/ckit-lib.mlb</tt> </p> </li> - - <ul> - - -<div> -<table> - <tr> -<td align="center"> -MLB file</td> -</tr> - <tr> -<td> -<tt>$(SML_LIB)/ckit-lib/src/ckit-lib.mlb</tt></td> -</tr> -</table> -</div> - - </ul> - - - <li> + <li class="gap"> <p> - If you are porting a project from SML/NJ's <a href="CompilationManager">CompilationManager</a> to MLton's <a href="MLBasis"> ML Basis system</a> using <tt>cm2mlb</tt>, you will find it helpful to add the following to your <tt>.mlton/cm2mlb-map</tt>: -<pre>ckit-lib $(SML_LIB)/ckit-lib/src -</pre> This will automatically convert a <tt>$/ckit-lib.cm</tt> import in an input <tt>.cm</tt> file into a <tt>$(SML_LIB)/ckit-lib/src/ckit-lib.mlb</tt> import in the output <tt>.mlb</tt> file. + If you are porting a project from SML/NJ's <a href="CompilationManager">CompilationManager</a> to MLton's <a href="MLBasis"> ML Basis system</a> using <tt>cm2mlb</tt>, note that the following map is included by default: +<pre>$ckit-lib.cm/ckit-lib.cm $(SML_LIB)/ckit-lib/ckit-lib.mlb +</pre> This will automatically convert a <tt>$/ckit-lib.cm</tt> import in an input <tt>.cm</tt> file into a <tt>$(SML_LIB)/ckit-lib/ckit-lib.mlb</tt> import in the output <tt>.mlb</tt> file. </p> </li> @@ -167,7 +147,7 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051115-release/lib/ckit-lib/ckit.patch?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit.patch</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/tags/on-20051202-release/lib/ckit-lib/ckit.patch?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit.patch</a> </p> </li> @@ -179,5 +159,5 @@ <p> <hr> -Last edited on 2005-08-19 15:56:56 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +Last edited on 2005-11-30 23:24:50 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/branches/on-20050822-x86_64-branch/doc/guide/CallGraph =================================================================== --- mlton/branches/on-20050822-x86_64-branch/doc/guide/CallGraph 2005-12-08 20:07:14 UTC (rev 4289) +++ mlton/branches/on-20050822-x86_64-branc... [truncated message content] |
From: Stephen W. <sw...@ml...> - 2005-12-08 12:07:16
|
Patch from Geoff Mainlaind for FreeBSD packaging. ---------------------------------------------------------------------- U mlton/trunk/package/freebsd/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/package/freebsd/Makefile =================================================================== --- mlton/trunk/package/freebsd/Makefile 2005-12-08 16:31:53 UTC (rev 4288) +++ mlton/trunk/package/freebsd/Makefile 2005-12-08 20:07:14 UTC (rev 4289) @@ -18,7 +18,7 @@ DISTFILES= ${BOOT_DIST} ${SRC_DIST} EXTRACT_ONLY= ${SRC_DIST} -MAINTAINER= ML...@ml... +MAINTAINER= sw...@sw... and mai...@ap... COMMENT= An optimizing Standard ML compiler BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash @@ -54,21 +54,21 @@ INSTALL_TARGET= install-no-docs .endif -PORTDIR= usr/ports/lang/mlton +MANUAL_PACKAGE_BUILD= "Requires at least 512MB of dedicated heap to build." .include <bsd.port.pre.mk> .if ${OSVERSION} >= 600000 -LIB_DEPENDS+= c.5:${PORTSDIR}/misc/compat5x +BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libc.so.5:${PORTSDIR}/misc/compat5x .endif -.if ${OSVERSION} >= 503000 -LIB_DEPENDS+= m.2:${PORTSDIR}/misc/compat4x +.if ${OSVERSION} < 504000 ++BROKEN= "Cannot bootstrap on FreeBSD < 5.4" .endif BOOT_EXTRACT= --bzip2 BOOT_SUF= tbz -BOOT_VER= 20041109 +BOOT_VER= 20051202 post-extract: @${MKDIR} ${BOOT_WRKSRC} |
From: Stephen W. <sw...@ml...> - 2005-12-08 08:31:55
|
Changed paths for Cygwin package. ---------------------------------------------------------------------- U mlton/trunk/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/Makefile =================================================================== --- mlton/trunk/Makefile 2005-12-06 02:10:53 UTC (rev 4287) +++ mlton/trunk/Makefile 2005-12-08 16:31:53 UTC (rev 4288) @@ -351,6 +351,9 @@ # puts them. DESTDIR = $(CURDIR)/install PREFIX = /usr +ifeq ($(TARGET_OS), cygwin) +PREFIX = / +endif ifeq ($(TARGET_OS), darwin) PREFIX = /usr/local endif @@ -367,6 +370,9 @@ TLIB = $(DESTDIR)$(prefix)/$(ULIB) TMAN = $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1 TDOC = $(DESTDIR)$(prefix)/share/doc/mlton +ifeq ($(TARGET_OS), cygwin) +TDOC = $(DESTDIR)$(prefix)/usr/share/doc/mlton +endif ifeq ($(TARGET_OS), solaris) TDOC = $(DESTDIR)$(prefix)/doc/mlton endif |
From: Stephen W. <sw...@ml...> - 2005-12-05 18:10:54
|
Moved RELASE variable down in FreeBSD Makefile to quell warnings about *_DEPENDS not being defined sooner. ---------------------------------------------------------------------- U mlton/trunk/package/freebsd/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/package/freebsd/Makefile =================================================================== --- mlton/trunk/package/freebsd/Makefile 2005-12-05 23:24:44 UTC (rev 4286) +++ mlton/trunk/package/freebsd/Makefile 2005-12-06 02:10:53 UTC (rev 4287) @@ -21,8 +21,6 @@ MAINTAINER= ML...@ml... COMMENT= An optimizing Standard ML compiler -RELEASE ?= 1 - BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash .if !defined(NOPORTDOCS) BUILD_DEPENDS+= gsed:${PORTSDIR}/textproc/gsed \ @@ -50,6 +48,8 @@ PATH=${WRKSRC}/build/bin:${BOOT_WRKSRC}/bin:${PATH} \ PREFIX=${PREFIX} +RELEASE ?= 1 + .if defined(NOPORTDOCS) INSTALL_TARGET= install-no-docs .endif |
From: Stephen W. <sw...@ml...> - 2005-12-05 15:24:46
|
Added missing .ignore file. Remember, the .ignore file is primary and the sync-ignore script propagates its contents to svn:ignore property. ---------------------------------------------------------------------- A mlton/trunk/doc/guide/.ignore ---------------------------------------------------------------------- Added: mlton/trunk/doc/guide/.ignore =================================================================== --- mlton/trunk/doc/guide/.ignore 2005-12-02 22:33:05 UTC (rev 4285) +++ mlton/trunk/doc/guide/.ignore 2005-12-05 23:24:44 UTC (rev 4286) @@ -0,0 +1 @@ +mlton-guide.pdf |
From: Stephen W. <sw...@ml...> - 2005-12-02 14:33:08
|
Punctuation. ---------------------------------------------------------------------- U mlton/trunk/doc/changelog ---------------------------------------------------------------------- Modified: mlton/trunk/doc/changelog =================================================================== --- mlton/trunk/doc/changelog 2005-12-02 20:58:27 UTC (rev 4284) +++ mlton/trunk/doc/changelog 2005-12-02 22:33:05 UTC (rev 4285) @@ -20,7 +20,7 @@ * Added: allowFFI, nonexhaustiveExnMatch, nonexhaustiveMatch, redundantMatch, sequenceNonUnit. * Deprecated: allowExport, allowImport, sequenceUnit, warnMatch. - + Libraries + + Libraries. o Basis Library. * Added: Int1, Word1. o MLton structure. |
From: Stephen W. <sw...@ml...> - 2005-12-02 12:58:28
|
Structured feature list like the Features wiki page. ---------------------------------------------------------------------- U mlton/trunk/doc/README ---------------------------------------------------------------------- Modified: mlton/trunk/doc/README =================================================================== --- mlton/trunk/doc/README 2005-12-02 18:20:57 UTC (rev 4283) +++ mlton/trunk/doc/README 2005-12-02 20:58:27 UTC (rev 4284) @@ -1,27 +1,39 @@ MLton is a whole-program optimizing compiler for the Standard ML -programming language. MLton has the following features. +programming language. MLton has the following features. - + Runs on a variety of platforms. - o HPPA: Debian - o PowerPC: Debian, Mac OSX - o X86: Linux, Cygwin/Windows, FreeBSD, MinGW/Windows, NetBSD, OpenBSD - o Sparc: Debian, Solaris. - + Generates standalone executables with excellent running times. - + Supports the full SML 97 language. - + A complete basis library matching the latest specification. - + Untagged native integers and words. - + Unboxed reals. - + Unboxed arrays - + Fast C FFI for calling from SML to C and from C to SML. - + Source-level profiling of both time and allocation. - + Multiple garbage collection strategies. - + Support for large amounts of memory (up to 4G), large arrays (up - to 2G elements), and large files (using 64-bit integers for file - positions). - + Fast IntInf based on the GNU multiprecision library (gmp). - + Libraries for C pointers, continuations, interval timers, random - numbers, resource limits, resource usage, signal handlers, - system logging, threads, and heap save and restore. + + Portability. + MLton runs on the following platforms. + o HPPA: Debian. + o PowerPC: Debian, Mac OSX. + o X86: Linux, Cygwin/Windows, FreeBSD, MinGW/Windows, NetBSD, OpenBSD. + o Sparc: Debian, Solaris. + + Robustness. + o Supports the full SML 97 language. + o Follows the Definition of SML closely. + o Has a complete implementation of the Basis Library. + o Generates standalone executables. + o Compiles large programs (hundreds of thousands of lines). + o Supports large amounts of memory (up to 4G). + o Supports large arrays (up to 2G elements). + o Supports large files (using 64-bit integers for file positions). + + Performance. + o Executables with excellent running times. + o Untagged and unboxed native integers and words. + o Unboxed reals. + o Unboxed arrays. + o Multiple garbage collection strategies. + o Fast arbitrary-precision arithmetic based on the GnuMP. + + Tools. + o Source-level profiler for both time and allocation. + o Lexer generator. + o Parser generator. + o ML-NLFFIGEN. + + Extensions. + o Fast C FFI for calling from SML to C and from C to SML. + o ML Basis system for programming in the very large. + o Libraries for C pointers, continuations, interval timers, random + numbers, resource limits, resource usage, signal handlers, + system logging, threads, and heap save and restore. For more information, go to the MLton home page. |