summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-10-27 14:32:10 +0000
committerChristian Grothoff <christian@grothoff.org>2010-10-27 14:32:10 +0000
commitb229a887dfd73dcb2e8bd3d54dc21878fa189ddc (patch)
treefbe712d4bf6842f74c464eafaffd365649869b5d
parent6ba9ee7b1d1c3e1ba90ad4e936672c6a3b1b99da (diff)
seaspidering
-rwxr-xr-xbin/seaspider2
-rw-r--r--contrib/seaspider.jarbin0 -> 154789 bytes
-rw-r--r--src/datacache/plugin_datacache_sqlite.c7
-rw-r--r--src/fragmentation/fragmentation.c2
-rw-r--r--src/fs/test_fs.c2
-rw-r--r--src/fs/test_fs_download_recursive.c6
-rw-r--r--src/fs/test_fs_search_ranking.c10
-rw-r--r--src/monkey/gnunet-monkey.c2
-rw-r--r--src/monkey/seaspider/C.jj3
-rw-r--r--src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java3
-rw-r--r--src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java15
-rw-r--r--src/testing/test_testing_topology.c2
-rw-r--r--src/testing/testing_group.c4
-rw-r--r--src/util/test_pseudonym.c12
-rw-r--r--src/vpn/gnunet-daemon-vpn.c3
15 files changed, 41 insertions, 32 deletions
diff --git a/bin/seaspider b/bin/seaspider
new file mode 100755
index 000000000..d64ef0012
--- /dev/null
+++ b/bin/seaspider
@@ -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
index 000000000..f140d74cb
--- /dev/null
+++ b/contrib/seaspider.jar
Binary files differ
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c
index 95b65cb10..7674402c7 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -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);
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index ecd82b2c4..3ff737ccf 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -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.
diff --git a/src/fs/test_fs.c b/src/fs/test_fs.c
index a073e1234..f9621949e 100644
--- a/src/fs/test_fs.c
+++ b/src/fs/test_fs.c
@@ -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;
diff --git a/src/fs/test_fs_download_recursive.c b/src/fs/test_fs_download_recursive.c
index 1c8df5d0d..20f681f11 100644
--- a/src/fs/test_fs_download_recursive.c
+++ b/src/fs/test_fs_download_recursive.c
@@ -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;
diff --git a/src/fs/test_fs_search_ranking.c b/src/fs/test_fs_search_ranking.c
index 13ef92620..8c75bc1b1 100644
--- a/src/fs/test_fs_search_ranking.c
+++ b/src/fs/test_fs_search_ranking.c
@@ -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)
diff --git a/src/monkey/gnunet-monkey.c b/src/monkey/gnunet-monkey.c
index 342601774..b7feb1c51 100644
--- a/src/monkey/gnunet-monkey.c
+++ b/src/monkey/gnunet-monkey.c
@@ -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)
{
diff --git a/src/monkey/seaspider/C.jj b/src/monkey/seaspider/C.jj
index c7156069e..9cab0974a 100644
--- a/src/monkey/seaspider/C.jj
+++ b/src/monkey/seaspider/C.jj
@@ -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 ()
)
diff --git a/src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java b/src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java
index 95e3f3c10..5886fc90b 100644
--- a/src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java
+++ b/src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java
@@ -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) {
diff --git a/src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java b/src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java
index ed305ba74..f07413657 100644
--- a/src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java
+++ b/src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java
@@ -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();
}
}
}
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index 8e1fa9c33..bb1455e60 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -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,
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 23ab2f9fe..4c123a980 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -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;
diff --git a/src/util/test_pseudonym.c b/src/util/test_pseudonym.c
index 2bdc7bab8..0f68f9f05 100644
--- a/src/util/test_pseudonym.c
+++ b/src/util/test_pseudonym.c
@@ -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)));
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index a02af54a2..cc2474f32 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -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);