libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

yajl: remove global variable

Open markus2330 opened this issue 3 years ago • 1 comments

In yajl we unfortunately introduced a global variable (yajl/yajl_parse.c:static elektraCursor itKs;) which needs to be removed.

See also #4466.

@flo91 can you describe how it can be removed?

markus2330 avatar Sep 14 '22 05:09 markus2330

I had a quick look and it seems elektraCursor itKs was a quick and dirty workaround, since yajl relied on the internal cursor in KeySets for communication between different functions. So changing this will require reworking some of these functions. This probably means creating a custom struct to wrap a KeySet * and a elektraCursor and pass that around instead of a KeySet *.

kodebach avatar Sep 14 '22 20:09 kodebach

The triage by @kodebach summarizes the issue very well. As the parameters of the callback-functions are given by yajl,the information must be passed as part of a void *

@markus2330 This looks like an ideal issue for the FLOSS course!

flo91 avatar Oct 04 '22 21:10 flo91