X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/ae384229c538b20b429ea640ec30071ae944c0e7..8d14d66b84cc370cefe54b33de1b95bb49c90bf6:/main.c diff --git a/main.c b/main.c index 9580e01..f9c7c8e 100644 --- a/main.c +++ b/main.c @@ -4,23 +4,13 @@ #include #include "armor.h" +#include "charfuncs.h" #include "keydb.h" #include "keyid.h" #include "keyindex.h" #include "keystructs.h" #include "parsekey.h" -int getnextchar(void *ctx, size_t count, unsigned char *c) -{ - return (!read(0, c, count)); -} - -int putnextchar(void *ctx, size_t count, unsigned char *c) -{ - return (!write(1, c, count)); -} - - int main(int argc, char *argv[]) { struct openpgp_packet_list *packets = NULL; @@ -35,9 +25,9 @@ int main(int argc, char *argv[]) read_openpgp_stream(getnextchar, ctx, &packets, 0); */ fputs("Doing dearmor_openpgp_stream():\n", stderr); - dearmor_openpgp_stream(getnextchar, NULL, &packets); + dearmor_openpgp_stream(stdin_getchar, NULL, &packets); fputs("Doing armor_openpgp_stream():\n", stderr); - armor_openpgp_stream(putnextchar, NULL, packets); + armor_openpgp_stream(stdout_putchar, NULL, packets); /* fputs("Doing parse_keys():\n", stderr); @@ -47,7 +37,7 @@ int main(int argc, char *argv[]) key_index(keys, true, false, false); - initdb(); + initdb(true); fetch_key(get_keyid(keys), &newkeys); cleanupdb();