Scroll to navigation

kdbmacros.h(3elektra) Elektra kdbmacros.h(3elektra)

NAME

kdbmacros.h - Macros by Elektra.

SYNOPSIS

Macros


#define ELEKTRA_QUOTE(x) #x
Surround a value with double quotes. #define ELEKTRA_STRINGIFY(x) ELEKTRA_QUOTE (x)
Surround a macro value with double quotes. #define ELEKTRA_SET_ERROR_READ_ONLY(info, returned, error)
Sets error 84 if info != returned.

Detailed Description

Macros by Elektra.

Macros start with ELEKTRA_ and are uppercase.

Copyright:

BSD License (see LICENSE.md or https://www.libelektra.org)

Macro Definition Documentation

#define ELEKTRA_SET_ERROR_READ_ONLY(info, returned, error)

Value:

do                                                                                                                                         {                                                                                                                                                  Key * k;                                                                                                                                   ksRewind (info);                                                                                                                           ksRewind (returned);                                                                                                                       while ((k = ksNext (returned)))                                                                                                            {                                                                                                                                                  Key * c = ksNext (info);                                                                                                                   if (!c)                                                                                                                                    {                                                                                                                                                  ELEKTRA_SET_ERRORF (84, error, "the key %s (value %s) was added", keyName (k), keyString (k));                                             ksDel (info);                                                                                                                              return -1;                                                                                                                         }                                                                                                                                          if (strcmp (keyName (k), keyName (c)) || strcmp (keyString (k), keyString (c)))                                                            {                                                                                                                                                  ELEKTRA_SET_ERRORF (84, error, "the key %s (expected %s) was modified to %s (expected %s)", keyName (k),                                                       keyName (c), keyString (k), keyString (c));                                                                            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)

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

Author

Generated automatically by Doxygen for Elektra from the source code.

Mon Jan 15 2018 Version 0.8.20