gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9772 - in Extractor: doc src/main


From: gnunet
Subject: [GNUnet-SVN] r9772 - in Extractor: doc src/main
Date: Tue, 15 Dec 2009 20:23:40 +0100

Author: grothoff
Date: 2009-12-15 20:23:40 +0100 (Tue, 15 Dec 2009)
New Revision: 9772

Modified:
   Extractor/doc/extract.1
   Extractor/src/main/extract.c
Log:
adding option for running in-process

Modified: Extractor/doc/extract.1
===================================================================
--- Extractor/doc/extract.1     2009-12-15 16:41:13 UTC (rev 9771)
+++ Extractor/doc/extract.1     2009-12-15 19:23:40 UTC (rev 9772)
@@ -17,6 +17,9 @@
 .I hash\-algorithm
 ]
 [
+.B \-i
+]
+[
 .B \-l
 .I library
 ]
@@ -63,6 +66,9 @@
 .B \-H ALGORITHM
 Use the ALGORITHM to compute a hash of each file (possible algorithms are sha1 
and md5).
 .TP 8
+.B \-i
+Run plugins in-process (for debugging).  By default, each plugin is run in its 
own process.
+.TP 8
 .B \-L
 Print a list of all known keyword types.
 .TP 8

Modified: Extractor/src/main/extract.c
===================================================================
--- Extractor/src/main/extract.c        2009-12-15 16:41:13 UTC (rev 9771)
+++ Extractor/src/main/extract.c        2009-12-15 19:23:40 UTC (rev 9772)
@@ -1,6 +1,6 @@
 /*
      This file is part of libextractor.
-     (C) 2002, 2003, 2004, 2005, 2006 Vidyut Samanta and Christian Grothoff
+     (C) 2002, 2003, 2004, 2005, 2006, 2009 Vidyut Samanta and Christian 
Grothoff
 
      libextractor is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -36,7 +36,12 @@
  */
 static int verbose;
 
+/**
+ * Run plugins in-process.
+ */
+static int in_process;
 
+
 typedef struct {
   char shortArg;
   char * longArg;
@@ -143,6 +148,8 @@
       gettext_noop("print this help") },
     { 'H', "hash", "ALGORITHM",
       gettext_noop("compute hash using the given ALGORITHM (currently sha1 or 
md5)") },
+    { 'i', "in-process", NULL,
+      gettext_noop("run plugins in-process (simplifies debugging)") },
     { 'l', "library", "LIBRARY",
       gettext_noop("load an extractor plugin named LIBRARY") },
     { 'L', "list", NULL,
@@ -537,6 +544,7 @@
        {"grep-friendly", 0, 0, 'g'},
        {"help", 0, 0, 'h'},
        {"hash", 1, 0, 'H'},
+       {"in-process", 0, 0, 'i'},
        {"list", 0, 0, 'L'},
        {"library", 1, 0, 'l'},
        {"nodefault", 0, 0, 'n'},
@@ -549,7 +557,7 @@
       option_index = 0;
       c = getopt_long (argc,
                       argv, 
-                      "abB:ghH:l:Lnp:vVx:",
+                      "abB:ghH:il:Lnp:vVx:",
                       long_options,
                       &option_index);
 
@@ -586,6 +594,9 @@
        case 'H':
          hash = optarg;
          break;
+       case 'i':
+         in_process = 1;
+         break;
        case 'l':
          libraries = optarg;
          break;
@@ -687,8 +698,10 @@
     plugins = NULL;
   if (libraries != NULL)
     plugins = EXTRACTOR_plugin_add_config (plugins, 
-                                             libraries,
-                                             EXTRACTOR_OPTION_NONE);
+                                          libraries,
+                                          in_process 
+                                          ? EXTRACTOR_OPTION_NONE
+                                          : EXTRACTOR_OPTION_AUTO_RESTART);
   if (binary != NULL) 
     {
       name = malloc(strlen(binary) + strlen("printable_") + 1);
@@ -697,7 +710,9 @@
       plugins = EXTRACTOR_plugin_add_last(plugins,
                                          name,
                                          NULL,
-                                         EXTRACTOR_OPTION_NONE);
+                                         in_process 
+                                         ? EXTRACTOR_OPTION_NONE
+                                         : EXTRACTOR_OPTION_AUTO_RESTART);
       free(name);
     }
   if (hash != NULL) 
@@ -708,7 +723,9 @@
       plugins = EXTRACTOR_plugin_add_last(plugins,
                                          name,
                                          NULL,
-                                         EXTRACTOR_OPTION_NONE);
+                                         in_process 
+                                         ? EXTRACTOR_OPTION_NONE
+                                         : EXTRACTOR_OPTION_AUTO_RESTART);
       free(name);
     }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]