Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
syslog.c File Reference
`#include "ruby/ruby.h"`
`#include "ruby/util.h"`
`#include <syslog.h>`
Include dependency graph for syslog.c:

Go to the source code of this file.

## Macros
#define | define_syslog_shortcut_method(pri, name)
#define | rb_define_syslog_option(c) rb_define_const(mSyslogOption, #c, INT2NUM(c))
#define | rb_define_syslog_facility(c) rb_define_const(mSyslogFacility, #c, INT2NUM(c))
#define | rb_define_syslog_level(c, m)

## Functions
static void | syslog_write (int pri, int argc, VALUE *argv)
static VALUE | mSyslog_close (VALUE self)
static VALUE | mSyslog_open (int argc, VALUE *argv, VALUE self)
static VALUE | mSyslog_reopen (int argc, VALUE *argv, VALUE self)
static VALUE | mSyslog_isopen (VALUE self)
static VALUE | mSyslog_ident (VALUE self)
static VALUE | mSyslog_options (VALUE self)
static VALUE | mSyslog_facility (VALUE self)
static VALUE | mSyslog_get_mask (VALUE self)
static VALUE | mSyslog_set_mask (VALUE self, VALUE mask)
static VALUE | mSyslog_log (int argc, VALUE *argv, VALUE self)
static VALUE | mSyslog_inspect (VALUE self)
static VALUE | mSyslog_instance (VALUE self)
static VALUE | mSyslogMacros_LOG_MASK (VALUE mod, VALUE pri)
static VALUE | mSyslogMacros_LOG_UPTO (VALUE mod, VALUE pri)
static VALUE | mSyslogMacros_included (VALUE mod, VALUE target)
void | Init_syslog ()

## Variables
static VALUE | mSyslog
static VALUE | mSyslogConstants
static VALUE | mSyslogOption
static VALUE | mSyslogFacility
static VALUE | mSyslogLevel
static VALUE | mSyslogMacros
static const char * | syslog_ident = NULL
static int | syslog_options = -1
static int | syslog_facility = -1
static int | syslog_mask = -1
static int | syslog_opened = 0

## Macro Definition Documentation

#define define_syslog_shortcut_method | ( |  | pri,
|  |  | name
| ) |  |

Value:
static VALUE mSyslog_##name(int argc, VALUE *argv, VALUE self) \
{ \
syslog_write((pri), argc, argv); \
\
return self; \
}

Definition at line 350 of file syslog.c.

#define rb_define_syslog_facility | ( |  | c) |  | rb_define_const(mSyslogFacility, #c, INT2NUM(c))

Referenced by Init_syslog().

#define rb_define_syslog_level | ( |  | c,
|  |  | m
| ) |  |

Value:
rb_define_const(mSyslogLevel, #c, INT2NUM(c)); \
rb_define_module_function(mSyslog, #m, mSyslog_##m, -1)

Referenced by Init_syslog().

#define rb_define_syslog_option | ( |  | c) |  | rb_define_const(mSyslogOption, #c, INT2NUM(c))

Referenced by Init_syslog().

## Function Documentation

void Init_syslog | ( | ) |  |

Definition at line 424 of file syslog.c.

References debug, err, mSyslog, mSyslog_close(), mSyslog_facility(), mSyslog_get_mask(), mSyslog_ident(), mSyslog_inspect(), mSyslog_instance(), mSyslog_isopen(), mSyslog_log(), mSyslog_open(), mSyslog_options(), mSyslog_reopen(), mSyslog_set_mask(), mSyslogConstants, mSyslogFacility, mSyslogLevel, mSyslogMacros, mSyslogMacros_included(), mSyslogMacros_LOG_MASK(), mSyslogMacros_LOG_UPTO(), mSyslogOption, rb_define_method(), rb_define_module(), rb_define_module_function(), rb_define_module_under(), rb_define_singleton_method(), rb_define_syslog_facility, rb_define_syslog_level, rb_define_syslog_option, rb_funcall(), rb_include_module(), and rb_intern.

static VALUE mSyslog_close | ( | VALUE | self) |  |
| static

Definition at line 57 of file syslog.c.

References NULL, Qnil, rb_eRuntimeError, rb_raise(), rb_secure(), syslog_facility, syslog_ident, syslog_mask, syslog_opened, syslog_options, and xfree.

Referenced by Init_syslog(), mSyslog_open(), and mSyslog_reopen().

static VALUE mSyslog_facility | ( | VALUE | self) |  |
| static

Definition at line 236 of file syslog.c.

References INT2NUM, Qnil, syslog_facility, and syslog_opened.

Referenced by Init_syslog().

static VALUE mSyslog_get_mask | ( | VALUE | self) |  |
| static

Definition at line 244 of file syslog.c.

References INT2NUM, Qnil, syslog_mask, and syslog_opened.

Referenced by Init_syslog().

static VALUE mSyslog_ident | ( | VALUE | self) |  |
| static

Definition at line 222 of file syslog.c.

References Qnil, rb_str_new2, syslog_ident, and syslog_opened.

Referenced by Init_syslog().

static VALUE mSyslog_inspect | ( | VALUE | self) |  |
| static

Definition at line 328 of file syslog.c.

References Check_Type, rb_class2name(), rb_sprintf(), syslog_facility, syslog_ident, syslog_mask, syslog_opened, syslog_options, and T_MODULE.

Referenced by Init_syslog().

static VALUE mSyslog_instance | ( | VALUE | self) |  |
| static

Definition at line 345 of file syslog.c.

Referenced by Init_syslog().

static VALUE mSyslog_isopen | ( | VALUE | self) |  |
| static

Definition at line 215 of file syslog.c.

References Qfalse, Qtrue, and syslog_opened.

Referenced by Init_syslog().

static VALUE mSyslog_log | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 306 of file syslog.c.

References CLASS_OF, FIX2INT, FIXNUM_P, rb_class2name(), rb_eArgError, rb_eTypeError, rb_raise(), and syslog_write().

Referenced by Init_syslog().

static VALUE mSyslog_open | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 152 of file syslog.c.

References mSyslog_close(), NIL_P, NUM2INT, rb_block_given_p(), rb_ensure(), rb_eRuntimeError, rb_gv_get(), rb_raise(), rb_scan_args(), rb_yield(), RSTRING_PTR, SafeStringValue, strdup, syslog_facility, syslog_ident, syslog_mask, syslog_opened, and syslog_options.

Referenced by Init_syslog(), and mSyslog_reopen().

static VALUE mSyslog_options | ( | VALUE | self) |  |
| static

Definition at line 229 of file syslog.c.

References INT2NUM, Qnil, syslog_opened, and syslog_options.

Referenced by Init_syslog().

static VALUE mSyslog_reopen | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 203 of file syslog.c.

References mSyslog_close(), and mSyslog_open().

Referenced by Init_syslog().

static VALUE mSyslog_set_mask | ( | VALUE | self,
|  | VALUE | mask
| ) |  |
| static

Definition at line 264 of file syslog.c.

References NUM2INT, rb_eRuntimeError, rb_raise(), rb_secure(), syslog_mask, and syslog_opened.

Referenced by Init_syslog().

static VALUE mSyslogMacros_included | ( | VALUE | mod,
|  | VALUE | target
| ) |  |
| static

Definition at line 404 of file syslog.c.

References mod, mSyslogMacros, and rb_extend_object().

Referenced by Init_syslog().

static VALUE mSyslogMacros_LOG_MASK | ( | VALUE | mod,
|  | VALUE | pri
| ) |  |
| static

Definition at line 388 of file syslog.c.

References INT2FIX, and NUM2INT.

Referenced by Init_syslog().

static VALUE mSyslogMacros_LOG_UPTO | ( | VALUE | mod,
|  | VALUE | pri
| ) |  |
| static

Definition at line 399 of file syslog.c.

References INT2FIX, and NUM2INT.

Referenced by Init_syslog().

static void syslog_write | ( | int | pri,
|  | int | argc,
|  | VALUE * | argv
| ) |  |
| static

Definition at line 36 of file syslog.c.

References rb_eArgError, rb_eRuntimeError, rb_f_sprintf(), rb_raise(), rb_secure(), RSTRING_PTR, strscanner::str, and syslog_opened.

Referenced by mSyslog_log().

## Variable Documentation

VALUE mSyslog
| static

Definition at line 16 of file syslog.c.

Referenced by Init_syslog().

VALUE mSyslogConstants
| static

Definition at line 21 of file syslog.c.

Referenced by Init_syslog().

VALUE mSyslogFacility
| static

Definition at line 25 of file syslog.c.

Referenced by Init_syslog().

VALUE mSyslogLevel
| static

Definition at line 27 of file syslog.c.

Referenced by Init_syslog().

VALUE mSyslogMacros
| static

Definition at line 29 of file syslog.c.

Referenced by Init_syslog(), and mSyslogMacros_included().

VALUE mSyslogOption
| static

Definition at line 23 of file syslog.c.

Referenced by Init_syslog().

int syslog_facility = -1
| static

Definition at line 32 of file syslog.c.

Referenced by mSyslog_close(), mSyslog_facility(), mSyslog_inspect(), and mSyslog_open().

const char* syslog_ident = NULL
| static

Definition at line 31 of file syslog.c.

Referenced by mSyslog_close(), mSyslog_ident(), mSyslog_inspect(), and mSyslog_open().

int syslog_mask = -1
| static

Definition at line 32 of file syslog.c.

Referenced by mSyslog_close(), mSyslog_get_mask(), mSyslog_inspect(), mSyslog_open(), and mSyslog_set_mask().

int syslog_opened = 0
| static

Definition at line 33 of file syslog.c.

Referenced by mSyslog_close(), mSyslog_facility(), mSyslog_get_mask(), mSyslog_ident(), mSyslog_inspect(), mSyslog_isopen(), mSyslog_open(), mSyslog_options(), mSyslog_set_mask(), and syslog_write().

int syslog_options = -1
| static

Definition at line 32 of file syslog.c.

Referenced by mSyslog_close(), mSyslog_inspect(), mSyslog_open(), and mSyslog_options().