From 2d102a8a824740c80e2c45d3142ca97c37a4203d Mon Sep 17 00:00:00 2001 From: Gibu Thomas Date: Mon, 24 Oct 2022 15:05:59 +0400 Subject: [PATCH] Add placeholder section for C wrapper external declartion for future extension if needed (#139) --- src/main/scala/djinni/YamlGenerator.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/scala/djinni/YamlGenerator.scala b/src/main/scala/djinni/YamlGenerator.scala index 866a5e06..92c99747 100644 --- a/src/main/scala/djinni/YamlGenerator.scala +++ b/src/main/scala/djinni/YamlGenerator.scala @@ -14,6 +14,7 @@ class YamlGenerator(spec: Spec) extends Generator(spec) { val objcppMarshal = new ObjcppMarshal(spec) val javaMarshal = new JavaMarshal(spec) val jniMarshal = new JNIMarshal(spec) + val cWrapperMarshal = new CWrapperMarshal(spec) val cppCliMarshal = new CppCliMarshal(spec) case class QuotedString( @@ -74,6 +75,7 @@ class YamlGenerator(spec: Spec) extends Generator(spec) { w.wl("java:").nested { write(w, java(td)) } w.wl("jni:").nested { write(w, jni(td)) } w.wl("cs:").nested { write(w, cs(td)) } + w.wl("cwrapper:").nested { write(w, cwrapper(td)) } } private def write(w: IndentWriter, m: Map[String, Any]) { @@ -186,6 +188,10 @@ class YamlGenerator(spec: Spec) extends Generator(spec) { "reference" -> cppCliMarshal.isReference(td) ) + private def cwrapper(td: TypeDecl) = Map[String, Any]( + "typename" -> QuotedString(cWrapperMarshal.fqTypename(td.ident, td.body)), + ) + // TODO: there has to be a way to do all this without the MExpr/Meta conversions? private def mexpr(td: TypeDecl) = MExpr(meta(td), List())