]> gitweb.factorcode.org Git - factor.git/commitdiff
Use gvplugin_list instead of gvPluginList
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 24 Sep 2011 23:50:58 +0000 (18:50 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 25 Sep 2011 00:00:17 +0000 (19:00 -0500)
Make graphviz unix only for several reasons:
1) Win32 graphviz doesn't have the gvplugin_list() exported and we don't have a word to check if an ffi call exists before attempting to call it so we are unable to find a two-state solution with both gvplugin_list and gvPluginList
2) Compiling the Graphviz Project on Windows is extremely broken under Cygwin, MinGW and Visual Studio 2008 and fails to compile without major changes and still has disabled projects and thousands of warnings/errors. Th HOWTO on their website is outdated on all counts and the maintainer has not replied to my email asking for help. I do not have time to be a Graphviz maintainer myself.
3) When I did manage to compile it on Windows, none of the engines are avaialable to the dlls we load so the compiled Graphviz has no features except symbol exports. The same is true for the binary package--we do not have access to the
4) There is no win64 binary of Graphviz on their website and compiling it would likely result in an unusable set of dlls as per above

extra/graphviz/ffi/ffi.factor
extra/graphviz/platforms.txt [new file with mode: 0644]

index 0447ff1b8bdfbf7bc520be2d858cf2a575b36134..d0ca4ca8ae969b7b5ca0b1cb395c7dd979756d55 100644 (file)
@@ -134,11 +134,12 @@ API_textlayout
 API_device
 API_loadimage ;
 
+! This function doesn't exist on the Linux mason in Graphviz 2.28
 FUNCTION: char**
           gvPluginList
           ( GVC_t* gvc, c-string kind, int* size, c-string str ) ;
 
-:: plugin-list ( kind-string -- seq )
+:: Plugin-list ( kind-string -- seq )
     [
         gvContext &gvFreeContext
         kind-string
@@ -151,8 +152,19 @@ FUNCTION: char**
         ] { } map-as
     ] with-destructors ;
 
+! This function doesn't exist on the Windows mason in Graphviz 2.28
+FUNCTION: c-string
+          gvplugin_list
+          ( GVC_t* gvc, api_t api, c-string str ) ;
+
+: plugin-list ( API_t -- seq )
+    '[
+        gvContext &gvFreeContext _ "" gvplugin_list
+        " " split harvest
+    ] with-destructors ;
+    
 PRIVATE>
 
-MEMO: supported-engines ( -- seq ) "layout" plugin-list ;
-MEMO: supported-formats ( -- seq ) "device" plugin-list ;
+MEMO: supported-engines ( -- seq ) API_layout plugin-list ;
+MEMO: supported-formats ( -- seq ) API_device plugin-list ;
 
diff --git a/extra/graphviz/platforms.txt b/extra/graphviz/platforms.txt
new file mode 100644 (file)
index 0000000..47e0a69
--- /dev/null
@@ -0,0 +1 @@
+unix
\ No newline at end of file