Motr  M0
enum.c File Reference
#include "lib/trace.h"
#include "lib/errno.h"
#include "lib/misc.h"
#include "xcode/xcode.h"
#include "xcode/enum.h"
Include dependency graph for enum.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_XCODE
 
#define P(fmt, val)
 
#define BETWEEN(ch, l, h)   ((l) <= (ch) && (ch) <= (h))
 

Functions

static const struct m0_xcode_enum_valvalget (const struct m0_xcode_enum *en, uint64_t val)
 
static const struct m0_xcode_enum_valnameget (const struct m0_xcode_enum *en, const char *name, int nr)
 
static int enum_getnum (const char *buf, uint64_t *out)
 
static const char * enum_id (const char *buf)
 
static const char * bitmask_id (const char *buf)
 
bool m0_xcode_enum_is_valid (const struct m0_xcode_enum *en, uint64_t val)
 
const char * m0_xcode_enum_print (const struct m0_xcode_enum *en, uint64_t val, char *buf)
 
int m0_xcode_enum_read (const struct m0_xcode_enum *en, const char *buf, int nr, uint64_t *val)
 
bool m0_xcode_bitmask_is_valid (const struct m0_xcode_enum *en, uint64_t val)
 
int m0_xcode_bitmask_print (const struct m0_xcode_enum *en, uint64_t val, char *buf, int nr)
 
int m0_xcode_bitmask_read (const struct m0_xcode_enum *en, const char *buf, int nr, uint64_t *val)
 
M0_INTERNAL int m0_xcode_enum_field_read (const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
 
M0_INTERNAL int m0_xcode_bitmask_field_read (const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
 
static bool enum_char (char ch)
 

Macro Definition Documentation

◆ BETWEEN

#define BETWEEN (   ch,
  l,
 
)    ((l) <= (ch) && (ch) <= (h))

◆ P

#define P (   fmt,
  val 
)
Value:
({ \
nob += snprintf(buf + nob, nr - nob, "%s" fmt, \
nob == 0 ? "" : "|", val); \
})
static size_t nr
Definition: dump.c:1505
Definition: idx_mock.c:52
Definition: sock.c:887
char * fmt(const char *format,...) __attribute__((format(printf