--- /dev/null
+#!/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/
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);
/**
* Hashtable *with* collision management!
*/
-static FC *defragmentationCache[DEFRAG_BUCKET_COUNT];
+static struct FC *defragmentationCache[DEFRAG_BUCKET_COUNT];
/**
* Lock for the defragmentation cache.
return fn;
}
-static volatile enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
static struct GNUNET_MetaData *search_meta;
static struct GNUNET_GE_Context *ectx;
-volatile int download_done;
+static int download_done;
static char *
makeName (unsigned int i)
}
-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;
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)
printf("<< %s\n",str);
}
-volatile int async_c=0;
+static int async_c=0;
void cb_async(mi_output *o, void *data)
{
(StorageClassSpecifier())*
(
LOOKAHEAD (FunctionDeclaration()) FunctionDeclaration() |
- LOOKAHEAD (StructOrUnionSpecifier()) StructOrUnionSpecifier() ";" |
+ LOOKAHEAD (StructOrUnionSpecifier() ";") StructOrUnionSpecifier() ";" |
+ LOOKAHEAD (EnumSpecifier() ";") EnumSpecifier() ";" |
LOOKAHEAD (VariableDeclaration()) VariableDeclaration() |
LOOKAHEAD (TypeDeclaration()) TypeDeclaration ()
)
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) {
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[])
{
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");
}
};
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();
}
}
}
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,
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;
#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;
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[])
{
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)));
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);