Removed old syslog cruft.
This commit is contained in:
parent
fa5258b957
commit
3cf10885fa
110
scsh/syscalls1.c
110
scsh/syscalls1.c
|
@ -34,7 +34,6 @@
|
||||||
#ifdef HAVE_CRYPT_H
|
#ifdef HAVE_CRYPT_H
|
||||||
#include <crypt.h>
|
#include <crypt.h>
|
||||||
#endif
|
#endif
|
||||||
#include <syslog.h>
|
|
||||||
#include "cstuff.h"
|
#include "cstuff.h"
|
||||||
#include "machine/stdio_dep.h"
|
#include "machine/stdio_dep.h"
|
||||||
|
|
||||||
|
@ -762,112 +761,3 @@ s48_value scm_crypt(s48_value key, s48_value salt)
|
||||||
return s48_enter_string (crypt ( s48_extract_string (key),
|
return s48_enter_string (crypt ( s48_extract_string (key),
|
||||||
s48_extract_string(salt)));
|
s48_extract_string(salt)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* syslog
|
|
||||||
*******************
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum scsh_syslog_option {SCSH_LOG_OPTION_DEFAULT,
|
|
||||||
SCSH_LOG_CONS, SCSH_LOG_NDELAY, SCSH_LOG_PID};
|
|
||||||
|
|
||||||
int extract_option(s48_value _option)
|
|
||||||
{
|
|
||||||
int option;
|
|
||||||
switch (s48_extract_fixnum (_option)){
|
|
||||||
case SCSH_LOG_OPTION_DEFAULT: option = 0; break;
|
|
||||||
case SCSH_LOG_CONS: option = LOG_CONS; break;
|
|
||||||
case SCSH_LOG_NDELAY: option = LOG_NDELAY; break;
|
|
||||||
case SCSH_LOG_PID: option = LOG_PID; break;
|
|
||||||
default: s48_raise_argtype_error (_option);}
|
|
||||||
return option;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum scsh_syslog_facility{SCSH_LOG_FACILITY_DEFAULT,
|
|
||||||
SCSH_LOG_AUTH,
|
|
||||||
SCSH_LOG_DAEMON,
|
|
||||||
SCSH_LOG_KERN,
|
|
||||||
SCSH_LOG_LOCAL0,
|
|
||||||
SCSH_LOG_LOCAL1,
|
|
||||||
SCSH_LOG_LOCAL2,
|
|
||||||
SCSH_LOG_LOCAL3,
|
|
||||||
SCSH_LOG_LOCAL4,
|
|
||||||
SCSH_LOG_LOCAL5,
|
|
||||||
SCSH_LOG_LOCAL6,
|
|
||||||
SCSH_LOG_LOCAL7,
|
|
||||||
SCSH_LOG_LPR,
|
|
||||||
SCSH_LOG_MAIL,
|
|
||||||
SCSH_LOG_USER};
|
|
||||||
|
|
||||||
int extract_facility(s48_value _facility)
|
|
||||||
{
|
|
||||||
int facility;
|
|
||||||
switch (s48_extract_fixnum(_facility)){
|
|
||||||
case SCSH_LOG_FACILITY_DEFAULT: facility = 0; break;
|
|
||||||
case SCSH_LOG_AUTH: facility = LOG_AUTH; break;
|
|
||||||
case SCSH_LOG_DAEMON: facility = LOG_DAEMON; break;
|
|
||||||
case SCSH_LOG_KERN: facility = LOG_KERN; break;
|
|
||||||
case SCSH_LOG_LOCAL0: facility = LOG_LOCAL0; break;
|
|
||||||
case SCSH_LOG_LOCAL1: facility = LOG_LOCAL1; break;
|
|
||||||
case SCSH_LOG_LOCAL2: facility = LOG_LOCAL2; break;
|
|
||||||
case SCSH_LOG_LOCAL3: facility = LOG_LOCAL3; break;
|
|
||||||
case SCSH_LOG_LOCAL4: facility = LOG_LOCAL4; break;
|
|
||||||
case SCSH_LOG_LOCAL5: facility = LOG_LOCAL5; break;
|
|
||||||
case SCSH_LOG_LOCAL6: facility = LOG_LOCAL6; break;
|
|
||||||
case SCSH_LOG_LOCAL7: facility = LOG_LOCAL7; break;
|
|
||||||
case SCSH_LOG_LPR: facility = LOG_LPR; break;
|
|
||||||
case SCSH_LOG_MAIL: facility = LOG_MAIL; break;
|
|
||||||
case SCSH_LOG_USER: facility = LOG_USER; break;
|
|
||||||
default: s48_raise_argtype_error (_facility);}
|
|
||||||
return facility;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum scsh_syslog_level{SCSH_LOG_LEVEL_DEFAULT,
|
|
||||||
SCSH_LOG_EMERG,
|
|
||||||
SCSH_LOG_ALERT,
|
|
||||||
SCSH_LOG_CRIT,
|
|
||||||
SCSH_LOG_ERR,
|
|
||||||
SCSH_LOG_WARNING,
|
|
||||||
SCSH_LOG_NOTICE,
|
|
||||||
SCSH_LOG_INFO,
|
|
||||||
SCSH_LOG_DEBUG};
|
|
||||||
|
|
||||||
int extract_level(s48_value _level)
|
|
||||||
{
|
|
||||||
int level;
|
|
||||||
switch (s48_extract_fixnum (_level)){
|
|
||||||
case SCSH_LOG_LEVEL_DEFAULT: level = 0; break;
|
|
||||||
case SCSH_LOG_EMERG: level = LOG_EMERG; break;
|
|
||||||
case SCSH_LOG_ALERT: level = LOG_ALERT; break;
|
|
||||||
case SCSH_LOG_CRIT: level = LOG_CRIT; break;
|
|
||||||
case SCSH_LOG_ERR: level = LOG_ERR; break;
|
|
||||||
case SCSH_LOG_WARNING: level = LOG_WARNING; break;
|
|
||||||
case SCSH_LOG_NOTICE: level = LOG_NOTICE; break;
|
|
||||||
case SCSH_LOG_INFO: level = LOG_INFO; break;
|
|
||||||
case SCSH_LOG_DEBUG: level = LOG_DEBUG; break;
|
|
||||||
default: s48_raise_argtype_error (_level);}
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
|
|
||||||
s48_value scm_openlog (s48_value _ident, s48_value _option, s48_value _facility)
|
|
||||||
{
|
|
||||||
openlog(s48_extract_string(_ident),
|
|
||||||
extract_option (_option),
|
|
||||||
extract_facility (_facility));
|
|
||||||
return S48_UNSPECIFIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
s48_value scm_syslog (s48_value _facility, s48_value _level, s48_value _message)
|
|
||||||
{
|
|
||||||
int facility = extract_facility (_facility);
|
|
||||||
int level = extract_level (_level);
|
|
||||||
|
|
||||||
syslog (facility | level, s48_extract_string (_message));
|
|
||||||
return S48_UNSPECIFIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
s48_value scm_closelog ()
|
|
||||||
{
|
|
||||||
closelog();
|
|
||||||
return S48_UNSPECIFIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue