X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=add.c;h=3c8c38b44c92711aed527beb84cf37cb8576474b;hb=0c120d1895d25b59abe338862189be1b87447569;hp=6f919becfe7e30b077cfd11d079851a478fe0091;hpb=5e1b22d763640c4d7a09d07920403d8d491b4410;p=onak.git diff --git a/add.c b/add.c index 6f919be..3c8c38b 100644 --- a/add.c +++ b/add.c @@ -17,7 +17,7 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include @@ -28,10 +28,8 @@ #include "charfuncs.h" #include "getcgi.h" #include "keydb.h" -#include "keystructs.h" #include "log.h" #include "mem.h" -#include "merge.h" #include "onak-conf.h" #include "parsekey.h" @@ -43,6 +41,7 @@ int main(int argc, char *argv[]) struct buffer_ctx ctx; int count = 0; int i; + struct onak_dbctx *dbctx; memset(&ctx, 0, sizeof(ctx)); @@ -88,13 +87,13 @@ int main(int argc, char *argv[]) fclose(stderr); } catchsignals(); - config.dbbackend->initdb(false); + dbctx = config.dbinit(config.backend, false); count = cleankeys(keys); logthing(LOGTHING_INFO, "%d keys cleaned.", count); - count = config.dbbackend->update_keys(&keys, true); + count = dbctx->update_keys(dbctx, &keys, true); logthing(LOGTHING_NOTICE, "Got %d new keys.", count); @@ -103,7 +102,7 @@ int main(int argc, char *argv[]) keys = NULL; } - config.dbbackend->cleanupdb(); + dbctx->cleanupdb(dbctx); } else { puts("No OpenPGP packets found in input."); end_html();