[MLton-commit] r4318
Matthew Fluet
MLton@mlton.org
Sat, 28 Jan 2006 09:00:39 -0800
Adding MLton.Syslog
----------------------------------------------------------------------
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog-consts.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog.c
----------------------------------------------------------------------
Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog-consts.c 2006-01-28 17:00:16 UTC (rev 4317)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog-consts.c 2006-01-28 17:00:37 UTC (rev 4318)
@@ -0,0 +1,34 @@
+#include "platform.h"
+
+const C_Int_t MLton_Syslog_Logopt_LOG_CONS = LOG_CONS;
+const C_Int_t MLton_Syslog_Logopt_LOG_NDELAY = LOG_NDELAY;
+const C_Int_t MLton_Syslog_Logopt_LOG_NOWAIT = LOG_NOWAIT;
+const C_Int_t MLton_Syslog_Logopt_LOG_ODELAY = LOG_ODELAY;
+const C_Int_t MLton_Syslog_Logopt_LOG_PID = LOG_PID;
+
+const C_Int_t MLton_Syslog_Facility_LOG_AUTH = LOG_AUTH;
+const C_Int_t MLton_Syslog_Facility_LOG_CRON = LOG_CRON;
+const C_Int_t MLton_Syslog_Facility_LOG_DAEMON = LOG_DAEMON;
+const C_Int_t MLton_Syslog_Facility_LOG_KERN = LOG_KERN;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL0 = LOG_LOCAL0;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL1 = LOG_LOCAL1;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL2 = LOG_LOCAL2;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL3 = LOG_LOCAL3;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL4 = LOG_LOCAL4;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL5 = LOG_LOCAL5;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL6 = LOG_LOCAL6;
+const C_Int_t MLton_Syslog_Facility_LOG_LOCAL7 = LOG_LOCAL7;
+const C_Int_t MLton_Syslog_Facility_LOG_LPR = LOG_LPR;
+const C_Int_t MLton_Syslog_Facility_LOG_MAIL = LOG_MAIL;
+const C_Int_t MLton_Syslog_Facility_LOG_NEWS = LOG_NEWS;
+const C_Int_t MLton_Syslog_Facility_LOG_USER = LOG_USER;
+const C_Int_t MLton_Syslog_Facility_LOG_UUCP = LOG_UUCP;
+
+const C_Int_t MLton_Syslog_Severity_LOG_ALERT = LOG_ALERT;
+const C_Int_t MLton_Syslog_Severity_LOG_CRIT = LOG_CRIT;
+const C_Int_t MLton_Syslog_Severity_LOG_DEBUG = LOG_DEBUG;
+const C_Int_t MLton_Syslog_Severity_LOG_EMERG = LOG_EMERG;
+const C_Int_t MLton_Syslog_Severity_LOG_ERR = LOG_ERR;
+const C_Int_t MLton_Syslog_Severity_LOG_INFO = LOG_INFO;
+const C_Int_t MLton_Syslog_Severity_LOG_NOTICE = LOG_NOTICE;
+const C_Int_t MLton_Syslog_Severity_LOG_WARNING = LOG_WARNING;
Added: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog.c 2006-01-28 17:00:16 UTC (rev 4317)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Syslog/Syslog.c 2006-01-28 17:00:37 UTC (rev 4318)
@@ -0,0 +1,17 @@
+#include "platform.h"
+
+void MLton_Syslog_closelog(void) {
+ closelog();
+}
+
+/* openlog relies on the string being around forever. */
+void MLton_Syslog_openlog(NullString8_t s, C_Int_t o, C_Int_t f) {
+ char *s_ = strdup ((const char*)s);
+ if (s_ == NULL)
+ s_ = "";
+ openlog (s_, o, f);
+}
+
+void MLton_Syslog_syslog(C_Int_t p, NullString8_t s) {
+ syslog(p, (const char*)s);
+}