X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=maxpath.c;h=0bb5fcf1aca5aa7b2a6f4aaeb359cbee2c889b78;hb=3e6039189ef4130641633e0c8ea6cf2c75e6472f;hp=f46ea4cb13db4cfa6f0c7657f7a2cffc1ddec6ba;hpb=e02c731dfbb288c736f2cd09a9b6df0507c59ddd;p=onak.git diff --git a/maxpath.c b/maxpath.c index f46ea4c..0bb5fcf 100644 --- a/maxpath.c +++ b/maxpath.c @@ -13,6 +13,7 @@ #include "hash.h" #include "keydb.h" #include "ll.h" +#include "onak-conf.h" #include "stats.h" void findmaxpath(unsigned long max) @@ -21,15 +22,14 @@ void findmaxpath(unsigned long max) struct ll *curkey; unsigned long distance, loop; - printf("In findmaxpath\n"); distance = 0; from = to = tmp = NULL; - hash_getkeysigs(0xF1BD4BE45B430367); + cached_getkeysigs(0xF1BD4BE45B430367); for (loop = 0; (loop < HASHSIZE) && (distance < max); loop++) { curkey = gethashtableentry(loop); while (curkey != NULL && distance < max) { - hash_getkeysigs(((struct stats_key *) + cached_getkeysigs(((struct stats_key *) curkey->object)->keyid); initcolour(false); tmp = furthestkey((struct stats_key *) @@ -51,16 +51,20 @@ void findmaxpath(unsigned long max) from->keyid, to->keyid, distance); + dofindpath(to->keyid, from->keyid, false); } int main(int argc, char *argv[]) { + readconfig(); initdb(); inithash(); findmaxpath(30); printf("--------\n"); findmaxpath(30); + destroyhash(); cleanupdb(); + cleanupconfig(); return EXIT_SUCCESS; }