X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=main.c;h=c7bfe28d5fc0b70357e7c257b8f685eb1da0e6fe;hb=4179d4a97b3a242b14ed023c2c3e8935a6e3e1e4;hp=1f86873f1eb044bb24d581b55b588329e26d0139;hpb=4b8483ae278577a3adc8d84da81d77019704466f;p=onak.git diff --git a/main.c b/main.c index 1f86873..c7bfe28 100644 --- a/main.c +++ b/main.c @@ -15,40 +15,40 @@ int getnextchar(void *ctx, size_t count, unsigned char *c) return (!read(0, c, count)); } -int putnextchar(void *ctx, unsigned char c) +int putnextchar(void *ctx, size_t count, unsigned char *c) { - return (!write(1, &c, 1)); + return (!write(1, c, count)); } 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; + 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 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 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); +// fputs("Doing parse_keys():\n", stderr); +// parse_keys(packets, &keys); - printf("Key id is 0x%llX\n", get_keyid(keys)); +// printf("Key id is 0x%llX\n", get_keyid(keys)); // key_index(keys, true, false, false); - initdb(); - fetch_key(get_keyid(keys), &newkeys); - cleanupdb(); +// initdb(); +// fetch_key(get_keyid(keys), &newkeys); +// cleanupdb(); - printf("New key id is 0x%llX\n", get_keyid(newkeys)); +// printf("New key id is 0x%llX\n", get_keyid(newkeys)); // fputs("Doing flatten_publickey():\n", stderr); // flatten_publickey(keys, &newpackets, &list_end);