+ strncpy (command, "LISTVAL", sizeof (command));
+
+#define ADD_SELECTOR(field) \
+ if (re_##field != NULL) \
+ { \
+ char tmp_re[sizeof (command)]; \
+ char tmp_cmd[sizeof (command)]; \
+ snprintf (tmp_cmd, sizeof (tmp_cmd), "%s %s=%s", command, #field, \
+ lcc_strescape (tmp_re, re_##field, sizeof (tmp_re))); \
+ memcpy (command, tmp_cmd, sizeof (command)); \
+ command[sizeof (command) - 1] = 0; \
+ }
+
+ ADD_SELECTOR (host)
+ ADD_SELECTOR (plugin)
+ ADD_SELECTOR (plugin_instance)
+ ADD_SELECTOR (type)
+ ADD_SELECTOR (type_instance)
+
+#undef ADD_SELECTOR
+
+ status = lcc_sendreceive (c, command, &res);