|
Packit |
d7e8d0 |
/* t-trustlist.c - Regression test.
|
|
Packit |
d7e8d0 |
Copyright (C) 2000 Werner Koch (dd9jn)
|
|
Packit |
d7e8d0 |
Copyright (C) 2001, 2003, 2004 g10 Code GmbH
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
This file is part of GPGME.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGME is free software; you can redistribute it and/or modify it
|
|
Packit |
d7e8d0 |
under the terms of the GNU Lesser General Public License as
|
|
Packit |
d7e8d0 |
published by the Free Software Foundation; either version 2.1 of
|
|
Packit |
d7e8d0 |
the License, or (at your option) any later version.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGME is distributed in the hope that it will be useful, but
|
|
Packit |
d7e8d0 |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
d7e8d0 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
d7e8d0 |
Lesser General Public License for more details.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
d7e8d0 |
License along with this program; if not, write to the Free Software
|
|
Packit |
d7e8d0 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
Packit |
d7e8d0 |
02111-1307, USA. */
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
/* We need to include config.h so that we know whether we are building
|
|
Packit |
d7e8d0 |
with large file system (LFS) support. */
|
|
Packit |
d7e8d0 |
#ifdef HAVE_CONFIG_H
|
|
Packit |
d7e8d0 |
#include <config.h>
|
|
Packit |
d7e8d0 |
#endif
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include <stdlib.h>
|
|
Packit |
d7e8d0 |
#include <stdio.h>
|
|
Packit |
d7e8d0 |
#include <string.h>
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include <gpgme.h>
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include "t-support.h"
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
int
|
|
Packit |
d7e8d0 |
main (int argc, char *argv[])
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
gpgme_ctx_t ctx;
|
|
Packit |
d7e8d0 |
gpgme_error_t err;
|
|
Packit Service |
68c0f2 |
gpgme_trust_item_t item;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
(void)argc;
|
|
Packit |
d7e8d0 |
(void)argv;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
err = gpgme_new (&ctx;;
|
|
Packit |
d7e8d0 |
fail_if_err (err);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
err = gpgme_op_trustlist_start (ctx, "alice", 0);
|
|
Packit |
d7e8d0 |
fail_if_err (err);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
while (!(err = gpgme_op_trustlist_next (ctx, &item)))
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
printf ("l=%d k=%s t=%d o=%s v=%s u=%s\n",
|
|
Packit |
d7e8d0 |
item->level, item->keyid, item->type, item->owner_trust,
|
|
Packit |
d7e8d0 |
item->validity, item->name);
|
|
Packit |
d7e8d0 |
gpgme_trust_item_unref (item);
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
if (gpgme_err_code (err) != GPG_ERR_EOF)
|
|
Packit |
d7e8d0 |
fail_if_err (err);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
gpgme_release (ctx);
|
|
Packit |
d7e8d0 |
return 0;
|
|
Packit |
d7e8d0 |
}
|