Attribute changed examples/test.c
authorAlan Knowles <alan@roojs.com>
Tue, 24 May 2016 09:50:38 +0000 (17:50 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 24 May 2016 09:50:38 +0000 (17:50 +0800)
examples/test.c [new file with mode: 0644]

diff --git a/examples/test.c b/examples/test.c
new file mode 100644 (file)
index 0000000..072ee75
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * simple test to see if we can call the shared library from C...
+ *
+ * compile:
+ *
+ * PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig" gcc test.c `pkg-config --cflags --libs roojspacker ` -o test
+ *
+ */
+
+#include <stdio.h>
+#include <glib.h>
+#include <roojspacker.h>
+int main(int argc, char *argv[]) {
+    
+    JSDOCPacker* packer;
+    char* out;
+    packer = jsdoc_packer_new ("", "");
+    jsdoc_packer_loadFile(packer, argv[1]);
+    out = jsdoc_packer_pack(packer);
+    printf("RESULT: %s", out );
+
+    return 0;
+}
\ No newline at end of file