seaspidering
authorChristian Grothoff <christian@grothoff.org>
Wed, 27 Oct 2010 14:32:10 +0000 (14:32 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 27 Oct 2010 14:32:10 +0000 (14:32 +0000)
15 files changed:
bin/seaspider [new file with mode: 0755]
contrib/seaspider.jar [new file with mode: 0644]
src/datacache/plugin_datacache_sqlite.c
src/fragmentation/fragmentation.c
src/fs/test_fs.c
src/fs/test_fs_download_recursive.c
src/fs/test_fs_search_ranking.c
src/monkey/gnunet-monkey.c
src/monkey/seaspider/C.jj
src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java
src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java
src/testing/test_testing_topology.c
src/testing/testing_group.c
src/util/test_pseudonym.c
src/vpn/gnunet-daemon-vpn.c

diff --git a/bin/seaspider b/bin/seaspider
new file mode 100755 (executable)
index 0000000..d64ef00
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+java -classpath contrib/seaspider.jar:contrib/antlr-runtime-3.1.3.jar:contrib/sqljet.1.0.3.b914.jar org.gnunet.seaspider.Seaspider contrib/seaspider.db src/
diff --git a/contrib/seaspider.jar b/contrib/seaspider.jar
new file mode 100644 (file)
index 0000000..f140d74
Binary files /dev/null and b/contrib/seaspider.jar differ
index 95b65cb10ab5c89b4c5eb44b8c8e82297e2c613f..7674402c7ba430788bf8bb7a219805f11fc6a333 100644 (file)
@@ -372,13 +372,12 @@ libgnunet_plugin_datacache_sqlite_init (void *cls)
       GNUNET_break (0);
       return NULL;
     }
-  fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn),
 #ifdef ENABLE_NLS
-                                   nl_langinfo (CODESET)
+  fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn), nl_langinfo (CODESET));
 #else
-                                   "UTF-8"      /* good luck */
+  /* good luck */
+  fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn), "UTF-8");
 #endif
-    );
   if (SQLITE_OK != sqlite3_open (fn_utf8, &dbh))
     {
       GNUNET_free (fn);
index ecd82b2c4ba4e1809ebfa6fae1bcaa28b46b0b61..3ff737ccf42d055735d40a94315aefaa1ce59531 100644 (file)
@@ -333,7 +333,7 @@ static int stat_discarded;
 /**
  * Hashtable *with* collision management!
  */
-static FC *defragmentationCache[DEFRAG_BUCKET_COUNT];
+static struct FC *defragmentationCache[DEFRAG_BUCKET_COUNT];
 
 /**
  * Lock for the defragmentation cache.
index a073e123470e7e57a4c51e10c94fe77319f97573..f9621949e34a4d0d7e26811c03e60c62aea333db 100644 (file)
@@ -47,7 +47,7 @@ makeName (unsigned int i)
   return fn;
 }
 
-static volatile enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
 
 static struct GNUNET_MetaData *search_meta;
 
index 1c8df5d0da96805fbbd31ab620839c7aae8b8fae..20f681f11407456add82ca77f1d9f103f99e5f05 100644 (file)
@@ -39,7 +39,7 @@
 
 static struct GNUNET_GE_Context *ectx;
 
-volatile int download_done;
+static int download_done;
 
 static char *
 makeName (unsigned int i)
@@ -150,8 +150,8 @@ checkHierarchy (unsigned int i, const char *tree)
 }
 
 
-static volatile enum GNUNET_FSUI_EventType lastEvent;
-static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType waitForEvent;
 static struct GNUNET_FSUI_Context *ctx;
 static struct GNUNET_ECRS_URI *upURI;
 static struct GNUNET_FSUI_DownloadList *download;
index 13ef926204487df004d26bdfbf1ec2dd0c3c2e89..8c75bc1b11fc1cecf45c05480e4aef696599b9ec 100644 (file)
@@ -48,15 +48,15 @@ makeName (unsigned int i)
 
 static struct GNUNET_FSUI_SearchList *search;
 
-static volatile enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
 
-static volatile struct GNUNET_ECRS_URI *uri;
+static struct GNUNET_ECRS_URI *uri;
 
-static volatile int availability;
+static int availability;
 
-static volatile unsigned int rank;
+static unsigned int rank;
 
-static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static enum GNUNET_FSUI_EventType waitForEvent;
 
 static void *
 eventCallback (void *cls, const GNUNET_FSUI_Event * event)
index 34260177429cf7d4f1e2e5a1886227e9b69789c4..b7feb1c511eafb85e7dc5e0869577e0ef300edb9 100644 (file)
@@ -46,7 +46,7 @@ void cb_from(const char *str, void *data)
  printf("<< %s\n",str);
 }
 
-volatile int async_c=0;
+static int async_c=0;
 
 void cb_async(mi_output *o, void *data)
 {
index c7156069edfd9ffb150f09578070bc3019fef4fe..9cab0974af68a09ace963dce4c329ce9806f1fbc 100644 (file)
@@ -179,7 +179,8 @@ void ExternalDeclaration() : {}
        (StorageClassSpecifier())*
        (
             LOOKAHEAD (FunctionDeclaration()) FunctionDeclaration() | 
-           LOOKAHEAD (StructOrUnionSpecifier()) StructOrUnionSpecifier() ";" |
+           LOOKAHEAD (StructOrUnionSpecifier() ";") StructOrUnionSpecifier() ";" |
+           LOOKAHEAD (EnumSpecifier() ";") EnumSpecifier() ";" |
            LOOKAHEAD (VariableDeclaration()) VariableDeclaration() |
            LOOKAHEAD (TypeDeclaration()) TypeDeclaration () 
         ) 
index 95e3f3c1045564ee443273e4f4c7aa44e86436d2..5886fc90b10807ea7995b6a68a7a7a2d09816933 100644 (file)
@@ -55,7 +55,8 @@ public class ExpressionDatabaseHandler {
                        return;
                if (expressionSyntax.startsWith("\""))
                        return;
-               System.out.println (fileName  + ":[" + startLineNo + "-" + endLineNo + "]: " + expressionSyntax);
+               if (false)
+                       System.out.println (fileName  + ":[" + startLineNo + "-" + endLineNo + "]: " + expressionSyntax);
                if (true)
                        return;
                if (db == null) {
index ed305ba74bce0ec759407938e1bb888f44df53fc..f074136572a926bb1508c37e562eb048e24a7b31 100644 (file)
@@ -7,11 +7,12 @@ import java.io.FileNotFoundException;
 
 import org.gnunet.seaspider.parser.CParser;
 import org.gnunet.seaspider.parser.ParseException;
+import org.gnunet.seaspider.parser.TokenMgrError;
 import org.gnunet.seaspider.parser.nodes.Node;
 
 public class Seaspider {
        
-       static final boolean DEBUG = true;
+       static final boolean DEBUG = false;
    
    public static void main(String args[])
    {
@@ -41,8 +42,7 @@ public class Seaspider {
      FileFilter sourceFilter = new FileFilter() {
        public boolean accept(File file) {
                String fileName = file.getName();
-               System.out.println ("Found file " + fileName);
-               return (fileName.endsWith(".c") || fileName.endsWith(".h"));
+               return fileName.endsWith(".c");
        }
      };
      
@@ -67,17 +67,22 @@ public class Seaspider {
                         e.printStackTrace();
                 }
                 try {
-                        System.out.println("Parsing file: " + dir + "/" + fileArr[j].getName());
                 Node root = parser.TranslationUnit();
                 root.accept(new ExpressionExtractorVisitor(fileArr[j].getName()));
                 System.out.println("File " + dir + "/" + fileArr[j].getName() + " parsed successfully.");
                 successCount++;
             }
             catch (ParseException e) {
-                System.out.println("Encountered errors during parsing file " + fileArr[j].getName());
+                System.err.println("Encountered errors during parsing file " + fileArr[j].getName() + ":" + e.getMessage());
                 failureCount++;
                 if (DEBUG)
                         e.printStackTrace();
+            } catch (TokenMgrError e)
+            {
+                System.err.println("Encountered errors during parsing file " + fileArr[j].getName() + ":" + e.getMessage());
+                failureCount++;
+                if (DEBUG)
+                        e.printStackTrace();                    
             }
         }
      }
index 8e1fa9c33b9c57ba573b9977bd5602d7056fc1b6..bb1455e60238c3df16abbe15c8c87b64d24140b7 100644 (file)
@@ -1001,7 +1001,7 @@ run (void *cls,
   modnum = num_peers / 4;
   dotnum = (num_peers / 50) + 1;
 #if VERBOSE
-  fprintf (stdout, "Hostkey generation progress: \[");
+  fprintf (stdout, "Hostkey generation progress: [");
 #endif
   /* Set up a task to end testing if peer start fails */
   die_task = GNUNET_SCHEDULER_add_delayed (sched,
index 23ab2f9fe7f30f20ef0e23edf60a9d3407885c62..4c123a980d1524bff572d7e339d409f4399360ea 100644 (file)
@@ -2395,12 +2395,12 @@ connect_topology (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_NotifyComp
       total = total + ret;
 
 #if OLD
-      connection_iter = ;
+      connection_iter = FIXME;
       while (connection_iter != NULL)
         {
           connect_context = GNUNET_malloc(sizeof(struct ConnectContext));
           connect_context->pg = pg;
-          connect_context->first = ;
+          connect_context->first = FIXME;
           connect_context->second = connection_iter->daemon;
           GNUNET_SCHEDULER_add_now(pg->sched, &schedule_connect, connect_context);
           connection_iter = connection_iter->next;
index 2bdc7bab813cacef241f0fd009b0588d519d76b5..0f68f9f053f12cf701b1cbb7085ebe8557746115 100644 (file)
@@ -31,7 +31,7 @@
 #include "gnunet_disk_lib.h"
 #include "gnunet_pseudonym_lib.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_break(0); goto FAILURE; }
+#define CHECK(a) do { if (!(a)) { ok = GNUNET_NO; GNUNET_break(0); goto FAILURE; } } while (0)
 
 static struct GNUNET_CONTAINER_MetaData *meta;
 
@@ -79,12 +79,12 @@ fake_noti_callback (void *cls,
 
 static int
 false_callback (void *cls,
-        const GNUNET_HashCode *
-        pseudonym,
-        const struct GNUNET_CONTAINER_MetaData *md, int rating)
+               const GNUNET_HashCode *pseudonym,
+               const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
-         return GNUNET_OK;
+  return GNUNET_OK;
 }
+
 int
 main (int argc, char *argv[])
 {
@@ -167,7 +167,7 @@ main (int argc, char *argv[])
   name1 = GNUNET_PSEUDONYM_id_to_name (cfg, &id1);
   CHECK (name1 != NULL);
   CHECK (0 != strcmp (name1, name2));
-  CHECK        (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, "fake", &rid2))
+  CHECK        (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, "fake", &rid2));
   CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name2, &rid2));
   CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name1, &rid1));
   CHECK (0 == memcmp (&id1, &rid1, sizeof (GNUNET_HashCode)));
index a02af54a20a16a2213371761b7053e7580f8801b..cc2474f3250f43e7ef9f0b9609ea321f1509f93a 100644 (file)
@@ -310,8 +310,9 @@ process_answer(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tc) {
 
     if (pkt->subtype == GNUNET_DNS_ANSWER_TYPE_SERVICE)
       {
-      pkt->subtype = GNUNET_DNS_ANSWER_TYPE_IP;
        unsigned char ip6addr[16];
+
+       pkt->subtype = GNUNET_DNS_ANSWER_TYPE_IP;
        memcpy(ip6addr, (int[]){htons(0x1234)}, 2);
        memcpy(ip6addr+2, &pkt->peer, 7);
        memcpy(ip6addr+9, &pkt->service_descriptor, 7);