New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ksSearch to public API #4026
Comments
I agree that static inline Key * ksLookup (KeySet * ks, Key * k, elektraLookupFlags options)
{
elektraCursor cursor = ksSearch (ks, k);
if (cursor < 0) return cursor;
return ksAtCursor (cursor);
} All Another benefit of making |
So which flag remains which you think it is important for ksSearch? Probably we should even get rid of the argument from ksLookup? (and provide ksRemove instead) |
Seems like the best option going forward
Markus Raab ***@***.***> schrieb am Fr., 10. Sept. 2021,
18:05:
… except for KDB_O_POP
- KDB_O_CREATE also does not work
- KDB_O_DEL was probably never a good idea (ksLookupByName is superior)
- KDB_O_SPEC is now irrelevant as we do not want spec keys in the
keyset anyway
So which flag remains which you think it is important for ksSearch?
Probably we should even get rid of the argument from ksLookup? (and
provide ksRemove instead)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4026 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFR66CJTWWZNQGFLDF6P63UBIUFFANCNFSM5DOVS7RQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Why?
I have used it once or twice, but adding another
Probably we should have a remove method that takes a cursor (called static inline Key * ksRemove (KeySet * ks, Key * k)
{
return ksRemoveAt (ks, ksSearch (ks, k));
} |
Actually it also applies to ksLookup: #4034
It makes sense that we offer a full iterator-based interface (including removal) and get rid all the special features from ksLookup (like creation and removal).
ksRemoveAtCursor would be more consistent to ksAtCursor. |
As discussed with @markus2330, I will add |
Is this necessary? I don't think there will be a need to call |
Optimization of |
Thank you 👍
Exactly, that is why it should be made private. |
But symbols in Symbols should be defined like this:
Note: "multiple libraries" in this context could also mean a single library and some tests, since tests are compiles as a separate ELF binary This means, if |
…placing `ksSearchInternal`
Yes 👍, ksSearchInternal can be static and then only ksSearch gets tested (which is a public symbol). |
As we want external iteration as the only iteration it probably makes sense to put
elektraCursor ksSearch(KeySet*, Key*)
into the public API: it returns the cursor of a key name: asksLookup
, only the return types differs.There is already a use case: #4002.
@lawli3t Do you think this would be still a minimal API?
Like always: everyone can share his/her thoughts about this proposal.
The text was updated successfully, but these errors were encountered: