-
Notifications
You must be signed in to change notification settings - Fork 122
locking key name in keyNew does not work #3151
Comments
Why do you think it is a problem? Can you give a case where it doesn't work. Shouldn't the actions be executed as passed via va_args? |
Here the link to the lines: libelektra/src/libs/elektra/keyhelpers.c Lines 291 to 306 in 7fb0dee
|
There are two issues here. The first one is a simple flow error in And the current test in The second issue is about the lock flags in general. Since the |
The idea is to make KEY_LOCK_xxx flags public. They can be used either in keyNew or keyLock. |
As explain I recommend to remove support for these flags in |
This order is because of the other name options (KEY_CASCADING_NAME | KEY_META_NAME | KEY_EMPTY_NAME). But as we want to get rid of these options (by @kodebach in #3115) we could also fix this problem that actions are being done before setting the name.
If you translate Let us go through the flags:
So why have this keyVInit and KEY_FLAGS at all? There was a reason to introduce it two years ago, but now it would be much cleaner to not have it? @raphi011 @PhilippGackstatter Have you been in contact with these parts? |
Yes. But this means that every time a new flag gets introduced this needs to be filtered and translated for every single binding. I'm already doing this for
I'm not insisting at all. Single or multiple functions are both fine for bindings wrapping. But vaargs are not. |
I think this is a good idea. If we remove the deprecated and the If we now ignore binary keys for a moment, we only have For the binary keys we could introduce a second set of functions: Key * keyCreateBinary (const char * name, size_t size, const void * value, ...);
Key * keyVCreateBinary (const char * name, size_t size, const void * value, va_list va); I know we decided that implementing We should keep the possibility to create a key with metadata in a single function call to allow things like |
As Rust does not allow defining variadic functions, I am not touching the I was thinking about providing a macro that would mirror
I agree. If the |
Yes, this would be an implication. The 3 proposed lock flags, however, already allow to lock everything useful (why would someone want to lock ref counter or sync flag?), I think we can take the risk.
Yes, so
It is not only about the points I wrote in #3112 but also about the timing. Even introducing
Yes, |
Sorry, GitHub gave me a 500 error and suggested to refresh. For every refresh it still showed 500 but it seems like it actually posted. |
Seems like keyLock is not ready for prime, only name locking is implemented: #3170. So better to not make it public for 1.0. |
as @manuelm reported in #3133:
The text was updated successfully, but these errors were encountered: