tests: Mark lots of unused vars and fix const mismatches.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-09-13 20:48:06 +02:00
parent 4491ef0a9a
commit 9064eebdc0
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
36 changed files with 289 additions and 216 deletions

View File

@ -37,7 +37,7 @@
static void static void
check_verify_result (gpgme_verify_result_t result, unsigned int summary, check_verify_result (gpgme_verify_result_t result, unsigned int summary,
char *fpr, gpgme_error_t status) const char *fpr, gpgme_error_t status)
{ {
gpgme_signature_t sig; gpgme_signature_t sig;
@ -104,6 +104,9 @@ main (int argc, char *argv[])
char *cipher_2_asc = make_filename ("cipher-2.asc"); char *cipher_2_asc = make_filename ("cipher-2.asc");
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,7 +36,7 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -46,6 +46,9 @@ main (int argc, char *argv[])
char *cipher_1_asc = make_filename ("cipher-1.asc"); char *cipher_1_asc = make_filename ("cipher-1.asc");
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -61,7 +64,7 @@ main (int argc, char *argv[])
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_decrypt (ctx, in, out); err = gpgme_op_decrypt (ctx, in, out);
fail_if_err (err); fail_if_err (err);
result = gpgme_op_decrypt_result (ctx); result = gpgme_op_decrypt_result (ctx);
@ -72,7 +75,7 @@ main (int argc, char *argv[])
exit (1); exit (1);
} }
print_data (out); print_data (out);
gpgme_data_release (in); gpgme_data_release (in);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_release (ctx); gpgme_release (ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -43,7 +43,7 @@ flush_data (gpgme_data_t dh)
{ {
char buf[100]; char buf[100];
int ret; int ret;
ret = gpgme_data_seek (dh, 0, SEEK_SET); ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret) if (ret)
fail_if_err (gpgme_error_from_errno (errno)); fail_if_err (gpgme_error_from_errno (errno));
@ -57,11 +57,11 @@ flush_data (gpgme_data_t dh)
gpgme_error_t gpgme_error_t
edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd) edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd)
{ {
char *result = NULL; const char *result = NULL;
gpgme_data_t out = (gpgme_data_t) opaque; gpgme_data_t out = (gpgme_data_t) opaque;
fputs ("[-- Response --]\n", stdout); fputs ("[-- Response --]\n", stdout);
flush_data (out); flush_data (out);
fprintf (stdout, "[-- Code: %i, %s --]\n", status, args); fprintf (stdout, "[-- Code: %i, %s --]\n", status, args);
@ -70,7 +70,7 @@ edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd)
if (!strcmp (args, "keyedit.prompt")) if (!strcmp (args, "keyedit.prompt"))
{ {
static int step = 0; static int step = 0;
switch (step) switch (step)
{ {
case 0: case 0:
@ -110,7 +110,7 @@ edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -120,6 +120,9 @@ main (int argc, char **argv)
const char *pattern = "Alpha"; const char *pattern = "Alpha";
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -2,17 +2,17 @@
Copyright (C) 2005 g10 Code GmbH Copyright (C) 2005 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -50,7 +50,7 @@ read_cb (void *handle, void *buffer, size_t size)
for (; size && parms->bytes_to_send; size--, parms->bytes_to_send--) for (; size && parms->bytes_to_send; size--, parms->bytes_to_send--)
*p++ = rand (); *p++ = rand ();
return (p - (char*)buffer); return (p - (char*)buffer);
} }
@ -60,6 +60,8 @@ write_cb (void *handle, const void *buffer, size_t size)
{ {
struct cb_parms *parms = handle; struct cb_parms *parms = handle;
(void)buffer;
parms->bytes_received += size; parms->bytes_received += size;
return size; return size;
@ -70,13 +72,18 @@ static void
progress_cb (void *opaque, const char *what, int type, int current, int total) progress_cb (void *opaque, const char *what, int type, int current, int total)
{ {
/* This is just a dummy. */ /* This is just a dummy. */
(void)opaque;
(void)what;
(void)type;
(void)current;
(void)total;
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -94,7 +101,7 @@ main (int argc, char *argv[])
nbytes = 100000; nbytes = 100000;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
memset (&cbs, 0, sizeof cbs); memset (&cbs, 0, sizeof cbs);
cbs.read = read_cb; cbs.read = read_cb;
cbs.write = write_cb; cbs.write = write_cb;
@ -131,7 +138,7 @@ main (int argc, char *argv[])
result->invalid_recipients->fpr); result->invalid_recipients->fpr);
exit (1); exit (1);
} }
printf ("plaintext=%u bytes, ciphertext=%u bytes\n", printf ("plaintext=%u bytes, ciphertext=%u bytes\n",
(unsigned int)nbytes, (unsigned int)parms.bytes_received); (unsigned int)nbytes, (unsigned int)parms.bytes_received);
gpgme_key_unref (key[0]); gpgme_key_unref (key[0]);

View File

@ -34,7 +34,7 @@
that an encrypted message can be decrypted without the that an encrypted message can be decrypted without the
secret key but that the recipient is also set correctly. */ secret key but that the recipient is also set correctly. */
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;

View File

@ -94,6 +94,9 @@ main (int argc, char **argv)
gpgme_sign_result_t sign_result; gpgme_sign_result_t sign_result;
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,7 +36,7 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -47,6 +47,9 @@ main (int argc, char *argv[])
char *p; char *p;
size_t len; size_t len;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -43,6 +43,9 @@ main (int argc, char *argv[])
gpgme_key_t key[3] = { NULL, NULL, NULL }; gpgme_key_t key[3] = { NULL, NULL, NULL };
gpgme_encrypt_result_t result; gpgme_encrypt_result_t result;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -167,8 +167,8 @@ struct gpgme_io_cbs io_cbs =
}; };
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -214,7 +214,7 @@ main (int argc, char *argv[])
fputs ("Begin Result:\n", stdout); fputs ("Begin Result:\n", stdout);
print_data (out); print_data (out);
fputs ("End Result.\n", stdout); fputs ("End Result.\n", stdout);
gpgme_key_unref (key[0]); gpgme_key_unref (key[0]);
gpgme_key_unref (key[1]); gpgme_key_unref (key[1]);
gpgme_data_release (in); gpgme_data_release (in);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -35,7 +35,7 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -44,6 +44,9 @@ main (int argc, char **argv)
const char *pattern[] = { "Alpha", "Bob", NULL }; const char *pattern[] = { "Alpha", "Bob", NULL };
gpgme_key_t keyarray[3]; gpgme_key_t keyarray[3];
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -60,7 +63,7 @@ main (int argc, char **argv)
fputs ("Begin Result:\n", stdout); fputs ("Begin Result:\n", stdout);
print_data (out); print_data (out);
fputs ("End Result.\n", stdout); fputs ("End Result.\n", stdout);
gpgme_data_release (out); gpgme_data_release (out);
/* Again. Now using a key array. */ /* Again. Now using a key array. */
@ -84,11 +87,11 @@ main (int argc, char **argv)
fputs ("Begin Result:\n", stdout); fputs ("Begin Result:\n", stdout);
print_data (out); print_data (out);
fputs ("End Result.\n", stdout); fputs ("End Result.\n", stdout);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_release (ctx); gpgme_release (ctx);
return 0; return 0;
} }

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,8 +36,8 @@
#define TESTNAME "abcde12345" #define TESTNAME "abcde12345"
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -47,7 +47,7 @@ main (int argc, char *argv[])
char *agent_info; char *agent_info;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
gpgme_set_armor (ctx, 1); gpgme_set_armor (ctx, 1);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -40,6 +40,8 @@ static int progress_called;
static void static void
progress (void *self, const char *what, int type, int current, int total) progress (void *self, const char *what, int type, int current, int total)
{ {
(void)self;
if (!strcmp (what, "primegen") && !current && !total if (!strcmp (what, "primegen") && !current && !total
&& (type == '.' || type == '+' || type == '!' && (type == '.' || type == '+' || type == '!'
|| type == '^' || type == '<' || type == '>')) || type == '^' || type == '<' || type == '>'))
@ -57,7 +59,7 @@ progress (void *self, const char *what, int type, int current, int total)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -75,13 +77,16 @@ main (int argc, char **argv)
"</GnupgKeyParms>\n"; "</GnupgKeyParms>\n";
gpgme_genkey_result_t result; gpgme_genkey_result_t result;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
gpgme_set_progress_cb (ctx, progress, NULL); gpgme_set_progress_cb (ctx, progress, NULL);
err = gpgme_op_genkey (ctx, parms, NULL, NULL); err = gpgme_op_genkey (ctx, parms, NULL, NULL);
fail_if_err (err); fail_if_err (err);

View File

@ -7,12 +7,12 @@
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -172,8 +172,8 @@ dump_opt (gpgme_conf_opt_t opt)
{ {
if (opt->argname) if (opt->argname)
{ {
char *more = (opt->flags & GPGME_CONF_LIST) ? "..." : ""; const char *more = (opt->flags & GPGME_CONF_LIST) ? "..." : "";
if (opt->flags & GPGME_CONF_OPTIONAL) if (opt->flags & GPGME_CONF_OPTIONAL)
{ {
printf ("%c%c --%s [%s%s] %s", level, runtime, opt->name, opt->argname, more, printf ("%c%c --%s [%s%s] %s", level, runtime, opt->name, opt->argname, more,
@ -187,7 +187,7 @@ dump_opt (gpgme_conf_opt_t opt)
} }
else else
printf ("%c%c --%s%s", level, runtime, opt->name, spaces (opt->name, 5)); printf ("%c%c --%s%s", level, runtime, opt->name, spaces (opt->name, 5));
if (opt->description) if (opt->description)
printf ("%s", opt->description); printf ("%s", opt->description);
printf ("\n"); printf ("\n");
@ -250,8 +250,8 @@ dump_comp (gpgme_conf_comp_t comp)
} }
int int
main (int argc, char **argv) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -302,13 +302,13 @@ main (int argc, char **argv)
opt = comp->options; opt = comp->options;
while (opt && strcmp (opt->name, "verbose")) while (opt && strcmp (opt->name, "verbose"))
opt = opt->next; opt = opt->next;
/* Allow for the verbose option not to be there. */ /* Allow for the verbose option not to be there. */
if (opt) if (opt)
{ {
err = gpgme_conf_opt_change (opt, 0, arg); err = gpgme_conf_opt_change (opt, 0, arg);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_conf_save (ctx, comp); err = gpgme_op_conf_save (ctx, comp);
fail_if_err (err); fail_if_err (err);
} }

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,7 +36,7 @@
void void
check_result (gpgme_import_result_t result, char *fpr, int secret) check_result (gpgme_import_result_t result, const char *fpr, int secret)
{ {
if (result->considered != 1 && (secret && result->considered != 3)) if (result->considered != 1 && (secret && result->considered != 3))
{ {
@ -207,7 +207,7 @@ check_result (gpgme_import_result_t result, char *fpr, int secret)
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -217,6 +217,9 @@ main (int argc, char *argv[])
char *pubkey_1_asc = make_filename ("pubkey-1.asc"); char *pubkey_1_asc = make_filename ("pubkey-1.asc");
char *seckey_1_asc = make_filename ("seckey-1.asc"); char *seckey_1_asc = make_filename ("seckey-1.asc");
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -36,20 +36,20 @@
struct struct
{ {
char *fpr; const char *fpr;
char *sec_keyid; const char *sec_keyid;
struct struct
{ {
char *name; const char *name;
char *comment; const char *comment;
char *email; const char *email;
struct struct
{ {
gpgme_pubkey_algo_t algo; gpgme_pubkey_algo_t algo;
char *keyid; const char *keyid;
char *name; const char *name;
char *comment; const char *comment;
char *email; const char *email;
unsigned int sig_class; unsigned int sig_class;
int exportable; int exportable;
} sig; } sig;
@ -72,7 +72,7 @@ keys[] =
int int
main (int argc, char **argv) main (void)
{ {
gpgme_error_t err; gpgme_error_t err;
gpgme_ctx_t ctx; gpgme_ctx_t ctx;

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,13 +36,13 @@
struct key_info_s struct key_info_s
{ {
char *fpr; const char *fpr;
char *sec_keyid; const char *sec_keyid;
struct struct
{ {
char *name; const char *name;
char *comment; const char *comment;
char *email; const char *email;
} uid[3]; } uid[3];
int n_subkeys; int n_subkeys;
void (*misc_check)(struct key_info_s *keyinfo, gpgme_key_t key); void (*misc_check)(struct key_info_s *keyinfo, gpgme_key_t key);
@ -121,7 +121,7 @@ struct key_info_s keys[] =
}; };
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_error_t err; gpgme_error_t err;
@ -132,6 +132,9 @@ main (int argc, char **argv)
int n; int n;
gpgme_subkey_t subkey; gpgme_subkey_t subkey;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -139,7 +142,7 @@ main (int argc, char **argv)
err = gpgme_op_keylist_start (ctx, NULL, 0); err = gpgme_op_keylist_start (ctx, NULL, 0);
fail_if_err (err); fail_if_err (err);
while (!(err = gpgme_op_keylist_next (ctx, &key))) while (!(err = gpgme_op_keylist_next (ctx, &key)))
{ {
if (!keys[i].fpr) if (!keys[i].fpr)
@ -223,7 +226,7 @@ main (int argc, char **argv)
exit (1); exit (1);
} }
for (n=0, subkey = key->subkeys; subkey; subkey = subkey->next) for (n=0, subkey = key->subkeys; subkey; subkey = subkey->next)
n++; n++;
if (!n || n-1 != keys[i].n_subkeys) if (!n || n-1 != keys[i].n_subkeys)
{ {
@ -583,7 +586,7 @@ check_whisky (struct key_info_s *keyinfo, gpgme_key_t key)
{ {
const char *name = keyinfo->uid[0].name; const char *name = keyinfo->uid[0].name;
gpgme_subkey_t sub1, sub2; gpgme_subkey_t sub1, sub2;
sub1 = key->subkeys->next->next; sub1 = key->subkeys->next->next;
sub2 = sub1->next; sub2 = sub1->next;

View File

@ -2,17 +2,17 @@
Copyright (C) 2005 g10 Code GmbH Copyright (C) 2005 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -44,14 +44,14 @@ static struct {
const char *value; const char *value;
gpgme_sig_notation_flags_t flags; gpgme_sig_notation_flags_t flags;
int seen; int seen;
} expected_notations[] = { } expected_notations[] = {
{ "laughing@me", { "laughing@me",
"Just Squeeze Me", "Just Squeeze Me",
GPGME_SIG_NOTATION_HUMAN_READABLE }, GPGME_SIG_NOTATION_HUMAN_READABLE },
{ "preferred-email-encoding@pgp.com", { "preferred-email-encoding@pgp.com",
"pgpmime", "pgpmime",
GPGME_SIG_NOTATION_HUMAN_READABLE | GPGME_SIG_NOTATION_CRITICAL }, GPGME_SIG_NOTATION_HUMAN_READABLE | GPGME_SIG_NOTATION_CRITICAL },
{ NULL, { NULL,
"http://www.gnu.org/policy/", "http://www.gnu.org/policy/",
0 } 0 }
}; };
@ -61,7 +61,7 @@ check_result (gpgme_verify_result_t result)
{ {
int i; int i;
gpgme_sig_notation_t r; gpgme_sig_notation_t r;
gpgme_signature_t sig; gpgme_signature_t sig;
sig = result->signatures; sig = result->signatures;
@ -74,7 +74,7 @@ check_result (gpgme_verify_result_t result)
for (i=0; i < DIM(expected_notations); i++ ) for (i=0; i < DIM(expected_notations); i++ )
expected_notations[i].seen = 0; expected_notations[i].seen = 0;
for (r = result->signatures->notations; r; r = r->next) for (r = result->signatures->notations; r; r = r->next)
{ {
int any = 0; int any = 0;
@ -124,7 +124,7 @@ check_result (gpgme_verify_result_t result)
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -135,6 +135,9 @@ main (int argc, char *argv[])
int i; int i;
gpgme_engine_info_t engine_info; gpgme_engine_info_t engine_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_get_engine_info (&engine_info); err = gpgme_get_engine_info (&engine_info);
@ -172,7 +175,7 @@ main (int argc, char *argv[])
expected_notations[i].flags); expected_notations[i].flags);
fail_if_err (err); fail_if_err (err);
} }
err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_NORMAL); err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_NORMAL);
fail_if_err (err); fail_if_err (err);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -82,7 +82,7 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -91,6 +91,9 @@ main (int argc, char **argv)
gpgme_sign_result_t result; gpgme_sign_result_t result;
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -102,7 +105,7 @@ main (int argc, char **argv)
gpgme_set_textmode (ctx, 1); gpgme_set_textmode (ctx, 1);
gpgme_set_armor (ctx, 1); gpgme_set_armor (ctx, 1);
#if 0 #if 0
{ {
gpgme_key_t akey; gpgme_key_t akey;
@ -126,8 +129,8 @@ main (int argc, char **argv)
check_result (result, GPGME_SIG_MODE_NORMAL); check_result (result, GPGME_SIG_MODE_NORMAL);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -93,7 +93,7 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -103,6 +103,9 @@ main (int argc, char *argv[])
gpgme_sign_result_t result; gpgme_sign_result_t result;
char *agent_info; char *agent_info;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
@ -141,7 +144,7 @@ main (int argc, char *argv[])
check_result (result, GPGME_SIG_MODE_NORMAL); check_result (result, GPGME_SIG_MODE_NORMAL);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
@ -152,7 +155,7 @@ main (int argc, char *argv[])
check_result (result, GPGME_SIG_MODE_DETACH); check_result (result, GPGME_SIG_MODE_DETACH);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
/* And finally a cleartext signature. */ /* And finally a cleartext signature. */
gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
@ -161,10 +164,10 @@ main (int argc, char *argv[])
fail_if_err (err); fail_if_err (err);
result = gpgme_op_sign_result (ctx); result = gpgme_op_sign_result (ctx);
check_result (result, GPGME_SIG_MODE_CLEAR); check_result (result, GPGME_SIG_MODE_CLEAR);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_seek (in, 0, SEEK_SET);
gpgme_data_release (in); gpgme_data_release (in);
gpgme_release (ctx); gpgme_release (ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -61,7 +61,7 @@ print_data (gpgme_data_t dh)
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
int ret; int ret;
ret = gpgme_data_seek (dh, 0, SEEK_SET); ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret) if (ret)
fail_if_err (gpgme_err_code_from_errno (errno)); fail_if_err (gpgme_err_code_from_errno (errno));
@ -107,7 +107,7 @@ make_filename (const char *fname)
if (!srcdir) if (!srcdir)
srcdir = "."; srcdir = ".";
buf = malloc (strlen(srcdir) + strlen(fname) + 2); buf = malloc (strlen(srcdir) + strlen(fname) + 2);
if (!buf) if (!buf)
exit (8); exit (8);
strcpy (buf, srcdir); strcpy (buf, srcdir);
strcat (buf, "/"); strcat (buf, "/");

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -68,7 +68,7 @@ thread_one (void *name)
err = gpgme_get_key (ctx, "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", err = gpgme_get_key (ctx, "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2",
&key[1], 0); &key[1], 0);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_encrypt (ctx, key, GPGME_ENCRYPT_ALWAYS_TRUST, in, out); err = gpgme_op_encrypt (ctx, key, GPGME_ENCRYPT_ALWAYS_TRUST, in, out);
fail_if_err (err); fail_if_err (err);
result = gpgme_op_encrypt_result (ctx); result = gpgme_op_encrypt_result (ctx);
@ -119,7 +119,7 @@ thread_two (void *name)
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_op_decrypt (ctx, in, out); err = gpgme_op_decrypt (ctx, in, out);
fail_if_err (err); fail_if_err (err);
result = gpgme_op_decrypt_result (ctx); result = gpgme_op_decrypt_result (ctx);
@ -130,7 +130,7 @@ thread_two (void *name)
exit (1); exit (1);
} }
printf ("Decrypt %s %i\n", (char *) name, i); printf ("Decrypt %s %i\n", (char *) name, i);
gpgme_data_release (in); gpgme_data_release (in);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_release (ctx); gpgme_release (ctx);
@ -139,16 +139,18 @@ thread_two (void *name)
return NULL; return NULL;
} }
int int
main (int argc, char *argv[]) main (void)
{ {
pthread_t tone; pthread_t tone;
pthread_t ttwo; pthread_t ttwo;
char arg_A[] = "A";
char arg_B[] = "B";
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
pthread_create (&tone, NULL, thread_one, "A"); pthread_create (&tone, NULL, thread_one, arg_A);
pthread_create (&ttwo, NULL, thread_two, "B"); pthread_create (&ttwo, NULL, thread_two, arg_B);
pthread_join (tone, NULL); pthread_join (tone, NULL);
pthread_join (ttwo, NULL); pthread_join (ttwo, NULL);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -34,13 +34,16 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
gpgme_trust_item_t item; gpgme_trust_item_t item;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -77,7 +77,7 @@ static const char test_sig2[] =
"-----END PGP MESSAGE-----\n"; "-----END PGP MESSAGE-----\n";
/* A message with a prepended but unsigned plaintext packet. */ /* A message with a prepended but unsigned plaintext packet. */
static const char double_plaintext_sig[] = static const char double_plaintext_sig[] =
"-----BEGIN PGP MESSAGE-----\n" "-----BEGIN PGP MESSAGE-----\n"
"\n" "\n"
"rDRiCmZvb2Jhci50eHRF4pxNVGhpcyBpcyBteSBzbmVha3kgcGxhaW50ZXh0IG1l\n" "rDRiCmZvb2Jhci50eHRF4pxNVGhpcyBpcyBteSBzbmVha3kgcGxhaW50ZXh0IG1l\n"
@ -92,7 +92,8 @@ static const char double_plaintext_sig[] =
static void static void
check_result (gpgme_verify_result_t result, unsigned int summary, char *fpr, check_result (gpgme_verify_result_t result, unsigned int summary,
const char *fpr,
gpgme_error_t status, int notation) gpgme_error_t status, int notation)
{ {
gpgme_signature_t sig; gpgme_signature_t sig;
@ -135,7 +136,7 @@ check_result (gpgme_verify_result_t result, unsigned int summary, char *fpr,
" das waren Umlaute und jetzt ein prozent%-Zeichen" }, " das waren Umlaute und jetzt ein prozent%-Zeichen" },
{ "foobar.1", { "foobar.1",
"this is a notation data with 2 lines" }, "this is a notation data with 2 lines" },
{ NULL, { NULL,
"http://www.gu.org/policy/" } "http://www.gu.org/policy/" }
}; };
int i; int i;
@ -201,7 +202,7 @@ check_result (gpgme_verify_result_t result, unsigned int summary, char *fpr,
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -209,6 +210,9 @@ main (int argc, char *argv[])
gpgme_data_t sig, text; gpgme_data_t sig, text;
gpgme_verify_result_t result; gpgme_verify_result_t result;
(void)argc;
(void)argv;
init_gpgme (GPGME_PROTOCOL_OpenPGP); init_gpgme (GPGME_PROTOCOL_OpenPGP);
err = gpgme_new (&ctx); err = gpgme_new (&ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -38,8 +38,8 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -48,8 +48,8 @@ static const char test_cip1[] =
"-----END CMS OBJECT-----\n"; "-----END CMS OBJECT-----\n";
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -78,7 +78,7 @@ main (int argc, char *argv[])
exit (1); exit (1);
} }
print_data (out); print_data (out);
gpgme_data_release (in); gpgme_data_release (in);
gpgme_data_release (out); gpgme_data_release (out);
gpgme_release (ctx); gpgme_release (ctx);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -33,8 +33,8 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char **argv) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -54,7 +54,7 @@ main (int argc, char **argv)
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);
err = gpgme_get_key (ctx, "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E", err = gpgme_get_key (ctx, "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E",
&key[0], 0); &key[0], 0);
fail_if_err (err); fail_if_err (err);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -34,15 +34,15 @@
#include "t-support.h" #include "t-support.h"
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
gpgme_data_t out; gpgme_data_t out;
const char *pattern1[] = { "DFN Top Level Certification Authority", NULL }; const char *pattern1[] = { "DFN Top Level Certification Authority", NULL };
const char *pattern2[] = { "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E", const char *pattern2[] = { "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E",
"DFN Server Certification Authority", "DFN Server Certification Authority",
NULL }; NULL };
init_gpgme (GPGME_PROTOCOL_CMS); init_gpgme (GPGME_PROTOCOL_CMS);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -40,6 +40,8 @@ static int progress_called;
static void static void
progress (void *self, const char *what, int type, int current, int total) progress (void *self, const char *what, int type, int current, int total)
{ {
(void)self;
if (!strcmp (what, "primegen") && !current && !total if (!strcmp (what, "primegen") && !current && !total
&& (type == '.' || type == '+' || type == '!' && (type == '.' || type == '+' || type == '!'
|| type == '^' || type == '<' || type == '>')) || type == '^' || type == '<' || type == '>'))
@ -57,8 +59,8 @@ progress (void *self, const char *what, int type, int current, int total)
} }
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -83,7 +85,7 @@ main (int argc, char *argv[])
gpgme_set_armor (ctx, 1); gpgme_set_armor (ctx, 1);
gpgme_set_progress_cb (ctx, progress, NULL); gpgme_set_progress_cb (ctx, progress, NULL);
err = gpgme_op_genkey (ctx, parms, certreq, NULL); err = gpgme_op_genkey (ctx, parms, certreq, NULL);
fail_if_err (err); fail_if_err (err);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,9 +36,11 @@
void void
check_result (gpgme_import_result_t result, char *fpr, int total, check_result (gpgme_import_result_t result, const char *fpr, int total,
int total_stat) int total_stat)
{ {
(void)fpr;
if (result->considered != total) if (result->considered != total)
{ {
fprintf (stderr, "Unexpected number of considered keys %i\n", fprintf (stderr, "Unexpected number of considered keys %i\n",
@ -118,14 +120,14 @@ check_result (gpgme_import_result_t result, char *fpr, int total,
result->not_imported); result->not_imported);
exit (1); exit (1);
} }
{ {
int n; int n;
gpgme_import_status_t r; gpgme_import_status_t r;
for (n=0, r=result->imports; r; r=r->next) for (n=0, r=result->imports; r; r=r->next)
n++; n++;
if (n != total_stat) if (n != total_stat)
{ {
fprintf (stderr, "Unexpected number of status reports\n"); fprintf (stderr, "Unexpected number of status reports\n");
@ -135,8 +137,8 @@ check_result (gpgme_import_result_t result, char *fpr, int total,
} }
int int
main (int argc, char **argv) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -149,7 +151,7 @@ main (int argc, char **argv)
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS); gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
err = gpgme_data_new_from_file (&in, cert_1, 1); err = gpgme_data_new_from_file (&in, cert_1, 1);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -36,15 +36,15 @@
struct struct
{ {
char *fpr; const char *fpr;
int secret; int secret;
long timestamp; long timestamp;
long expires; long expires;
char *issuer_serial; const char *issuer_serial;
char *issuer_name; const char *issuer_name;
char *chain_id; const char *chain_id;
char *uid; const char *uid;
char *email; const char *email;
gpgme_validity_t validity; gpgme_validity_t validity;
unsigned int key_length; unsigned int key_length;
} }
@ -80,8 +80,8 @@ keys[] =
}; };
int int
main (int argc, char **argv) main (void)
{ {
gpgme_error_t err; gpgme_error_t err;
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
@ -97,7 +97,7 @@ main (int argc, char **argv)
err = gpgme_op_keylist_start (ctx, NULL, 0); err = gpgme_op_keylist_start (ctx, NULL, 0);
fail_if_err (err); fail_if_err (err);
while (!(err = gpgme_op_keylist_next (ctx, &key))) while (!(err = gpgme_op_keylist_next (ctx, &key)))
{ {
if (!keys[i].fpr) if (!keys[i].fpr)

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -80,8 +80,8 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
} }
int int
main (int argc, char *argv[]) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -109,8 +109,8 @@ main (int argc, char *argv[])
check_result (result, GPGME_SIG_MODE_NORMAL); check_result (result, GPGME_SIG_MODE_NORMAL);
print_data (out); print_data (out);
gpgme_data_release (out); gpgme_data_release (out);
/* Now a detached signature. */ /* Now a detached signature. */
gpgme_data_seek (in, 0, SEEK_SET); gpgme_data_seek (in, 0, SEEK_SET);
err = gpgme_data_new (&out); err = gpgme_data_new (&out);
fail_if_err (err); fail_if_err (err);

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -47,7 +47,7 @@ print_data (gpgme_data_t dh)
#define BUF_SIZE 512 #define BUF_SIZE 512
char buf[BUF_SIZE + 1]; char buf[BUF_SIZE + 1];
int ret; int ret;
ret = gpgme_data_seek (dh, 0, SEEK_SET); ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret) if (ret)
fail_if_err (gpgme_error_from_errno (errno)); fail_if_err (gpgme_error_from_errno (errno));
@ -93,7 +93,7 @@ make_filename (const char *fname)
if (!srcdir) if (!srcdir)
srcdir = "."; srcdir = ".";
buf = malloc (strlen(srcdir) + strlen(fname) + 2); buf = malloc (strlen(srcdir) + strlen(fname) + 2);
if (!buf) if (!buf)
exit (8); exit (8);
strcpy (buf, srcdir); strcpy (buf, srcdir);
strcat (buf, "/"); strcat (buf, "/");

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME. This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -52,7 +52,7 @@ static const char test_sig1[] =
static void static void
check_result (gpgme_verify_result_t result, int summary, char *fpr, check_result (gpgme_verify_result_t result, int summary, const char *fpr,
gpgme_error_t status, gpgme_validity_t validity) gpgme_error_t status, gpgme_validity_t validity)
{ {
gpgme_signature_t sig; gpgme_signature_t sig;
@ -134,8 +134,8 @@ show_auditlog (gpgme_ctx_t ctx)
int int
main (int argc, char **argv) main (void)
{ {
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
gpgme_error_t err; gpgme_error_t err;
@ -147,7 +147,7 @@ main (int argc, char **argv)
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS); gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
/* Checking a valid message. */ /* Checking a valid message. */
err = gpgme_data_new_from_mem (&text, test_text1, strlen (test_text1), 0); err = gpgme_data_new_from_mem (&text, test_text1, strlen (test_text1), 0);
fail_if_err (err); fail_if_err (err);
@ -179,6 +179,6 @@ main (int argc, char **argv)
gpgme_data_release (text); gpgme_data_release (text);
gpgme_data_release (sig); gpgme_data_release (sig);
gpgme_release (ctx); gpgme_release (ctx);
return got_errors? 1 : 0; return got_errors? 1 : 0;
} }

View File

@ -7,12 +7,12 @@
under the terms of the GNU Lesser General Public License as under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version. the License, or (at your option) any later version.
GPGME is distributed in the hope that it will be useful, but GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -46,9 +46,12 @@
static gpgme_error_t static gpgme_error_t
data_cb (void *opaque, const void *data, size_t datalen) data_cb (void *opaque, const void *data, size_t datalen)
{ {
(void)opaque;
(void)data;
printf ("DATA_CB: datalen=%d\n", (int)datalen); printf ("DATA_CB: datalen=%d\n", (int)datalen);
return 0; return 0;
} }
static gpgme_error_t static gpgme_error_t
@ -58,12 +61,14 @@ inq_cb (void *opaque, const char *name, const char *args,
gpgme_data_t data; gpgme_data_t data;
gpgme_error_t err; gpgme_error_t err;
(void)opaque;
if (name) if (name)
{ {
printf ("INQ_CB: name=`%s' args=`%s'\n", name, args); printf ("INQ_CB: name=`%s' args=`%s'\n", name, args);
/* There shall be no data object. */ /* There shall be no data object. */
assert (!*r_data); assert (!*r_data);
err = gpgme_data_new (&data); err = gpgme_data_new (&data);
fail_if_err (err); fail_if_err (err);
*r_data = data; *r_data = data;
@ -85,19 +90,21 @@ inq_cb (void *opaque, const char *name, const char *args,
return 0; return 0;
} }
static gpgme_error_t static gpgme_error_t
status_cb (void *opaque, const char *status, const char *args) status_cb (void *opaque, const char *status, const char *args)
{ {
(void)opaque;
printf ("STATUS_CB: status=`%s' args=`%s'\n", status, args); printf ("STATUS_CB: status=`%s' args=`%s'\n", status, args);
return 0; return 0;
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
gpgme_error_t err; gpgme_error_t err;
@ -118,7 +125,7 @@ main (int argc, char **argv)
argv++; argv++;
} }
command = argc? *argv : "NOP"; command = argc? *argv : "NOP";
err = gpgme_new (&ctx); err = gpgme_new (&ctx);
fail_if_err (err); fail_if_err (err);

View File

@ -51,6 +51,8 @@ print_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
gpgme_invalid_key_t invkey; gpgme_invalid_key_t invkey;
gpgme_new_signature_t sig; gpgme_new_signature_t sig;
(void)type;
for (invkey = result->invalid_signers; invkey; invkey = invkey->next) for (invkey = result->invalid_signers; invkey; invkey = invkey->next)
printf ("Signing key `%s' not used: %s <%s>\n", printf ("Signing key `%s' not used: %s <%s>\n",
nonnull (invkey->fpr), nonnull (invkey->fpr),

View File

@ -86,6 +86,8 @@ read_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
unsigned int amount = strlen (text) - off; unsigned int amount = strlen (text) - off;
/* round_t round = *((round_t *) cb_value); */ /* round_t round = *((round_t *) cb_value); */
(void)cb_value;
if (!buffer && !count && !nread) if (!buffer && !count && !nread)
{ {
/* Rewind requested. */ /* Rewind requested. */
@ -190,8 +192,9 @@ write_test (round_t round, gpgme_data_t data)
} }
} }
int int
main (int argc, char **argv) main (void)
{ {
round_t round = TEST_INITIALIZER; round_t round = TEST_INITIALIZER;
char *text_filename = make_filename ("t-data-1.txt"); char *text_filename = make_filename ("t-data-1.txt");