diff options
-rwxr-xr-x | bin/seaspider | 2 | ||||
-rw-r--r-- | contrib/seaspider.jar | bin | 0 -> 154789 bytes | |||
-rw-r--r-- | src/datacache/plugin_datacache_sqlite.c | 7 | ||||
-rw-r--r-- | src/fragmentation/fragmentation.c | 2 | ||||
-rw-r--r-- | src/fs/test_fs.c | 2 | ||||
-rw-r--r-- | src/fs/test_fs_download_recursive.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_search_ranking.c | 10 | ||||
-rw-r--r-- | src/monkey/gnunet-monkey.c | 2 | ||||
-rw-r--r-- | src/monkey/seaspider/C.jj | 3 | ||||
-rw-r--r-- | src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java | 3 | ||||
-rw-r--r-- | src/monkey/seaspider/org/gnunet/seaspider/Seaspider.java | 15 | ||||
-rw-r--r-- | src/testing/test_testing_topology.c | 2 | ||||
-rw-r--r-- | src/testing/testing_group.c | 4 | ||||
-rw-r--r-- | src/util/test_pseudonym.c | 12 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 3 |
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 @@ | |||
1 | #!/bin/sh | ||
2 | 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) | |||
372 | GNUNET_break (0); | 372 | GNUNET_break (0); |
373 | return NULL; | 373 | return NULL; |
374 | } | 374 | } |
375 | fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn), | ||
376 | #ifdef ENABLE_NLS | 375 | #ifdef ENABLE_NLS |
377 | nl_langinfo (CODESET) | 376 | fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn), nl_langinfo (CODESET)); |
378 | #else | 377 | #else |
379 | "UTF-8" /* good luck */ | 378 | /* good luck */ |
379 | fn_utf8 = GNUNET_STRINGS_to_utf8 (fn, strlen (fn), "UTF-8"); | ||
380 | #endif | 380 | #endif |
381 | ); | ||
382 | if (SQLITE_OK != sqlite3_open (fn_utf8, &dbh)) | 381 | if (SQLITE_OK != sqlite3_open (fn_utf8, &dbh)) |
383 | { | 382 | { |
384 | GNUNET_free (fn); | 383 | 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; | |||
333 | /** | 333 | /** |
334 | * Hashtable *with* collision management! | 334 | * Hashtable *with* collision management! |
335 | */ | 335 | */ |
336 | static FC *defragmentationCache[DEFRAG_BUCKET_COUNT]; | 336 | static struct FC *defragmentationCache[DEFRAG_BUCKET_COUNT]; |
337 | 337 | ||
338 | /** | 338 | /** |
339 | * Lock for the defragmentation cache. | 339 | * 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) | |||
47 | return fn; | 47 | return fn; |
48 | } | 48 | } |
49 | 49 | ||
50 | static volatile enum GNUNET_FSUI_EventType lastEvent; | 50 | static enum GNUNET_FSUI_EventType lastEvent; |
51 | 51 | ||
52 | static struct GNUNET_MetaData *search_meta; | 52 | static struct GNUNET_MetaData *search_meta; |
53 | 53 | ||
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 @@ | |||
39 | 39 | ||
40 | static struct GNUNET_GE_Context *ectx; | 40 | static struct GNUNET_GE_Context *ectx; |
41 | 41 | ||
42 | volatile int download_done; | 42 | static int download_done; |
43 | 43 | ||
44 | static char * | 44 | static char * |
45 | makeName (unsigned int i) | 45 | makeName (unsigned int i) |
@@ -150,8 +150,8 @@ checkHierarchy (unsigned int i, const char *tree) | |||
150 | } | 150 | } |
151 | 151 | ||
152 | 152 | ||
153 | static volatile enum GNUNET_FSUI_EventType lastEvent; | 153 | static enum GNUNET_FSUI_EventType lastEvent; |
154 | static volatile enum GNUNET_FSUI_EventType waitForEvent; | 154 | static enum GNUNET_FSUI_EventType waitForEvent; |
155 | static struct GNUNET_FSUI_Context *ctx; | 155 | static struct GNUNET_FSUI_Context *ctx; |
156 | static struct GNUNET_ECRS_URI *upURI; | 156 | static struct GNUNET_ECRS_URI *upURI; |
157 | static struct GNUNET_FSUI_DownloadList *download; | 157 | 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) | |||
48 | 48 | ||
49 | static struct GNUNET_FSUI_SearchList *search; | 49 | static struct GNUNET_FSUI_SearchList *search; |
50 | 50 | ||
51 | static volatile enum GNUNET_FSUI_EventType lastEvent; | 51 | static enum GNUNET_FSUI_EventType lastEvent; |
52 | 52 | ||
53 | static volatile struct GNUNET_ECRS_URI *uri; | 53 | static struct GNUNET_ECRS_URI *uri; |
54 | 54 | ||
55 | static volatile int availability; | 55 | static int availability; |
56 | 56 | ||
57 | static volatile unsigned int rank; | 57 | static unsigned int rank; |
58 | 58 | ||
59 | static volatile enum GNUNET_FSUI_EventType waitForEvent; | 59 | static enum GNUNET_FSUI_EventType waitForEvent; |
60 | 60 | ||
61 | static void * | 61 | static void * |
62 | eventCallback (void *cls, const GNUNET_FSUI_Event * event) | 62 | 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) | |||
46 | printf("<< %s\n",str); | 46 | printf("<< %s\n",str); |
47 | } | 47 | } |
48 | 48 | ||
49 | volatile int async_c=0; | 49 | static int async_c=0; |
50 | 50 | ||
51 | void cb_async(mi_output *o, void *data) | 51 | void cb_async(mi_output *o, void *data) |
52 | { | 52 | { |
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() : {} | |||
179 | (StorageClassSpecifier())* | 179 | (StorageClassSpecifier())* |
180 | ( | 180 | ( |
181 | LOOKAHEAD (FunctionDeclaration()) FunctionDeclaration() | | 181 | LOOKAHEAD (FunctionDeclaration()) FunctionDeclaration() | |
182 | LOOKAHEAD (StructOrUnionSpecifier()) StructOrUnionSpecifier() ";" | | 182 | LOOKAHEAD (StructOrUnionSpecifier() ";") StructOrUnionSpecifier() ";" | |
183 | LOOKAHEAD (EnumSpecifier() ";") EnumSpecifier() ";" | | ||
183 | LOOKAHEAD (VariableDeclaration()) VariableDeclaration() | | 184 | LOOKAHEAD (VariableDeclaration()) VariableDeclaration() | |
184 | LOOKAHEAD (TypeDeclaration()) TypeDeclaration () | 185 | LOOKAHEAD (TypeDeclaration()) TypeDeclaration () |
185 | ) | 186 | ) |
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 { | |||
55 | return; | 55 | return; |
56 | if (expressionSyntax.startsWith("\"")) | 56 | if (expressionSyntax.startsWith("\"")) |
57 | return; | 57 | return; |
58 | System.out.println (fileName + ":[" + startLineNo + "-" + endLineNo + "]: " + expressionSyntax); | 58 | if (false) |
59 | System.out.println (fileName + ":[" + startLineNo + "-" + endLineNo + "]: " + expressionSyntax); | ||
59 | if (true) | 60 | if (true) |
60 | return; | 61 | return; |
61 | if (db == null) { | 62 | 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; | |||
7 | 7 | ||
8 | import org.gnunet.seaspider.parser.CParser; | 8 | import org.gnunet.seaspider.parser.CParser; |
9 | import org.gnunet.seaspider.parser.ParseException; | 9 | import org.gnunet.seaspider.parser.ParseException; |
10 | import org.gnunet.seaspider.parser.TokenMgrError; | ||
10 | import org.gnunet.seaspider.parser.nodes.Node; | 11 | import org.gnunet.seaspider.parser.nodes.Node; |
11 | 12 | ||
12 | public class Seaspider { | 13 | public class Seaspider { |
13 | 14 | ||
14 | static final boolean DEBUG = true; | 15 | static final boolean DEBUG = false; |
15 | 16 | ||
16 | public static void main(String args[]) | 17 | public static void main(String args[]) |
17 | { | 18 | { |
@@ -41,8 +42,7 @@ public class Seaspider { | |||
41 | FileFilter sourceFilter = new FileFilter() { | 42 | FileFilter sourceFilter = new FileFilter() { |
42 | public boolean accept(File file) { | 43 | public boolean accept(File file) { |
43 | String fileName = file.getName(); | 44 | String fileName = file.getName(); |
44 | System.out.println ("Found file " + fileName); | 45 | return fileName.endsWith(".c"); |
45 | return (fileName.endsWith(".c") || fileName.endsWith(".h")); | ||
46 | } | 46 | } |
47 | }; | 47 | }; |
48 | 48 | ||
@@ -67,17 +67,22 @@ public class Seaspider { | |||
67 | e.printStackTrace(); | 67 | e.printStackTrace(); |
68 | } | 68 | } |
69 | try { | 69 | try { |
70 | System.out.println("Parsing file: " + dir + "/" + fileArr[j].getName()); | ||
71 | Node root = parser.TranslationUnit(); | 70 | Node root = parser.TranslationUnit(); |
72 | root.accept(new ExpressionExtractorVisitor(fileArr[j].getName())); | 71 | root.accept(new ExpressionExtractorVisitor(fileArr[j].getName())); |
73 | System.out.println("File " + dir + "/" + fileArr[j].getName() + " parsed successfully."); | 72 | System.out.println("File " + dir + "/" + fileArr[j].getName() + " parsed successfully."); |
74 | successCount++; | 73 | successCount++; |
75 | } | 74 | } |
76 | catch (ParseException e) { | 75 | catch (ParseException e) { |
77 | System.out.println("Encountered errors during parsing file " + fileArr[j].getName()); | 76 | System.err.println("Encountered errors during parsing file " + fileArr[j].getName() + ":" + e.getMessage()); |
78 | failureCount++; | 77 | failureCount++; |
79 | if (DEBUG) | 78 | if (DEBUG) |
80 | e.printStackTrace(); | 79 | e.printStackTrace(); |
80 | } catch (TokenMgrError e) | ||
81 | { | ||
82 | System.err.println("Encountered errors during parsing file " + fileArr[j].getName() + ":" + e.getMessage()); | ||
83 | failureCount++; | ||
84 | if (DEBUG) | ||
85 | e.printStackTrace(); | ||
81 | } | 86 | } |
82 | } | 87 | } |
83 | } | 88 | } |
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, | |||
1001 | modnum = num_peers / 4; | 1001 | modnum = num_peers / 4; |
1002 | dotnum = (num_peers / 50) + 1; | 1002 | dotnum = (num_peers / 50) + 1; |
1003 | #if VERBOSE | 1003 | #if VERBOSE |
1004 | fprintf (stdout, "Hostkey generation progress: \["); | 1004 | fprintf (stdout, "Hostkey generation progress: ["); |
1005 | #endif | 1005 | #endif |
1006 | /* Set up a task to end testing if peer start fails */ | 1006 | /* Set up a task to end testing if peer start fails */ |
1007 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | 1007 | 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 | |||
2395 | total = total + ret; | 2395 | total = total + ret; |
2396 | 2396 | ||
2397 | #if OLD | 2397 | #if OLD |
2398 | connection_iter = ; | 2398 | connection_iter = FIXME; |
2399 | while (connection_iter != NULL) | 2399 | while (connection_iter != NULL) |
2400 | { | 2400 | { |
2401 | connect_context = GNUNET_malloc(sizeof(struct ConnectContext)); | 2401 | connect_context = GNUNET_malloc(sizeof(struct ConnectContext)); |
2402 | connect_context->pg = pg; | 2402 | connect_context->pg = pg; |
2403 | connect_context->first = ; | 2403 | connect_context->first = FIXME; |
2404 | connect_context->second = connection_iter->daemon; | 2404 | connect_context->second = connection_iter->daemon; |
2405 | GNUNET_SCHEDULER_add_now(pg->sched, &schedule_connect, connect_context); | 2405 | GNUNET_SCHEDULER_add_now(pg->sched, &schedule_connect, connect_context); |
2406 | connection_iter = connection_iter->next; | 2406 | 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 @@ | |||
31 | #include "gnunet_disk_lib.h" | 31 | #include "gnunet_disk_lib.h" |
32 | #include "gnunet_pseudonym_lib.h" | 32 | #include "gnunet_pseudonym_lib.h" |
33 | 33 | ||
34 | #define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_break(0); goto FAILURE; } | 34 | #define CHECK(a) do { if (!(a)) { ok = GNUNET_NO; GNUNET_break(0); goto FAILURE; } } while (0) |
35 | 35 | ||
36 | static struct GNUNET_CONTAINER_MetaData *meta; | 36 | static struct GNUNET_CONTAINER_MetaData *meta; |
37 | 37 | ||
@@ -79,12 +79,12 @@ fake_noti_callback (void *cls, | |||
79 | 79 | ||
80 | static int | 80 | static int |
81 | false_callback (void *cls, | 81 | false_callback (void *cls, |
82 | const GNUNET_HashCode * | 82 | const GNUNET_HashCode *pseudonym, |
83 | pseudonym, | 83 | const struct GNUNET_CONTAINER_MetaData *md, int rating) |
84 | const struct GNUNET_CONTAINER_MetaData *md, int rating) | ||
85 | { | 84 | { |
86 | return GNUNET_OK; | 85 | return GNUNET_OK; |
87 | } | 86 | } |
87 | |||
88 | int | 88 | int |
89 | main (int argc, char *argv[]) | 89 | main (int argc, char *argv[]) |
90 | { | 90 | { |
@@ -167,7 +167,7 @@ main (int argc, char *argv[]) | |||
167 | name1 = GNUNET_PSEUDONYM_id_to_name (cfg, &id1); | 167 | name1 = GNUNET_PSEUDONYM_id_to_name (cfg, &id1); |
168 | CHECK (name1 != NULL); | 168 | CHECK (name1 != NULL); |
169 | CHECK (0 != strcmp (name1, name2)); | 169 | CHECK (0 != strcmp (name1, name2)); |
170 | CHECK (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, "fake", &rid2)) | 170 | CHECK (GNUNET_SYSERR == GNUNET_PSEUDONYM_name_to_id (cfg, "fake", &rid2)); |
171 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name2, &rid2)); | 171 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name2, &rid2)); |
172 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name1, &rid1)); | 172 | CHECK (GNUNET_OK == GNUNET_PSEUDONYM_name_to_id (cfg, name1, &rid1)); |
173 | CHECK (0 == memcmp (&id1, &rid1, sizeof (GNUNET_HashCode))); | 173 | 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) { | |||
310 | 310 | ||
311 | if (pkt->subtype == GNUNET_DNS_ANSWER_TYPE_SERVICE) | 311 | if (pkt->subtype == GNUNET_DNS_ANSWER_TYPE_SERVICE) |
312 | { | 312 | { |
313 | pkt->subtype = GNUNET_DNS_ANSWER_TYPE_IP; | ||
314 | unsigned char ip6addr[16]; | 313 | unsigned char ip6addr[16]; |
314 | |||
315 | pkt->subtype = GNUNET_DNS_ANSWER_TYPE_IP; | ||
315 | memcpy(ip6addr, (int[]){htons(0x1234)}, 2); | 316 | memcpy(ip6addr, (int[]){htons(0x1234)}, 2); |
316 | memcpy(ip6addr+2, &pkt->peer, 7); | 317 | memcpy(ip6addr+2, &pkt->peer, 7); |
317 | memcpy(ip6addr+9, &pkt->service_descriptor, 7); | 318 | memcpy(ip6addr+9, &pkt->service_descriptor, 7); |