2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
/* t-version.c - Regression test.
|
2018-11-16 12:27:33 +00:00
|
|
|
* Copyright (C) 2001, 2004 g10 Code GmbH
|
|
|
|
*
|
|
|
|
* This file is part of GPGME.
|
|
|
|
*
|
|
|
|
* GPGME is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GPGME is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this program; if not, see <https://gnu.org/licenses/>.
|
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*/
|
2001-10-17 19:17:46 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2013-02-26 16:10:18 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2002-09-28 20:09:12 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* gpg/: New directory.
* Makefile.am, t-verify.c, t-encrypt.c, t-signers.c, t-trustlist.c,
t-sign.c, t-keylist.c, t-import.c, t-genkey.c, t-export.c,
t-decrypt-verify.c, t-decrypt.c, t-version.c, t-data.c, mkdemodirs.
cipher-1.asc, cipher-2.asc, geheim.txt, pubdemo.asc, pubkey-1.asc,
secdemo.asc, seckey-1.asc): Move to sub directory gpg/.
* gpg/Makefile.am (INCLUDES): Include gpgme/, not include/ and
intl/.
(LDD): Correct relative path to gpgme library.
(TESTS): Remove t-version and t-data.
* gpg/t-verify.c, gpg/t-encrypt.c, gpg/t-signers.c, gpg/t-trustlist.c,
gpg/t-sign.c, gpg/t-keylist.c, gpg/t-import.c, gpg/t-genkey.c,
gpg/t-export.c, gpg/t-decrypt-verify.c, gpg/t-decrypt.c,
t-version.c, t-data.c): Include gpgme.h, not "../gpgme/gpgme.h".
* Makefile.am: New file.
* gpgsm/: New directory.
* gpgsm/Makefile.am: New file.
2001-11-22 03:01:26 +00:00
|
|
|
#include <gpgme.h>
|
2001-10-17 19:17:46 +00:00
|
|
|
|
2013-02-26 16:10:18 +00:00
|
|
|
static int verbose;
|
|
|
|
static int debug;
|
|
|
|
|
|
|
|
|
2012-09-25 13:29:49 +00:00
|
|
|
int
|
2003-05-18 20:45:24 +00:00
|
|
|
main (int argc, char **argv)
|
2001-10-17 19:17:46 +00:00
|
|
|
{
|
2013-02-26 16:10:18 +00:00
|
|
|
int ret;
|
2001-10-17 19:17:46 +00:00
|
|
|
const char *null_result;
|
|
|
|
const char *current_result;
|
|
|
|
const char *future_result;
|
|
|
|
|
2013-02-26 16:10:18 +00:00
|
|
|
int last_argc = -1;
|
|
|
|
|
|
|
|
if (argc)
|
|
|
|
{
|
|
|
|
argc--; argv++;
|
|
|
|
}
|
|
|
|
while (argc && last_argc != argc )
|
|
|
|
{
|
|
|
|
last_argc = argc;
|
|
|
|
if (!strcmp (*argv, "--help"))
|
|
|
|
{
|
|
|
|
puts ("usage: ./t-version [options]\n"
|
|
|
|
"\n"
|
|
|
|
"Options:\n"
|
|
|
|
" --verbose Show what is going on\n"
|
|
|
|
);
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
if (!strcmp (*argv, "--verbose"))
|
|
|
|
{
|
|
|
|
verbose = 1;
|
|
|
|
argc--; argv++;
|
|
|
|
}
|
|
|
|
else if (!strcmp (*argv, "--debug"))
|
|
|
|
{
|
|
|
|
verbose = debug = 1;
|
|
|
|
argc--; argv++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-17 19:17:46 +00:00
|
|
|
null_result = gpgme_check_version (NULL);
|
|
|
|
current_result = gpgme_check_version (VERSION);
|
|
|
|
future_result = gpgme_check_version (VERSION ".1");
|
|
|
|
|
2013-02-26 16:10:18 +00:00
|
|
|
ret = !(null_result
|
|
|
|
&& ! strcmp (null_result, VERSION)
|
|
|
|
&& current_result
|
|
|
|
&& ! strcmp (current_result, VERSION)
|
|
|
|
&& ! future_result);
|
|
|
|
|
|
|
|
if (verbose || ret)
|
|
|
|
{
|
|
|
|
printf ("Version from header: %s (0x%06x)\n",
|
|
|
|
GPGME_VERSION, GPGME_VERSION_NUMBER);
|
|
|
|
printf ("Version from binary: %s\n", gpgme_check_version (NULL));
|
|
|
|
printf ("Copyright blurb ...:%s\n", gpgme_check_version ("\x01\x01"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
2001-10-17 19:17:46 +00:00
|
|
|
}
|