16 # define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
17 # define RB_OBJ_STRING(obj) (obj)
19 # define PRIsVALUE "s"
20 # define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
21 # define RB_OBJ_STRING(obj) StringValueCStr(obj)
149 VALUE ident, opt, fac;
330 return rb_sprintf(
"<#%s: opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
345 #define define_syslog_shortcut_method(pri, name) \
346 static VALUE mSyslog_##name(int argc, VALUE *argv, VALUE self) \
348 syslog_write((pri), argc, argv); \
449 #define rb_define_syslog_const(id) \
450 rb_define_const(mSyslogConstants, #id, INT2NUM(id))
543 #define rb_define_syslog_shortcut(name) \
544 rb_define_module_function(mSyslog, #name, mSyslog_##name, -1)
VALUE rb_f_sprintf(int, const VALUE *)
static VALUE mSyslog_isopen(VALUE self)
static VALUE mSyslog_reopen(int argc, VALUE *argv, VALUE self)
static VALUE INT2NUM(int v)
#define rb_define_syslog_const(id)
#define RSTRING_PTR(string)
void rb_raise(VALUE exc, const char *fmt,...)
static void syslog_write(int pri, int argc, VALUE *argv)
void rb_include_module(VALUE klass, VALUE module)
static VALUE mSyslog_instance(VALUE self)
static VALUE mSyslog_ident(VALUE self)
static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
VALUE rb_gv_get(const char *)
int rb_block_given_p(void)
#define rb_define_syslog_shortcut(name)
static const char * syslog_ident
static VALUE mSyslog_close(VALUE self)
static int syslog_facility
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
VALUE rb_sprintf(const char *format,...)
static VALUE mSyslog_facility(VALUE self)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
static int syslog_options
const char * rb_class2name(VALUE)
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
static VALUE mSyslog_inspect(VALUE self)
VALUE rb_define_module_under(VALUE outer, const char *name)
static VALUE mSyslogConstants
#define RB_OBJ_CLASSNAME(obj)
static VALUE mSyslog_set_mask(VALUE self, VALUE mask)
static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
#define SafeStringValue(v)
static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
VALUE rb_define_module(const char *name)
#define define_syslog_shortcut_method(pri, name)
VALUE rb_str_new2(const char *)
static VALUE mSyslogConstants_LOG_UPTO(VALUE klass, VALUE pri)
static VALUE mSyslog_get_mask(VALUE self)
static VALUE mSyslog_options(VALUE self)