Rizin
unix-like reverse engineering framework and cli tools
assert.c File Reference
#include <rz_util.h>

Go to the source code of this file.

Functions

static void print_message (RzLogLevel level, const char *fmt, va_list args)
 
RZ_API void rz_assert_log (RzLogLevel level, const char *fmt,...)
 

Function Documentation

◆ print_message()

static void print_message ( RzLogLevel  level,
const char *  fmt,
va_list  args 
)
static

Definition at line 18 of file assert.c.

18  {
19  RZ_VLOG(level, NULL, fmt, args);
20 }
#define NULL
Definition: cris-opc.c:27
int args
Definition: mipsasm.c:18
#define RZ_VLOG(lvl, tag, fmtstr, args)
Definition: rz_log.h:36
static int level
Definition: vmenus.c:2424

References args, level, NULL, and RZ_VLOG.

Referenced by rz_assert_log().

◆ rz_assert_log()

RZ_API void rz_assert_log ( RzLogLevel  level,
const char *  fmt,
  ... 
)

Definition at line 26 of file assert.c.

26  {
27  va_list args;
28  va_start(args, fmt);
29  print_message(level, fmt, args);
30  va_end(args);
31  char *env = rz_sys_getenv("RZ_DEBUG_ASSERT");
32  if (env) {
34  if (*env && atoi(env)) {
36  }
37  free(env);
38  }
39 }
static void print_message(RzLogLevel level, const char *fmt, va_list args)
Definition: assert.c:18
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
#define rz_sys_breakpoint()
Definition: rz_sys.h:178
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
Definition: sys.c:483
RZ_API char RZ_API void rz_sys_backtrace(void)
Print the backtrace at the point this function is called from.
Definition: sys.c:265
static char ** env
Definition: sys.c:32

References args, env, free(), level, print_message(), rz_sys_backtrace(), rz_sys_breakpoint, and rz_sys_getenv().