SCM Repository
Annotation of /trunk/src/compiler/fields/raw-types.sml
Parent Directory
|
Revision Log
Revision 239 - (view) (download)
1 : | jhr | 141 | (* raw-types.sml |
2 : | * | ||
3 : | * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu) | ||
4 : | * All rights reserved. | ||
5 : | * | ||
6 : | * This file defines the representation of the raw scalar types used to | ||
7 : | * define image data in the NRRD file format. | ||
8 : | *) | ||
9 : | |||
10 : | structure RawTypes = | ||
11 : | struct | ||
12 : | |||
13 : | (* raw numeric types as supported by NRRD *) | ||
14 : | datatype ty | ||
15 : | = RT_Int8 | RT_UInt8 | ||
16 : | | RT_Int16 | RT_UInt16 | ||
17 : | | RT_Int32 | RT_UInt32 | ||
18 : | | RT_Int64 | RT_UInt64 | ||
19 : | | RT_Float | RT_Double | ||
20 : | |||
21 : | jhr | 239 | fun fromString ty = (case ty |
22 : | of "signed char" => RT_Int8 | ||
23 : | | "unsigned char" => RT_UInt8 | ||
24 : | | "short" => RT_Int16 | ||
25 : | | "unsigned short" => RT_UInt16 | ||
26 : | | "int" => RT_Int32 | ||
27 : | | "unsigned int" => RT_UInt32 | ||
28 : | | "long long int" => RT_Int64 | ||
29 : | | "unsigned long long int" => RT_UInt64 | ||
30 : | | "float" => RT_Float | ||
31 : | | "double" => RT_Double | ||
32 : | | _ => raise Fail("unknown raw type "^ty) | ||
33 : | (* end case *)) | ||
34 : | |||
35 : | jhr | 141 | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |