Home GnuPG

gpgscm: Some adjustments for use in gpgrt.

Description

gpgscm: Some adjustments for use in gpgrt.

* gpgscm/Makefile.am: Remove cruft leftover from GnuPG.  Link to the
just build libgpg-error.
* gpgscm/private.h: Include gpgrt.h and provide i18n macros.
(xfree, xtrymalloc, xtrycalloc, xtryrealloc): New macros.
(xmalloc, xstrdup): New inline functions.
* gpgscm/main.c: Remove inclusion of gcrypt.h and gpg-error.h.  Remove
all other gnupg specific headers.
(opts, parse_arguments): Temporary comment out.
(main): Adjust for use with gpgrt.  Temporary comment out some stuff.
* gpgscm/ffi-private.h: Include local gpgrt.h instead of gpg-error.h.
* gpgscm/ffi.h: Ditto.
* gpgscm/ffi.c: Remove gpg-error.h and headers from GnuPG.
(do_getenv): Use gpgrt_getenv.
(do_setenv): Use gpgrt_setenv.
(do_mkdtemp): Temporary return an error.
(unlink_recursively): Use gpgrt_bsprintf.
(do_getcwd): Use gpgrt_getcwd.
(do_mkdir): Use gpgrt_mkdir.
(do_get_isotime): Temporary return an error.
(do_get_time): Directly use time().

Note that this does not yet compile because the spawn functions from
GnuPG are missing. There are two other problems as well:

  • We don't have GnuPG's isotime fucntions. We need to see whether we want to support them in gpgrt. That might be useful in libksba.
  • gpgrt_mkdtemp does not work. We do not want to link to Libgcrypt, which is the way mkdtemp was written for GnuPG. We should get a more straight implementation.
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Nov 28 2017, 4:17 PM
Parents
rE4a2538e69dd3: core: New API functions gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd.
Branches
Unknown
Tags
Unknown