From 18ec9ebcac7542a657c028ff8557bd3fab3670ba Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Sun, 7 Dec 2014 18:22:52 -0800
Subject: [PATCH] add getRegisteredRoutines .Internal

---
 .../builtin/base/HiddenInternalFunctions.java   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
index 3299dcf98d..5e9a45debc 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
@@ -208,4 +208,21 @@ public class HiddenInternalFunctions {
         }
     }
 
+    @RBuiltin(name = "getRegisteredRoutines", kind = INTERNAL, parameterNames = "info")
+    public abstract static class GetRegisteredRoutines extends RBuiltinNode {
+        private static final RStringVector NAMES = RDataFactory.createStringVector(new String[]{".C", ".Call", ".Fortran", ".External"}, RDataFactory.COMPLETE_VECTOR);
+        private static final RList EMPTY = RDataFactory.createList();
+
+        @Specialization
+        protected RList getRegisteredRoutines(Object info) {
+            Object[] data;
+            if (info == RNull.instance) {
+                data = new Object[]{EMPTY, EMPTY, EMPTY, EMPTY};
+                return RDataFactory.createList(data, NAMES);
+            } else {
+                throw RError.nyi(getEncapsulatingSourceSection(), " getRegisteredRoutines with non-null info");
+            }
+        }
+    }
+
 }
-- 
GitLab