[MLton-commit] r5651

Matthew Fluet fluet at mlton.org
Tue Jun 19 09:14:54 PDT 2007


Added /basis/c-types.mlb that binds a collection of C_* structures, giving ML representations to C types; the bindings are target platform dependent
----------------------------------------------------------------------

A   mlton/branches/on-20050822-x86_64-branch/basis-library/c-types.mlb
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/bind/pointer-mlton.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-char.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-int.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-real.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-string.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-word.sml
D   mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/libs/all.mlb
U   mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb

----------------------------------------------------------------------

Added: mlton/branches/on-20050822-x86_64-branch/basis-library/c-types.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/c-types.mlb	2007-06-19 15:27:20 UTC (rev 5650)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/c-types.mlb	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,53 @@
+(* Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+ann  
+   "deadCode true"
+   "sequenceNonUnit warn"
+   "nonexhaustiveMatch warn" "redundantMatch warn"
+   "warnUnused true" "forceUsed"
+in
+   local
+      basis.mlb
+      local
+         config/choose-int.sml
+         config/choose-real.sml
+         config/choose-word.sml
+         config/c/word-to-bool.sml
+         config/bind/int-top.sml 
+         config/bind/real-top.sml 
+         config/bind/word-top.sml 
+      in ann "forceUsed" in
+         config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml
+      end end
+   in
+      structure C_Char
+      structure C_SChar
+      structure C_UChar
+      structure C_Short
+      structure C_SShort
+      structure C_UShort
+      structure C_Int
+      structure C_SInt
+      structure C_UInt
+      structure C_Long
+      structure C_SLong
+      structure C_ULong
+      structure C_LongLong
+      structure C_SLongLong
+      structure C_ULongLong
+      structure C_Float
+      structure C_Double
+      structure C_Size
+      structure C_Ptrdiff
+      structure C_Intmax
+      structure C_UIntmax
+      structure C_Intptr
+      structure C_UIntptr
+      structure C_SSize
+   end
+end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/bind/pointer-mlton.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/bind/pointer-prim.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/bind/pointer-prim.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/bind/pointer-mlton.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,8 @@
+(* Copyright (C) 1999-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 Pointer = MLton.Pointer

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-char.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-char.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,24 @@
+(* Copyright (C) 1999-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.
+ *)
+
+signature CHOOSE_CHARN_ARG =
+   sig
+      type 'a t
+      val fChar8: Char8.char t
+      val fChar16: Char16.char t
+      val fChar32: Char32.char t
+   end
+
+functor ChooseCharN_Char8 (A : CHOOSE_CHARN_ARG) : 
+   sig val f : Char8.char A.t end = 
+   struct val f = A.fChar8 end
+functor ChooseCharN_Char16 (A : CHOOSE_CHARN_ARG) : 
+   sig val f : Char16.char A.t end = 
+   struct val f = A.fChar16 end
+functor ChooseCharN_Char32 (A : CHOOSE_CHARN_ARG) : 
+   sig val f : Char32.char A.t end = 
+   struct val f = A.fChar32 end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-int.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-int.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,54 @@
+(* Copyright (C) 1999-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.
+ *)
+
+signature CHOOSE_INTN_ARG =
+   sig
+      type 'a t
+      val fInt8: Int8.int t
+      val fInt16: Int16.int t
+      val fInt32: Int32.int t
+      val fInt64: Int64.int t
+   end
+
+functor ChooseIntN_Int8 (A : CHOOSE_INTN_ARG) : 
+   sig val f : Int8.int A.t end = 
+   struct val f = A.fInt8 end
+functor ChooseIntN_Int16 (A : CHOOSE_INTN_ARG) : 
+   sig val f : Int16.int A.t end = 
+   struct val f = A.fInt16 end
+functor ChooseIntN_Int32 (A : CHOOSE_INTN_ARG) : 
+   sig val f : Int32.int A.t end = 
+   struct val f = A.fInt32 end
+functor ChooseIntN_Int64 (A : CHOOSE_INTN_ARG) : 
+   sig val f : Int64.int A.t end = 
+   struct val f = A.fInt64 end
+
+signature CHOOSE_INT_ARG =
+   sig
+      type 'a t
+      val fInt8: Int8.int t
+      val fInt16: Int16.int t
+      val fInt32: Int32.int t
+      val fInt64: Int64.int t
+      val fIntInf: IntInf.int t
+   end
+
+functor ChooseInt_Int8 (A : CHOOSE_INT_ARG) : 
+   sig val f : Int8.int A.t end = 
+   struct val f = A.fInt8 end
+functor ChooseInt_Int16 (A : CHOOSE_INT_ARG) : 
+   sig val f : Int16.int A.t end = 
+   struct val f = A.fInt16 end
+functor ChooseInt_Int32 (A : CHOOSE_INT_ARG) : 
+   sig val f : Int32.int A.t end = 
+   struct val f = A.fInt32 end
+functor ChooseInt_Int64 (A : CHOOSE_INT_ARG) : 
+   sig val f : Int64.int A.t end = 
+   struct val f = A.fInt64 end
+functor ChooseInt_IntInf (A : CHOOSE_INT_ARG) : 
+   sig val f : IntInf.int A.t end = 
+   struct val f = A.fIntInf end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-real.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-real.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,20 @@
+(* Copyright (C) 1999-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.
+ *)
+
+signature CHOOSE_REALN_ARG =
+   sig
+      type 'a t
+      val fReal32: Real32.real t
+      val fReal64: Real64.real t
+   end
+
+functor ChooseRealN_Real32 (A : CHOOSE_REALN_ARG) : 
+   sig val f : Real32.real A.t end = 
+   struct val f = A.fReal32 end
+functor ChooseRealN_Real64 (A : CHOOSE_REALN_ARG) : 
+   sig val f : Real64.real A.t end = 
+   struct val f = A.fReal64 end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-string.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-string.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,24 @@
+(* Copyright (C) 1999-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.
+ *)
+
+signature CHOOSE_STRINGN_ARG =
+   sig
+      type 'a t
+      val fString8: String8.string t
+      val fString16: String16.string t
+      val fString32: String32.string t
+   end
+
+functor ChooseStringN_String8 (A : CHOOSE_STRINGN_ARG) : 
+   sig val f : String8.string A.t end = 
+   struct val f = A.fString8 end
+functor ChooseStringN_String16 (A : CHOOSE_STRINGN_ARG) : 
+   sig val f : String16.string A.t end = 
+   struct val f = A.fString16 end
+functor ChooseStringN_String32 (A : CHOOSE_STRINGN_ARG) : 
+   sig val f : String32.string A.t end = 
+   struct val f = A.fString32 end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-word.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose-word.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -0,0 +1,28 @@
+(* Copyright (C) 1999-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.
+ *)
+
+signature CHOOSE_WORDN_ARG =
+   sig
+      type 'a t
+      val fWord8: Word8.word t
+      val fWord16: Word16.word t
+      val fWord32: Word32.word t
+      val fWord64: Word64.word t
+   end
+
+functor ChooseWordN_Word8 (A : CHOOSE_WORDN_ARG) : 
+   sig val f : Word8.word A.t end = 
+   struct val f = A.fWord8 end
+functor ChooseWordN_Word16 (A : CHOOSE_WORDN_ARG) : 
+   sig val f : Word16.word A.t end = 
+   struct val f = A.fWord16 end
+functor ChooseWordN_Word32 (A : CHOOSE_WORDN_ARG) : 
+   sig val f : Word32.word A.t end = 
+   struct val f = A.fWord32 end
+functor ChooseWordN_Word64 (A : CHOOSE_WORDN_ARG) : 
+   sig val f : Word64.word A.t end = 
+   struct val f = A.fWord64 end

Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 15:27:20 UTC (rev 5650)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/choose.sml	2007-06-19 16:14:53 UTC (rev 5651)
@@ -1,126 +0,0 @@
-(* Copyright (C) 1999-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.
- *)
-
-signature CHOOSE_CHARN_ARG =
-   sig
-      type 'a t
-      val fChar8: Char8.char t
-      val fChar16: Char16.char t
-      val fChar32: Char32.char t
-   end
-
-functor ChooseCharN_Char8 (A : CHOOSE_CHARN_ARG) : 
-   sig val f : Char8.char A.t end = 
-   struct val f = A.fChar8 end
-functor ChooseCharN_Char16 (A : CHOOSE_CHARN_ARG) : 
-   sig val f : Char16.char A.t end = 
-   struct val f = A.fChar16 end
-functor ChooseCharN_Char32 (A : CHOOSE_CHARN_ARG) : 
-   sig val f : Char32.char A.t end = 
-   struct val f = A.fChar32 end
-
-signature CHOOSE_INTN_ARG =
-   sig
-      type 'a t
-      val fInt8: Int8.int t
-      val fInt16: Int16.int t
-      val fInt32: Int32.int t
-      val fInt64: Int64.int t
-   end
-
-functor ChooseIntN_Int8 (A : CHOOSE_INTN_ARG) : 
-   sig val f : Int8.int A.t end = 
-   struct val f = A.fInt8 end
-functor ChooseIntN_Int16 (A : CHOOSE_INTN_ARG) : 
-   sig val f : Int16.int A.t end = 
-   struct val f = A.fInt16 end
-functor ChooseIntN_Int32 (A : CHOOSE_INTN_ARG) : 
-   sig val f : Int32.int A.t end = 
-   struct val f = A.fInt32 end
-functor ChooseIntN_Int64 (A : CHOOSE_INTN_ARG) : 
-   sig val f : Int64.int A.t end = 
-   struct val f = A.fInt64 end
-
-signature CHOOSE_INT_ARG =
-   sig
-      type 'a t
-      val fInt8: Int8.int t
-      val fInt16: Int16.int t
-      val fInt32: Int32.int t
-      val fInt64: Int64.int t
-      val fIntInf: IntInf.int t
-   end
-
-functor ChooseInt_Int8 (A : CHOOSE_INT_ARG) : 
-   sig val f : Int8.int A.t end = 
-   struct val f = A.fInt8 end
-functor ChooseInt_Int16 (A : CHOOSE_INT_ARG) : 
-   sig val f : Int16.int A.t end = 
-   struct val f = A.fInt16 end
-functor ChooseInt_Int32 (A : CHOOSE_INT_ARG) : 
-   sig val f : Int32.int A.t end = 
-   struct val f = A.fInt32 end
-functor ChooseInt_Int64 (A : CHOOSE_INT_ARG) : 
-   sig val f : Int64.int A.t end = 
-   struct val f = A.fInt64 end
-functor ChooseInt_IntInf (A : CHOOSE_INT_ARG) : 
-   sig val f : IntInf.int A.t end = 
-   struct val f = A.fIntInf end
-
-signature CHOOSE_REALN_ARG =
-   sig
-      type 'a t
-      val fReal32: Real32.real t
-      val fReal64: Real64.real t
-   end
-
-functor ChooseRealN_Real32 (A : CHOOSE_REALN_ARG) : 
-   sig val f : Real32.real A.t end = 
-   struct val f = A.fReal32 end
-functor ChooseRealN_Real64 (A : CHOOSE_REALN_ARG) : 
-   sig val f : Real64.real A.t end = 
-   struct val f = A.fReal64 end
-
-signature CHOOSE_STRINGN_ARG =
-   sig
-      type 'a t
-      val fString8: String8.string t
-      val fString16: String16.string t
-      val fString32: String32.string t
-   end
-
-functor ChooseStringN_String8 (A : CHOOSE_STRINGN_ARG) : 
-   sig val f : String8.string A.t end = 
-   struct val f = A.fString8 end
-functor ChooseStringN_String16 (A : CHOOSE_STRINGN_ARG) : 
-   sig val f : String16.string A.t end = 
-   struct val f = A.fString16 end
-functor ChooseStringN_String32 (A : CHOOSE_STRINGN_ARG) : 
-   sig val f : String32.string A.t end = 
-   struct val f = A.fString32 end
-
-signature CHOOSE_WORDN_ARG =
-   sig
-      type 'a t
-      val fWord8: Word8.word t
-      val fWord16: Word16.word t
-      val fWord32: Word32.word t
-      val fWord64: Word64.word t
-   end
-
-functor ChooseWordN_Word8 (A : CHOOSE_WORDN_ARG) : 
-   sig val f : Word8.word A.t end = 
-   struct val f = A.fWord8 end
-functor ChooseWordN_Word16 (A : CHOOSE_WORDN_ARG) : 
-   sig val f : Word16.word A.t end = 
-   struct val f = A.fWord16 end
-functor ChooseWordN_Word32 (A : CHOOSE_WORDN_ARG) : 
-   sig val f : Word32.word A.t end = 
-   struct val f = A.fWord32 end
-functor ChooseWordN_Word64 (A : CHOOSE_WORDN_ARG) : 
-   sig val f : Word64.word A.t end = 
-   struct val f = A.fWord64 end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/libs/all.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/libs/all.mlb	2007-06-19 15:27:20 UTC (rev 5650)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/libs/all.mlb	2007-06-19 16:14:53 UTC (rev 5651)
@@ -14,5 +14,6 @@
    ../mlton.mlb
    ../sml-nj.mlb
    ../unsafe.mlb
+   ../c-types.mlb
 in
 end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb	2007-06-19 15:27:20 UTC (rev 5650)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb	2007-06-19 16:14:53 UTC (rev 5651)
@@ -30,7 +30,11 @@
       ../config/bind/string-prim.sml 
       ../config/bind/word-prim.sml 
    in ann "forceUsed" in
-      ../config/choose.sml
+      ../config/choose-char.sml
+      ../config/choose-int.sml
+      ../config/choose-real.sml
+      ../config/choose-string.sml
+      ../config/choose-word.sml
       ../config/c/word-to-bool.sml
    end end
 




More information about the MLton-commit mailing list