Graphviz's gvc.dll doesn't export gvplugin_list() on Windows, so call gvPluginList() instead. This bug has been reported to the Windows Graphviz maintainer, so we can potentially go back to calling gvplugin_list() someday.

db4
Doug Coleman 2011-09-16 01:23:52 -05:00
parent 88c5bb17f8
commit 7e4aa6f67f
1 changed files with 23 additions and 13 deletions

View File

@ -1,9 +1,11 @@
! Copyright (C) 2011 Alex Vondrak. ! Copyright (C) 2011 Alex Vondrak.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.c-types alien.destructors USING: accessors alien alien.c-types alien.data
alien.libraries alien.syntax combinators debugger destructors alien.destructors alien.libraries alien.strings alien.syntax
fry io kernel literals math prettyprint sequences splitting combinators debugger destructors fry graphviz io
system memoize graphviz ; io.encodings.ascii kernel libc literals locals math memoize
prettyprint sequences specialized-arrays splitting system ;
SPECIALIZED-ARRAY: void*
IN: graphviz.ffi IN: graphviz.ffi
<< <<
@ -132,17 +134,25 @@ API_textlayout
API_device API_device
API_loadimage ; API_loadimage ;
FUNCTION: c-string FUNCTION: char**
gvplugin_list gvPluginList
( GVC_t* gvc, api_t api, c-string str ) ; ( GVC_t* gvc, c-string kind, int* size, c-string str ) ;
: plugin-list ( API_t -- seq ) :: plugin-list ( kind-string -- seq )
'[ [
gvContext &gvFreeContext _ "" gvplugin_list gvContext &gvFreeContext
" " split harvest kind-string
0 int <ref> dup :> size*
f
gvPluginList &(free) :> ret
size* int deref :> size
ret size <direct-void*-array> [
&(free) ascii alien>string
] { } map-as
] with-destructors ; ] with-destructors ;
PRIVATE> PRIVATE>
MEMO: supported-engines ( -- seq ) API_layout plugin-list ; MEMO: supported-engines ( -- seq ) "layout" plugin-list ;
MEMO: supported-formats ( -- seq ) API_device plugin-list ; MEMO: supported-formats ( -- seq ) "device" plugin-list ;