cscvs to tla changeset 85
authorJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:47:48 +0000 (23:47 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:47:48 +0000 (23:47 +0000)
Author: noodles
Date: 2003/06/08 19:04:31
Further compile warning (under gcc 3.3 anyway) cleanups.

gpgwww.c
keyindex.c
keyindex.h
main.c
parsekey.c

index ad864f106ff562950abca5fca43d3bd39e724777..05cfc00097833646cc1ac8c54d31b7c9c23bf757 100644 (file)
--- a/gpgwww.c
+++ b/gpgwww.c
@@ -5,13 +5,13 @@
  *
  * Copyright 2001-2002 Project Purple.
  *
- * $Id: gpgwww.c,v 1.10 2003/06/04 20:57:08 noodles Exp $
+ * $Id: gpgwww.c,v 1.11 2003/06/08 19:04:31 noodles Exp $
  */
 
-// #include <stdint.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "getcgi.h"
 #include "hash.h"
index 180c3127965764a855f7c2f30e86285f542f22be..6593224885df754e01d5c98ad68772c41e2633b5 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
- * $Id: keyindex.c,v 1.10 2003/06/04 22:11:40 noodles Exp $
+ * $Id: keyindex.c,v 1.11 2003/06/08 19:04:32 noodles Exp $
  */
 
 #include <assert.h>
@@ -306,7 +306,7 @@ int mrkey_index(struct openpgp_publickey *keys)
                                keys->publickey->data[0]);
                }
 
-               printf(":%d:%d:%d::\n",
+               printf(":%d:%d:%ld::\n",
                        type,
                        length,
                        created_time);
index 81202241d7f616ed32d54a01c0c2ccb62d358930..110d234ed0cdde2a0fd818aaf2be2eec50844a0a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
- * $Id: keyindex.h,v 1.5 2003/06/04 20:57:09 noodles Exp $
+ * $Id: keyindex.h,v 1.6 2003/06/08 19:04:32 noodles Exp $
  */
 
 #ifndef __KEYINDEX_H__
 int key_index(struct openpgp_publickey *keys, bool verbose,
                bool fingerprint, bool html);
 
+/**
+ *     mrkey_index - List a set of OpenPGP keys in the MRHKP format.
+ *     @keys: The keys to display.
+ *
+ *     This function takes a list of OpenPGP public keys and displays a
+ *     machine readable list of them.
+ */
+int mrkey_index(struct openpgp_publickey *keys);
 #endif
diff --git a/main.c b/main.c
index c7bfe28d5fc0b70357e7c257b8f685eb1da0e6fe..b140c8edc9b7ac3740a50a834329f98aa003b5da 100644 (file)
--- a/main.c
+++ b/main.c
@@ -23,38 +23,41 @@ int putnextchar(void *ctx, size_t count, unsigned char *c)
 
 int main(int argc, char *argv[])
 {
-       struct openpgp_packet_list *packets = NULL; //, *newpackets = NULL;
-//     struct openpgp_packet_list *list_end = NULL;
-//     struct openpgp_publickey *keys = NULL;
-//     struct openpgp_publickey *newkeys = NULL;
-//     void *ctx = NULL;
-
-//     fputs("Doing read_openpgp_stream():\n", stderr);
-//     read_openpgp_stream(getnextchar, ctx, &packets);
-
+       struct openpgp_packet_list *packets = NULL; 
+/*
+       , *newpackets = NULL;
+       struct openpgp_packet_list *list_end = NULL;
+       struct openpgp_publickey *keys = NULL;
+       struct openpgp_publickey *newkeys = NULL;
+       void *ctx = NULL;
+
+       fputs("Doing read_openpgp_stream():\n", stderr);
+       read_openpgp_stream(getnextchar, ctx, &packets);
+*/
        fputs("Doing dearmor_openpgp_stream():\n", stderr);
        dearmor_openpgp_stream(getnextchar, NULL, &packets);
        fputs("Doing armor_openpgp_stream():\n", stderr);
        armor_openpgp_stream(putnextchar, NULL, packets);
 
-//     fputs("Doing parse_keys():\n", stderr);
-//     parse_keys(packets, &keys);
-
-//     printf("Key id is 0x%llX\n", get_keyid(keys));
+/*
+       fputs("Doing parse_keys():\n", stderr);
+       parse_keys(packets, &keys);
 
-//     key_index(keys, true, false, false);
+       printf("Key id is 0x%llX\n", get_keyid(keys));
 
-//     initdb();
-//     fetch_key(get_keyid(keys), &newkeys);
-//     cleanupdb();
+       key_index(keys, true, false, false);
 
-//     printf("New key id is 0x%llX\n", get_keyid(newkeys));
+       initdb();
+       fetch_key(get_keyid(keys), &newkeys);
+       cleanupdb();
 
-//     fputs("Doing flatten_publickey():\n", stderr);
-//     flatten_publickey(keys, &newpackets, &list_end);
+       printf("New key id is 0x%llX\n", get_keyid(newkeys));
 
-//     fputs("Doing write_openpgp_stream():\n", stderr);
-//     write_openpgp_stream(putnextchar, ctx, newpackets);
+       fputs("Doing flatten_publickey():\n", stderr);
+       flatten_publickey(keys, &newpackets, &list_end);
 
+       fputs("Doing write_openpgp_stream():\n", stderr);
+       write_openpgp_stream(putnextchar, ctx, newpackets);
+*/
        return 0;
 }
index 88a4594b5b9ffd780c2ac9730cf6b40cfe93ab7e..0f02e8cf757f8839f2fd609c151e7d2202412aec 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
- * $Id: parsekey.c,v 1.7 2003/06/04 20:57:12 noodles Exp $
+ * $Id: parsekey.c,v 1.8 2003/06/08 19:04:32 noodles Exp $
  */
 
 #include <assert.h>
@@ -203,7 +203,9 @@ int read_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
 
                        curpacket->packet->newformat = (curchar & 0x40);
 
-                       // TODO: Better error checking on getchar_func.
+                       /*
+                        * TODO: Better error checking on getchar_func.
+                        */
                        if (curpacket->packet->newformat) {
                                curpacket->packet->tag = (curchar & 0x3F);
                                rc = getchar_func(ctx, 1, &curchar);
@@ -356,10 +358,8 @@ int write_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
                        }
                }
 
-               putchar_func(ctx, packets->packet->length, packets->packet->data);
-//             for (i = 0; i < packets->packet->length; i++) {
-//                     putchar_func(ctx, packets->packet->data[i]);
-//             }
+               putchar_func(ctx, packets->packet->length,
+                               packets->packet->data);
                packets = packets->next;
        }
        return 0;