Commits

wlav committed 83b6d1c

add first stab at a dummy backend (for testing only)

  • Participants
  • Parent commits c6d9d62
  • Branches reflex-support

Comments (0)

Files changed (1)

pypy/module/cppyy/src/dummy_backend.cxx

+#include "cppyy.h"
+#include "capi.h"
+
+#include <string>
+
+#include <stdlib.h>
+#include <string.h>
+
+
+/* local helpers ---------------------------------------------------------- */
+static inline char* cppstring_to_cstring(const std::string& name) {
+    char* name_char = (char*)malloc(name.size() + 1);
+    strcpy(name_char, name.c_str());
+    return name_char;
+}
+
+
+/* name to opaque C++ scope representation -------------------------------- */
+int cppyy_num_scopes(cppyy_scope_t handle) {
+    return 0;
+}
+
+char* cppyy_resolve_name(const char* cppitem_name) {
+    return cppstring_to_cstring(cppitem_name);
+}
+
+cppyy_scope_t cppyy_get_scope(const char* scope_name) {
+    return 0;
+}
+
+
+/* misc helpers ----------------------------------------------------------- */
+void cppyy_free(void* ptr) {
+    free(ptr);
+}