libexplain  1.4.D001
Data Structures | Typedefs | Functions | Variables
libexplain/output/syslog.c File Reference
#include <libexplain/ac/string.h>
#include <libexplain/ac/syslog.h>
#include <libexplain/output.h>
#include <libexplain/program_name.h>

Go to the source code of this file.

Data Structures

struct  explain_output_syslog_t

Typedefs

typedef struct
explain_output_syslog_t 
explain_output_syslog_t

Functions

static void message (explain_output_t *op, const char *text)
explain_output_texplain_output_syslog_new (void)
explain_output_texplain_output_syslog_new1 (int level)
explain_output_texplain_output_syslog_new3 (int option, int facility, int level)

Variables

static int openlog_has_been_called
static const
explain_output_vtable_t 
vtable

Typedef Documentation

Definition at line 27 of file syslog.c.


Function Documentation

The explain_output_syslog_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2);

The following values are used:
option = 0
facility = LOG_USER
level = LOG_ERR
See syslog(3) for more information.

Returns:
NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the syslog class.

Definition at line 93 of file syslog.c.

The explain_output_syslog_new1 function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2);

The following values are used:
option = 0
facility = LOG_USER
See syslog(3) for more information.

Parameters:
levelThe syslog level to be used, see syslog(3) for a definition.
Returns:
NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the syslog class.

Definition at line 101 of file syslog.c.

explain_output_t* explain_output_syslog_new3 ( int  option,
int  facility,
int  level 
)

The explain_output_syslog_new3 function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2);

If you want different facilities or levels, create multiple instances.

Parameters:
optionThe syslog option to be used, see syslog(3) for a definition.
facilityThe syslog facility to be used, see syslog(3) for a definition.
levelThe syslog level to be used, see syslog(3) for a definition.
Returns:
NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the syslog class.

Definition at line 110 of file syslog.c.

static void message ( explain_output_t op,
const char *  text 
) [static]

Definition at line 38 of file syslog.c.


Variable Documentation

Definition at line 34 of file syslog.c.

Initial value:
{
    0, 
    message,
    0, 
    sizeof(explain_output_t)
}

Definition at line 83 of file syslog.c.