about summary refs log tree commit diff
path: root/Src/Modules/datetime.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules/datetime.c')
-rw-r--r--Src/Modules/datetime.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c
index add4b303b..06bf52046 100644
--- a/Src/Modules/datetime.c
+++ b/Src/Modules/datetime.c
@@ -154,8 +154,16 @@ static const struct gsu_integer epochseconds_gsu =
 { getcurrentsecs, NULL, stdunsetfn };
 
 static struct paramdef patab[] = {
-    PARAMDEF("EPOCHSECONDS", PM_INTEGER|PM_SPECIAL|PM_READONLY,
-		    NULL, &epochseconds_gsu),
+    SPECIALPMDEF("EPOCHSECONDS", PM_INTEGER|PM_READONLY,
+		 &epochseconds_gsu, NULL, NULL),
+};
+
+static struct features module_features = {
+    bintab, sizeof(bintab)/sizeof(*bintab),
+    NULL, 0,
+    patab, sizeof(patab)/sizeof(*patab),
+    NULL, 0,
+    0
 };
 
 /**/
@@ -167,30 +175,35 @@ setup_(UNUSED(Module m))
 
 /**/
 int
-boot_(Module m)
+features_(Module m, char ***features)
 {
-    return !(addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)) |
-	     addparamdefs(m->nam, patab, sizeof(patab)/sizeof(*patab))
-	    );
+    *features = featuresarray(m->nam, &module_features);
+    return 0;
 }
 
 /**/
 int
-cleanup_(Module m)
+enables_(Module m, int **enables)
 {
-    Param pm;
+    return handlefeatures(m->nam, &module_features, enables);
+}
 
-    deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
-    pm = (Param) paramtab->getnode(paramtab, "EPOCHSECONDS");
-    if (pm && (pm->node.flags & PM_SPECIAL)) {
-	pm->node.flags &= ~PM_READONLY;
-	unsetparam_pm(pm, 0, 1);
-    }
+/**/
+int
+boot_(Module m)
+{
     return 0;
 }
 
 /**/
 int
+cleanup_(Module m)
+{
+    return setfeatureenables(m->nam, &module_features, NULL);
+}
+
+/**/
+int
 finish_(UNUSED(Module m))
 {
     return 0;