annotate src/libgcrypt-test.c @ 4545:0e56fe2d2ef5

Makefile.in: add update-build-tools target * Makefile.in: add update-build-tools target * src/build-autoconf.mk, src/build-automake.mk, src/build-bison.mk, src/build-gawk.mk, src/build-gcc.mk, src/build-gettext.mk, src/build-gperf.mk, src/build-m4.mk, src/build-texinfo.mk, src/build-libtool.mk : update PKG_UPDATE for getting latest version from gnu.org * src/build-cmake.mk, src/build-flex.mk, src/build-lzip.mk, src/build-pkg-config.mk, src/pkg-config.mk, src/build-scons.mk : add implemented PKG_UPDATE macro
author John Donoghue <john.donoghue@ieee.org>
date Thu, 23 Nov 2017 12:05:29 -0500
parents 3a37e58eab36
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2442
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
1 /*
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
2 * This file is part of MXE.
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
3 * See index.html for further information.
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
4 */
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
5
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
6 #include <stdio.h>
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
7 #include <gcrypt.h>
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
8
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
9 int main(int argc, char *argv[])
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
10 {
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
11 (void)argc;
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
12 (void)argv;
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
13
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
14 if (!gcry_check_version (GCRYPT_VERSION)) {
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
15 fputs ("libgcrypt version mismatch\n", stderr);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
16 exit (2);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
17 }
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
18
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
19 gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
20 gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
21 gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
22 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
23
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
24 if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
25 fputs ("libgcrypt has not been initialized\n", stderr);
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
26 abort ();
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
27 }
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
28
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
29 printf("gcrypt version: %s", GCRYPT_VERSION );
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
30
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
31 return 0;
3a37e58eab36 package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff changeset
32 }