Remove all trailing whitespace from source files

--
Command used:  sed -i 's,[ \t]*$,,' FILE
This commit is contained in:
Werner Koch 2012-09-25 15:29:49 +02:00
parent 83e74202cd
commit 139e798c87
83 changed files with 726 additions and 726 deletions

View File

@ -1,18 +1,18 @@
# Makefile.am for gpgme/lang. # Makefile.am for gpgme/lang.
# Copyright (C) 2003, 2006 g10 Code GmbH # Copyright (C) 2003, 2006 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 the # published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version. # License, or (at your option) any later version.
# #
# GPGME is distributed in the hope that it will be useful, but WITHOUT # GPGME is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
# Public License for more details. # 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 02111-1307, USA # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

View File

@ -200,7 +200,7 @@ my_waitpid (assuan_context_t ctx, pid_t pid,
NOWAIT in POSIX systems just means the caller already did the NOWAIT in POSIX systems just means the caller already did the
waitpid for this child. */ waitpid for this child. */
if (! nowait) if (! nowait)
return _gpgme_ath_waitpid (pid, status, options); return _gpgme_ath_waitpid (pid, status, options);
#endif #endif
return 0; return 0;
} }

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004 g10 Code GmbH Copyright (C) 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
@ -151,7 +151,7 @@ ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
return select (nfd, rset, wset, eset, timeout); return select (nfd, rset, wset, eset, timeout);
} }
ssize_t ssize_t
ath_waitpid (pid_t pid, int *status, int options) ath_waitpid (pid_t pid, int *status, int options)
{ {

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004 g10 Code GmbH Copyright (C) 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
@ -158,7 +158,7 @@ ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
#endif #endif
} }
ssize_t ssize_t
ath_waitpid (pid_t pid, int *status, int options) ath_waitpid (pid_t pid, int *status, int options)
{ {

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004 g10 Code GmbH Copyright (C) 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

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2005, 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,18 +1,18 @@
/* data-compat.c - Compatibility interfaces for data objects. /* data-compat.c - Compatibility interfaces for data objects.
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2002, 2003, 2004, 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

View File

@ -1,18 +1,18 @@
/* data-fd.c - A file descripor based data object. /* data-fd.c - A file descripor based data object.
Copyright (C) 2002, 2004 g10 Code GmbH Copyright (C) 2002, 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

View File

@ -1,18 +1,18 @@
/* data-mem.c - A memory based data object. /* data-mem.c - A memory based data object.
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2002, 2003, 2004, 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
@ -72,7 +72,7 @@ mem_write (gpgme_data_t dh, const void *buffer, size_t size)
return -1; return -1;
memcpy (new_buffer, dh->data.mem.orig_buffer, dh->data.mem.length); memcpy (new_buffer, dh->data.mem.orig_buffer, dh->data.mem.length);
dh->data.mem.buffer = new_buffer; dh->data.mem.buffer = new_buffer;
dh->data.mem.size = new_size; dh->data.mem.size = new_size;
} }
@ -124,7 +124,7 @@ mem_seek (gpgme_data_t dh, off_t offset, int whence)
break; break;
case SEEK_CUR: case SEEK_CUR:
if ((offset > 0 && dh->data.mem.length - dh->data.mem.offset < offset) if ((offset > 0 && dh->data.mem.length - dh->data.mem.offset < offset)
|| (offset < 0 && dh->data.mem.offset < -offset)) || (offset < 0 && dh->data.mem.offset < -offset))
{ {
gpg_err_set_errno (EINVAL); gpg_err_set_errno (EINVAL);
return -1; return -1;
@ -211,7 +211,7 @@ gpgme_data_new_from_mem (gpgme_data_t *r_dh, const char *buffer,
} }
else else
(*r_dh)->data.mem.orig_buffer = buffer; (*r_dh)->data.mem.orig_buffer = buffer;
(*r_dh)->data.mem.size = size; (*r_dh)->data.mem.size = size;
(*r_dh)->data.mem.length = size; (*r_dh)->data.mem.length = size;
return TRACE_SUC1 ("dh=%p", *r_dh); return TRACE_SUC1 ("dh=%p", *r_dh);

View File

@ -1,18 +1,18 @@
/* data-stream.c - A stream based data object. /* data-stream.c - A stream based data object.
Copyright (C) 2002, 2004 g10 Code GmbH Copyright (C) 2002, 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

View File

@ -1,18 +1,18 @@
/* data-user.c - A user callback based data object. /* data-user.c - A user callback based data object.
Copyright (C) 2002, 2004 g10 Code GmbH Copyright (C) 2002, 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

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004, 2005, 2007 g10 Code GmbH Copyright (C) 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

View File

@ -1,18 +1,18 @@
/* data.h - Internal data object abstraction interface. /* data.h - Internal data object abstraction interface.
Copyright (C) 2002, 2004, 2005 g10 Code GmbH Copyright (C) 2002, 2004, 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

View File

@ -1,22 +1,22 @@
/* debug.c - helpful output in desperate situations /* debug.c - helpful output in desperate situations
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 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., 51 Franklin Street, Fifth Floor, Boston, Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */ MA 02110-1301, USA. */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
@ -205,7 +205,7 @@ _gpgme_debug (int level, const char *format, ...)
saved_errno = errno; saved_errno = errno;
if (debug_level < level) if (debug_level < level)
return; return;
va_start (arg_ptr, format); va_start (arg_ptr, format);
LOCK (debug_lock); LOCK (debug_lock);
{ {
@ -220,7 +220,7 @@ _gpgme_debug (int level, const char *format, ...)
#else #else
struct tm *tp; struct tm *tp;
time_t atime = time (NULL); time_t atime = time (NULL);
tp = localtime (&atime); tp = localtime (&atime);
fprintf (errfp, "GPGME %04d-%02d-%02d %02d:%02d:%02d <0x%04llx> ", fprintf (errfp, "GPGME %04d-%02d-%02d %02d:%02d:%02d <0x%04llx> ",
1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday, 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
@ -342,7 +342,7 @@ _gpgme_debug_buffer (int lvl, const char *const fmt,
char str[51]; char str[51];
char *strp = str; char *strp = str;
char *strp2 = &str[34]; char *strp2 = &str[34];
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
unsigned char val; unsigned char val;

View File

@ -1,18 +1,18 @@
/* debug.h - interface to debugging functions /* debug.h - interface to debugging functions
Copyright (C) 2002, 2004, 2005, 2007 g10 Code GmbH Copyright (C) 2002, 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
@ -245,7 +245,7 @@ void _gpgme_debug_frame_end (void);
#define TRACE_SEQ(hlp,fmt) \ #define TRACE_SEQ(hlp,fmt) \
_gpgme_debug_begin (&(hlp), _gpgme_trace_level, \ _gpgme_debug_begin (&(hlp), _gpgme_trace_level, \
"%s: check: %s=%p, " fmt, _gpgme_trace_func, \ "%s: check: %s=%p, " fmt, _gpgme_trace_func, \
_gpgme_trace_tagname, _gpgme_trace_tag) _gpgme_trace_tagname, _gpgme_trace_tag)
#define TRACE_ADD0(hlp,fmt) \ #define TRACE_ADD0(hlp,fmt) \
_gpgme_debug_add (&(hlp), fmt) _gpgme_debug_add (&(hlp), fmt)
#define TRACE_ADD1(hlp,fmt,a) \ #define TRACE_ADD1(hlp,fmt,a) \

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
@ -76,7 +76,7 @@ decrypt_verify_start (gpgme_ctx_t ctx, int synchronous,
_gpgme_engine_set_status_handler (ctx->engine, _gpgme_engine_set_status_handler (ctx->engine,
decrypt_verify_status_handler, ctx); decrypt_verify_status_handler, ctx);
return _gpgme_engine_op_decrypt_verify (ctx->engine, cipher, plain); return _gpgme_engine_op_decrypt_verify (ctx->engine, cipher, plain);
} }
@ -94,7 +94,7 @@ gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = decrypt_verify_start (ctx, 0, cipher, plain); err = decrypt_verify_start (ctx, 0, cipher, plain);
return TRACE_ERR (err); return TRACE_ERR (err);
} }
@ -113,7 +113,7 @@ gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = decrypt_verify_start (ctx, 1, cipher, plain); err = decrypt_verify_start (ctx, 1, cipher, plain);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);

View File

@ -377,7 +377,7 @@ gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = decrypt_start (ctx, 0, cipher, plain); err = decrypt_start (ctx, 0, cipher, plain);
return TRACE_ERR (err); return TRACE_ERR (err);
} }
@ -395,7 +395,7 @@ gpgme_op_decrypt (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = decrypt_start (ctx, 1, cipher, plain); err = decrypt_start (ctx, 1, cipher, plain);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);

View File

@ -2,17 +2,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
@ -98,12 +98,12 @@ gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key,
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx, TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx,
"key=%p (%s), allow_secret=%i", key, "key=%p (%s), allow_secret=%i", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret); key->subkeys->fpr : "invalid", allow_secret);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = delete_start (ctx, 0, key, allow_secret); err = delete_start (ctx, 0, key, allow_secret);
return TRACE_ERR (err); return TRACE_ERR (err);
} }
@ -118,12 +118,12 @@ gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret)
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx, TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx,
"key=%p (%s), allow_secret=%i", key, "key=%p (%s), allow_secret=%i", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret); key->subkeys->fpr : "invalid", allow_secret);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = delete_start (ctx, 1, key, allow_secret); err = delete_start (ctx, 1, key, allow_secret);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);

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/>.
*/ */
@ -33,7 +33,7 @@
DEFINE_STATIC_LOCK (dirinfo_lock); DEFINE_STATIC_LOCK (dirinfo_lock);
/* Constants used internally to select the data. */ /* Constants used internally to select the data. */
enum enum
{ {
WANT_HOMEDIR, WANT_HOMEDIR,
WANT_AGENT_SOCKET WANT_AGENT_SOCKET
@ -65,7 +65,7 @@ parse_output (char *line)
return; return;
if (!*value) if (!*value)
return; return;
if (!strcmp (line, "homedir") && !dirinfo.homedir) if (!strcmp (line, "homedir") && !dirinfo.homedir)
dirinfo.homedir = strdup (value); dirinfo.homedir = strdup (value);
else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket) else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket)
@ -76,7 +76,7 @@ parse_output (char *line)
/* Read the directory information from gpgconf. This function expects /* Read the directory information from gpgconf. This function expects
that DIRINFO_LOCK is held by the caller. */ that DIRINFO_LOCK is held by the caller. */
static void static void
read_gpgconf_dirs (void) read_gpgconf_dirs (void)
{ {
const char *pgmname; const char *pgmname;
char linebuf[1024] = {0}; char linebuf[1024] = {0};
@ -112,8 +112,8 @@ read_gpgconf_dirs (void)
do do
{ {
nread = _gpgme_io_read (rp[0], nread = _gpgme_io_read (rp[0],
linebuf + linelen, linebuf + linelen,
sizeof linebuf - linelen - 1); sizeof linebuf - linelen - 1);
if (nread > 0) if (nread > 0)
{ {
@ -141,7 +141,7 @@ read_gpgconf_dirs (void)
} }
} }
while (nread > 0 && linelen < sizeof linebuf - 1); while (nread > 0 && linelen < sizeof linebuf - 1);
_gpgme_io_close (rp[0]); _gpgme_io_close (rp[0]);
} }

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004 g10 Code GmbH Copyright (C) 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
@ -143,12 +143,12 @@ gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit_start", ctx, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit_start", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out); key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out); err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
return err; return err;
} }
@ -164,12 +164,12 @@ gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit", ctx, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out); key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out); err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
if (!err) if (!err)
@ -187,12 +187,12 @@ gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit_start", ctx, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit_start", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out); key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out); err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
return err; return err;
} }
@ -208,12 +208,12 @@ gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit", ctx, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ? (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out); key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out); err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
if (!err) if (!err)
err = _gpgme_wait_one (ctx); err = _gpgme_wait_one (ctx);

View File

@ -1,19 +1,19 @@
/* encrypt-sign.c - encrypt and verify functions /* encrypt-sign.c - encrypt and verify functions
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
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
@ -80,7 +80,7 @@ encrypt_sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t recp[],
_gpgme_engine_set_status_handler (ctx->engine, _gpgme_engine_set_status_handler (ctx->engine,
encrypt_sign_status_handler, ctx); encrypt_sign_status_handler, ctx);
return _gpgme_engine_op_encrypt_sign (ctx->engine, recp, flags, plain, return _gpgme_engine_op_encrypt_sign (ctx->engine, recp, flags, plain,
cipher, ctx->use_armor, cipher, ctx->use_armor,
ctx /* FIXME */); ctx /* FIXME */);
@ -102,7 +102,7 @@ gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp) if (_gpgme_debug_trace () && recp)
{ {
int i = 0; int i = 0;
@ -110,7 +110,7 @@ gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
while (recp[i]) while (recp[i])
{ {
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
(recp[i]->subkeys && recp[i]->subkeys->fpr) ? (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid"); recp[i]->subkeys->fpr : "invalid");
i++; i++;
} }
@ -136,7 +136,7 @@ gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[],
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp) if (_gpgme_debug_trace () && recp)
{ {
int i = 0; int i = 0;
@ -144,7 +144,7 @@ gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[],
while (recp[i]) while (recp[i])
{ {
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
(recp[i]->subkeys && recp[i]->subkeys->fpr) ? (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid"); recp[i]->subkeys->fpr : "invalid");
i++; i++;
} }

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
@ -92,7 +92,7 @@ gpgme_op_encrypt_result (gpgme_ctx_t ctx)
i++; i++;
} }
} }
TRACE_SUC1 ("result=%p", &opd->result); TRACE_SUC1 ("result=%p", &opd->result);
return &opd->result; return &opd->result;
} }
@ -234,7 +234,7 @@ gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && recp) if (_gpgme_debug_trace () && recp)
{ {
int i = 0; int i = 0;
@ -242,7 +242,7 @@ gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
while (recp[i]) while (recp[i])
{ {
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
(recp[i]->subkeys && recp[i]->subkeys->fpr) ? (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid"); recp[i]->subkeys->fpr : "invalid");
i++; i++;
} }
@ -275,7 +275,7 @@ gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[],
while (recp[i]) while (recp[i])
{ {
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
(recp[i]->subkeys && recp[i]->subkeys->fpr) ? (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid"); recp[i]->subkeys->fpr : "invalid");
i++; i++;
} }

View File

@ -210,7 +210,7 @@ llass_release (void *engine)
/* Create a new instance. If HOME_DIR is NULL standard options for use /* Create a new instance. If HOME_DIR is NULL standard options for use
with gpg-agent are issued. */ with gpg-agent are issued. */
static gpgme_error_t static gpgme_error_t
llass_new (void **engine, const char *file_name, const char *home_dir) llass_new (void **engine, const char *file_name, const char *home_dir)
{ {
@ -234,7 +234,7 @@ llass_new (void **engine, const char *file_name, const char *home_dir)
/* Very simple parser only working for the one option we support. */ /* Very simple parser only working for the one option we support. */
/* Note that wk promised to write a regression test if this /* Note that wk promised to write a regression test if this
parser will be extended. */ parser will be extended. */
if (!strncmp (home_dir, "GPG_AGENT", 9) if (!strncmp (home_dir, "GPG_AGENT", 9)
&& (!home_dir[9] || home_dir[9] == ' ')) && (!home_dir[9] || home_dir[9] == ' '))
llass->opt.gpg_agent = 1; llass->opt.gpg_agent = 1;
} }
@ -312,7 +312,7 @@ llass_new (void **engine, const char *file_name, const char *home_dir)
goto leave; goto leave;
} }
free (dft_ttytype); free (dft_ttytype);
err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL, err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL,
NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
free (optstr); free (optstr);
@ -463,7 +463,7 @@ llass_status_handler (void *opaque, int fd)
err = 0; err = 0;
continue; continue;
} }
TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass, TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass,
"fd 0x%x: error reading assuan line: %s", "fd 0x%x: error reading assuan line: %s",
fd, gpg_strerror (err)); fd, gpg_strerror (err));
@ -561,7 +561,7 @@ llass_status_handler (void *opaque, int fd)
args++; args++;
err = inquire_cb (llass, src, args); err = inquire_cb (llass, src, args);
if (!err) if (!err)
{ {
/* Flush and send END. */ /* Flush and send END. */
err = assuan_send_data (llass->assuan_ctx, NULL, 0); err = assuan_send_data (llass->assuan_ctx, NULL, 0);

View File

@ -1,18 +1,18 @@
/* engine-backend.h - A crypto backend for the engine interface. /* engine-backend.h - A crypto backend for the engine interface.
Copyright (C) 2002, 2003, 2004, 2009 g10 Code GmbH Copyright (C) 2002, 2003, 2004, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -98,7 +98,7 @@ struct engine_ops
gpgme_data_t signed_text, gpgme_data_t plaintext); gpgme_data_t signed_text, gpgme_data_t plaintext);
gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output, gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output,
unsigned int flags); unsigned int flags);
gpgme_error_t (*opassuan_transact) (void *engine, gpgme_error_t (*opassuan_transact) (void *engine,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,

View File

@ -1,19 +1,19 @@
/* engine-g13.c - G13 engine. /* engine-g13.c - G13 engine.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 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
@ -91,7 +91,7 @@ struct engine_g13
typedef struct engine_g13 *engine_g13_t; typedef struct engine_g13 *engine_g13_t;
static void g13_io_event (void *engine, static void g13_io_event (void *engine,
gpgme_event_io_t type, void *type_data); gpgme_event_io_t type, void *type_data);
@ -386,7 +386,7 @@ g13_set_locale (void *engine, int category, const char *value)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
/* FIXME: Reset value to default. */ /* FIXME: Reset value to default. */
if (!value) if (!value)
return 0; return 0;
if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0) if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
@ -487,7 +487,7 @@ status_handler (void *opaque, int fd)
TRACE2 (DEBUG_CTX, "gpgme:status_handler", g13, TRACE2 (DEBUG_CTX, "gpgme:status_handler", g13,
"fd 0x%x: ERR line: %s", "fd 0x%x: ERR line: %s",
fd, err ? gpg_strerror (err) : "ok"); fd, err ? gpg_strerror (err) : "ok");
/* Command execution errors are not fatal, as we use /* Command execution errors are not fatal, as we use
a session based protocol. */ a session based protocol. */
data->op_err = err; data->op_err = err;
@ -557,7 +557,7 @@ status_handler (void *opaque, int fd)
src = line + 2; src = line + 2;
while (*src == ' ') while (*src == ' ')
src++; src++;
args = strchr (line + 2, ' '); args = strchr (line + 2, ' ');
if (!args) if (!args)
args = line + linelen; /* set to an empty string */ args = line + linelen; /* set to an empty string */
@ -581,12 +581,12 @@ status_handler (void *opaque, int fd)
else if (linelen >= 7 else if (linelen >= 7
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q' && line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R' && line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
&& line[6] == 'E' && line[6] == 'E'
&& (line[7] == '\0' || line[7] == ' ')) && (line[7] == '\0' || line[7] == ' '))
{ {
char *src; char *src;
char *args; char *args;
for (src=line+7; *src == ' '; src++) for (src=line+7; *src == ' '; src++)
; ;
@ -600,7 +600,7 @@ status_handler (void *opaque, int fd)
args++; args++;
err = default_inq_cb (g13, src, args); err = default_inq_cb (g13, src, args);
if (!err) if (!err)
{ {
/* Flush and send END. */ /* Flush and send END. */
err = assuan_send_data (g13->assuan_ctx, NULL, 0); err = assuan_send_data (g13->assuan_ctx, NULL, 0);
@ -614,10 +614,10 @@ status_handler (void *opaque, int fd)
} }
} }
while (!err && assuan_pending_line (g13->assuan_ctx)); while (!err && assuan_pending_line (g13->assuan_ctx));
return err; return err;
} }
static gpgme_error_t static gpgme_error_t
add_io_cb (engine_g13_t g13, iocb_data_t *iocbd, gpgme_io_cb_t handler) add_io_cb (engine_g13_t g13, iocb_data_t *iocbd, gpgme_io_cb_t handler)

View File

@ -2,19 +2,19 @@
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2009, 2010, 2012 g10 Code GmbH 2009, 2010, 2012 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -87,7 +87,7 @@ struct engine_gpg
struct struct
{ {
int fd[2]; int fd[2];
int arg_loc; int arg_loc;
size_t bufsize; size_t bufsize;
char *buffer; char *buffer;
@ -101,7 +101,7 @@ struct engine_gpg
/* This is a kludge - see the comment at colon_line_handler. */ /* This is a kludge - see the comment at colon_line_handler. */
struct struct
{ {
int fd[2]; int fd[2];
int arg_loc; int arg_loc;
size_t bufsize; size_t bufsize;
char *buffer; char *buffer;
@ -113,7 +113,7 @@ struct engine_gpg
colon_preprocessor_t preprocess_fnc; colon_preprocessor_t preprocess_fnc;
} colon; } colon;
char **argv; char **argv;
struct fd_data_map_s *fd_data_map; struct fd_data_map_s *fd_data_map;
/* stuff needed for interactive (command) mode */ /* stuff needed for interactive (command) mode */
@ -125,7 +125,7 @@ struct engine_gpg
int idx; /* Index in fd_data_map */ int idx; /* Index in fd_data_map */
gpgme_status_code_t code; /* last code */ gpgme_status_code_t code; /* last code */
char *keyword; /* what has been requested (malloced) */ char *keyword; /* what has been requested (malloced) */
engine_command_handler_t fnc; engine_command_handler_t fnc;
void *fnc_value; void *fnc_value;
/* The kludges never end. This is used to couple command handlers /* The kludges never end. This is used to couple command handlers
with output data in edit key mode. */ with output data in edit key mode. */
@ -537,7 +537,7 @@ gpg_new (void **engine, const char *file_name, const char *home_dir)
rc = _gpgme_getenv ("TERM", &dft_ttytype); rc = _gpgme_getenv ("TERM", &dft_ttytype);
if (rc) if (rc)
goto leave; goto leave;
if (dft_ttytype) if (dft_ttytype)
{ {
rc = add_arg (gpg, "--ttytype"); rc = add_arg (gpg, "--ttytype");
@ -632,7 +632,7 @@ gpg_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc,
if (!gpg->colon.buffer) if (!gpg->colon.buffer)
return gpg_error_from_errno (errno); return gpg_error_from_errno (errno);
if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1) if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1)
{ {
int saved_errno = errno; int saved_errno = errno;
free (gpg->colon.buffer); free (gpg->colon.buffer);
@ -722,7 +722,7 @@ build_argv (engine_gpg_t gpg)
gpgme_error_t err; gpgme_error_t err;
struct arg_and_data_s *a; struct arg_and_data_s *a;
struct fd_data_map_s *fd_data_map; struct fd_data_map_s *fd_data_map;
size_t datac=0, argc=0; size_t datac=0, argc=0;
char **argv; char **argv;
int need_special = 0; int need_special = 0;
int use_agent = 0; int use_agent = 0;
@ -850,9 +850,9 @@ build_argv (engine_gpg_t gpg)
fd_data_map[datac].inbound = a->inbound; fd_data_map[datac].inbound = a->inbound;
/* Create a pipe. */ /* Create a pipe. */
{ {
int fds[2]; int fds[2];
if (_gpgme_io_pipe (fds, fd_data_map[datac].inbound ? 1 : 0) if (_gpgme_io_pipe (fds, fd_data_map[datac].inbound ? 1 : 0)
== -1) == -1)
{ {
@ -976,13 +976,13 @@ read_status (engine_gpg_t gpg)
{ {
char *p; char *p;
int nread; int nread;
size_t bufsize = gpg->status.bufsize; size_t bufsize = gpg->status.bufsize;
char *buffer = gpg->status.buffer; char *buffer = gpg->status.buffer;
size_t readpos = gpg->status.readpos; size_t readpos = gpg->status.readpos;
assert (buffer); assert (buffer);
if (bufsize - readpos < 256) if (bufsize - readpos < 256)
{ {
/* Need more room for the read. */ /* Need more room for the read. */
bufsize += 1024; bufsize += 1024;
buffer = realloc (buffer, bufsize); buffer = realloc (buffer, bufsize);
@ -1029,7 +1029,7 @@ read_status (engine_gpg_t gpg)
rest = p; /* Set to an empty string. */ rest = p; /* Set to an empty string. */
else else
*rest++ = 0; *rest++ = 0;
r = _gpgme_parse_status (buffer + 9); r = _gpgme_parse_status (buffer + 9);
if (r >= 0) if (r >= 0)
{ {
@ -1060,12 +1060,12 @@ read_status (engine_gpg_t gpg)
else if (gpg->status.fnc) else if (gpg->status.fnc)
{ {
gpgme_error_t err; gpgme_error_t err;
err = gpg->status.fnc (gpg->status.fnc_value, err = gpg->status.fnc (gpg->status.fnc_value,
r, rest); r, rest);
if (err) if (err)
return err; return err;
} }
if (r == GPGME_STATUS_END_STREAM) if (r == GPGME_STATUS_END_STREAM)
{ {
if (gpg->cmd.used) if (gpg->cmd.used)
@ -1120,7 +1120,7 @@ read_status (engine_gpg_t gpg)
else else
readpos++; readpos++;
} }
} }
/* Update the gpg object. */ /* Update the gpg object. */
gpg->status.bufsize = bufsize; gpg->status.bufsize = bufsize;
@ -1152,17 +1152,17 @@ read_colon_line (engine_gpg_t gpg)
{ {
char *p; char *p;
int nread; int nread;
size_t bufsize = gpg->colon.bufsize; size_t bufsize = gpg->colon.bufsize;
char *buffer = gpg->colon.buffer; char *buffer = gpg->colon.buffer;
size_t readpos = gpg->colon.readpos; size_t readpos = gpg->colon.readpos;
assert (buffer); assert (buffer);
if (bufsize - readpos < 256) if (bufsize - readpos < 256)
{ {
/* Need more room for the read. */ /* Need more room for the read. */
bufsize += 1024; bufsize += 1024;
buffer = realloc (buffer, bufsize); buffer = realloc (buffer, bufsize);
if (!buffer) if (!buffer)
return gpg_error_from_errno (errno); return gpg_error_from_errno (errno);
} }
@ -1208,7 +1208,7 @@ read_colon_line (engine_gpg_t gpg)
if (line) if (line)
free (line); free (line);
} }
/* To reuse the buffer for the next line we have to /* To reuse the buffer for the next line we have to
shift the remaining data to the buffer start and shift the remaining data to the buffer start and
restart the loop Hmmm: We can optimize this function restart the loop Hmmm: We can optimize this function
@ -1224,7 +1224,7 @@ read_colon_line (engine_gpg_t gpg)
else else
readpos++; readpos++;
} }
} }
/* Update the gpg object. */ /* Update the gpg object. */
gpg->colon.bufsize = bufsize; gpg->colon.bufsize = bufsize;
@ -1295,7 +1295,7 @@ start (engine_gpg_t gpg)
/* status_fd, colon_fd and end of list. */ /* status_fd, colon_fd and end of list. */
n = 3; n = 3;
for (i = 0; gpg->fd_data_map[i].data; i++) for (i = 0; gpg->fd_data_map[i].data; i++)
n++; n++;
fd_list = calloc (n, sizeof *fd_list); fd_list = calloc (n, sizeof *fd_list);
if (! fd_list) if (! fd_list)
@ -1309,7 +1309,7 @@ start (engine_gpg_t gpg)
n++; n++;
if (gpg->colon.fnc) if (gpg->colon.fnc)
{ {
fd_list[n].fd = gpg->colon.fd[1]; fd_list[n].fd = gpg->colon.fd[1];
fd_list[n].dup_to = 1; fd_list[n].dup_to = 1;
n++; n++;
} }
@ -1367,7 +1367,7 @@ start (engine_gpg_t gpg)
? _gpgme_data_inbound_handler ? _gpgme_data_inbound_handler
: _gpgme_data_outbound_handler, : _gpgme_data_outbound_handler,
gpg->fd_data_map[i].data, &gpg->fd_data_map[i].tag); gpg->fd_data_map[i].data, &gpg->fd_data_map[i].tag);
if (rc) if (rc)
/* FIXME: kill the child */ /* FIXME: kill the child */
return rc; return rc;
@ -1375,7 +1375,7 @@ start (engine_gpg_t gpg)
} }
gpg_io_event (gpg, GPGME_EVENT_START, NULL); gpg_io_event (gpg, GPGME_EVENT_START, NULL);
/* fixme: check what data we can release here */ /* fixme: check what data we can release here */
return 0; return 0;
} }
@ -1605,7 +1605,7 @@ append_args_from_recipients (engine_gpg_t gpg, gpgme_key_t recp[])
if (err) if (err)
break; break;
i++; i++;
} }
return err; return err;
} }
@ -1832,7 +1832,7 @@ gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor,
Note that we use a delimiter and thus a trailing delimiter is not Note that we use a delimiter and thus a trailing delimiter is not
required. DELIM may not be changed after the first call. */ required. DELIM may not be changed after the first call. */
static const char * static const char *
string_from_data (gpgme_data_t data, int delim, string_from_data (gpgme_data_t data, int delim,
void **helpptr, gpgme_error_t *r_err) void **helpptr, gpgme_error_t *r_err)
{ {
#define MYBUFLEN 2000 /* Fixme: We don't support URLs longer than that. */ #define MYBUFLEN 2000 /* Fixme: We don't support URLs longer than that. */
@ -1900,7 +1900,7 @@ string_from_data (gpgme_data_t data, int delim,
return NULL; return NULL;
} }
nread = gpgme_data_read (data, self->buf + self->buflen, nread = gpgme_data_read (data, self->buf + self->buflen,
MYBUFLEN - self->buflen); MYBUFLEN - self->buflen);
if (nread < 0) if (nread < 0)
{ {
@ -2034,7 +2034,7 @@ gpg_keylist_preprocess (char *line, char **r_line)
rectype = RT_PUB; rectype = RT_PUB;
else if (!strcmp (field[0], "uid")) else if (!strcmp (field[0], "uid"))
rectype = RT_UID; rectype = RT_UID;
else else
rectype = RT_NONE; rectype = RT_NONE;
switch (rectype) switch (rectype)
@ -2052,7 +2052,7 @@ gpg_keylist_preprocess (char *line, char **r_line)
pub:<keyid>:<algo>:<keylen>:<creationdate>:<expirationdate>:<flags> pub:<keyid>:<algo>:<keylen>:<creationdate>:<expirationdate>:<flags>
as defined in 5.2. Machine Readable Indexes of the OpenPGP as defined in 5.2. Machine Readable Indexes of the OpenPGP
HTTP Keyserver Protocol (draft). HTTP Keyserver Protocol (draft).
We want: We want:
pub:o<flags>:<keylen>:<algo>:<keyid>:<creatdate>:<expdate>:::::::: pub:o<flags>:<keylen>:<algo>:<keyid>:<creatdate>:<expdate>::::::::
@ -2070,7 +2070,7 @@ gpg_keylist_preprocess (char *line, char **r_line)
uid:<escaped uid string>:<creationdate>:<expirationdate>:<flags> uid:<escaped uid string>:<creationdate>:<expirationdate>:<flags>
as defined in 5.2. Machine Readable Indexes of the OpenPGP as defined in 5.2. Machine Readable Indexes of the OpenPGP
HTTP Keyserver Protocol (draft). HTTP Keyserver Protocol (draft).
We want: We want:
uid:o<flags>::::<creatdate>:<expdate>:::<c-coded uid>: uid:o<flags>::::<creatdate>:<expdate>:::<c-coded uid>:
@ -2181,10 +2181,10 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,
} }
if (!err) if (!err)
err = add_arg (gpg, "--"); err = add_arg (gpg, "--");
return err; return err;
} }
static gpgme_error_t static gpgme_error_t
gpg_keylist (void *engine, const char *pattern, int secret_only, gpg_keylist (void *engine, const char *pattern, int secret_only,
@ -2287,7 +2287,7 @@ gpg_trustlist (void *engine, const char *pattern)
err = add_arg (gpg, "--with-colons"); err = add_arg (gpg, "--with-colons");
if (!err) if (!err)
err = add_arg (gpg, "--list-trust-path"); err = add_arg (gpg, "--list-trust-path");
/* Tell the gpg object about the data. */ /* Tell the gpg object about the data. */
if (!err) if (!err)
err = add_arg (gpg, "--"); err = add_arg (gpg, "--");
@ -2353,7 +2353,7 @@ struct engine_ops _gpgme_engine_ops_gpg =
{ {
/* Static functions. */ /* Static functions. */
_gpgme_get_gpg_path, _gpgme_get_gpg_path,
NULL, NULL,
gpg_get_version, gpg_get_version,
gpg_get_req_version, gpg_get_req_version,
gpg_new, gpg_new,

View File

@ -2,19 +2,19 @@
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009, Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009,
2010 g10 Code GmbH 2010 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
@ -101,7 +101,7 @@ struct engine_gpgsm
int linelen; int linelen;
} attic; } attic;
int any; /* any data line seen */ int any; /* any data line seen */
} colon; } colon;
gpgme_data_t inline_data; /* Used to collect D lines. */ gpgme_data_t inline_data; /* Used to collect D lines. */
@ -111,7 +111,7 @@ struct engine_gpgsm
typedef struct engine_gpgsm *engine_gpgsm_t; typedef struct engine_gpgsm *engine_gpgsm_t;
static void gpgsm_io_event (void *engine, static void gpgsm_io_event (void *engine,
gpgme_event_io_t type, void *type_data); gpgme_event_io_t type, void *type_data);
@ -542,7 +542,7 @@ gpgsm_set_locale (void *engine, int category, const char *value)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
/* FIXME: Reset value to default. */ /* FIXME: Reset value to default. */
if (!value) if (!value)
return 0; return 0;
if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0) if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
@ -705,10 +705,10 @@ gpgsm_set_fd (engine_gpgsm_t gpgsm, fd_type_t fd_type, const char *opt)
snprintf (line, COMMANDLINELEN, "%s FD", which); snprintf (line, COMMANDLINELEN, "%s FD", which);
#else #else
if (opt) if (opt)
snprintf (line, COMMANDLINELEN, "%s FD=%s %s", snprintf (line, COMMANDLINELEN, "%s FD=%s %s",
which, iocb_data->server_fd_str, opt); which, iocb_data->server_fd_str, opt);
else else
snprintf (line, COMMANDLINELEN, "%s FD=%s", snprintf (line, COMMANDLINELEN, "%s FD=%s",
which, iocb_data->server_fd_str); which, iocb_data->server_fd_str);
#endif #endif
@ -793,7 +793,7 @@ status_handler (void *opaque, int fd)
if (gpgsm->status.fnc) if (gpgsm->status.fnc)
err = gpgsm->status.fnc (gpgsm->status.fnc_value, err = gpgsm->status.fnc (gpgsm->status.fnc_value,
GPGME_STATUS_EOF, ""); GPGME_STATUS_EOF, "");
if (!err && gpgsm->colon.fnc && gpgsm->colon.any) if (!err && gpgsm->colon.fnc && gpgsm->colon.any)
{ {
/* We must tell a colon function about the EOF. We do /* We must tell a colon function about the EOF. We do
@ -856,12 +856,12 @@ status_handler (void *opaque, int fd)
*dst = *src++; *dst = *src++;
(*alinelen)++; (*alinelen)++;
} }
if (*dst == '\n') if (*dst == '\n')
{ {
/* Terminate the pending line, pass it to the colon /* Terminate the pending line, pass it to the colon
handler and reset it. */ handler and reset it. */
gpgsm->colon.any = 1; gpgsm->colon.any = 1;
if (*alinelen > 1 && *(dst - 1) == '\r') if (*alinelen > 1 && *(dst - 1) == '\r')
dst--; dst--;
@ -904,10 +904,10 @@ status_handler (void *opaque, int fd)
} }
else else
*dst++ = *src++; *dst++ = *src++;
linelen++; linelen++;
} }
src = line + 2; src = line + 2;
while (linelen > 0) while (linelen > 0)
{ {
@ -931,7 +931,7 @@ status_handler (void *opaque, int fd)
{ {
char *rest; char *rest;
gpgme_status_code_t r; gpgme_status_code_t r;
rest = strchr (line + 2, ' '); rest = strchr (line + 2, ' ');
if (!rest) if (!rest)
rest = line + linelen; /* set to an empty string */ rest = line + linelen; /* set to an empty string */
@ -954,7 +954,7 @@ status_handler (void *opaque, int fd)
else if (linelen >= 7 else if (linelen >= 7
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q' && line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R' && line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
&& line[6] == 'E' && line[6] == 'E'
&& (line[7] == '\0' || line[7] == ' ')) && (line[7] == '\0' || line[7] == ' '))
{ {
char *keyword = line+7; char *keyword = line+7;
@ -967,7 +967,7 @@ status_handler (void *opaque, int fd)
} }
while (!err && assuan_pending_line (gpgsm->assuan_ctx)); while (!err && assuan_pending_line (gpgsm->assuan_ctx));
return err; return err;
} }
@ -1272,7 +1272,7 @@ gpgsm_export (void *engine, const char *pattern, gpgme_export_mode_t mode,
if (!gpgsm) if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
if (mode) if (mode)
return gpg_error (GPG_ERR_NOT_SUPPORTED); return gpg_error (GPG_ERR_NOT_SUPPORTED);
@ -1446,8 +1446,8 @@ gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray)
/* Fist check whether the engine already features the /* Fist check whether the engine already features the
--re-import option. */ --re-import option. */
err = gpgsm_assuan_simple_command err = gpgsm_assuan_simple_command
(gpgsm->assuan_ctx, (gpgsm->assuan_ctx,
"GETINFO cmd_has_option IMPORT re-import", NULL, NULL); "GETINFO cmd_has_option IMPORT re-import", NULL, NULL);
if (err) if (err)
return gpg_error (GPG_ERR_NOT_SUPPORTED); return gpg_error (GPG_ERR_NOT_SUPPORTED);
@ -1460,7 +1460,7 @@ gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray)
{ {
if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS
&& keyarray[idx]->subkeys && keyarray[idx]->subkeys
&& keyarray[idx]->subkeys->fpr && keyarray[idx]->subkeys->fpr
&& *keyarray[idx]->subkeys->fpr) && *keyarray[idx]->subkeys->fpr)
buflen += strlen (keyarray[idx]->subkeys->fpr) + 1; buflen += strlen (keyarray[idx]->subkeys->fpr) + 1;
} }
@ -1473,11 +1473,11 @@ gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray)
{ {
if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS
&& keyarray[idx]->subkeys && keyarray[idx]->subkeys
&& keyarray[idx]->subkeys->fpr && keyarray[idx]->subkeys->fpr
&& *keyarray[idx]->subkeys->fpr) && *keyarray[idx]->subkeys->fpr)
p = stpcpy (stpcpy (p, keyarray[idx]->subkeys->fpr), "\n"); p = stpcpy (stpcpy (p, keyarray[idx]->subkeys->fpr), "\n");
} }
err = gpgme_data_new_from_mem (&gpgsm->input_helper_data, err = gpgme_data_new_from_mem (&gpgsm->input_helper_data,
buffer, buflen, 0); buffer, buflen, 0);
if (err) if (err)
@ -1566,14 +1566,14 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only,
/* Use the validation mode if requested. We don't check for an error /* Use the validation mode if requested. We don't check for an error
yet because this is a pretty fresh gpgsm features. */ yet because this is a pretty fresh gpgsm features. */
gpgsm_assuan_simple_command (gpgsm->assuan_ctx, gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_VALIDATE)? (mode & GPGME_KEYLIST_MODE_VALIDATE)?
"OPTION with-validation=1": "OPTION with-validation=1":
"OPTION with-validation=0" , "OPTION with-validation=0" ,
NULL, NULL); NULL, NULL);
/* Include the ephemeral keys if requested. We don't check for an error /* Include the ephemeral keys if requested. We don't check for an error
yet because this is a pretty fresh gpgsm features. */ yet because this is a pretty fresh gpgsm features. */
gpgsm_assuan_simple_command (gpgsm->assuan_ctx, gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_EPHEMERAL)? (mode & GPGME_KEYLIST_MODE_EPHEMERAL)?
"OPTION with-ephemeral-keys=1": "OPTION with-ephemeral-keys=1":
"OPTION with-ephemeral-keys=0" , "OPTION with-ephemeral-keys=0" ,
@ -1638,7 +1638,7 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
/* Always send key validation because RESET does not reset it. */ /* Always send key validation because RESET does not reset it. */
/* Use the validation mode if required. We don't check for an error /* Use the validation mode if required. We don't check for an error
yet because this is a pretty fresh gpgsm features. */ yet because this is a pretty fresh gpgsm features. */
gpgsm_assuan_simple_command (gpgsm->assuan_ctx, gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_VALIDATE)? (mode & GPGME_KEYLIST_MODE_VALIDATE)?
"OPTION with-validation=1": "OPTION with-validation=1":
"OPTION with-validation=0" , "OPTION with-validation=0" ,
@ -1775,7 +1775,7 @@ gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
else else
err = gpg_error (GPG_ERR_INV_VALUE); err = gpg_error (GPG_ERR_INV_VALUE);
gpgme_key_unref (key); gpgme_key_unref (key);
if (err) if (err)
return err; return err;
} }
@ -1872,7 +1872,7 @@ gpgsm_getauditlog (void *engine, gpgme_data_t output, unsigned int flags)
static void static void
gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc, gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc,
void *fnc_value) void *fnc_value)
{ {
engine_gpgsm_t gpgsm = engine; engine_gpgsm_t gpgsm = engine;
@ -1883,7 +1883,7 @@ gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc,
static gpgme_error_t static gpgme_error_t
gpgsm_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, gpgsm_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc,
void *fnc_value) void *fnc_value)
{ {
engine_gpgsm_t gpgsm = engine; engine_gpgsm_t gpgsm = engine;
@ -1927,7 +1927,7 @@ gpgsm_passwd (void *engine, gpgme_key_t key, unsigned int flags)
if (asprintf (&line, "PASSWD -- %s", key->subkeys->fpr) < 0) if (asprintf (&line, "PASSWD -- %s", key->subkeys->fpr) < 0)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();
gpgsm_clear_fd (gpgsm, OUTPUT_FD); gpgsm_clear_fd (gpgsm, OUTPUT_FD);
gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, INPUT_FD);
gpgsm_clear_fd (gpgsm, MESSAGE_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD);

View File

@ -1,19 +1,19 @@
/* engine.c - GPGME engine support. /* engine.c - GPGME engine support.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009, 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -568,7 +568,7 @@ _gpgme_engine_set_protocol (engine_t engine, gpgme_protocol_t protocol)
return (*engine->ops->set_protocol) (engine->engine, protocol); return (*engine->ops->set_protocol) (engine->engine, protocol);
} }
gpgme_error_t gpgme_error_t
_gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph, _gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph,
@ -810,7 +810,7 @@ _gpgme_engine_op_getauditlog (engine_t engine, gpgme_data_t output,
gpgme_error_t gpgme_error_t
_gpgme_engine_op_assuan_transact (engine_t engine, _gpgme_engine_op_assuan_transact (engine_t engine,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,
@ -825,7 +825,7 @@ _gpgme_engine_op_assuan_transact (engine_t engine,
if (!engine->ops->opassuan_transact) if (!engine->ops->opassuan_transact)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED); return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
return (*engine->ops->opassuan_transact) (engine->engine, return (*engine->ops->opassuan_transact) (engine->engine,
command, command,
data_cb, data_cb_value, data_cb, data_cb_value,
inq_cb, inq_cb_value, inq_cb, inq_cb_value,

View File

@ -1,19 +1,19 @@
/* engine.h - GPGME engine interface. /* engine.h - GPGME engine interface.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2010 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
@ -23,7 +23,7 @@
#define ENGINE_H #define ENGINE_H
#include "gpgme.h" #include "gpgme.h"
struct engine; struct engine;
typedef struct engine *engine_t; typedef struct engine *engine_t;
@ -133,8 +133,8 @@ gpgme_error_t _gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig,
gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine, gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine,
gpgme_data_t output, gpgme_data_t output,
unsigned int flags); unsigned int flags);
gpgme_error_t _gpgme_engine_op_assuan_transact gpgme_error_t _gpgme_engine_op_assuan_transact
(engine_t engine, (engine_t engine,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,

View File

@ -2,17 +2,17 @@
Copyright (C) 2003, 2004 g10 Code GmbH Copyright (C) 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
@ -55,7 +55,7 @@ gpgme_strsource (gpgme_error_t err)
return gpg_strsource (err); return gpg_strsource (err);
} }
/* Retrieve the error code for the system error ERR. This returns /* Retrieve the error code for the system error ERR. This returns
GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
this). */ this). */
@ -93,7 +93,7 @@ gpgme_err_set_errno (int err)
gpg_err_set_errno (err); gpg_err_set_errno (err);
} }
/* Return an error value with the error source SOURCE and the system /* Return an error value with the error source SOURCE and the system
error ERR. */ error ERR. */
gpgme_error_t gpgme_error_t

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -48,7 +48,7 @@ export_start (gpgme_ctx_t ctx, int synchronous, const char *pattern,
|GPGME_EXPORT_MODE_MINIMAL))) |GPGME_EXPORT_MODE_MINIMAL)))
return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */ return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */
if ((mode & GPGME_EXPORT_MODE_EXTERN)) if ((mode & GPGME_EXPORT_MODE_EXTERN))
{ {
if (keydata) if (keydata)
@ -221,7 +221,7 @@ export_keys_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t keys[],
nkeys++; nkeys++;
if (!nkeys) if (!nkeys)
return gpg_error (GPG_ERR_NO_DATA); return gpg_error (GPG_ERR_NO_DATA);
pattern = calloc (nkeys+1, sizeof *pattern); pattern = calloc (nkeys+1, sizeof *pattern);
if (!pattern) if (!pattern)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();
@ -272,7 +272,7 @@ gpgme_op_export_keys_start (gpgme_ctx_t ctx,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && keys) if (_gpgme_debug_trace () && keys)
{ {
int i = 0; int i = 0;
@ -280,7 +280,7 @@ gpgme_op_export_keys_start (gpgme_ctx_t ctx,
while (keys[i]) while (keys[i])
{ {
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i], TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
(keys[i]->subkeys && keys[i]->subkeys->fpr) ? (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid"); keys[i]->subkeys->fpr : "invalid");
i++; i++;
} }
@ -303,7 +303,7 @@ gpgme_op_export_keys (gpgme_ctx_t ctx,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (_gpgme_debug_trace () && keys) if (_gpgme_debug_trace () && keys)
{ {
int i = 0; int i = 0;
@ -311,7 +311,7 @@ gpgme_op_export_keys (gpgme_ctx_t ctx,
while (keys[i]) while (keys[i])
{ {
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i], TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
(keys[i]->subkeys && keys[i]->subkeys->fpr) ? (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid"); keys[i]->subkeys->fpr : "invalid");
i++; i++;
} }

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

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
@ -46,7 +46,7 @@ static void
release_op_data (void *hook) release_op_data (void *hook)
{ {
op_data_t opd = (op_data_t) hook; op_data_t opd = (op_data_t) hook;
if (opd->result.fpr) if (opd->result.fpr)
free (opd->result.fpr); free (opd->result.fpr);
if (opd->key_parameter) if (opd->key_parameter)
@ -173,7 +173,7 @@ genkey_start (gpgme_ctx_t ctx, int synchronous, const char *parms,
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook, err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook; opd = hook;

View File

@ -2,17 +2,17 @@
Copyright (C) 2003, 2004 g10 Code GmbH Copyright (C) 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

View File

@ -3,17 +3,17 @@
Copyright (C) 2007 g10 Code GmbH Copyright (C) 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -48,7 +48,7 @@ getauditlog_start (gpgme_ctx_t ctx, int synchronous,
if (err) if (err)
return err; return err;
_gpgme_engine_set_status_handler (ctx->engine, _gpgme_engine_set_status_handler (ctx->engine,
getauditlog_status_handler, ctx); getauditlog_status_handler, ctx);
return _gpgme_engine_op_getauditlog (ctx->engine, output, flags); return _gpgme_engine_op_getauditlog (ctx->engine, output, flags);
@ -61,7 +61,7 @@ getauditlog_start (gpgme_ctx_t ctx, int synchronous,
available GPG_ERR_NO_DATA is returned. This is the asynchronous available GPG_ERR_NO_DATA is returned. This is the asynchronous
variant. */ variant. */
gpgme_error_t gpgme_error_t
gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_op_getauditlog_start (gpgme_ctx_t ctx,
gpgme_data_t output, unsigned int flags) gpgme_data_t output, unsigned int flags)
{ {
gpg_error_t err; gpg_error_t err;

View File

@ -2,17 +2,17 @@
Copyright (C) 2007 g10 Code GmbH Copyright (C) 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

View File

@ -2,17 +2,17 @@
Copyright (C) 2009, 2010 g10 Code GmbH Copyright (C) 2009, 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -40,10 +40,10 @@
#include "gpgme.h" #include "gpgme.h"
/* GCC attributes. */ /* GCC attributes. */
#if __GNUC__ >= 4 #if __GNUC__ >= 4
# define GT_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a))) # define GT_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a)))
#else #else
# define GT_GCC_A_SENTINEL(a) # define GT_GCC_A_SENTINEL(a)
#endif #endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 ) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
@ -158,9 +158,9 @@ struct argp
| ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR) | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
void argp_error (const struct argp_state *state, void argp_error (const struct argp_state *state,
const char *fmt, ...) GT_GCC_A_PRINTF(2, 3); const char *fmt, ...) GT_GCC_A_PRINTF(2, 3);
char * char *
@ -374,10 +374,10 @@ argp_parse (const struct argp *argp, int argc,
*arg = '\0'; *arg = '\0';
arg++; arg++;
} }
if (state.argv[idx][1] != '-') if (state.argv[idx][1] != '-')
key = state.argv[idx][1]; key = state.argv[idx][1];
while (! found && opt->key) while (! found && opt->key)
{ {
if (key == opt->key if (key == opt->key
@ -453,7 +453,7 @@ argp_parse (const struct argp *argp, int argc,
rc = argp->parser (ARGP_KEY_FINI, NULL, &state); rc = argp->parser (ARGP_KEY_FINI, NULL, &state);
if (rc && rc != ARGP_ERR_UNKNOWN) if (rc && rc != ARGP_ERR_UNKNOWN)
goto argperror; goto argperror;
rc = 0; rc = 0;
argp->parser (ARGP_KEY_SUCCESS, NULL, &state); argp->parser (ARGP_KEY_SUCCESS, NULL, &state);
@ -481,7 +481,7 @@ char *program_name = "gpgme-tool";
#define spacep(p) (*(p) == ' ' || *(p) == '\t') #define spacep(p) (*(p) == ' ' || *(p) == '\t')
void log_error (int status, gpg_error_t errnum, void log_error (int status, gpg_error_t errnum,
const char *fmt, ...) GT_GCC_A_PRINTF(3,4); const char *fmt, ...) GT_GCC_A_PRINTF(3,4);
@ -518,7 +518,7 @@ strcpy_escaped_plus (char *d, const char *s)
while (*s) while (*s)
{ {
if (*s == '%' && s[1] && s[2]) if (*s == '%' && s[1] && s[2])
{ {
s++; s++;
*d++ = xtoi_2 (s); *d++ = xtoi_2 (s);
s += 2; s += 2;
@ -528,7 +528,7 @@ strcpy_escaped_plus (char *d, const char *s)
else else
*d++ = *s++; *d++ = *s++;
} }
*d = 0; *d = 0;
} }
@ -630,7 +630,7 @@ result_xml_tag_start (struct result_xml_state *state, char *name, ...)
state->had_data[state->next_tag] = 0; state->had_data[state->next_tag] = 0;
state->indent += 2; state->indent += 2;
state->next_tag++; state->next_tag++;
while (1) while (1)
{ {
attr = va_arg (ap, char *); attr = va_arg (ap, char *);
@ -704,7 +704,7 @@ result_xml_tag_end (struct result_xml_state *state)
gpg_error_t gpg_error_t
result_add_error (struct result_xml_state *state, char *name, gpg_error_t err) result_add_error (struct result_xml_state *state, char *name, gpg_error_t err)
{ {
char code[20]; char code[20];
char msg[1024]; char msg[1024];
snprintf (code, sizeof (code) - 1, "0x%x", err); snprintf (code, sizeof (code) - 1, "0x%x", err);
@ -720,7 +720,7 @@ result_add_error (struct result_xml_state *state, char *name, gpg_error_t err)
gpg_error_t gpg_error_t
result_add_pubkey_algo (struct result_xml_state *state, result_add_pubkey_algo (struct result_xml_state *state,
char *name, gpgme_pubkey_algo_t algo) char *name, gpgme_pubkey_algo_t algo)
{ {
char code[20]; char code[20];
char msg[80]; char msg[80];
snprintf (code, sizeof (code) - 1, "0x%x", algo); snprintf (code, sizeof (code) - 1, "0x%x", algo);
@ -736,7 +736,7 @@ result_add_pubkey_algo (struct result_xml_state *state,
gpg_error_t gpg_error_t
result_add_hash_algo (struct result_xml_state *state, result_add_hash_algo (struct result_xml_state *state,
char *name, gpgme_hash_algo_t algo) char *name, gpgme_hash_algo_t algo)
{ {
char code[20]; char code[20];
char msg[80]; char msg[80];
snprintf (code, sizeof (code) - 1, "0x%x", algo); snprintf (code, sizeof (code) - 1, "0x%x", algo);
@ -751,7 +751,7 @@ result_add_hash_algo (struct result_xml_state *state,
gpg_error_t gpg_error_t
result_add_keyid (struct result_xml_state *state, char *name, char *keyid) result_add_keyid (struct result_xml_state *state, char *name, char *keyid)
{ {
result_xml_tag_start (state, name, NULL); result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, keyid); result_xml_tag_data (state, keyid);
result_xml_tag_end (state); result_xml_tag_end (state);
@ -761,7 +761,7 @@ result_add_keyid (struct result_xml_state *state, char *name, char *keyid)
gpg_error_t gpg_error_t
result_add_fpr (struct result_xml_state *state, char *name, char *fpr) result_add_fpr (struct result_xml_state *state, char *name, char *fpr)
{ {
result_xml_tag_start (state, name, NULL); result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, fpr); result_xml_tag_data (state, fpr);
result_xml_tag_end (state); result_xml_tag_end (state);
@ -785,7 +785,7 @@ result_add_timestamp (struct result_xml_state *state, char *name,
gpg_error_t gpg_error_t
result_add_sig_mode (struct result_xml_state *state, char *name, result_add_sig_mode (struct result_xml_state *state, char *name,
gpgme_sig_mode_t sig_mode) gpgme_sig_mode_t sig_mode)
{ {
char *mode; char *mode;
char code[20]; char code[20];
@ -815,7 +815,7 @@ result_add_sig_mode (struct result_xml_state *state, char *name,
gpg_error_t gpg_error_t
result_add_value (struct result_xml_state *state, result_add_value (struct result_xml_state *state,
char *name, unsigned int val) char *name, unsigned int val)
{ {
char code[20]; char code[20];
snprintf (code, sizeof (code) - 1, "0x%x", val); snprintf (code, sizeof (code) - 1, "0x%x", val);
@ -828,7 +828,7 @@ result_add_value (struct result_xml_state *state,
gpg_error_t gpg_error_t
result_add_string (struct result_xml_state *state, result_add_string (struct result_xml_state *state,
char *name, char *str) char *name, char *str)
{ {
result_xml_tag_start (state, name, NULL); result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, str); result_xml_tag_data (state, str);
result_xml_tag_end (state); result_xml_tag_end (state);
@ -854,7 +854,7 @@ result_encrypt_to_xml (gpgme_ctx_t ctx, int indent,
if (inv_recp) if (inv_recp)
{ {
result_xml_tag_start (&state, "invalid-recipients", NULL); result_xml_tag_start (&state, "invalid-recipients", NULL);
while (inv_recp) while (inv_recp)
{ {
result_xml_tag_start (&state, "invalid-key", NULL); result_xml_tag_start (&state, "invalid-key", NULL);
@ -867,7 +867,7 @@ result_encrypt_to_xml (gpgme_ctx_t ctx, int indent,
result_xml_tag_end (&state); result_xml_tag_end (&state);
} }
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -920,7 +920,7 @@ result_decrypt_to_xml (gpgme_ctx_t ctx, int indent,
result_xml_tag_end (&state); result_xml_tag_end (&state);
} }
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -944,7 +944,7 @@ result_sign_to_xml (gpgme_ctx_t ctx, int indent,
if (inv_key) if (inv_key)
{ {
result_xml_tag_start (&state, "invalid-signers", NULL); result_xml_tag_start (&state, "invalid-signers", NULL);
while (inv_key) while (inv_key)
{ {
result_xml_tag_start (&state, "invalid-key", NULL); result_xml_tag_start (&state, "invalid-key", NULL);
@ -980,7 +980,7 @@ result_sign_to_xml (gpgme_ctx_t ctx, int indent,
} }
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1014,7 +1014,7 @@ result_verify_to_xml (gpgme_ctx_t ctx, int indent,
while (sig) while (sig)
{ {
result_xml_tag_start (&state, "signature", NULL); result_xml_tag_start (&state, "signature", NULL);
/* FIXME: Could be done better. */ /* FIXME: Could be done better. */
result_add_value (&state, "summary", sig->summary); result_add_value (&state, "summary", sig->summary);
if (sig->fpr) if (sig->fpr)
@ -1032,7 +1032,7 @@ result_verify_to_xml (gpgme_ctx_t ctx, int indent,
result_add_hash_algo (&state, "hash-algo", sig->hash_algo); result_add_hash_algo (&state, "hash-algo", sig->hash_algo);
if (sig->pka_address) if (sig->pka_address)
result_add_string (&state, "pka_address", sig->pka_address); result_add_string (&state, "pka_address", sig->pka_address);
result_xml_tag_end (&state); result_xml_tag_end (&state);
sig = sig->next; sig = sig->next;
} }
@ -1040,7 +1040,7 @@ result_verify_to_xml (gpgme_ctx_t ctx, int indent,
} }
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1078,7 +1078,7 @@ result_import_to_xml (gpgme_ctx_t ctx, int indent,
if (stat) if (stat)
{ {
result_xml_tag_start (&state, "imports", NULL); result_xml_tag_start (&state, "imports", NULL);
while (stat) while (stat)
{ {
result_xml_tag_start (&state, "import-status", NULL); result_xml_tag_start (&state, "import-status", NULL);
@ -1096,7 +1096,7 @@ result_import_to_xml (gpgme_ctx_t ctx, int indent,
} }
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1120,7 +1120,7 @@ result_genkey_to_xml (gpgme_ctx_t ctx, int indent,
result_add_fpr (&state, "fpr", res->fpr); result_add_fpr (&state, "fpr", res->fpr);
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1141,7 +1141,7 @@ result_keylist_to_xml (gpgme_ctx_t ctx, int indent,
result_add_value (&state, "truncated", res->truncated); result_add_value (&state, "truncated", res->truncated);
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1162,7 +1162,7 @@ result_vfs_mount_to_xml (gpgme_ctx_t ctx, int indent,
result_add_string (&state, "mount-dir", res->mount_dir); result_add_string (&state, "mount-dir", res->mount_dir);
result_xml_tag_end (&state); result_xml_tag_end (&state);
return 0; return 0;
} }
@ -1209,7 +1209,7 @@ typedef struct gpgme_tool *gpgme_tool_t;
/* Forward declaration. */ /* Forward declaration. */
void gt_write_status (gpgme_tool_t gt, void gt_write_status (gpgme_tool_t gt,
status_t status, ...) GT_GCC_A_SENTINEL(0); status_t status, ...) GT_GCC_A_SENTINEL(0);
void void
@ -1281,7 +1281,7 @@ gt_get_key (gpgme_tool_t gt, const char *pattern, gpgme_key_t *r_key)
if (!gt || !r_key || !pattern) if (!gt || !r_key || !pattern)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
ctx = gt->ctx; ctx = gt->ctx;
err = gpgme_new (&listctx); err = gpgme_new (&listctx);
@ -1343,10 +1343,10 @@ gt_get_key (gpgme_tool_t gt, const char *pattern, gpgme_key_t *r_key)
} }
} }
gpgme_release (listctx); gpgme_release (listctx);
if (! err) if (! err)
gt_write_status (gt, STATUS_RECIPIENT, gt_write_status (gt, STATUS_RECIPIENT,
((*r_key)->subkeys && (*r_key)->subkeys->fpr) ? ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid", NULL); (*r_key)->subkeys->fpr : "invalid", NULL);
return err; return err;
} }
@ -1390,7 +1390,7 @@ gt_reset (gpgme_tool_t gt)
{ {
gpg_error_t err; gpg_error_t err;
gpgme_ctx_t ctx; gpgme_ctx_t ctx;
err = _gt_gpgme_new (gt, &ctx); err = _gt_gpgme_new (gt, &ctx);
if (err) if (err)
return err; return err;
@ -1482,7 +1482,7 @@ gt_protocol_from_name (const char *name)
return GPGME_PROTOCOL_UNKNOWN; return GPGME_PROTOCOL_UNKNOWN;
} }
gpg_error_t gpg_error_t
gt_set_protocol (gpgme_tool_t gt, gpgme_protocol_t proto) gt_set_protocol (gpgme_tool_t gt, gpgme_protocol_t proto)
{ {
@ -1572,7 +1572,7 @@ gt_get_keylist_mode (gpgme_tool_t gt)
const char *modes[NR_KEYLIST_MODES + 1]; const char *modes[NR_KEYLIST_MODES + 1];
int idx = 0; int idx = 0;
gpgme_keylist_mode_t mode = gpgme_get_keylist_mode (gt->ctx); gpgme_keylist_mode_t mode = gpgme_get_keylist_mode (gt->ctx);
if (mode & GPGME_KEYLIST_MODE_LOCAL) if (mode & GPGME_KEYLIST_MODE_LOCAL)
modes[idx++] = "local"; modes[idx++] = "local";
if (mode & GPGME_KEYLIST_MODE_EXTERN) if (mode & GPGME_KEYLIST_MODE_EXTERN)
@ -1693,18 +1693,18 @@ gt_import_keys (gpgme_tool_t gt, char *fpr[])
int cnt; int cnt;
int idx; int idx;
gpgme_key_t *keys; gpgme_key_t *keys;
cnt = 0; cnt = 0;
while (fpr[cnt]) while (fpr[cnt])
cnt++; cnt++;
if (! cnt) if (! cnt)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
keys = malloc ((cnt + 1) * sizeof (gpgme_key_t)); keys = malloc ((cnt + 1) * sizeof (gpgme_key_t));
if (! keys) if (! keys)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();
for (idx = 0; idx < cnt; idx++) for (idx = 0; idx < cnt; idx++)
{ {
err = gpgme_get_key (gt->ctx, fpr[idx], &keys[idx], 0); err = gpgme_get_key (gt->ctx, fpr[idx], &keys[idx], 0);
@ -1716,7 +1716,7 @@ gt_import_keys (gpgme_tool_t gt, char *fpr[])
keys[cnt] = NULL; keys[cnt] = NULL;
err = gpgme_op_import_keys (gt->ctx, keys); err = gpgme_op_import_keys (gt->ctx, keys);
} }
/* Rollback. */ /* Rollback. */
while (--idx >= 0) while (--idx >= 0)
gpgme_key_unref (keys[idx]); gpgme_key_unref (keys[idx]);
@ -1786,7 +1786,7 @@ gt_vfs_create (gpgme_tool_t gt, const char *container_file, int flags)
} }
static const char hlp_passwd[] = static const char hlp_passwd[] =
"PASSWD <user-id>\n" "PASSWD <user-id>\n"
"\n" "\n"
"Ask the backend to change the passphrase for the key\n" "Ask the backend to change the passphrase for the key\n"
@ -1922,7 +1922,7 @@ server_parse_fd (assuan_context_t ctx, char *line, assuan_fd_t *rfd,
else else
return assuan_command_parse_fd (ctx, line, rfd); return assuan_command_parse_fd (ctx, line, rfd);
} }
static gpgme_data_encoding_t static gpgme_data_encoding_t
server_data_encoding (const char *line) server_data_encoding (const char *line)
@ -2033,7 +2033,7 @@ reset_notify (assuan_context_t ctx, char *line)
} }
static const char hlp_version[] = static const char hlp_version[] =
"VERSION [<string>]\n" "VERSION [<string>]\n"
"\n" "\n"
"Call the function gpgme_check_version."; "Call the function gpgme_check_version.";
@ -2065,7 +2065,7 @@ cmd_engine (assuan_context_t ctx, char *line)
} }
static const char hlp_protocol[] = static const char hlp_protocol[] =
"PROTOCOL [<name>]\n" "PROTOCOL [<name>]\n"
"\n" "\n"
"With NAME, set the protocol. Without, return the current\n" "With NAME, set the protocol. Without, return the current\n"
@ -2109,11 +2109,11 @@ cmd_armor (assuan_context_t ctx, char *line)
if (line && *line) if (line && *line)
{ {
int flag = 0; int flag = 0;
if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes") if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes")
|| line[0] == '1') || line[0] == '1')
flag = 1; flag = 1;
return gt_set_armor (server->gt, flag); return gt_set_armor (server->gt, flag);
} }
else else
@ -2137,7 +2137,7 @@ cmd_textmode (assuan_context_t ctx, char *line)
if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes") if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes")
|| line[0] == '1') || line[0] == '1')
flag = 1; flag = 1;
return gt_set_textmode (server->gt, flag); return gt_set_textmode (server->gt, flag);
} }
else else
@ -2160,12 +2160,12 @@ cmd_include_certs (assuan_context_t ctx, char *line)
if (line && *line) if (line && *line)
{ {
int include_certs = 0; int include_certs = 0;
if (! strcasecmp (line, "default")) if (! strcasecmp (line, "default"))
include_certs = GPGME_INCLUDE_CERTS_DEFAULT; include_certs = GPGME_INCLUDE_CERTS_DEFAULT;
else else
include_certs = atoi (line); include_certs = atoi (line);
return gt_set_include_certs (server->gt, include_certs); return gt_set_include_certs (server->gt, include_certs);
} }
else else
@ -2186,7 +2186,7 @@ cmd_keylist_mode (assuan_context_t ctx, char *line)
if (line && *line) if (line && *line)
{ {
gpgme_keylist_mode_t mode = 0; gpgme_keylist_mode_t mode = 0;
if (strstr (line, "local")) if (strstr (line, "local"))
mode |= GPGME_KEYLIST_MODE_LOCAL; mode |= GPGME_KEYLIST_MODE_LOCAL;
if (strstr (line, "extern")) if (strstr (line, "extern"))
@ -2199,7 +2199,7 @@ cmd_keylist_mode (assuan_context_t ctx, char *line)
mode |= GPGME_KEYLIST_MODE_EPHEMERAL; mode |= GPGME_KEYLIST_MODE_EPHEMERAL;
if (strstr (line, "validate")) if (strstr (line, "validate"))
mode |= GPGME_KEYLIST_MODE_VALIDATE; mode |= GPGME_KEYLIST_MODE_VALIDATE;
return gt_set_keylist_mode (server->gt, mode); return gt_set_keylist_mode (server->gt, mode);
} }
else else
@ -2339,7 +2339,7 @@ _cmd_decrypt_verify (assuan_context_t ctx, char *line, int verify)
out_fn = server->output_filename; out_fn = server->output_filename;
if (out_fd == ASSUAN_INVALID_FD && !out_fn) if (out_fd == ASSUAN_INVALID_FD && !out_fn)
return GPG_ERR_ASS_NO_OUTPUT; return GPG_ERR_ASS_NO_OUTPUT;
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data, err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream); &server->input_stream);
if (err) if (err)
@ -2352,7 +2352,7 @@ _cmd_decrypt_verify (assuan_context_t ctx, char *line, int verify)
return err; return err;
} }
err = gt_decrypt_verify (server->gt, inp_data, out_data, verify); err = gt_decrypt_verify (server->gt, inp_data, out_data, verify);
gpgme_data_release (inp_data); gpgme_data_release (inp_data);
gpgme_data_release (out_data); gpgme_data_release (out_data);
@ -2410,7 +2410,7 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign)
flags |= GPGME_ENCRYPT_PREPARE; flags |= GPGME_ENCRYPT_PREPARE;
if (strstr (line, "--expect-sign")) if (strstr (line, "--expect-sign"))
flags |= GPGME_ENCRYPT_EXPECT_SIGN; flags |= GPGME_ENCRYPT_EXPECT_SIGN;
inp_fd = assuan_get_input_fd (ctx); inp_fd = assuan_get_input_fd (ctx);
inp_fn = server->input_filename; inp_fn = server->input_filename;
out_fd = assuan_get_output_fd (ctx); out_fd = assuan_get_output_fd (ctx);
@ -2433,7 +2433,7 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign)
} }
} }
err = gt_sign_encrypt (server->gt, flags, inp_data, out_data, sign); err = gt_sign_encrypt (server->gt, flags, inp_data, out_data, sign);
gpgme_data_release (inp_data); gpgme_data_release (inp_data);
gpgme_data_release (out_data); gpgme_data_release (out_data);
@ -2510,7 +2510,7 @@ cmd_sign (assuan_context_t ctx, char *line)
out_fn = server->output_filename; out_fn = server->output_filename;
if (out_fd == ASSUAN_INVALID_FD && !out_fn) if (out_fd == ASSUAN_INVALID_FD && !out_fn)
return GPG_ERR_ASS_NO_OUTPUT; return GPG_ERR_ASS_NO_OUTPUT;
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data, err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream); &server->input_stream);
if (err) if (err)
@ -2614,7 +2614,7 @@ static gpg_error_t
cmd_import (assuan_context_t ctx, char *line) cmd_import (assuan_context_t ctx, char *line)
{ {
struct server *server = assuan_get_pointer (ctx); struct server *server = assuan_get_pointer (ctx);
if (line && *line) if (line && *line)
{ {
char *fprs[2] = { line, NULL }; char *fprs[2] = { line, NULL };
@ -2627,7 +2627,7 @@ cmd_import (assuan_context_t ctx, char *line)
assuan_fd_t inp_fd; assuan_fd_t inp_fd;
char *inp_fn; char *inp_fn;
gpgme_data_t inp_data; gpgme_data_t inp_data;
inp_fd = assuan_get_input_fd (ctx); inp_fd = assuan_get_input_fd (ctx);
inp_fn = server->input_filename; inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn) if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
@ -2637,9 +2637,9 @@ cmd_import (assuan_context_t ctx, char *line)
&server->input_stream); &server->input_stream);
if (err) if (err)
return err; return err;
err = gt_import (server->gt, inp_data); err = gt_import (server->gt, inp_data);
gpgme_data_release (inp_data); gpgme_data_release (inp_data);
server_reset_fds (server); server_reset_fds (server);
@ -2648,7 +2648,7 @@ cmd_import (assuan_context_t ctx, char *line)
} }
static const char hlp_export[] = static const char hlp_export[] =
"EXPORT [--extern] [--minimal] [<pattern>]\n" "EXPORT [--extern] [--minimal] [<pattern>]\n"
"\n" "\n"
"Export the keys described by PATTERN. Write the\n" "Export the keys described by PATTERN. Write the\n"
@ -2730,7 +2730,7 @@ cmd_genkey (assuan_context_t ctx, char *line)
return GPG_ERR_ASS_NO_INPUT; return GPG_ERR_ASS_NO_INPUT;
out_fd = assuan_get_output_fd (ctx); out_fd = assuan_get_output_fd (ctx);
out_fn = server->output_filename; out_fn = server->output_filename;
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data, err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream); &server->input_stream);
if (err) if (err)
@ -2789,7 +2789,7 @@ cmd_genkey (assuan_context_t ctx, char *line)
if (parms_data) if (parms_data)
gpgme_data_release (parms_data); gpgme_data_release (parms_data);
return err; return err;
} }
@ -2811,7 +2811,7 @@ cmd_delete (assuan_context_t ctx, char *line)
} }
static const char hlp_keylist[] = static const char hlp_keylist[] =
"KEYLIST [--secret-only] [<patterns>]\n" "KEYLIST [--secret-only] [<patterns>]\n"
"\n" "\n"
"List all certificates or only those specified by PATTERNS. Each\n" "List all certificates or only those specified by PATTERNS. Each\n"
@ -2877,14 +2877,14 @@ cmd_keylist (assuan_context_t ctx, char *line)
gpgme_key_unref (key); gpgme_key_unref (key);
} }
} }
server_reset_fds (server); server_reset_fds (server);
return err; return err;
} }
static const char hlp_getauditlog[] = static const char hlp_getauditlog[] =
"GETAUDITLOG [--html] [--with-help]\n" "GETAUDITLOG [--html] [--with-help]\n"
"\n" "\n"
"Call the function gpgme_op_getauditlog with the given flags. Write\n" "Call the function gpgme_op_getauditlog with the given flags. Write\n"
@ -3087,7 +3087,7 @@ register_commands (assuan_context_t ctx)
table[idx].help); table[idx].help);
if (err) if (err)
return err; return err;
} }
return 0; return 0;
} }
@ -3153,7 +3153,7 @@ gpgme_server (gpgme_tool_t gt)
log_error (0, err, "assuan accept problem"); log_error (0, err, "assuan accept problem");
break; break;
} }
err = assuan_process (server.assuan_ctx); err = assuan_process (server.assuan_ctx);
if (err) if (err)
log_error (0, err, "assuan processing failed"); log_error (0, err, "assuan processing failed");

View File

@ -2,17 +2,17 @@
Copyright (C) 2008 g10 Code GmbH Copyright (C) 2008 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -63,7 +63,7 @@ build_commandline (char **argv)
int n = 0; int n = 0;
char *buf; char *buf;
char *p; char *p;
/* We have to quote some things because under Windows the program /* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes whole argument in double-quotes, and escape literal double-quotes
@ -145,7 +145,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
memset (&sec_attr, 0, sizeof sec_attr); memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr; sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE; sec_attr.bInheritHandle = FALSE;
arg_string = build_commandline (argv); arg_string = build_commandline (argv);
if (!arg_string) if (!arg_string)
return -1; return -1;
@ -182,11 +182,11 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_list[i].peer_name); fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_list[i].peer_name);
} }
} }
if (!duped_stdin || !duped_stdout || !duped_stderr) if (!duped_stdin || !duped_stdout || !duped_stderr)
{ {
SECURITY_ATTRIBUTES sa; SECURITY_ATTRIBUTES sa;
memset (&sa, 0, sizeof sa); memset (&sa, 0, sizeof sa);
sa.nLength = sizeof sa; sa.nLength = sizeof sa;
sa.bInheritHandle = TRUE; sa.bInheritHandle = TRUE;
@ -214,8 +214,8 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
if (!duped_stderr) if (!duped_stderr)
si.hStdError = hnul; si.hStdError = hnul;
} }
cr_flags |= CREATE_SUSPENDED; cr_flags |= CREATE_SUSPENDED;
cr_flags |= DETACHED_PROCESS; cr_flags |= DETACHED_PROCESS;
if (!CreateProcessA (argv[0], if (!CreateProcessA (argv[0],
arg_string, arg_string,
@ -239,7 +239,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
/* Close the /dev/nul handle if used. */ /* Close the /dev/nul handle if used. */
if (hnul != INVALID_HANDLE_VALUE) if (hnul != INVALID_HANDLE_VALUE)
CloseHandle (hnul); CloseHandle (hnul);
for (i = 0; fd_list[i].handle != -1; i++) for (i = 0; fd_list[i].handle != -1; i++)
CloseHandle ((HANDLE) fd_list[i].handle); CloseHandle ((HANDLE) fd_list[i].handle);
@ -248,7 +248,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
static int initialized; static int initialized;
static BOOL (WINAPI * func)(DWORD); static BOOL (WINAPI * func)(DWORD);
void *handle; void *handle;
if (!initialized) if (!initialized)
{ {
/* Available since W2000; thus we dynload it. */ /* Available since W2000; thus we dynload it. */
@ -261,7 +261,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
FreeLibrary (handle); FreeLibrary (handle);
} }
} }
if (func) if (func)
{ {
int rc = func (pi.dwProcessId); int rc = func (pi.dwProcessId);
@ -269,7 +269,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
(int)pi.dwProcessId, rc); (int)pi.dwProcessId, rc);
} }
} }
ResumeThread (pi.hThread); ResumeThread (pi.hThread);
CloseHandle (pi.hThread); CloseHandle (pi.hThread);
CloseHandle (pi.hProcess); CloseHandle (pi.hProcess);
@ -281,8 +281,8 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
#define MAX_TRANS 10 #define MAX_TRANS 10
int int
translate_get_from_file (const char *trans_file, translate_get_from_file (const char *trans_file,
struct spawn_fd_item_s *fd_list, struct spawn_fd_item_s *fd_list,
unsigned int *r_flags) unsigned int *r_flags)
{ {
/* Hold roughly MAX_TRANS triplets of 64 bit numbers in hex /* Hold roughly MAX_TRANS triplets of 64 bit numbers in hex
@ -340,7 +340,7 @@ translate_get_from_file (const char *trans_file,
if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) if (tail == NULL || ! (*tail == '\0' || isspace (*tail)))
break; break;
linep = tail; linep = tail;
while (isspace (*((unsigned char *)linep))) while (isspace (*((unsigned char *)linep)))
linep++; linep++;
if (*linep == '\0') if (*linep == '\0')

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
@ -71,7 +71,7 @@ gpgme_new (gpgme_ctx_t *r_ctx)
return TRACE_ERR (gpg_error_from_errno (errno)); return TRACE_ERR (gpg_error_from_errno (errno));
INIT_LOCK (ctx->lock); INIT_LOCK (ctx->lock);
_gpgme_engine_info_copy (&ctx->engine_info); _gpgme_engine_info_copy (&ctx->engine_info);
if (!ctx->engine_info) if (!ctx->engine_info)
{ {
@ -727,7 +727,7 @@ gpgme_ctx_set_engine_info (gpgme_ctx_t ctx, gpgme_protocol_t proto,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
/* Shut down the engine when changing engine info. */ /* Shut down the engine when changing engine info. */
if (ctx->engine) if (ctx->engine)
{ {
@ -789,7 +789,7 @@ gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
"name=%s, value=%s, flags=0x%x", "name=%s, value=%s, flags=0x%x",
name ? name : "(null)", value ? value : "(null)", name ? name : "(null)", value ? value : "(null)",
flags); flags);
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
@ -826,7 +826,7 @@ gpgme_sig_notation_get (gpgme_ctx_t ctx)
return ctx->sig_notations; return ctx->sig_notations;
} }
const char * const char *
gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo) gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo)

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 @@ gpgme_op_import_result (gpgme_ctx_t ctx)
return NULL; return NULL;
} }
if (_gpgme_debug_trace ()) if (_gpgme_debug_trace ())
{ {
gpgme_import_status_t impstat; gpgme_import_status_t impstat;
@ -318,7 +318,7 @@ gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata)
static gpgme_error_t static gpgme_error_t
_gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous, _gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous,
gpgme_key_t *keys) gpgme_key_t *keys)
{ {
gpgme_error_t err; gpgme_error_t err;
@ -382,7 +382,7 @@ gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t *keys)
while (keys[i]) while (keys[i])
{ {
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i], TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
(keys[i]->subkeys && keys[i]->subkeys->fpr) ? (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid"); keys[i]->subkeys->fpr : "invalid");
i++; i++;
} }
@ -421,7 +421,7 @@ gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t *keys)
while (keys[i]) while (keys[i])
{ {
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i], TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
(keys[i]->subkeys && keys[i]->subkeys->fpr) ? (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid"); keys[i]->subkeys->fpr : "invalid");
i++; i++;
} }

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
@ -78,7 +78,7 @@ _gpgme_key_add_subkey (gpgme_key_t key, gpgme_subkey_t *r_subkey)
static char * static char *
set_user_id_part (char *tail, const char *buf, size_t len) set_user_id_part (char *tail, const char *buf, size_t len)
{ {
while (len && (buf[len - 1] == ' ' || buf[len - 1] == '\t')) while (len && (buf[len - 1] == ' ' || buf[len - 1] == '\t'))
len--; len--;
for (; len; len--) for (; len; len--)
*tail++ = *buf++; *tail++ = *buf++;
@ -157,10 +157,10 @@ parse_user_id (char *src, char **name, char **email,
{ {
in_name = 1; in_name = 1;
start = src; start = src;
} }
src++; src++;
} }
if (in_name) if (in_name)
{ {
if (!*name) if (!*name)
@ -169,7 +169,7 @@ parse_user_id (char *src, char **name, char **email,
tail = set_user_id_part (tail, start, src - start); tail = set_user_id_part (tail, start, src - start);
} }
} }
/* Let unused parts point to an EOS. */ /* Let unused parts point to an EOS. */
tail--; tail--;
if (!*name) if (!*name)
@ -187,7 +187,7 @@ parse_x509_user_id (char *src, char **name, char **email,
{ {
if (*src == '<' && src[strlen (src) - 1] == '>') if (*src == '<' && src[strlen (src) - 1] == '>')
*email = src; *email = src;
/* Let unused parts point to an EOS. */ /* Let unused parts point to an EOS. */
tail--; tail--;
if (!*name) if (!*name)
@ -361,7 +361,7 @@ gpgme_key_unref (gpgme_key_t key)
free (uid); free (uid);
uid = next_uid; uid = next_uid;
} }
if (key->issuer_serial) if (key->issuer_serial)
free (key->issuer_serial); free (key->issuer_serial);
if (key->issuer_name) if (key->issuer_name)
@ -518,7 +518,7 @@ gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
case GPGME_ATTR_FPR: case GPGME_ATTR_FPR:
return subkey ? subkey->fpr : NULL; return subkey ? subkey->fpr : NULL;
case GPGME_ATTR_ALGO: case GPGME_ATTR_ALGO:
return subkey ? gpgme_pubkey_algo_name (subkey->pubkey_algo) : NULL; return subkey ? gpgme_pubkey_algo_name (subkey->pubkey_algo) : NULL;
case GPGME_ATTR_TYPE: case GPGME_ATTR_TYPE:
@ -527,10 +527,10 @@ gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
case GPGME_ATTR_OTRUST: case GPGME_ATTR_OTRUST:
return otrust_to_string (key->owner_trust); return otrust_to_string (key->owner_trust);
case GPGME_ATTR_USERID: case GPGME_ATTR_USERID:
return uid ? uid->uid : NULL; return uid ? uid->uid : NULL;
case GPGME_ATTR_NAME: case GPGME_ATTR_NAME:
return uid ? uid->name : NULL; return uid ? uid->name : NULL;
case GPGME_ATTR_EMAIL: case GPGME_ATTR_EMAIL:
@ -542,7 +542,7 @@ gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
case GPGME_ATTR_VALIDITY: case GPGME_ATTR_VALIDITY:
return uid ? validity_to_string (uid->validity) : NULL; return uid ? validity_to_string (uid->validity) : NULL;
case GPGME_ATTR_KEY_CAPS: case GPGME_ATTR_KEY_CAPS:
return subkey ? capabilities_to_string (subkey) : NULL; return subkey ? capabilities_to_string (subkey) : NULL;
case GPGME_ATTR_SERIAL: case GPGME_ATTR_SERIAL:
@ -604,7 +604,7 @@ gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
return (subkey && subkey->timestamp >= 0) return (subkey && subkey->timestamp >= 0)
? (unsigned long) subkey->timestamp : 0; ? (unsigned long) subkey->timestamp : 0;
case GPGME_ATTR_EXPIRE: case GPGME_ATTR_EXPIRE:
return (subkey && subkey->expires >= 0) return (subkey && subkey->expires >= 0)
? (unsigned long) subkey->expires : 0; ? (unsigned long) subkey->expires : 0;
@ -693,13 +693,13 @@ gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
case GPGME_ATTR_KEYID: case GPGME_ATTR_KEYID:
return certsig->keyid; return certsig->keyid;
case GPGME_ATTR_ALGO: case GPGME_ATTR_ALGO:
return gpgme_pubkey_algo_name (certsig->pubkey_algo); return gpgme_pubkey_algo_name (certsig->pubkey_algo);
case GPGME_ATTR_USERID: case GPGME_ATTR_USERID:
return certsig->uid; return certsig->uid;
case GPGME_ATTR_NAME: case GPGME_ATTR_NAME:
return certsig->name; return certsig->name;
case GPGME_ATTR_EMAIL: case GPGME_ATTR_EMAIL:
@ -707,7 +707,7 @@ gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
case GPGME_ATTR_COMMENT: case GPGME_ATTR_COMMENT:
return certsig->comment; return certsig->comment;
default: default:
return NULL; return NULL;
} }
@ -725,13 +725,13 @@ gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, _gpgme_attr_t what,
switch (what) switch (what)
{ {
case GPGME_ATTR_ALGO: case GPGME_ATTR_ALGO:
return (unsigned long) certsig->pubkey_algo; return (unsigned long) certsig->pubkey_algo;
case GPGME_ATTR_CREATED: case GPGME_ATTR_CREATED:
return certsig->timestamp < 0 ? 0L : (unsigned long) certsig->timestamp; return certsig->timestamp < 0 ? 0L : (unsigned long) certsig->timestamp;
case GPGME_ATTR_EXPIRE: case GPGME_ATTR_EXPIRE:
return certsig->expires < 0 ? 0L : (unsigned long) certsig->expires; return certsig->expires < 0 ? 0L : (unsigned long) certsig->expires;
case GPGME_ATTR_KEY_REVOKED: case GPGME_ATTR_KEY_REVOKED:

View File

@ -4,17 +4,17 @@
2008, 2009 g10 Code GmbH 2008, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -218,7 +218,7 @@ set_userid_flags (gpgme_key_t key, const char *src)
case 'r': case 'r':
uid->revoked = 1; uid->revoked = 1;
break; break;
case 'i': case 'i':
uid->invalid = 1; uid->invalid = 1;
break; break;
@ -469,17 +469,17 @@ keylist_colon_handler (void *priv, char *line)
rectype = RT_CRT; rectype = RT_CRT;
else if (!strcmp (field[0], "crs")) else if (!strcmp (field[0], "crs"))
rectype = RT_CRS; rectype = RT_CRS;
else if (!strcmp (field[0], "fpr") && key) else if (!strcmp (field[0], "fpr") && key)
rectype = RT_FPR; rectype = RT_FPR;
else if (!strcmp (field[0], "uid") && key) else if (!strcmp (field[0], "uid") && key)
rectype = RT_UID; rectype = RT_UID;
else if (!strcmp (field[0], "sub") && key) else if (!strcmp (field[0], "sub") && key)
rectype = RT_SUB; rectype = RT_SUB;
else if (!strcmp (field[0], "ssb") && key) else if (!strcmp (field[0], "ssb") && key)
rectype = RT_SSB; rectype = RT_SSB;
else if (!strcmp (field[0], "spk") && key) else if (!strcmp (field[0], "spk") && key)
rectype = RT_SPK; rectype = RT_SPK;
else else
rectype = RT_NONE; rectype = RT_NONE;
/* Only look at signatures immediately following a user ID. For /* Only look at signatures immediately following a user ID. For
@ -529,7 +529,7 @@ keylist_colon_handler (void *priv, char *line)
int i = atoi (field[2]); int i = atoi (field[2]);
/* Ignore invalid values. */ /* Ignore invalid values. */
if (i > 1) if (i > 1)
subkey->length = i; subkey->length = i;
} }
/* Field 4 has the public key algorithm. */ /* Field 4 has the public key algorithm. */
@ -560,7 +560,7 @@ keylist_colon_handler (void *priv, char *line)
if (!key->issuer_serial) if (!key->issuer_serial)
return gpg_error_from_errno (errno); return gpg_error_from_errno (errno);
} }
/* Field 9 has the ownertrust. */ /* Field 9 has the ownertrust. */
if (fields >= 9) if (fields >= 9)
set_ownertrust (key, field[8]); set_ownertrust (key, field[8]);
@ -632,7 +632,7 @@ keylist_colon_handler (void *priv, char *line)
/* Field 8 is reserved (LID). */ /* Field 8 is reserved (LID). */
/* Field 9 has the ownertrust. */ /* Field 9 has the ownertrust. */
/* Field 10, the user ID, is n/a for a subkey. */ /* Field 10, the user ID, is n/a for a subkey. */
/* Field 11 has the signature class. */ /* Field 11 has the signature class. */
/* Field 12 has the capabilities. */ /* Field 12 has the capabilities. */
@ -730,11 +730,11 @@ keylist_colon_handler (void *priv, char *line)
if (i >= 1 && i < 128) if (i >= 1 && i < 128)
keysig->pubkey_algo = i; keysig->pubkey_algo = i;
} }
/* Field 5 has the long keyid. */ /* Field 5 has the long keyid. */
if (fields >= 5 && strlen (field[4]) == DIM(keysig->_keyid) - 1) if (fields >= 5 && strlen (field[4]) == DIM(keysig->_keyid) - 1)
strcpy (keysig->_keyid, field[4]); strcpy (keysig->_keyid, field[4]);
/* Field 6 has the timestamp (seconds). */ /* Field 6 has the timestamp (seconds). */
if (fields >= 6) if (fields >= 6)
keysig->timestamp = _gpgme_parse_timestamp (field[5], NULL); keysig->timestamp = _gpgme_parse_timestamp (field[5], NULL);
@ -802,7 +802,7 @@ keylist_colon_handler (void *priv, char *line)
keysig->_last_notation = notation; keysig->_last_notation = notation;
} }
} }
case RT_NONE: case RT_NONE:
/* Unknown record. */ /* Unknown record. */
break; break;
@ -961,19 +961,19 @@ gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
if (!opd->key_cond) if (!opd->key_cond)
return TRACE_ERR (gpg_error (GPG_ERR_EOF)); return TRACE_ERR (gpg_error (GPG_ERR_EOF));
opd->key_cond = 0; opd->key_cond = 0;
assert (opd->key_queue); assert (opd->key_queue);
} }
queue_item = opd->key_queue; queue_item = opd->key_queue;
opd->key_queue = queue_item->next; opd->key_queue = queue_item->next;
if (!opd->key_queue) if (!opd->key_queue)
opd->key_cond = 0; opd->key_cond = 0;
*r_key = queue_item->key; *r_key = queue_item->key;
free (queue_item); free (queue_item);
return TRACE_SUC2 ("key=%p (%s)", *r_key, return TRACE_SUC2 ("key=%p (%s)", *r_key,
((*r_key)->subkeys && (*r_key)->subkeys->fpr) ? ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid"); (*r_key)->subkeys->fpr : "invalid");
} }
@ -983,7 +983,7 @@ gpgme_error_t
gpgme_op_keylist_end (gpgme_ctx_t ctx) gpgme_op_keylist_end (gpgme_ctx_t ctx)
{ {
TRACE (DEBUG_CTX, "gpgme_op_keylist_end", ctx); TRACE (DEBUG_CTX, "gpgme_op_keylist_end", ctx);
if (!ctx) if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
@ -1006,7 +1006,7 @@ gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key,
if (!ctx || !r_key || !fpr) if (!ctx || !r_key || !fpr)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (strlen (fpr) < 8) /* We have at least a key ID. */ if (strlen (fpr) < 8) /* We have at least a key ID. */
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
@ -1068,7 +1068,7 @@ gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, gpgme_key_t *r_key,
if (! err) if (! err)
{ {
TRACE_LOG2 ("key=%p (%s)", *r_key, TRACE_LOG2 ("key=%p (%s)", *r_key,
((*r_key)->subkeys && (*r_key)->subkeys->fpr) ? ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid"); (*r_key)->subkeys->fpr : "invalid");
} }
return TRACE_ERR (err); return TRACE_ERR (err);

View File

@ -2,17 +2,17 @@
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2002, 2003, 2004, 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -72,7 +72,7 @@ _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type, void **hook,
/* type is: 0: asynchronous operation (use global or user event loop). /* type is: 0: asynchronous operation (use global or user event loop).
1: synchronous operation (always use private event loop). 1: synchronous operation (always use private event loop).
2: asynchronous private operation (use private or user 2: asynchronous private operation (use private or user
event loop). event loop).
256: Modification flag to suppress the engine reset. 256: Modification flag to suppress the engine reset.
*/ */
gpgme_error_t gpgme_error_t

View File

@ -2,17 +2,17 @@
Copyright (C) 2009 g10 Code GmbH Copyright (C) 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -79,7 +79,7 @@ opassuan_start (gpgme_ctx_t ctx, int synchronous,
/* XXXX. This is the asynchronous variant. */ /* XXXX. This is the asynchronous variant. */
gpgme_error_t gpgme_error_t
gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,
@ -128,7 +128,7 @@ gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
if (!ctx) if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
err = opassuan_start (ctx, 1, command, err = opassuan_start (ctx, 1, command,
data_cb, data_cb_value, data_cb, data_cb_value,
inq_cb, inq_cb_value, inq_cb, inq_cb_value,
status_cb, status_cb_value); status_cb, status_cb_value);
@ -147,7 +147,7 @@ gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
} }
if (op_err_p) if (op_err_p)
*op_err_p = op_err; *op_err_p = op_err;
out: out:
return TRACE_ERR (err); return TRACE_ERR (err);
} }

View File

@ -1,19 +1,19 @@
/* ops.h - Internal operation support. /* ops.h - Internal operation support.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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

View File

@ -1,19 +1,19 @@
/* passphrase.c - Passphrase callback. /* passphrase.c - Passphrase callback.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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
@ -133,7 +133,7 @@ _gpgme_passphrase_command_handler (void *priv, gpgme_status_code_t code,
if (err) if (err)
return err; return err;
if (code == GPGME_STATUS_GET_HIDDEN if (code == GPGME_STATUS_GET_HIDDEN
&& (!strcmp (key, "passphrase.enter") && (!strcmp (key, "passphrase.enter")
|| !strcmp (key, "passphrase.pin.ask"))) || !strcmp (key, "passphrase.pin.ask")))
{ {

View File

@ -2,17 +2,17 @@
Copyright (C) 2010 g10 Code GmbH Copyright (C) 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -53,7 +53,7 @@ parse_error (char *args)
if (where) if (where)
*where = '\0'; *where = '\0';
where = args; where = args;
} }
else else
return gpg_error (GPG_ERR_INV_ENGINE); return gpg_error (GPG_ERR_INV_ENGINE);
@ -91,7 +91,7 @@ passwd_status_handler (void *priv, gpgme_status_code_t code, char *args)
case GPGME_STATUS_SUCCESS: case GPGME_STATUS_SUCCESS:
opd->success_seen = 1; opd->success_seen = 1;
break; break;
case GPGME_STATUS_EOF: case GPGME_STATUS_EOF:
/* In case the OpenPGP engine does not properly implement the /* In case the OpenPGP engine does not properly implement the
passwd command we won't get a success status back and thus we passwd command we won't get a success status back and thus we
@ -147,7 +147,7 @@ passwd_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
/* Change the passphrase for KEY. FLAGS is reserved for future use /* Change the passphrase for KEY. FLAGS is reserved for future use
and must be passed as 0. The engine is expected to present a user and must be passed as 0. The engine is expected to present a user
interface to enter the old and the new passphrase. This is the interface to enter the old and the new passphrase. This is the
asynchronous variant. asynchronous variant.
Note that if ever the need arises to supply a passphrase we can do Note that if ever the need arises to supply a passphrase we can do
this with a flag value and the passphrase callback feature. */ this with a flag value and the passphrase callback feature. */

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2004, 2005, 2007, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2004, 2005, 2007, 2010 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -195,7 +195,7 @@ _gpgme_io_close (int fd)
handler (fd, handler_value); handler (fd, handler_value);
} }
/* Then do the close. */ /* Then do the close. */
res = close (fd); res = close (fd);
return TRACE_SYSRES (res); return TRACE_SYSRES (res);
} }
@ -212,7 +212,7 @@ _gpgme_io_set_close_notify (int fd, _gpgme_close_notify_handler_t handler,
"close_handler=%p/%p", handler, value); "close_handler=%p/%p", handler, value);
assert (fd != -1); assert (fd != -1);
LOCK (notify_table_lock); LOCK (notify_table_lock);
for (idx=0; idx < notify_table_size; idx++) for (idx=0; idx < notify_table_size; idx++)
if (notify_table[idx].fd == -1) if (notify_table[idx].fd == -1)
@ -246,7 +246,7 @@ _gpgme_io_set_close_notify (int fd, _gpgme_close_notify_handler_t handler,
notify_table[idx].fd = fd; notify_table[idx].fd = fd;
notify_table[idx].handler = handler; notify_table[idx].handler = handler;
notify_table[idx].value = value; notify_table[idx].value = value;
leave: leave:
UNLOCK (notify_table_lock); UNLOCK (notify_table_lock);
@ -389,7 +389,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
TRACE_LOG3 ("fd[%i] = 0x%x -> 0x%x", i, fd_list[i].fd, fd_list[i].dup_to); TRACE_LOG3 ("fd[%i] = 0x%x -> 0x%x", i, fd_list[i].fd, fd_list[i].dup_to);
pid = fork (); pid = fork ();
if (pid == -1) if (pid == -1)
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
if (!pid) if (!pid)
@ -450,7 +450,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
close (fd_list[i].fd); close (fd_list[i].fd);
} }
if (! seen_stdin || ! seen_stderr) if (! seen_stdin || ! seen_stderr)
{ {
fd = open ("/dev/null", O_RDWR); fd = open ("/dev/null", O_RDWR);
@ -492,7 +492,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
if (fd != 0 && fd != 2) if (fd != 0 && fd != 2)
close (fd); close (fd);
} }
execv (path, (char *const *) argv); execv (path, (char *const *) argv);
/* Hmm: in that case we could write a special status code to the /* Hmm: in that case we could write a special status code to the
status-pipe. */ status-pipe. */
@ -559,7 +559,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
any = 0; any = 0;
for (i = 0; i < nfds; i++) for (i = 0; i < nfds; i++)
{ {
if (fds[i].fd == -1) if (fds[i].fd == -1)
continue; continue;
if (fds[i].for_read) if (fds[i].for_read)
{ {
@ -581,7 +581,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
} }
fds[i].signaled = 0; fds[i].signaled = 0;
} }
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
if (!any) if (!any)
return TRACE_SYSRES (0); return TRACE_SYSRES (0);
@ -606,7 +606,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
} }
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
} }
/* The variable N is used to optimize it a little bit. */ /* The variable N is used to optimize it a little bit. */
for (n = count, i = 0; i < nfds && n; i++) for (n = count, i = 0; i < nfds && n; i++)
{ {
@ -649,7 +649,7 @@ _gpgme_io_recvmsg (int fd, struct msghdr *msg, int flags)
nread += iov->iov_len; nread += iov->iov_len;
iov++; iov++;
} }
TRACE_LOG1 ("about to receive %d bytes", nread); TRACE_LOG1 ("about to receive %d bytes", nread);
do do

View File

@ -1,19 +1,19 @@
/* posix-sema.c /* posix-sema.c
Copyright (C) 2001 Werner Koch (dd9jn) Copyright (C) 2001 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH Copyright (C) 2001, 2002, 2004, 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

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2004 g10 Code GmbH Copyright (C) 2001, 2002, 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
@ -100,7 +100,7 @@ _gpgme_get_conf_int (const char *key, int *value)
return 0; return 0;
} }
void void
_gpgme_allow_set_foreground_window (pid_t pid) _gpgme_allow_set_foreground_window (pid_t pid)
{ {
(void)pid; (void)pid;

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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

View File

@ -1,19 +1,19 @@
/* progress.c - status handler for progress status /* progress.c - status handler for progress status
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
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
@ -71,7 +71,7 @@ _gpgme_progress_status_handler (void *priv, gpgme_status_code_t code,
} }
} }
} }
} }
if (type != 'X') if (type != 'X')
ctx->progress_cb (ctx->progress_cb_value, args_cpy, type, current, total); ctx->progress_cb (ctx->progress_cb_value, args_cpy, type, current, total);

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

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2001, 2003, 2004, 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
@ -43,7 +43,7 @@ struct critsect_s
} \ } \
while (0) while (0)
#define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name)) #define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name))
#define LOCK(name) \ #define LOCK(name) \
do \ do \

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
@ -56,7 +56,7 @@ sig_notation_set_flags (gpgme_sig_notation_t notation,
/* We copy the flags into individual bits to make them easier /* We copy the flags into individual bits to make them easier
accessible individually for the user. */ accessible individually for the user. */
notation->human_readable = flags & GPGME_SIG_NOTATION_HUMAN_READABLE ? 1 : 0; notation->human_readable = flags & GPGME_SIG_NOTATION_HUMAN_READABLE ? 1 : 0;
notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0; notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0;
notation->flags = flags; notation->flags = flags;
} }

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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
@ -273,7 +273,7 @@ _gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args)
case GPGME_STATUS_INV_RECP: case GPGME_STATUS_INV_RECP:
if (opd->inv_sgnr_seen && opd->ignore_inv_recp) if (opd->inv_sgnr_seen && opd->ignore_inv_recp)
break; break;
/* FALLTROUGH */ /* FALLTROUGH */
case GPGME_STATUS_INV_SGNR: case GPGME_STATUS_INV_SGNR:
if (code == GPGME_STATUS_INV_SGNR) if (code == GPGME_STATUS_INV_SGNR)

View File

@ -1,19 +1,19 @@
/* signers.c - Maintain signer sets. /* signers.c - Maintain signer sets.
Copyright (C) 2001 Werner Koch (dd9jn) Copyright (C) 2001 Werner Koch (dd9jn)
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
@ -66,7 +66,7 @@ gpgme_error_t
gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key) gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
{ {
TRACE_BEG2 (DEBUG_CTX, "gpgme_signers_add", ctx, TRACE_BEG2 (DEBUG_CTX, "gpgme_signers_add", ctx,
"key=%p (%s)", key, (key->subkeys && key->subkeys->fpr) ? "key=%p (%s)", key, (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid"); key->subkeys->fpr : "invalid");
if (!ctx || !key) if (!ctx || !key)

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
@ -120,7 +120,7 @@ const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
val = item->keyid; val = item->keyid;
break; break;
case GPGME_ATTR_OTRUST: case GPGME_ATTR_OTRUST:
val = item->owner_trust; val = item->owner_trust;
break; break;
@ -128,7 +128,7 @@ const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
val = item->validity; val = item->validity;
break; break;
case GPGME_ATTR_USERID: case GPGME_ATTR_USERID:
val = item->name; val = item->name;
break; break;
@ -156,11 +156,11 @@ int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
switch (what) switch (what)
{ {
case GPGME_ATTR_LEVEL: case GPGME_ATTR_LEVEL:
val = item->level; val = item->level;
break; break;
case GPGME_ATTR_TYPE: case GPGME_ATTR_TYPE:
val = item->type; val = item->type;
break; break;

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
@ -83,7 +83,7 @@ trustlist_colon_handler (void *priv, char *line)
{ {
field++; field++;
pend = strchr (p, ':'); pend = strchr (p, ':');
if (pend) if (pend)
*pend++ = 0; *pend++ = 0;
switch (field) switch (field)
@ -232,7 +232,7 @@ gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)
return TRACE_ERR (err); return TRACE_ERR (err);
if (!opd->trust_cond) if (!opd->trust_cond)
return TRACE_ERR (gpg_error (GPG_ERR_EOF)); return TRACE_ERR (gpg_error (GPG_ERR_EOF));
opd->trust_cond = 0; opd->trust_cond = 0;
assert (opd->trust_queue); assert (opd->trust_queue);
} }
q = opd->trust_queue; q = opd->trust_queue;

View File

@ -33,10 +33,10 @@ Boston, MA 02111-1307, USA. */
#define va_copy(d, s) (*(d) = *(s)) #define va_copy(d, s) (*(d) = *(s))
#elif defined (MUST_COPY_VA_BYVAL) #elif defined (MUST_COPY_VA_BYVAL)
#define va_copy(d, s) ((d) = (s)) #define va_copy(d, s) ((d) = (s))
#else #else
#define va_copy(d, s) memcpy ((d), (s), sizeof (va_list)) #define va_copy(d, s) memcpy ((d), (s), sizeof (va_list))
#endif #endif
#endif #endif
#ifdef TEST #ifdef TEST

View File

@ -1,19 +1,19 @@
/* version.c - Version check routines. /* version.c - Version check routines.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 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
@ -69,7 +69,7 @@ do_subsystem_inits (void)
/* We need to make sure that the sockets are initialized. */ /* We need to make sure that the sockets are initialized. */
{ {
WSADATA wsadat; WSADATA wsadat;
WSAStartup (0x202, &wsadat); WSAStartup (0x202, &wsadat);
} }
#endif #endif
@ -159,7 +159,7 @@ _gpgme_compare_versions (const char *my_version,
if (my_major > rq_major if (my_major > rq_major
|| (my_major == rq_major && my_minor > rq_minor) || (my_major == rq_major && my_minor > rq_minor)
|| (my_major == rq_major && my_minor == rq_minor || (my_major == rq_major && my_minor == rq_minor
&& my_micro > rq_micro) && my_micro > rq_micro)
|| (my_major == rq_major && my_minor == rq_minor || (my_major == rq_major && my_minor == rq_minor
&& my_micro == rq_micro && strcmp (my_plvl, rq_plvl) >= 0)) && my_micro == rq_micro && strcmp (my_plvl, rq_plvl) >= 0))
@ -191,7 +191,7 @@ gpgme_check_version (const char *req_version)
TRACE2 (DEBUG_INIT, "gpgme_check_version", 0, TRACE2 (DEBUG_INIT, "gpgme_check_version", 0,
"req_version=%s, VERSION=%s", "req_version=%s, VERSION=%s",
req_version? req_version:"(null)", VERSION); req_version? req_version:"(null)", VERSION);
result = _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL; result = _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL;
if (result != NULL) if (result != NULL)
_gpgme_selftest = 0; _gpgme_selftest = 0;
@ -233,7 +233,7 @@ gpgme_check_version_internal (const char *req_version,
/* Extract the version string of a program from STRING. The version /* Extract the version string of a program from STRING. The version
number is expected to be in GNU style format: number is expected to be in GNU style format:
foo 1.2.3 foo 1.2.3
foo (bar system) 1.2.3 foo (bar system) 1.2.3
foo 1.2.3 cruft foo 1.2.3 cruft

View File

@ -2,17 +2,17 @@
Copyright (C) 2009 g10 Code GmbH Copyright (C) 2009 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
@ -62,7 +62,7 @@ vfs_start (gpgme_ctx_t ctx, int synchronous,
#if 0 #if 0
/* XXXX. This is the asynchronous variant. */ /* XXXX. This is the asynchronous variant. */
static gpgme_error_t static gpgme_error_t
gpgme_op_vfs_transact_start (gpgme_ctx_t ctx, gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,
@ -93,7 +93,7 @@ gpgme_op_vfs_transact (gpgme_ctx_t ctx,
if (!ctx) if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
err = vfs_start (ctx, 1, command, data_cb, data_cb_value, err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value); inq_cb, inq_cb_value, status_cb, status_cb_value);
if (!err) if (!err)
@ -142,7 +142,7 @@ _gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
free (container_file_esc); free (container_file_esc);
return err; return err;
} }
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL, err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
NULL, NULL, op_err); NULL, NULL, op_err);
free (cmd); free (cmd);
@ -161,7 +161,7 @@ _gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
return err; return err;
} }
free (container_file_esc); free (container_file_esc);
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL, err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
NULL, NULL, op_err); NULL, NULL, op_err);
free (cmd); free (cmd);
@ -187,11 +187,11 @@ gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
if (_gpgme_debug_trace () && recp) if (_gpgme_debug_trace () && recp)
{ {
int i = 0; int i = 0;
while (recp[i]) while (recp[i])
{ {
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
(recp[i]->subkeys && recp[i]->subkeys->fpr) ? (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid"); recp[i]->subkeys->fpr : "invalid");
i++; i++;
} }

View File

@ -2,17 +2,17 @@
Copyright (C) 2009 g10 Code GmbH Copyright (C) 2009 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
@ -119,7 +119,7 @@ vfs_start (gpgme_ctx_t ctx, int synchronous,
#if 0 #if 0
/* XXXX. This is the asynchronous variant. */ /* XXXX. This is the asynchronous variant. */
static gpgme_error_t static gpgme_error_t
gpgme_op_vfs_transact_start (gpgme_ctx_t ctx, gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
const char *command, const char *command,
gpgme_assuan_data_cb_t data_cb, gpgme_assuan_data_cb_t data_cb,
void *data_cb_value, void *data_cb_value,
@ -150,7 +150,7 @@ gpgme_op_vfs_transact (gpgme_ctx_t ctx,
if (!ctx) if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE); return gpg_error (GPG_ERR_INV_VALUE);
err = vfs_start (ctx, 1, command, data_cb, data_cb_value, err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value); inq_cb, inq_cb_value, status_cb, status_cb_value);
if (!err) if (!err)
@ -217,7 +217,7 @@ _gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
if (asprintf (&cmd, "MOUNT") < 0) if (asprintf (&cmd, "MOUNT") < 0)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();
} }
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL, err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
_gpgme_vfs_mount_status_handler, ctx, op_err); _gpgme_vfs_mount_status_handler, ctx, op_err);
free (cmd); free (cmd);

View File

@ -1,19 +1,19 @@
/* w32-ce.h /* w32-ce.h
Copyright (C) 2010 g10 Code GmbH Copyright (C) 2010 g10 Code GmbH
Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc. Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc.
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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -35,7 +35,7 @@
but that header also redefines some Windows functions which we need but that header also redefines some Windows functions which we need
to avoid unless having included shlobj.h. */ to avoid unless having included shlobj.h. */
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <windows.h> #include <windows.h>
#include <shlobj.h> #include <shlobj.h>
@ -92,7 +92,7 @@ utf8_to_wchar (const char *string)
} }
nbytes = (size_t)(n+1) * sizeof(*result); nbytes = (size_t)(n+1) * sizeof(*result);
if (nbytes / sizeof(*result) != (n+1)) if (nbytes / sizeof(*result) != (n+1))
{ {
gpg_err_set_errno (ENOMEM); gpg_err_set_errno (ENOMEM);
return NULL; return NULL;
@ -317,7 +317,7 @@ RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved,
free (name); free (name);
return ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
} }
err = RegQueryValueExW (hKey, name, lpReserved, &type, data, &data_len); err = RegQueryValueExW (hKey, name, lpReserved, &type, data, &data_len);
if (lpType) if (lpType)
*lpType = type; *lpType = type;
@ -337,7 +337,7 @@ RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved,
/* This is valid since we allocated one more above. */ /* This is valid since we allocated one more above. */
((char*)data)[data_len] = '\0'; ((char*)data)[data_len] = '\0';
((char*)data)[data_len + 1] = '\0'; ((char*)data)[data_len + 1] = '\0';
data_c = wchar_to_utf8 ((wchar_t*) data); data_c = wchar_to_utf8 ((wchar_t*) data);
if (!data_c) if (!data_c)
return GetLastError(); return GetLastError();
@ -439,7 +439,7 @@ SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR lpszPath, int nFolder,
path_c = wchar_to_utf8 (path); path_c = wchar_to_utf8 (path);
if (! path_c) if (! path_c)
return 0; return 0;
strncpy (lpszPath, path_c, MAX_PATH); strncpy (lpszPath, path_c, MAX_PATH);
free (path_c); free (path_c);
lpszPath[MAX_PATH - 1] = '\0'; lpszPath[MAX_PATH - 1] = '\0';
@ -449,7 +449,7 @@ SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR lpszPath, int nFolder,
/* Replacement for the access function. Note that we can't use fopen /* Replacement for the access function. Note that we can't use fopen
here because wince might now allow to have a shared read for an here because wince might now allow to have a shared read for an
executable; it is better to to read the file attributes. executable; it is better to to read the file attributes.
Limitation: Only F_OK is supported. Limitation: Only F_OK is supported.
*/ */
int int
@ -476,7 +476,7 @@ _gpgme_wince_access (const char *fname, int mode)
/* Perform a binary search for KEY in BASE which has NMEMB elements /* Perform a binary search for KEY in BASE which has NMEMB elements
of SIZE bytes each. The comparisons are done by (*COMPAR)(). of SIZE bytes each. The comparisons are done by (*COMPAR)().
Code taken from glibc-2.6. */ Code taken from glibc-2.6. */
void * void *
_gpgme_wince_bsearch (const void *key, const void *base, _gpgme_wince_bsearch (const void *key, const void *base,

View File

@ -1,18 +1,18 @@
/* w32-ce.h /* w32-ce.h
Copyright (C) 2010 g10 Code GmbH Copyright (C) 2010 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
@ -74,7 +74,7 @@ int _gpgme_wince_access (const char *fname, int mode);
void *_gpgme_wince_bsearch (const void *key, const void *base, void *_gpgme_wince_bsearch (const void *key, const void *base,
size_t nmemb, size_t size, size_t nmemb, size_t size,
int (*compar) (const void *, const void *)); int (*compar) (const void *, const void *));
#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e)) #define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
#if defined(_MSC_VER) #if defined(_MSC_VER)
/* Remove the redefined __leave keyword. It is defined by MSC for /* Remove the redefined __leave keyword. It is defined by MSC for

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2004, 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
@ -83,7 +83,7 @@
#define MAX_SLAFD 256 #define MAX_SLAFD 256
static struct static struct
{ {
int used; int used;
@ -230,7 +230,7 @@ int
_gpgme_io_fd2str (char *buf, int buflen, int fd) _gpgme_io_fd2str (char *buf, int buflen, int fd)
{ {
HANDLE hndl; HANDLE hndl;
TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_fd2str", fd, "fd=%d", fd); TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_fd2str", fd, "fd=%d", fd);
if (giochannel_table[fd].fd != -1) if (giochannel_table[fd].fd != -1)
hndl = (HANDLE) _get_osfhandle (giochannel_table[fd].fd); hndl = (HANDLE) _get_osfhandle (giochannel_table[fd].fd);
@ -238,7 +238,7 @@ _gpgme_io_fd2str (char *buf, int buflen, int fd)
hndl = (HANDLE) giochannel_table[fd].socket; hndl = (HANDLE) giochannel_table[fd].socket;
TRACE_SUC1 ("syshd=%p", hndl); TRACE_SUC1 ("syshd=%p", hndl);
return snprintf (buf, buflen, "%d", (int) hndl); return snprintf (buf, buflen, "%d", (int) hndl);
} }
@ -299,7 +299,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
nread = -1; nread = -1;
saved_errno = EIO; saved_errno = EIO;
} }
if (nread != 0 && nread != -1) if (nread != 0 && nread != -1)
TRACE_LOGBUF (buffer, nread); TRACE_LOGBUF (buffer, nread);
@ -401,7 +401,7 @@ _gpgme_io_pipe (int filedes[2], int inherit_idx)
if (filedes[inherit_idx] < 0) if (filedes[inherit_idx] < 0)
{ {
int saved_errno = errno; int saved_errno = errno;
_close (fds[0]); _close (fds[0]);
_close (fds[1]); _close (fds[1]);
errno = saved_errno; errno = saved_errno;
@ -414,13 +414,13 @@ _gpgme_io_pipe (int filedes[2], int inherit_idx)
if (filedes[1 - inherit_idx] < 0) if (filedes[1 - inherit_idx] < 0)
{ {
int saved_errno = errno; int saved_errno = errno;
_gpgme_io_close (fds[inherit_idx]); _gpgme_io_close (fds[inherit_idx]);
_close (fds[1 - inherit_idx]); _close (fds[1 - inherit_idx]);
errno = saved_errno; errno = saved_errno;
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
return TRACE_SUC5 ("read=0x%x/%p, write=0x%x/%p, channel=%p", return TRACE_SUC5 ("read=0x%x/%p, write=0x%x/%p, channel=%p",
filedes[0], filedes[0],
(HANDLE) _get_osfhandle (giochannel_table[filedes[0]].fd), (HANDLE) _get_osfhandle (giochannel_table[filedes[0]].fd),
@ -456,7 +456,7 @@ _gpgme_io_close (int fd)
{ {
if (giochannel_table[fd].primary) if (giochannel_table[fd].primary)
g_io_channel_shutdown (giochannel_table[fd].chan, 1, NULL); g_io_channel_shutdown (giochannel_table[fd].chan, 1, NULL);
g_io_channel_unref (giochannel_table[fd].chan); g_io_channel_unref (giochannel_table[fd].chan);
} }
else else
@ -465,7 +465,7 @@ _gpgme_io_close (int fd)
assert (giochannel_table[fd].fd != -1); assert (giochannel_table[fd].fd != -1);
_close (giochannel_table[fd].fd); _close (giochannel_table[fd].fd);
} }
giochannel_table[fd].used = 0; giochannel_table[fd].used = 0;
giochannel_table[fd].fd = -1; giochannel_table[fd].fd = -1;
giochannel_table[fd].socket = INVALID_SOCKET; giochannel_table[fd].socket = INVALID_SOCKET;
@ -502,7 +502,7 @@ _gpgme_io_set_nonblocking (int fd)
{ {
GIOChannel *chan; GIOChannel *chan;
GIOStatus status; GIOStatus status;
TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_set_nonblocking", fd); TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_set_nonblocking", fd);
chan = find_channel (fd); chan = find_channel (fd);
@ -540,7 +540,7 @@ build_commandline (char **argv)
int n = 0; int n = 0;
char *buf; char *buf;
char *p; char *p;
/* We have to quote some things because under Windows the program /* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes whole argument in double-quotes, and escape literal double-quotes
@ -621,7 +621,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags,
TRACE_LOG2 ("argv[%2i] = %s", i, argv[i]); TRACE_LOG2 ("argv[%2i] = %s", i, argv[i]);
i++; i++;
} }
/* We do not inherit any handles by default, and just insert those /* We do not inherit any handles by default, and just insert those
handles we want the child to have afterwards. But some handle handles we want the child to have afterwards. But some handle
values occur on the command line, and we need to move values occur on the command line, and we need to move
@ -643,7 +643,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags,
memset (&sec_attr, 0, sizeof sec_attr); memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr; sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE; sec_attr.bInheritHandle = FALSE;
arg_string = build_commandline (args); arg_string = build_commandline (args);
free (args); free (args);
if (!arg_string) if (!arg_string)
@ -685,7 +685,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags,
} }
free (arg_string); free (arg_string);
if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) if (flags & IOSPAWN_FLAG_ALLOW_SET_FG)
_gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId); _gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId);
@ -739,7 +739,7 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags,
{ {
/* Strip the newline. */ /* Strip the newline. */
len = strlen (line) - 1; len = strlen (line) - 1;
/* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */ /* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */
snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n", snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n",
fd_list[i].fd, fd_list[i].dup_to, fd_list[i].fd, fd_list[i].dup_to,
@ -761,18 +761,18 @@ _gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags,
close (tmp_fd); close (tmp_fd);
/* The temporary file is deleted by the gpgme-w32spawn process /* The temporary file is deleted by the gpgme-w32spawn process
(hopefully). */ (hopefully). */
TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, " TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, "
"dwProcessID=%d, dwThreadId=%d", "dwProcessID=%d, dwThreadId=%d",
pi.hProcess, pi.hThread, pi.hProcess, pi.hThread,
(int) pi.dwProcessId, (int) pi.dwThreadId); (int) pi.dwProcessId, (int) pi.dwThreadId);
if (r_pid) if (r_pid)
*r_pid = (pid_t)pi.dwProcessId; *r_pid = (pid_t)pi.dwProcessId;
if (ResumeThread (pi.hThread) < 0) if (ResumeThread (pi.hThread) < 0)
TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ());
if (!CloseHandle (pi.hThread)) if (!CloseHandle (pi.hThread))
TRACE_LOG1 ("CloseHandle of thread failed: ec=%d", TRACE_LOG1 ("CloseHandle of thread failed: ec=%d",
(int) GetLastError ()); (int) GetLastError ());
@ -810,7 +810,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
{ {
int npollfds; int npollfds;
GPollFD *pollfds; GPollFD *pollfds;
int *pollfds_map; int *pollfds_map;
int i; int i;
int j; int j;
int any; int any;
@ -842,14 +842,14 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
{ {
GIOChannel *chan = NULL; GIOChannel *chan = NULL;
if (fds[i].fd == -1) if (fds[i].fd == -1)
continue; continue;
if ((fds[i].for_read || fds[i].for_write) if ((fds[i].for_read || fds[i].for_write)
&& !(chan = find_channel (fds[i].fd))) && !(chan = find_channel (fds[i].fd)))
{ {
TRACE_ADD1 (dbg_help, "[BAD0x%x ", fds[i].fd); TRACE_ADD1 (dbg_help, "[BAD0x%x ", fds[i].fd);
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
assert (!"see log file"); assert (!"see log file");
} }
else if (fds[i].for_read ) else if (fds[i].for_read )
@ -872,7 +872,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
} }
fds[i].signaled = 0; fds[i].signaled = 0;
} }
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
if (!any) if (!any)
{ {
count = 0; count = 0;
@ -900,7 +900,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
} }
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
} }
/* COUNT is used to stop the lop as soon as possible. */ /* COUNT is used to stop the lop as soon as possible. */
for (n = count, i = 0; i < npollfds && n; i++) for (n = count, i = 0; i < npollfds && n; i++)
{ {
@ -955,7 +955,7 @@ _gpgme_io_dup (int fd)
errno = EIO; errno = EIO;
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
chan = giochannel_table[fd].chan; chan = giochannel_table[fd].chan;
g_io_channel_ref (chan); g_io_channel_ref (chan);
giochannel_table[newfd].used = 1; giochannel_table[newfd].used = 1;
@ -1016,7 +1016,7 @@ _gpgme_io_socket (int domain, int type, int proto)
} }
TRACE_SUC2 ("fd=%i, socket=0x%x", fd, res); TRACE_SUC2 ("fd=%i, socket=0x%x", fd, res);
return fd; return fd;
} }
@ -1024,7 +1024,7 @@ _gpgme_io_socket (int domain, int type, int proto)
int int
_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen)
{ {
GIOChannel *chan; GIOChannel *chan;
int sockfd; int sockfd;
int res; int res;
GIOFlags flags; GIOFlags flags;

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2007, 2010 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2007, 2010 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 @@ static struct
want to close something. Using the same handle for these want to close something. Using the same handle for these
duplicates works just fine. */ duplicates works just fine. */
int dup_from; int dup_from;
} fd_table[MAX_SLAFD]; } fd_table[MAX_SLAFD];
/* Returns the FD or -1 on resource limit. */ /* Returns the FD or -1 on resource limit. */
@ -147,7 +147,7 @@ struct reader_context_s
{ {
HANDLE file_hd; HANDLE file_hd;
int file_sock; int file_sock;
HANDLE thread_hd; HANDLE thread_hd;
int refcount; int refcount;
DECLARE_LOCK (mutex); DECLARE_LOCK (mutex);
@ -157,7 +157,7 @@ struct reader_context_s
int eof_shortcut; int eof_shortcut;
int error; int error;
int error_code; int error_code;
/* This is manually reset. */ /* This is manually reset. */
HANDLE have_data_ev; HANDLE have_data_ev;
/* This is automatically reset. */ /* This is automatically reset. */
@ -182,11 +182,11 @@ struct writer_context_s
{ {
HANDLE file_hd; HANDLE file_hd;
int file_sock; int file_sock;
HANDLE thread_hd; HANDLE thread_hd;
int refcount; int refcount;
DECLARE_LOCK (mutex); DECLARE_LOCK (mutex);
int stop_me; int stop_me;
int error; int error;
int error_code; int error_code;
@ -195,7 +195,7 @@ struct writer_context_s
HANDLE have_data; HANDLE have_data;
HANDLE is_empty; HANDLE is_empty;
HANDLE stopped; HANDLE stopped;
size_t nbytes; size_t nbytes;
char buffer[WRITEBUF_SIZE]; char buffer[WRITEBUF_SIZE];
}; };
@ -257,7 +257,7 @@ set_synchronize (HANDLE hd)
} }
static DWORD CALLBACK static DWORD CALLBACK
reader (void *arg) reader (void *arg)
{ {
struct reader_context_s *ctx = arg; struct reader_context_s *ctx = arg;
@ -278,7 +278,7 @@ reader (void *arg)
/* Leave a 1 byte gap so that we can see whether it is empty or /* Leave a 1 byte gap so that we can see whether it is empty or
full. */ full. */
if ((ctx->writepos + 1) % READBUF_SIZE == ctx->readpos) if ((ctx->writepos + 1) % READBUF_SIZE == ctx->readpos)
{ {
/* Wait for space. */ /* Wait for space. */
if (!ResetEvent (ctx->have_space_ev)) if (!ResetEvent (ctx->have_space_ev))
TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ());
@ -298,7 +298,7 @@ reader (void *arg)
if (nbytes > READBUF_SIZE - ctx->writepos) if (nbytes > READBUF_SIZE - ctx->writepos)
nbytes = READBUF_SIZE - ctx->writepos; nbytes = READBUF_SIZE - ctx->writepos;
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
TRACE_LOG2 ("%s %d bytes", sock? "receiving":"reading", nbytes); TRACE_LOG2 ("%s %d bytes", sock? "receiving":"reading", nbytes);
if (sock) if (sock)
@ -358,7 +358,7 @@ reader (void *arg)
break; break;
} }
TRACE_LOG1 ("got %u bytes", nread); TRACE_LOG1 ("got %u bytes", nread);
ctx->writepos = (ctx->writepos + nread) % READBUF_SIZE; ctx->writepos = (ctx->writepos + nread) % READBUF_SIZE;
if (!SetEvent (ctx->have_data_ev)) if (!SetEvent (ctx->have_data_ev))
TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev, TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev,
@ -370,7 +370,7 @@ reader (void *arg)
TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev, TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev,
(int) GetLastError ()); (int) GetLastError ());
SetEvent (ctx->stopped); SetEvent (ctx->stopped);
return TRACE_SUC (); return TRACE_SUC ();
} }
@ -387,7 +387,7 @@ create_reader (int fd)
memset (&sec_attr, 0, sizeof sec_attr); memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr; sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE; sec_attr.bInheritHandle = FALSE;
ctx = calloc (1, sizeof *ctx); ctx = calloc (1, sizeof *ctx);
if (!ctx) if (!ctx)
{ {
@ -447,7 +447,7 @@ create_reader (int fd)
free (ctx); free (ctx);
TRACE_SYSERR (EIO); TRACE_SYSERR (EIO);
return NULL; return NULL;
} }
else else
{ {
/* We set the priority of the thread higher because we know that /* We set the priority of the thread higher because we know that
@ -472,7 +472,7 @@ destroy_reader (struct reader_context_s *ctx)
return; return;
} }
ctx->stop_me = 1; ctx->stop_me = 1;
if (ctx->have_space_ev) if (ctx->have_space_ev)
SetEvent (ctx->have_space_ev); SetEvent (ctx->have_space_ev);
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
@ -497,7 +497,7 @@ destroy_reader (struct reader_context_s *ctx)
WaitForSingleObject (ctx->stopped, INFINITE); WaitForSingleObject (ctx->stopped, INFINITE);
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_reader", ctx->file_hd, TRACE1 (DEBUG_SYSIO, "gpgme:destroy_reader", ctx->file_hd,
"thread %p has terminated", ctx->thread_hd); "thread %p has terminated", ctx->thread_hd);
if (ctx->stopped) if (ctx->stopped)
CloseHandle (ctx->stopped); CloseHandle (ctx->stopped);
if (ctx->have_data_ev) if (ctx->have_data_ev)
@ -573,7 +573,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
struct reader_context_s *ctx; struct reader_context_s *ctx;
TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_read", fd, TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_read", fd,
"buffer=%p, count=%u", buffer, count); "buffer=%p, count=%u", buffer, count);
ctx = find_reader (fd, 1); ctx = find_reader (fd, 1);
if (!ctx) if (!ctx)
{ {
@ -593,7 +593,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
TRACE_LOG1 ("data from thread %p available", ctx->thread_hd); TRACE_LOG1 ("data from thread %p available", ctx->thread_hd);
LOCK (ctx->mutex); LOCK (ctx->mutex);
} }
if (ctx->readpos == ctx->writepos || ctx->error) if (ctx->readpos == ctx->writepos || ctx->error)
{ {
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
@ -608,7 +608,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
gpg_err_set_errno (ctx->error_code); gpg_err_set_errno (ctx->error_code);
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
nread = ctx->readpos < ctx->writepos nread = ctx->readpos < ctx->writepos
? ctx->writepos - ctx->readpos ? ctx->writepos - ctx->readpos
: READBUF_SIZE - ctx->readpos; : READBUF_SIZE - ctx->readpos;
@ -637,7 +637,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
TRACE_LOGBUF (buffer, nread); TRACE_LOGBUF (buffer, nread);
return TRACE_SYSRES (nread); return TRACE_SYSRES (nread);
} }
@ -646,7 +646,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
/* The writer does use a simple buffering strategy so that we are /* The writer does use a simple buffering strategy so that we are
informed about write errors as soon as possible (i. e. with the the informed about write errors as soon as possible (i. e. with the the
next call to the write function. */ next call to the write function. */
static DWORD CALLBACK static DWORD CALLBACK
writer (void *arg) writer (void *arg)
{ {
struct writer_context_s *ctx = arg; struct writer_context_s *ctx = arg;
@ -669,7 +669,7 @@ writer (void *arg)
break; break;
} }
if (!ctx->nbytes) if (!ctx->nbytes)
{ {
if (!SetEvent (ctx->is_empty)) if (!SetEvent (ctx->is_empty))
TRACE_LOG1 ("SetEvent failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("SetEvent failed: ec=%d", (int) GetLastError ());
if (!ResetEvent (ctx->have_data)) if (!ResetEvent (ctx->have_data))
@ -686,7 +686,7 @@ writer (void *arg)
break; break;
} }
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
TRACE_LOG2 ("%s %d bytes", sock?"sending":"writing", ctx->nbytes); TRACE_LOG2 ("%s %d bytes", sock?"sending":"writing", ctx->nbytes);
/* Note that CTX->nbytes is not zero at this point, because /* Note that CTX->nbytes is not zero at this point, because
@ -727,7 +727,7 @@ writer (void *arg)
} }
} }
TRACE_LOG1 ("wrote %d bytes", (int) nwritten); TRACE_LOG1 ("wrote %d bytes", (int) nwritten);
LOCK (ctx->mutex); LOCK (ctx->mutex);
ctx->nbytes -= nwritten; ctx->nbytes -= nwritten;
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
@ -760,7 +760,7 @@ create_writer (int fd)
TRACE_SYSERR (errno); TRACE_SYSERR (errno);
return NULL; return NULL;
} }
if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used) if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used)
{ {
TRACE_SYSERR (EIO); TRACE_SYSERR (EIO);
@ -813,7 +813,7 @@ create_writer (int fd)
free (ctx); free (ctx);
TRACE_SYSERR (EIO); TRACE_SYSERR (EIO);
return NULL; return NULL;
} }
else else
{ {
/* We set the priority of the thread higher because we know /* We set the priority of the thread higher because we know
@ -837,7 +837,7 @@ destroy_writer (struct writer_context_s *ctx)
return; return;
} }
ctx->stop_me = 1; ctx->stop_me = 1;
if (ctx->have_data) if (ctx->have_data)
SetEvent (ctx->have_data); SetEvent (ctx->have_data);
UNLOCK (ctx->mutex); UNLOCK (ctx->mutex);
@ -854,13 +854,13 @@ destroy_writer (struct writer_context_s *ctx)
"unblock control call failed for thread %p", ctx->thread_hd); "unblock control call failed for thread %p", ctx->thread_hd);
} }
#endif #endif
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd, TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd,
"waiting for termination of thread %p", ctx->thread_hd); "waiting for termination of thread %p", ctx->thread_hd);
WaitForSingleObject (ctx->stopped, INFINITE); WaitForSingleObject (ctx->stopped, INFINITE);
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd, TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd,
"thread %p has terminated", ctx->thread_hd); "thread %p has terminated", ctx->thread_hd);
if (ctx->stopped) if (ctx->stopped)
CloseHandle (ctx->stopped); CloseHandle (ctx->stopped);
if (ctx->have_data) if (ctx->have_data)
@ -900,7 +900,7 @@ find_writer (int fd, int start_it)
{ {
wt = create_writer (fd); wt = create_writer (fd);
writer_table[i].fd = fd; writer_table[i].fd = fd;
writer_table[i].context = wt; writer_table[i].context = wt;
writer_table[i].used = 1; writer_table[i].used = 1;
} }
@ -1058,14 +1058,14 @@ _gpgme_io_pipe (int filedes[2], int inherit_idx)
{ {
fd_table[rfd].handle = hd; fd_table[rfd].handle = hd;
fd_table[wfd].rvid = rvid; fd_table[wfd].rvid = rvid;
} }
#else #else
memset (&sec_attr, 0, sizeof (sec_attr)); memset (&sec_attr, 0, sizeof (sec_attr));
sec_attr.nLength = sizeof (sec_attr); sec_attr.nLength = sizeof (sec_attr);
sec_attr.bInheritHandle = FALSE; sec_attr.bInheritHandle = FALSE;
if (!CreatePipe (&rh, &wh, &sec_attr, PIPEBUF_SIZE)) if (!CreatePipe (&rh, &wh, &sec_attr, PIPEBUF_SIZE))
{ {
TRACE_LOG1 ("CreatePipe failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("CreatePipe failed: ec=%d", (int) GetLastError ());
@ -1173,7 +1173,7 @@ _gpgme_io_close (int fd)
if (fd_table[fd].handle != INVALID_HANDLE_VALUE) if (fd_table[fd].handle != INVALID_HANDLE_VALUE)
{ {
if (!CloseHandle (fd_table[fd].handle)) if (!CloseHandle (fd_table[fd].handle))
{ {
TRACE_LOG1 ("CloseHandle failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("CloseHandle failed: ec=%d", (int) GetLastError ());
/* FIXME: Should translate the error code. */ /* FIXME: Should translate the error code. */
gpg_err_set_errno (EIO); gpg_err_set_errno (EIO);
@ -1183,7 +1183,7 @@ _gpgme_io_close (int fd)
else if (fd_table[fd].socket != INVALID_SOCKET) else if (fd_table[fd].socket != INVALID_SOCKET)
{ {
if (closesocket (fd_table[fd].socket)) if (closesocket (fd_table[fd].socket))
{ {
TRACE_LOG1 ("closesocket failed: ec=%d", (int) WSAGetLastError ()); TRACE_LOG1 ("closesocket failed: ec=%d", (int) WSAGetLastError ());
/* FIXME: Should translate the error code. */ /* FIXME: Should translate the error code. */
gpg_err_set_errno (EIO); gpg_err_set_errno (EIO);
@ -1194,7 +1194,7 @@ _gpgme_io_close (int fd)
} }
release_fd (fd); release_fd (fd);
return TRACE_SYSRES (0); return TRACE_SYSRES (0);
} }
@ -1253,7 +1253,7 @@ build_commandline (char **argv, int fd0, int fd0_isnull,
p = fdbuf; p = fdbuf;
*p = 0; *p = 0;
if (fd0 != -1) if (fd0 != -1)
{ {
if (fd0_isnull) if (fd0_isnull)
@ -1280,7 +1280,7 @@ build_commandline (char **argv, int fd0, int fd0_isnull,
} }
strcpy (p, "-&S2=null "); strcpy (p, "-&S2=null ");
p += strlen (p); p += strlen (p);
n = strlen (fdbuf); n = strlen (fdbuf);
for (i=0; (s = argv[i]); i++) for (i=0; (s = argv[i]); i++)
{ {
@ -1297,7 +1297,7 @@ build_commandline (char **argv, int fd0, int fd0_isnull,
return NULL; return NULL;
p = stpcpy (p, fdbuf); p = stpcpy (p, fdbuf);
for (i = 0; argv[i]; i++) for (i = 0; argv[i]; i++)
{ {
if (!i) if (!i)
continue; /* Ignore argv[0]. */ continue; /* Ignore argv[0]. */
@ -1322,7 +1322,7 @@ build_commandline (char **argv, int fd0, int fd0_isnull,
p = stpcpy (p, argv[i]); p = stpcpy (p, argv[i]);
} }
return buf; return buf;
} }
#else #else
static char * static char *
@ -1332,7 +1332,7 @@ build_commandline (char **argv)
int n = 0; int n = 0;
char *buf; char *buf;
char *p; char *p;
/* We have to quote some things because under Windows the program /* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes whole argument in double-quotes, and escape literal double-quotes
@ -1432,7 +1432,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
gpg_err_set_errno (EBADF); gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
if (fd_list[i].dup_to == 0) if (fd_list[i].dup_to == 0)
{ {
fd_in = fd_list[i].fd; fd_in = fd_list[i].fd;
@ -1550,7 +1550,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
memset (&sec_attr, 0, sizeof sec_attr); memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr; sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE; sec_attr.bInheritHandle = FALSE;
arg_string = build_commandline (args); arg_string = build_commandline (args);
free (args); free (args);
if (!arg_string) if (!arg_string)
@ -1603,7 +1603,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
int fd = fd_list[i].fd; int fd = fd_list[i].fd;
HANDLE ohd = INVALID_HANDLE_VALUE; HANDLE ohd = INVALID_HANDLE_VALUE;
HANDLE hd = INVALID_HANDLE_VALUE; HANDLE hd = INVALID_HANDLE_VALUE;
/* Make it inheritable for the wrapper process. */ /* Make it inheritable for the wrapper process. */
if (fd >= 0 && fd < MAX_SLAFD && fd_table[fd].used) if (fd >= 0 && fd < MAX_SLAFD && fd_table[fd].used)
ohd = fd_table[fd].handle; ohd = fd_table[fd].handle;
@ -1629,7 +1629,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
/* Return the child name of this handle. */ /* Return the child name of this handle. */
fd_list[i].peer_name = handle_to_fd (hd); fd_list[i].peer_name = handle_to_fd (hd);
} }
/* Write the handle translation information to the temporary /* Write the handle translation information to the temporary
file. */ file. */
{ {
@ -1651,7 +1651,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
{ {
/* Strip the newline. */ /* Strip the newline. */
len = strlen (line) - 1; len = strlen (line) - 1;
/* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */ /* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */
snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n", snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n",
fd_list[i].fd, fd_list[i].dup_to, fd_list[i].fd, fd_list[i].dup_to,
@ -1678,16 +1678,16 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, " TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, "
"dwProcessID=%d, dwThreadId=%d", "dwProcessID=%d, dwThreadId=%d",
pi.hProcess, pi.hThread, pi.hProcess, pi.hThread,
(int) pi.dwProcessId, (int) pi.dwThreadId); (int) pi.dwProcessId, (int) pi.dwThreadId);
if (r_pid) if (r_pid)
*r_pid = (pid_t)pi.dwProcessId; *r_pid = (pid_t)pi.dwProcessId;
if (ResumeThread (pi.hThread) < 0) if (ResumeThread (pi.hThread) < 0)
TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ()); TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ());
if (!CloseHandle (pi.hThread)) if (!CloseHandle (pi.hThread))
TRACE_LOG1 ("CloseHandle of thread failed: ec=%d", TRACE_LOG1 ("CloseHandle of thread failed: ec=%d",
(int) GetLastError ()); (int) GetLastError ());
@ -1749,7 +1749,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
if (fds[i].for_read) if (fds[i].for_read)
{ {
struct reader_context_s *ctx = find_reader (fds[i].fd,1); struct reader_context_s *ctx = find_reader (fds[i].fd,1);
if (!ctx) if (!ctx)
TRACE_LOG1 ("error: no reader for FD 0x%x (ignored)", TRACE_LOG1 ("error: no reader for FD 0x%x (ignored)",
fds[i].fd); fds[i].fd);
@ -1772,7 +1772,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
else if (fds[i].for_write) else if (fds[i].for_write)
{ {
struct writer_context_s *ctx = find_writer (fds[i].fd,1); struct writer_context_s *ctx = find_writer (fds[i].fd,1);
if (!ctx) if (!ctx)
TRACE_LOG1 ("error: no writer for FD 0x%x (ignored)", TRACE_LOG1 ("error: no writer for FD 0x%x (ignored)",
fds[i].fd); fds[i].fd);
@ -1795,7 +1795,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
} }
} }
TRACE_END (dbg_help, "]"); TRACE_END (dbg_help, "]");
if (!any) if (!any)
return TRACE_SYSRES (0); return TRACE_SYSRES (0);
code = WaitForMultipleObjects (nwait, waitbuf, 0, nonblock ? 0 : 1000); code = WaitForMultipleObjects (nwait, waitbuf, 0, nonblock ? 0 : 1000);
@ -1835,7 +1835,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
{ {
int k; int k;
int j = handle_to_fd (waitbuf[i]); int j = handle_to_fd (waitbuf[i]);
TRACE_LOG1 ("WFMO invalid handle %d removed", j); TRACE_LOG1 ("WFMO invalid handle %d removed", j);
for (k = 0 ; k < nfds; k++) for (k = 0 ; k < nfds; k++)
{ {
@ -1856,7 +1856,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
TRACE_LOG1 ("WFMO returned %d", code); TRACE_LOG1 ("WFMO returned %d", code);
count = -1; count = -1;
} }
if (count > 0) if (count > 0)
{ {
TRACE_SEQ (dbg_help, "select OK [ "); TRACE_SEQ (dbg_help, "select OK [ ");
@ -1876,7 +1876,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
/* FIXME: Should determine a proper error code. */ /* FIXME: Should determine a proper error code. */
gpg_err_set_errno (EIO); gpg_err_set_errno (EIO);
} }
return TRACE_SYSRES (count); return TRACE_SYSRES (count);
} }
@ -1926,7 +1926,7 @@ _gpgme_io_dup (int fd)
newfd = new_fd(); newfd = new_fd();
if (newfd == -1) if (newfd == -1)
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
fd_table[newfd].handle = fd_table[fd].handle; fd_table[newfd].handle = fd_table[fd].handle;
fd_table[newfd].socket = fd_table[fd].socket; fd_table[newfd].socket = fd_table[fd].socket;
fd_table[newfd].rvid = fd_table[fd].rvid; fd_table[newfd].rvid = fd_table[fd].rvid;
@ -2023,7 +2023,7 @@ _gpgme_io_socket (int domain, int type, int proto)
fd = new_fd(); fd = new_fd();
if (fd == -1) if (fd == -1)
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
res = socket (domain, type, proto); res = socket (domain, type, proto);
if (res == INVALID_SOCKET) if (res == INVALID_SOCKET)
{ {
@ -2034,7 +2034,7 @@ _gpgme_io_socket (int domain, int type, int proto)
fd_table[fd].socket = res; fd_table[fd].socket = res;
TRACE_SUC2 ("socket=0x%x (0x%x)", fd, fd_table[fd].socket); TRACE_SUC2 ("socket=0x%x (0x%x)", fd, fd_table[fd].socket);
return fd; return fd;
} }
@ -2052,7 +2052,7 @@ _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen)
gpg_err_set_errno (EBADF); gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1); return TRACE_SYSRES (-1);
} }
res = connect (fd_table[fd].socket, addr, addrlen); res = connect (fd_table[fd].socket, addr, addrlen);
if (res) if (res)
{ {

View File

@ -1,19 +1,19 @@
/* w32-sema.c /* w32-sema.c
Copyright (C) 2001 Werner Koch (dd9jn) Copyright (C) 2001 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH Copyright (C) 2001, 2002, 2004, 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
@ -54,7 +54,7 @@ critsect_init (struct critsect_s *s)
CRITICAL_SECTION *mp; CRITICAL_SECTION *mp;
static CRITICAL_SECTION init_lock; static CRITICAL_SECTION init_lock;
static int initialized; static int initialized;
if (!initialized) { if (!initialized) {
/* The very first time we call this function, we assume that /* The very first time we call this function, we assume that
only one thread is running, so that we can bootstrap the only one thread is running, so that we can bootstrap the

View File

@ -4,17 +4,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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
@ -51,7 +51,7 @@
but that header also redefines some Windows functions which we need but that header also redefines some Windows functions which we need
to avoid unless having included shlobj.h. */ to avoid unless having included shlobj.h. */
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <windows.h> #include <windows.h>
#include <shlobj.h> #include <shlobj.h>
@ -105,10 +105,10 @@ dlclose (void * hd)
return 0; return 0;
} }
return -1; return -1;
} }
#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */ #endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */
void void
_gpgme_allow_set_foreground_window (pid_t pid) _gpgme_allow_set_foreground_window (pid_t pid)
{ {
#ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW #ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW
@ -162,7 +162,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
HKEY root_key, key_handle; HKEY root_key, key_handle;
DWORD n1, nbytes, type; DWORD n1, nbytes, type;
char *result = NULL; char *result = NULL;
if (!root) if (!root)
root_key = HKEY_CURRENT_USER; root_key = HKEY_CURRENT_USER;
else if (!strcmp( root, "HKEY_CLASSES_ROOT")) else if (!strcmp( root, "HKEY_CLASSES_ROOT"))
@ -179,7 +179,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
root_key = HKEY_CURRENT_CONFIG; root_key = HKEY_CURRENT_CONFIG;
else else
return NULL; return NULL;
if (RegOpenKeyExA (root_key, dir, 0, KEY_READ, &key_handle)) if (RegOpenKeyExA (root_key, dir, 0, KEY_READ, &key_handle))
{ {
if (root) if (root)
@ -215,10 +215,10 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
#ifndef HAVE_W32CE_SYSTEM #ifndef HAVE_W32CE_SYSTEM
/* Windows CE does not have an environment. */ /* Windows CE does not have an environment. */
if (type == REG_EXPAND_SZ && strchr (result, '%')) if (type == REG_EXPAND_SZ && strchr (result, '%'))
{ {
char *tmp; char *tmp;
n1 += 1000; n1 += 1000;
tmp = malloc (n1 + 1); tmp = malloc (n1 + 1);
if (!tmp) if (!tmp)
@ -247,7 +247,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
result = malloc (strlen (tmp)+1); result = malloc (strlen (tmp)+1);
if (!result) if (!result)
result = tmp; result = tmp;
else else
{ {
strcpy (result, tmp); strcpy (result, tmp);
free (tmp); free (tmp);
@ -271,7 +271,7 @@ static char *
find_program_in_registry (const char *name) find_program_in_registry (const char *name)
{ {
char *program = NULL; char *program = NULL;
program = read_w32_registry_string (NULL, "Software\\GNU\\GnuPG", name); program = read_w32_registry_string (NULL, "Software\\GNU\\GnuPG", name);
if (program) if (program)
{ {
@ -326,7 +326,7 @@ find_program_at_standard_place (const char *name)
{ {
char path[MAX_PATH]; char path[MAX_PATH];
char *result = NULL; char *result = NULL;
/* See http://wiki.tcl.tk/17492 for details on compatibility. */ /* See http://wiki.tcl.tk/17492 for details on compatibility. */
if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0)) if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0))
{ {
@ -595,7 +595,7 @@ _gpgme_mkstemp (int *fd, char **name)
else else
{ {
int len = strlen(tmp); int len = strlen(tmp);
/* GetTempPath may return with \ on the end */ /* GetTempPath may return with \ on the end */
while(len > 0 && tmp[len - 1] == '\\') while(len > 0 && tmp[len - 1] == '\\')
{ {

View File

@ -1,19 +1,19 @@
/* wait-global.c /* wait-global.c
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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
@ -306,10 +306,10 @@ gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
gpgme_error_t err = 0; gpgme_error_t err = 0;
gpgme_error_t local_op_err = 0; gpgme_error_t local_op_err = 0;
struct wait_item_s *item; struct wait_item_s *item;
assert (nr); assert (nr);
nr--; nr--;
item = (struct wait_item_s *) fdt.fds[i].opaque; item = (struct wait_item_s *) fdt.fds[i].opaque;
assert (item); assert (item);
ictx = item->ctx; ictx = item->ctx;
@ -352,7 +352,7 @@ gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
struct gpgme_io_event_done_data data; struct gpgme_io_event_done_data data;
data.err = 0; data.err = 0;
data.op_err = 0; data.op_err = 0;
/* FIXME: This does not perform too well. We have to /* FIXME: This does not perform too well. We have to
release the lock because the I/O event handler release the lock because the I/O event handler
acquires it to remove the context from the active acquires it to remove the context from the active

View File

@ -1,19 +1,19 @@
/* wait-private.c /* wait-private.c
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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
@ -95,7 +95,7 @@ _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond,
return err; return err;
} }
for (i = 0; i < ctx->fdt.size && nr; i++) for (i = 0; i < ctx->fdt.size && nr; i++)
{ {
if (ctx->fdt.fds[i].fd != -1 && ctx->fdt.fds[i].signaled) if (ctx->fdt.fds[i].fd != -1 && ctx->fdt.fds[i].signaled)
@ -110,9 +110,9 @@ _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond,
if (ctx->canceled) if (ctx->canceled)
err = gpg_error (GPG_ERR_CANCELED); err = gpg_error (GPG_ERR_CANCELED);
UNLOCK (ctx->lock); UNLOCK (ctx->lock);
if (!err) if (!err)
err = _gpgme_run_io_cb (&ctx->fdt.fds[i], 0, &op_err); err = _gpgme_run_io_cb (&ctx->fdt.fds[i], 0, &op_err);
if (err) if (err)
{ {
/* An error occured. Close all fds in this context, /* An error occured. Close all fds in this context,

View File

@ -1,19 +1,19 @@
/* wait-user.c /* wait-user.c
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 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

View File

@ -1,19 +1,19 @@
/* wait.c /* wait.c
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
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
@ -74,7 +74,7 @@ fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx)
* sizeof (*new_fds)); * sizeof (*new_fds));
if (!new_fds) if (!new_fds)
return gpg_error_from_errno (errno); return gpg_error_from_errno (errno);
fdt->fds = new_fds; fdt->fds = new_fds;
fdt->size += FDT_ALLOCSIZE; fdt->size += FDT_ALLOCSIZE;
for (j = 0; j < FDT_ALLOCSIZE; j++) for (j = 0; j < FDT_ALLOCSIZE; j++)

View File

@ -1,19 +1,19 @@
/* wait.h - Definitions for the wait queue interface. /* wait.h - Definitions for the wait queue interface.
Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2000 Werner Koch (dd9jn)
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
@ -88,7 +88,7 @@ struct io_cb_data
{ {
/* If this is the first field, the old internal code will still work. */ /* If this is the first field, the old internal code will still work. */
void *handler_value; void *handler_value;
/* The I/O callback can pass an operational error here. */ /* The I/O callback can pass an operational error here. */
gpgme_error_t op_err; gpgme_error_t op_err;
}; };

View File

@ -2,17 +2,17 @@
Copyright (C) 2008, 2009 g10 Code GmbH Copyright (C) 2008, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -48,7 +48,7 @@ show_usage (int ex)
exit (ex); exit (ex);
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -86,9 +86,9 @@ main (int argc, char **argv)
} }
else if (!strncmp (*argv, "--", 2)) else if (!strncmp (*argv, "--", 2))
show_usage (1); show_usage (1);
} }
if (!argc) if (!argc)
show_usage (1); show_usage (1);
@ -101,7 +101,7 @@ main (int argc, char **argv)
/* Lookup the keys. */ /* Lookup the keys. */
err = gpgme_op_keylist_ext_start (ctx, (const char**)argv, 0, 0); err = gpgme_op_keylist_ext_start (ctx, (const char**)argv, 0, 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)))
{ {
printf ("keyid: %s (fpr: %s)\n", printf ("keyid: %s (fpr: %s)\n",
@ -138,7 +138,7 @@ main (int argc, char **argv)
fail_if_err (err); fail_if_err (err);
gpgme_set_armor (ctx, 1); gpgme_set_armor (ctx, 1);
err = gpgme_op_export_keys (ctx, keyarray, mode, err = gpgme_op_export_keys (ctx, keyarray, mode,
(mode & GPGME_KEYLIST_MODE_EXTERN)? NULL:out); (mode & GPGME_KEYLIST_MODE_EXTERN)? NULL:out);
fail_if_err (err); fail_if_err (err);

View File

@ -2,17 +2,17 @@
Copyright (C) 2008, 2009 g10 Code GmbH Copyright (C) 2008, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -49,7 +49,7 @@ show_usage (int ex)
exit (ex); exit (ex);
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -89,9 +89,9 @@ main (int argc, char **argv)
} }
else if (!strncmp (*argv, "--", 2)) else if (!strncmp (*argv, "--", 2))
show_usage (1); show_usage (1);
} }
if (!argc) if (!argc)
show_usage (1); show_usage (1);
@ -110,7 +110,7 @@ main (int argc, char **argv)
if (url_mode) if (url_mode)
gpgme_data_set_encoding (data, (nul_mode? GPGME_DATA_ENCODING_URL0 gpgme_data_set_encoding (data, (nul_mode? GPGME_DATA_ENCODING_URL0
: GPGME_DATA_ENCODING_URL)); : GPGME_DATA_ENCODING_URL));
err = gpgme_op_import (ctx, data); err = gpgme_op_import (ctx, data);
fail_if_err (err); fail_if_err (err);
impres = gpgme_op_import_result (ctx); impres = gpgme_op_import_result (ctx);
@ -120,7 +120,7 @@ main (int argc, char **argv)
exit (1); exit (1);
} }
print_import_result (impres); print_import_result (impres);
gpgme_data_release (data); gpgme_data_release (data);
} }

View File

@ -2,17 +2,17 @@
Copyright (C) 2008, 2009 g10 Code GmbH Copyright (C) 2008, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -57,7 +57,7 @@ show_usage (int ex)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -136,9 +136,9 @@ main (int argc, char **argv)
} }
else if (!strncmp (*argv, "--", 2)) else if (!strncmp (*argv, "--", 2))
show_usage (1); show_usage (1);
} }
if (argc > 1) if (argc > 1)
show_usage (1); show_usage (1);
@ -152,12 +152,12 @@ main (int argc, char **argv)
err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0); err = gpgme_op_keylist_start (ctx, argc? argv[0]: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)))
{ {
gpgme_user_id_t uid; gpgme_user_id_t uid;
int nuids; int nuids;
printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?"); printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?");
printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?"); printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?");
@ -176,7 +176,7 @@ main (int argc, char **argv)
for (nuids=0, uid=key->uids; uid; uid = uid->next, nuids++) for (nuids=0, uid=key->uids; uid; uid = uid->next, nuids++)
{ {
printf ("userid %d: %s\n", nuids, nonnull(uid->uid)); printf ("userid %d: %s\n", nuids, nonnull(uid->uid));
printf ("valid %d: %s\n", nuids, printf ("valid %d: %s\n", nuids,
uid->validity == GPGME_VALIDITY_UNKNOWN? "unknown": uid->validity == GPGME_VALIDITY_UNKNOWN? "unknown":
uid->validity == GPGME_VALIDITY_UNDEFINED? "undefined": uid->validity == GPGME_VALIDITY_UNDEFINED? "undefined":
uid->validity == GPGME_VALIDITY_NEVER? "never": uid->validity == GPGME_VALIDITY_NEVER? "never":

View File

@ -2,17 +2,17 @@
Copyright (C) 2009 g10 Code GmbH Copyright (C) 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -44,10 +44,10 @@ print_result (gpgme_sign_result_t result, gpgme_sig_mode_t type)
gpgme_new_signature_t sig; gpgme_new_signature_t sig;
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),
gpg_strerror (invkey->reason), gpg_strsource (invkey->reason)); gpg_strerror (invkey->reason), gpg_strsource (invkey->reason));
for (sig = result->signatures; sig; sig = sig->next) for (sig = result->signatures; sig; sig = sig->next)
{ {
printf ("Key fingerprint: %s\n", nonnull (sig->fpr)); printf ("Key fingerprint: %s\n", nonnull (sig->fpr));
@ -76,7 +76,7 @@ show_usage (int ex)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -131,9 +131,9 @@ main (int argc, char **argv)
} }
else if (!strncmp (*argv, "--", 2)) else if (!strncmp (*argv, "--", 2))
show_usage (1); show_usage (1);
} }
if (argc != 1) if (argc != 1)
show_usage (1); show_usage (1);
@ -153,7 +153,7 @@ main (int argc, char **argv)
if (key_string) if (key_string)
{ {
gpgme_key_t akey; gpgme_key_t akey;
err = gpgme_get_key (ctx, key_string, &akey, 1); err = gpgme_get_key (ctx, key_string, &akey, 1);
if (err) if (err)
{ {

View File

@ -3,17 +3,17 @@
Copyright (C) 2001, 2002, 2003, 2004, 2009 g10 Code GmbH Copyright (C) 2001, 2002, 2003, 2004, 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -60,7 +60,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));
@ -108,7 +108,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

@ -2,17 +2,17 @@
Copyright (C) 2009 g10 Code GmbH Copyright (C) 2009 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, see <http://www.gnu.org/licenses/>. License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -63,7 +63,7 @@ print_summary (gpgme_sigsum_t summary)
fputs (" sys-error", stdout); fputs (" sys-error", stdout);
} }
static void static void
print_validity (gpgme_validity_t val) print_validity (gpgme_validity_t val)
{ {
const char *s = NULL; const char *s = NULL;
@ -133,7 +133,7 @@ show_usage (int ex)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -176,17 +176,17 @@ main (int argc, char **argv)
} }
else if (!strncmp (*argv, "--", 2)) else if (!strncmp (*argv, "--", 2))
show_usage (1); show_usage (1);
} }
if (argc < 1 || argc > 2) if (argc < 1 || argc > 2)
show_usage (1); show_usage (1);
fp_sig = fopen (argv[0], "rb"); fp_sig = fopen (argv[0], "rb");
if (!fp_sig) if (!fp_sig)
{ {
err = gpgme_error_from_syserror (); err = gpgme_error_from_syserror ();
fprintf (stderr, PGM ": can't open `%s': %s\n", fprintf (stderr, PGM ": can't open `%s': %s\n",
argv[0], gpgme_strerror (err)); argv[0], gpgme_strerror (err));
exit (1); exit (1);
} }
@ -196,7 +196,7 @@ main (int argc, char **argv)
if (!fp_msg) if (!fp_msg)
{ {
err = gpgme_error_from_syserror (); err = gpgme_error_from_syserror ();
fprintf (stderr, PGM ": can't open `%s': %s\n", fprintf (stderr, PGM ": can't open `%s': %s\n",
argv[1], gpgme_strerror (err)); argv[1], gpgme_strerror (err));
exit (1); exit (1);
} }

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
@ -190,7 +190,7 @@ write_test (round_t round, gpgme_data_t data)
} }
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
round_t round = TEST_INITIALIZER; round_t round = TEST_INITIALIZER;

View File

@ -2,17 +2,17 @@
Copyright (C) 2003, 2004, 2007 g10 Code GmbH Copyright (C) 2003, 2004, 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
@ -67,7 +67,7 @@ check_engine_info (gpgme_engine_info_t info, gpgme_protocol_t protocol,
} }
int int
main (int argc, char **argv ) main (int argc, char **argv )
{ {
gpgme_engine_info_t info; gpgme_engine_info_t info;

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
@ -26,7 +26,7 @@
#include <gpgme.h> #include <gpgme.h>
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
const char *null_result; const char *null_result;