--- graphviz_filter.info.orig	2008-04-18 02:05:12.000000000 +0200
+++ graphviz_filter.info	2008-04-20 17:08:41.000000000 +0200
@@ -4,7 +4,8 @@
 package = Filters
 
 ; Information added by drupal.org packaging script on 2008-04-18
-version = "5.x-1.x-dev"
+version = "6.x-1.x-dev"
+core = "6.x"
 project = "graphviz_filter"
 datestamp = "1208477112"
 
--- graphviz_filter.module.orig	2008-04-17 18:03:43.000000000 +0200
+++ graphviz_filter.module	2008-04-20 17:02:55.000000000 +0200
@@ -5,10 +5,81 @@
  * and outputs corresponding PNG image of the graph.
  * Uses PEAR::Image_GraphViz (http://pear.php.net/package/Image_GraphViz)
  */
-
+$module_path = drupal_get_path("module", "graphviz_filter");
+ini_set("include_path", $module_path."/pear/PEAR".PATH_SEPARATOR.ini_get("include_path"));
 require_once('Image/GraphViz.php');
 
+function graphviz_filter_menu() {
+  $items = array();
+  $items['admin/settings/graphviz_filter'] = array(
+    'title' => 'GraphViz Filter',
+    'description' => 'Basic GraphViz configuration',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('graphviz_filter_settings'),
+    'access' => array('administer site configuration'),
+  );
+  return $items;
+}
+
+function syscall($command){
+ if ($proc = popen("($command)2>&1","r")){
+ while (!feof($proc)) $result .= fgets($proc, 1000);
+ pclose($proc);
+ return $result;
+ }
+ }
+
+function graphviz_filter_settings() {
+//   error_reporting(E_ALL);
+  $modulepath = drupal_get_path('module', 'graphviz_filter');
+  $nomask = array('.', '..', 'pear', 'pear3');
+  $dotbin = current(file_scan_directory($modulepath, '^dot$', $nomask));
+  $libgvc = current(file_scan_directory($modulepath, '^libgvc.so.2', $nomask));
+//   drupal_set_message('<pre>'.print_r($dotbin, TRUE).'</pre>');
+//   drupal_set_message('<pre>'.print_r($libgvc, TRUE).'</pre>');
+  $realdotbin = !empty($dotbin) ? realpath($dotbin->filename) : '';
+  $reallibgvc = !empty($libgvc) ? realpath($libgvc->filename) : '';
+  $graphvizbinpath = !empty($realdotbin) ? substr($realdotbin, 0, strlen($realdotbin)-3) : 'not found';
+  $graphvizlibpath = !empty($reallibgvc) ? substr($reallibgvc, 0, strlen($reallibgvc)-strlen($libgvc->basename)) : 'not found';
+//   drupal_set_message('<pre>'.print_r($graphvizbinpath, TRUE).'</pre>');
+//   drupal_set_message('<pre>'.print_r($graphvizlibpath, TRUE).'</pre>');
+  $output = array();
+  $ret = 0;
+  $cmd = 'LD_LIBRARY_PATH="'.$graphvizlibpath.'" '.$realdotbin.' -V';
+  $graphvizconfig = $graphvizlibpath.'config';
+  $graphvizconfig = '/usr/lib/graphviz/config';
+  drupal_set_message('<pre>cmd='.print_r($cmd, TRUE).'</pre>');
+  drupal_set_message('<pre>is='.print_r(is_file($graphvizconfig), TRUE).'</pre>');
+  drupal_set_message('<pre>cfg='.print_r($graphvizconfig, TRUE).'</pre>');
+//   exec($cmd, $output, $ret);
+  $reti = syscall($cmd);
+//   drupal_set_message('<pre>dotbin='.print_r($realdotbin, TRUE).'</pre>');
+//   drupal_set_message('<pre>output='.print_r($output, TRUE).'</pre>');
+  drupal_set_message('<pre>ret='.print_r($reti, TRUE).'</pre>');
+
+  $form['graphviz_filter_graphviz_bin_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path to the dot/neato binaries'),
+    '#description' => t('If GraphViz is not installed (f.e. on a shared host) and you extract the binaries into this module\'s directory this will be autodetected. If you click \'Reset to defaults\' the path will be redetected.'),
+    '#default_value' => variable_get('graphviz_filter_graphviz_bin_path', $graphvizbinpath),
+    '#size' => 80,
+  );
+  $form['graphviz_filter_graphviz_lib_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path to the GraphViz libraries'),
+    '#description' => t('Analog to the previous option the library path can be set here.'),
+    '#default_value' => variable_get('graphviz_filter_graphviz_lib_path', $graphvizlibpath),
+    '#size' => 80,
+  );
+
+  return system_settings_form($form);
+}
+
 function graphviz_filter_filter($op, $delta = 0, $format = -1, $text = '') {
+/*drupal_set_message('<pre>'.print_r($op, TRUE).'</pre>');
+drupal_set_message('<pre>'.print_r($delta, TRUE).'</pre>');
+drupal_set_message('<pre>'.print_r($format, TRUE).'</pre>');
+drupal_set_message('<pre>'.print_r($text, TRUE).'</pre>');*/
   if ($op == 'list') {
     return array(
       0 => t('Graphviz (DOT) syntax'),
@@ -60,6 +131,9 @@
     
   // Create and render the graph.
   $G = new Image_GraphViz($args['directed']);
+  $G->binPath = variable_get('graphviz_filter_graphviz_bin_path', '');
+  $G->libPath = variable_get('graphviz_filter_graphviz_lib_path', '');
+//   $G->_returnFalseOnError = false;
   if ($args['command']) {
     if ($args['directed']) {
       $G->dotCommand = $args['command'];
@@ -93,11 +167,18 @@
     }
     $module = $formats[$format];
     $outpath = file_create_filename(md5($text).'.'.$format, $outdir);
-    if ($G->renderDotFile($inpath, $outpath, $format)) {
+$ret = $G->renderDotFile($inpath, $outpath, $format);
+drupal_set_message('<pre>$inpath'.print_r($inpath, TRUE).'</pre>');
+drupal_set_message('<pre>$outpath'.print_r($outpath, TRUE).'</pre>');
+drupal_set_message('<pre>$format'.print_r($format, TRUE).'</pre>');
+drupal_set_message('<pre>$ret'.print_r($ret, TRUE).'</pre>');
+    if ($ret) {
+drupal_set_message('<pre>'.print_r($G, TRUE).'</pre>');
       $output .= module_invoke($module, 'graphviz_render', $inpath, $outpath, $format, $args);
       $output .= '<p />';
     }
     else {
+drupal_set_message('<pre>'.print_r($G, TRUE).'</pre>');
       $msg = t('There was an error rendering the Graphviz file using format %format.', array('%format' => $format));
       drupal_set_message($msg, 'error');
       watchdog('graphviz_filter', $msg, WATCHDOG_ERROR);
--- graphviz_formats.info.orig	2008-04-18 02:05:12.000000000 +0200
+++ graphviz_formats.info	2008-04-20 17:10:30.000000000 +0200
@@ -1,11 +1,12 @@
 ; $Id: graphviz_formats.info,v 1.1 2008/01/17 22:25:06 kratib Exp $
 name = Graphviz Filter formats
 description = "Additional rendering formats for Graphviz Filter."
-dependencies = graphviz_filter
+dependencies[] = graphviz_filter
 package = Filters
 
 ; Information added by drupal.org packaging script on 2008-04-18
-version = "5.x-1.x-dev"
+version = "6.x-1.x-dev"
+core = "6.x"
 project = "graphviz_filter"
 datestamp = "1208477112"
 
