Home GnuPG
Diffusion GPGME d7267db472a4

Refactor gpgme-json for future re-use.

Description

Refactor gpgme-json for future re-use.

* src/gpgme-json.c: Factor large chunks of code out to ...
* src/json-core.c: new file and ...
* src/json-util.c: new file and ...
* src/json-common.h: new file.
* src/Makefile.am (gpgme_json_SOURCES): Add new files.

Details

Provenance
wernerAuthored on Fri, May 23, 3:06 PM
Parents
rM15ae7da74bc4: Treat empty algorithm the same way as unset algorithm
Branches
Unknown
Tags
Unknown

Event Timeline

Hi Werner, one minor issue in this commit as can be seen by the following GCC warnings:

In file included from ../../src/json-util.c:31:
../../src/json-common.h:21: warning: header guard ‘GPGME_JSON_COMMON_H’ followed by ‘#define’ of a different macro [-Wheader-guard]
   21 | #ifndef GPGME_JSON_COMMON_H
../../src/json-common.h:22: note: ‘GNUPG_JSON_COMMON_H’ is defined here; did you mean ‘GPGME_JSON_COMMON_H’?
   22 | #define GNUPG_JSON_COMMON_H
mv -f .deps/json-util.Tpo .deps/json-util.Po

This can cause redefinitions if the header is included multiple times so it is worth fixing. I'll send the simple one line patch for this. Didn't think it was worth creating a bug report since it was just committed today.