Macros by Elektra.
More...
Macros by Elektra.
Macros start with ELEKTRA_ and are uppercase.
- Copyright
- BSD License (see LICENSE.md or https://www.libelektra.org)
◆ ELEKTRA_SET_ERROR_READ_ONLY
#define ELEKTRA_SET_ERROR_READ_ONLY |
( |
|
info, |
|
|
|
returned, |
|
|
|
error |
|
) |
| |
Value:do \
{ \
Key * k; \
ksRewind (info); \
ksRewind (returned); \
while ((k =
ksNext (returned))) \
{ \
if (!c) \
{ \
ELEKTRA_SET_ERRORF (84, error,
"the key %s (value %s) was added",
keyName (k),
keyString (k)); \
ksDel (info); \
return -1; \
} \
{ \
ELEKTRA_SET_ERRORF (84, error,
"the key %s (expected %s) was modified to %s (expected %s)",
keyName (k), \
ksDel (info); \
return -1; \
} \
} \
if ((k =
ksNext (info)) != 0) \
{ \
ELEKTRA_SET_ERRORF (84, error,
"the key %s (value %s) was removed",
keyName (k),
keyString (k)); \
ksDel (info); \
return -1; \
} \
ksDel (info); \
} while (0)
const char * keyString(const Key *key)
Get the c-string representing the value.
Definition: keyvalue.c:193
Key * ksNext(KeySet *ks)
Returns the next Key in a KeySet.
Definition: keyset.c:1262
const char * keyName(const Key *key)
Returns a pointer to the abbreviated real internal key name.
Definition: elektra/keyname.c:213
Sets error 84 if info != returned.
- Parameters
-
info | how the info is now (freshly received) |
returned | how the info passed from user is |
error | key to set error to |
- Returns
- with -1 on error