about summary refs log tree commit diff
path: root/Src/Builtins
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Builtins')
-rw-r--r--Src/Builtins/rlimits.c27
-rw-r--r--Src/Builtins/sched.c28
2 files changed, 49 insertions, 6 deletions
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 88c7602af..8d55d022d 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -889,6 +889,14 @@ static struct builtin bintab[] = {
     BUILTIN("unlimit", 0, bin_unlimit, 0, -1, 0, "hs", NULL),
 };
 
+static struct features module_features = {
+    bintab, sizeof(bintab)/sizeof(*bintab),
+    NULL, 0,
+    NULL, 0,
+    NULL, 0,
+    0
+};
+
 /**/
 int
 setup_(UNUSED(Module m))
@@ -898,16 +906,31 @@ setup_(UNUSED(Module m))
 
 /**/
 int
+features_(Module m, char ***features)
+{
+    *features = featuresarray(m->nam, &module_features);
+    return 0;
+}
+
+/**/
+int
+enables_(Module m, int **enables)
+{
+    return handlefeatures(m->nam, &module_features, enables);
+}
+
+/**/
+int
 boot_(Module m)
 {
-    return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
+    return 0;
 }
 
 /**/
 int
 cleanup_(Module m)
 {
-    deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
+    return setfeatureenables(m->nam, &module_features, NULL);
     return 0;
 }
 
diff --git a/Src/Builtins/sched.c b/Src/Builtins/sched.c
index 1d9feab7d..b6b00dff3 100644
--- a/Src/Builtins/sched.c
+++ b/Src/Builtins/sched.c
@@ -333,6 +333,14 @@ static struct builtin bintab[] = {
     BUILTIN("sched", 0, bin_sched, 0, -1, 0, NULL, NULL),
 };
 
+static struct features module_features = {
+    bintab, sizeof(bintab)/sizeof(*bintab),
+    NULL, 0,
+    NULL, 0,
+    NULL, 0,
+    0
+};
+
 /**/
 int
 setup_(UNUSED(Module m))
@@ -342,10 +350,23 @@ setup_(UNUSED(Module m))
 
 /**/
 int
+features_(Module m, char ***features)
+{
+    *features = featuresarray(m->nam, &module_features);
+    return 0;
+}
+
+/**/
+int
+enables_(Module m, int **enables)
+{
+    return handlefeatures(m->nam, &module_features, enables);
+}
+
+/**/
+int
 boot_(Module m)
 {
-    if(!addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)))
-	return 1;
     addprepromptfn(&checksched);
     return 0;
 }
@@ -364,8 +385,7 @@ cleanup_(Module m)
 	zfree(sch, sizeof(*sch));
     }
     delprepromptfn(&checksched);
-    deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
-    return 0;
+    return setfeatureenables(m->nam, &module_features, NULL);
 }
 
 /**/