Fold out-parameters via the catalog's shape.outParams flag#32
Merged
estebanzimanyi merged 1 commit intoJul 9, 2026
Merged
Conversation
The MEOS-API catalog carries each function's Doxygen @param[out] tags as shape.outParams, cross-checked against the C signature. Read that flag on each ParamDef and fold out-parameters from it instead of a hardcoded parameter-name whitelist, so an out-param folds regardless of how it is spelled in the signature (size_out, size, result, value, ...). A size_t* out-param is the throwaway byte-count of the *_as_wkb/_as_hexwkb family; any other pointer out-param on a boolean-returning method is the value the wrapper allocates, forwards, reads back, and returns. A boolean function with exactly one such out-param folds to a returned Pointer; functions with two or more (intersection_*/synchronize_*: inter1/inter2, *_to_arrow: out_schema/out_array) keep those out-params as caller-provided Pointer arguments. Enrich the vendored catalog with shape.outParams and adapt the one hand-written consumer (TText.value_at_timestamp) to the folded signature.
706445b to
d9c99ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MEOS-API catalog now carries each function's Doxygen
@param[out]tags asshape.outParams, cross-checked against the C signature (MobilityDB/MEOS-API#37). This wires JMEOS to fold out-parameters from that flag instead of a hardcoded parameter-name whitelist ({"size_out"},{"result"}), which silently missed every out-param spelled otherwise (e.g.int *value,text **value).What changes
FunctionsGeneratorreadsshape.outParamsonto eachParamDefand folds by it. An out-param's role is read from its C type, not its spelling:size_t*out-param is the throwaway byte-count of the*_as_wkb/*_as_hexwkbfamily — allocated, forwarded, discarded;Pointer. Functions with two or more result-out params (intersection_*/synchronize_*:inter1/inter2;*_to_arrow:out_schema/out_array) cannot collapse to a single returned buffer, so they keep those out-params as caller-providedPointerarguments.shape.outParams(380 functions, 438 out-params).TText.value_at_timestamp) is adapted to the folded 3-arg signature.Effect
value_at_timestamptz/_nand the boxtmax/tminaccessors now fold uniformly:Verified: generator +
jmeos-corecompile clean, the jar packages, andjavapconfirms the folded and preserved signatures above.