diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 63e16155..03c72d3f 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,29 +1,34 @@ 2001-01-30 Werner Koch + * signers.c (gpgme_signers_add): Ooops, one should test code and + not just write it; the newarr was not assigned. Thanks to José + for pointing this out. Hmmm, still not tested, why shoudl a coder + test his fix :-) + * w32-io.c: Does now use reader threads, so that we can use WaitForMultipleObjects. * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections. Does currently only work for W32. * debug.c, util.h : New. Changed all fprintfs to use this new set of debugging functions. 2001-01-23 Werner Koch * data.c (_gpgme_data_release_and_return_string): Fixed string termination. 2001-01-22 Werner Koch * delete.c: New. * signers.c: New. * key.c (gpgme_key_ref, gpgme_key_unref): New. * sign.c (gpgme_op_sign_start): Allow the use of other keys. * version.c (gpgme_get_engine_info,gpgme_check_engine): New. * rungpg.c (_gpgme_gpg_set_simple_line_handler): New. 2001-01-05 Werner Koch * data.c (gpgme_data_rewind): Allow to rewind data_type_none. diff --git a/trunk/gpgme/gpgme-memory.h b/trunk/gpgme/gpgme-memory.h deleted file mode 100644 index 76ff3880..00000000 --- a/trunk/gpgme/gpgme-memory.h +++ /dev/null @@ -1,36 +0,0 @@ -/* gpgme-memory.h - * Copyright (C) 2000 Werner Koch (dd9jn) - * - * This file is part of GPGME. - * - * GPGME is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GPGME is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifndef GPGME_MEMORY_H -#define GPGME_MEMORY_H - -void *xmalloc ( size_t n ); -void *xtrymalloc (size_t n ); -void *xcalloc ( size_t n, size_t m ); -void *xtrycalloc (size_t n, size_t m ); -void *xrealloc (void *p, size_t n); -void *xtryrealloc (void *p, size_t n); -void xfree ( void *a ); - -#endif /* GPGME_MEMORY_H */ - - - - diff --git a/trunk/gpgme/gpgme-types.h b/trunk/gpgme/gpgme-types.h deleted file mode 100644 index e20e758c..00000000 --- a/trunk/gpgme/gpgme-types.h +++ /dev/null @@ -1,38 +0,0 @@ -/* gpgme-types.h - GnuPG Made Easy - * Copyright (C) 2000 Werner Koch (dd9jn) - * - * This file is part of GPGME. - * - * GPGME is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GPGME is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifndef GPGME_TYPES_H -#define GPGME_TYPES_H - -#include "gpgme.h" - -struct gpgme_context_s { - int initialized; -}; - - - - -#endif /* GPGME_TYPES_H */ - - - - - diff --git a/trunk/gpgme/signers.c b/trunk/gpgme/signers.c index 70c3a004..6432b8f0 100644 --- a/trunk/gpgme/signers.c +++ b/trunk/gpgme/signers.c @@ -1,105 +1,107 @@ /* signers.c - maintain signer sets * Copyright (C) 2001 Werner Koch (dd9jn) * * This file is part of GPGME. * * GPGME is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GPGME is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include "util.h" #include "context.h" #include "rungpg.h" /* The signers are directly stored in the context. * So this is quite different to a recipient set. */ void gpgme_signers_clear (GpgmeCtx c) { int i; return_if_fail (c); if (!c->signers) return; for (i=0; i < c->signers_size; i++ ) { if (!c->signers[i]) break; gpgme_key_unref (c->signers[i]); c->signers[i] = NULL; } } GpgmeError gpgme_signers_add (GpgmeCtx c, const GpgmeKey key) { int i = 0; if (!c || !key) return mk_error (Invalid_Value); if (!c->signers) c->signers_size = 0; for (i=0; i < c->signers_size && c->signers[i]; i++ ) ; if ( !(i < c->signers_size) ) { GpgmeKey *newarr; int j; int n = c->signers_size + 5; newarr = xtrycalloc ( n, sizeof *newarr ); if ( !newarr ) return mk_error (Out_Of_Core); for (j=0; j < c->signers_size; j++ ) newarr[j] = c->signers[j]; c->signers_size = n; + xfree (c->signers); + c->signers = newarr; } gpgme_key_ref (key); c->signers[i] = key; return 0; } GpgmeKey gpgme_signers_enum (const GpgmeCtx c, int seq ) { int i; return_null_if_fail (c); return_null_if_fail (seq>=0); if (!c->signers) c->signers_size = 0; for (i=0; i < c->signers_size && c->signers[i]; i++ ) { if (i==seq) { gpgme_key_ref (c->signers[i]); return c->signers[i]; } } return NULL; }