1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpgscm: Implement tags.

* tests/gpgscm/opdefines.h: Add opcodes to create and retrieve tags.
* tests/gpgscm/scheme.c (T_TAGGED): New macro.
(mk_tagged_value): New function.
(has_tag): Likewise.
(get_tag): Likewise.
(mark): Mark tag.
(opexe_4): Implement new opcodes.
* tests/gpgscm/scheme.h (USE_TAGS): New macro.
--

Tags are similar to property lists, but property lists can only be
attached to symbols.  Tags can not be attached to an existing object,
but a tagged copy can be created.  Once done, the tag can be
manipulated in constant time.

Using this during parsing will enable us to produce meaningful error
messages.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-11-18 13:23:11 +01:00
parent a75790b740
commit fcf5aea446
3 changed files with 91 additions and 0 deletions

View file

@ -44,6 +44,7 @@ extern "C" {
# define USE_DL 0
# define USE_PLIST 0
# define USE_SMALL_INTEGERS 0
# define USE_TAGS 0
#endif
@ -76,6 +77,11 @@ extern "C" {
# define USE_PLIST 0
#endif
/* If set, then every object can be tagged. */
#ifndef USE_TAGS
# define USE_TAGS 1
#endif
/* To force system errors through user-defined error handling (see *error-hook*) */
#ifndef USE_ERROR_HOOK
# define USE_ERROR_HOOK 1