* src/cJSON.c: Remove util.h. Use gpgrt alloc functions.
(cJSON_Delete): Do not clobber ERRNO.
(cJSON_AddItemToObject): Return OBJECT or NULL.
(cJSON_AddNullToObject): New.
(cJSON_AddTrueToObject): New.
(cJSON_AddFalseToObject): New.
(cJSON_AddBoolToObject): New.
(cJSON_AddNumberToObject): New.
(cJSON_AddStringToObject): New.
* src/cJSON.h (cJSON__h): Replace macro by cJSON_h for C compliance.
(cJSON_AddNullToObject): Remove macro.
(cJSON_AddTrueToObject): Remove macro.
(cJSON_AddFalseToObject): Remove macro.
(cJSON_AddBoolToObject): Remove macro.
(cJSON_AddNumberToObject): Remove macro.
(cJSON_AddStringToObject): Remove macro.
--
The gpgrt malloc functions are used so that we can easily mix memory
returned by gpgrt (e.g. es_read_line) with memory returned from the
JSON function. In general that is not needed but on Windows it makes
a difference if the gpgme DLL is linked to a different C runtime
than the application.
The macros have been replaced to allow error checking (i.e out of
core) for these functions. More error checking should be implemented
instead of silently creating objects which are not as requested.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/cJSON.c: New.
* src/cJSON.h: New.
* src/cJSON.readme: New.
--
This is a copy of the code from the payproc commit
af5d6b4f820ee19e246a2cab6f56465fe91f1233. The code was originally
added to payproc with the commit below.
Signed-off-by: Werner Koch <wk@gnupg.org>
===============================================
commit 7ae7ef29bc5ec19e005e6a5a739233d655f3f05f
Author: Werner Koch <wk@gnupg.org>
AuthorDate: Wed Apr 2 09:01:42 2014 +0200
Commit: Werner Koch <wk@gnupg.org>
CommitDate: Wed Apr 2 09:12:02 2014 +0200
Simplify cJSON and add new macros.
* src/cJSON.h: Re-indented.
(cjson_t): New.
(cjson_is_): New macros.
* src/cJSON.c: Re-indented. Include errno.h and our util.h.
(ep): Remove global var.
(cJSON_GetErrorPtr): Remove.
(cJSON_strcasecmp): Cast args for use with tolower.
(cJSON_malloc, cJSON_free): Remove. Change callers to use xtrymalloc
and xfree.
(cJSON_InitHooks): Remove.
(cJSON_strdup): Remove. Change callers to use xtrystrdup.
(cJSON_New_Item): Simplify.
(cJSON_ParseWithOpts, cJSON_Parse): Add arg R_ERROFF.
(parse_string, parse_value, parse_array, parse_object): Add arg EP.
--
cJSON has been taken from cjson-code-58.zip. The README file has been
renamed to cJSON.readme and the files have been changed to GNU coding
standards. Because that parser is small enough to be source copied it
does not make sense to treat it as a library and I changed the memory
allocation functions to the usual xmalloc ones. The only external
dependency now is out util.h which declares those functions.
The lowercase cjson_t better fits into our coding style as well as the
new macros. Thanks to Dave Gamble for this nice parser.
===============================================
* Updated TODO with tags to make everything appear properly when
exported to HTML or PDF.
* Added a couple more items, mainly to do with docs or future bindings.
* Marked some, but not all as actual TODO items.
* Some items should probably be removed, but haven't been yet.
* Some have probably been completed already.
* Added the idea for alternative Emacs bindings (to extend the
existing ones, not replace them outright).
* Added a reference to the API Squared part of the project.
* If we're going to use Org, let's actually use Org.
* Added the properties tags for each point.
* Some of thems still need custom ID tags assigned properly.
* Probably ought to make them actual TODOs at some point, but that can
wait until they can be marked as DONE anyway.
* Will add a TODO for some of this stuff ... oh, the irony.
* Set LaTeX headers to enable ligatures and a 12pt font by default.
* Paper size left for regional defaults.
* Using XeLaTeX for easier font control.
* Using default LaTeX font of Latin Main, but that's easy enough to change.
* The developers of Phabricator, the web front-end on dev.gnupg.org
have not implemented renderers for Markdown, Org-Mode or any other
common markdown like language.
* They also refuse to do so.
* Instead they re-invented the wheel and implemented their own version
of Markdown-like thing which is incompatible with everything else.
It is called Remarkup.
* The developers of Phabricator and Remarkup have refused to provide
conversion tools to move files to/from any format to/from Remarkup.
* They expect everyone to learn their new favourite pet project.
* Remarkup may or may not display Org Mode files, but if so then it is
likely to only want to do so as plain text.
* There is an unaffiliated and unofficial project to convert Github
Markdown to Remarkup via Pandoc. This might be adapted for our use,
but requires testing.
* Until then exporting from Org Mode to UTF-8 text is likely the least
worst plan.
* Which means renaming this file to README.org first.
* Removed Markdown style heading underlining.
* Removed in-line file type declaration (which is not correctly parsed
by the web interface on dev.gnupg.org).
* Fixed or updated the most fundamental errors.
* Also included some details on which modules are available on PyPI,
as well as what happened to the PyME commit log.
* Updated TODO.
* The entirety of the old TODO has been replaced with either more
relevant tasks or goals for the examples and a more measured
approach to the docs and why, in this project, Org Mode trumps reST,
even though it's Python through and through.
* Added a bunch of things to .gitignore that might otherwise creep in
during Python development.
* This really should be merged ASAP. You'll thank me later ...
* tests/gpg/Makefile.am: Don't allow target with '/'.
* tests/gpgsm/Makefile.am: Ditto.
--
BSD Make doesn't allow a target with '/'. We still have such a target
in lang/python/Makefile.am, but it's for maintainer only, so,
assumption to GNU Make is OK there.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* configure.ac: have_thread_safe_getenv=yes with have_w32_system.
--
We want to define this for both 32 and 64 bit targets if
we use mingw. have_w32_system is defined for both targets.
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
* src/engine-spawn.c (engspawn_start): Translate spawn flag
to IOSPAWN flag.
* src/gpgme-w32spawn.c (my_spawn): Handle the new flag.
* src/gpgme.h.in (GPGME_SPAWN_SHOW_WINDOW): New.
* src/priv-io.h (IOSPAWN_FLAG_SHOW_WINDOW): New.
--
Used by GpgOL
* src/w32-io.c (_gpgme_io_spawn): Don't hardcode flags value.
--
IOSPAWN_FLAG_ALLOW_SET_FG is 2 and was translated to 1.
This might fix the pinentry foreground handling pass through.
* tests/gpg/Makefile.am, tests/gpgsm/Makefile.am: Remove ./.
--
GNU Make is powerful enough for handling and interpreting of
pathname as target, but BSD Make is not.
GnuPG-bug-id: 3056
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>