]> the.earth.li Git - onak.git/blobdiff - lookup.c
cscvs to tla changeset 123
[onak.git] / lookup.c
index 71c27c3357f32e27806fd0be668a8c5d244b7a3b..67eac5904be420e8d4142b4bd712b80fdc0129b1 100644 (file)
--- a/lookup.c
+++ b/lookup.c
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
- * $Id: lookup.c,v 1.10 2003/06/07 13:45:34 noodles Exp $
+ * $Id: lookup.c,v 1.14 2004/05/26 18:53:14 noodles Exp $
  */
 
 #include <inttypes.h>
@@ -16,6 +16,7 @@
 #include <unistd.h>
 
 #include "armor.h"
+#include "charfuncs.h"
 #include "getcgi.h"
 #include "keydb.h"
 #include "keyindex.h"
 #define OP_INDEX   2
 #define OP_VINDEX  3
 
-int putnextchar(void *ctx, size_t count, unsigned char *c)
-{
-       return printf("%.*s", (int) count, c);
-}
-
 void find_keys(char *search, uint64_t keyid, bool ishex,
                bool fingerprint, bool exact, bool verbose, bool mrhkp)
 {
@@ -150,17 +146,19 @@ int main(int argc, char *argv[])
        } else if (search == NULL) {
                puts("Error: No key to search for supplied.");
        } else {
-               readconfig();
+               readconfig(NULL);
                initlogthing("lookup", config.logfile);
-               initdb();
+               initdb(true);
                switch (op) {
                case OP_GET:
+                       logthing(LOGTHING_NOTICE, "Getting keyid %llX",
+                                       keyid);
                        if (fetch_key(keyid, &publickey, false)) {
                                puts("<pre>");
                                flatten_publickey(publickey,
                                                        &packets,
                                                        &list_end);
-                               armor_openpgp_stream(putnextchar,
+                               armor_openpgp_stream(stdout_putchar,
                                                NULL,
                                                packets);
                                puts("</pre>");