Index: trunk/glueforge/glueforge.in
===================================================================
--- trunk/glueforge/glueforge.in	(revision 8660)
+++ trunk/glueforge/glueforge.in	(revision 9668)
@@ -3,5 +3,5 @@
 # Copyright (C) 2005-2006  Joshua Hoblitt
 #
-# $Id: glueforge.in,v 1.50 2006-08-28 23:50:20 jhoblitt Exp $
+# $Id: glueforge.in,v 1.51 2006-10-20 00:55:43 jhoblitt Exp $
 
 use strict;
@@ -94,7 +94,11 @@
     my $type = shift;
 
-    my %primitives = map { $_ => 1 } qw( S8 S16 S32 S64 U8 U16 U32 U64 F32 F64 );
-    my %mtypes = map { $_ => "PS_DATA_$_" } keys %primitives;
-    my %ctypes = map { $_ => "ps$_" } keys %primitives;
+    my %primitives = map { $_ => 1 }
+            qw( S8 S16 S32 S64 U8 U16 U32 U64 F32 F64 );
+    my %times = map { $_ => 1 } qw( UTC UT1 TAI TT );
+    my %mtypes = (map({ $_ => "PS_DATA_$_" } keys %primitives),
+                  map({ $_ => "PS_DATA_TIME" } keys %times));
+    my %ctypes = (map({ $_ => "ps$_" } keys %primitives),
+                  map({ $_ => "psTime*"} keys %times));
 
     my %ttypes = (
@@ -109,16 +113,28 @@
         F32     => 32.32,
         F64     => 64.64,
+        UTC     => '"0001-01-01T00:00:00Z"',
+        UT1     => '"0001-01-01T00:00:00Z"',
+        TAI     => '"0001-01-01T00:00:00Z"',
+        TT      => '"0001-01-01T00:00:00Z"',
     );
 
-    if ( $primitives{$type} ) {
+    if ($primitives{$type}) {
         return {
             ctype   => $ctypes{$type},
             mtype   => $mtypes{$type},
             test    => $ttypes{$type},
-        };
+        }; 
+    }
+    elsif ($times{$type}) {
+        return {
+            ctype   => $ctypes{$type},
+            mtype   => $mtypes{$type},
+            test    => $ttypes{$type},
+            timetype => "PS_TIME_$type",
+        }; 
     } elsif ( $type =~ /STR|STRING/ ) {
         return {
             ctype   => "char*",
-            mtype   => 'PS_DATA_STR',
+            mtype   => 'PS_DATA_STRING',
             test    => '"a string"',
         };
@@ -168,4 +184,11 @@
     my @items;
 
+    # setup one table per nested metadata
+    my @tables;
+    foreach my $meta (@{$config}) {
+        push @tables, tabledata_from_meta($meta);
+    }
+
+=for off
     # setup items
     for (my $i = 0; $i < @{$config}; $i++) {
@@ -176,13 +199,15 @@
 
         push @items, {
+            %{$mdtypes},
             name    => $elem->{name},
             type    => $elem->{type},
-            ctype   => $mdtypes->{ctype},
-            mtype   => $mdtypes->{mtype},
-            test    => $mdtypes->{test},
+#            ctype   => $mdtypes->{ctype},
+#            mtype   => $mdtypes->{mtype},
+#            test    => $mdtypes->{test},
             comment => $elem->{comment},
             value   => $elem->{value},
         };
     }
+=cut
 
     $table{columns} = \@items;
@@ -272,9 +297,10 @@
             name    => $column->{name},
             type    => $column->{type},
-            ctype   => $mdtypes->{ctype},
-            mtype   => $mdtypes->{mtype},
-            test    => $mdtypes->{test},
+#            ctype   => $mdtypes->{ctype},
+#            mtype   => $mdtypes->{mtype},
+#            test    => $mdtypes->{test},
             comment => $column->{comment},
             value   => $column->{value},
+            %{$mdtypes},
         };
     }
