Index: /trunk/glueforge/templates/psdb/alloc.tt
===================================================================
--- /trunk/glueforge/templates/psdb/alloc.tt	(revision 4010)
+++ /trunk/glueforge/templates/psdb/alloc.tt	(revision 4010)
@@ -0,0 +1,25 @@
+[% USE format -%]
+[% indented = format('%-15s %s') -%]
+[% object_name %] *[% object_name %]Alloc(
+    [%- SET i = 0 -%]
+    [%- FOREACH item = columns -%]
+        [%- IF i == 0 -%]
+            [%- i = 1 -%]
+
+        [%- ELSE -%]
+, 
+        [%- END -%]
+        [%- item.ctype %] [% item.name %]
+        [%- i = i + 1 -%]
+    [%- END -%]
+) {
+    [% indented(object_name, "*object") %];
+
+    object = psAlloc(sizeof([% object_name %]));
+
+[% FOREACH item = columns -%]
+    object->[% item.name %] = [% item.name %];
+[% END -%]
+
+    return object;
+}
Index: /trunk/glueforge/templates/psdb/alloc_at.tt
===================================================================
--- /trunk/glueforge/templates/psdb/alloc_at.tt	(revision 4010)
+++ /trunk/glueforge/templates/psdb/alloc_at.tt	(revision 4010)
@@ -0,0 +1,6 @@
+AT_SETUP([[% object_name %]Alloc - Creates a new [% object_name %] object])
+AT_KEYWORDS([[% object_name %]Alloc])
+
+AT_CHECK([alloc])
+
+AT_CLEANUP
Index: /trunk/glueforge/templates/psdb/alloc_c.tt
===================================================================
--- /trunk/glueforge/templates/psdb/alloc_c.tt	(revision 4010)
+++ /trunk/glueforge/templates/psdb/alloc_c.tt	(revision 4010)
@@ -0,0 +1,29 @@
+[% USE format -%]
+[% indented = format('%-15s %s') -%]
+#include <pslib.h>
+#include <[% pkg_name %].h>
+#include <stdlib.h>
+
+int main () {
+    [% indented(object_name, "*object") %];
+
+    object = [% object_name %]Alloc(
+[%- SET i = 0 -%]
+[%- FOREACH item = columns -%]
+    [%- IF i == 0 -%]
+        [%- i = 1 -%]
+
+    [%- ELSE -%]
+, 
+    [%- END -%]
+    [%- item.test %]
+    [%- i = i + 1 -%]
+[%- END -%]
+);
+
+    if (!object) {
+        exit(EXIT_FAILURE);
+    }
+
+    exit(EXIT_SUCCESS);
+}
