#include <ctype.h>
#include <assert.h>
-#define LOGLEVEL_NAME_VALUE_ARRAY_COUNT(name) (sizeof(name) / sizeof(struct loglevel_name_value))
-
struct loglevel_name_value {
const char *name;
int value;
int loglevel_name_to_value(const char *name, enum lttng_loglevel *loglevel)
{
int ret = lookup_value_from_name(loglevel_values,
- LOGLEVEL_NAME_VALUE_ARRAY_COUNT(loglevel_values), name);
+ ARRAY_SIZE(loglevel_values), name);
if (ret >= 0) {
*loglevel = (typeof(*loglevel)) ret;
const char *name, enum lttng_loglevel_log4j *loglevel)
{
int ret = lookup_value_from_name(loglevel_log4j_values,
- LOGLEVEL_NAME_VALUE_ARRAY_COUNT(loglevel_log4j_values),
+ ARRAY_SIZE(loglevel_log4j_values),
name);
if (ret >= 0) {
const char *name, enum lttng_loglevel_jul *loglevel)
{
int ret = lookup_value_from_name(loglevel_jul_values,
- LOGLEVEL_NAME_VALUE_ARRAY_COUNT(loglevel_jul_values),
+ ARRAY_SIZE(loglevel_jul_values),
name);
if (ret >= 0) {
const char *name, enum lttng_loglevel_python *loglevel)
{
int ret = lookup_value_from_name(loglevel_python_values,
- LOGLEVEL_NAME_VALUE_ARRAY_COUNT(loglevel_python_values),
+ ARRAY_SIZE(loglevel_python_values),
name);
if (ret >= 0) {
}
return ret;
-}
\ No newline at end of file
+}