OSSP CVS Repository

ossp - Check-in [951]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 951
Date: 2001-Sep-12 11:42:34 (local)
2001-Sep-12 09:42:34 (UTC)
User:ms
Branch:
Comment: Upgraded both stream and channel-level APIs to include new L2_LEVEL parameter design.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2.h.in      1.3 -> 1.4     4 inserted, 4 deleted
ossp-pkg/l2/l2_ch_file.c      1.16 -> 1.17     2 inserted, 2 deleted
ossp-pkg/l2/l2_ch_filter.c      1.7 -> 1.8     2 inserted, 2 deleted
ossp-pkg/l2/l2_ch_null.c      1.7 -> 1.8     1 inserted, 1 deleted
ossp-pkg/l2/l2_ch_pipe.c      1.7 -> 1.8     1 inserted, 2 deleted
ossp-pkg/l2/l2_ch_prefix.c      1.11 -> 1.12     4 inserted, 4 deleted
ossp-pkg/l2/l2_ch_smtp.c      1.1 -> 1.2     2 inserted, 2 deleted
ossp-pkg/l2/l2_ch_socket.c      1.24 -> 1.25     2 inserted, 2 deleted
ossp-pkg/l2/l2_ch_syslog.c      1.19 -> 1.20     2 inserted, 2 deleted
ossp-pkg/l2/l2_channel.c      1.16 -> 1.17     2 inserted, 2 deleted
ossp-pkg/l2/l2_stream.c      1.14 -> 1.15     3 inserted, 3 deleted

ossp-pkg/l2/l2.h.in 1.3 -> 1.4

--- l2.h.in      2001/09/10 10:15:11     1.3
+++ l2.h.in      2001/09/12 09:42:34     1.4
@@ -157,7 +157,7 @@
     l2_result_t (*create)   (l2_context_t *ctx, l2_channel_t *ch);
     l2_result_t (*configure)(l2_context_t *ctx, l2_channel_t *ch, const char *fmt, va_list ap);
     l2_result_t (*open)     (l2_context_t *ctx, l2_channel_t *ch);
-    l2_result_t (*write)    (l2_context_t *ctx, l2_channel_t *ch, const char *buf, size_t bufsize);
+    l2_result_t (*write)    (l2_context_t *ctx, l2_channel_t *ch, l2_level_t level, const char *buf, size_t bufsize);
     l2_result_t (*flush)    (l2_context_t *ctx, l2_channel_t *ch);
     l2_result_t (*close)    (l2_context_t *ctx, l2_channel_t *ch);
     l2_result_t (*destroy)  (l2_context_t *ctx, l2_channel_t *ch);
@@ -192,7 +192,7 @@
 l2_channel_t *l2_channel_create     (l2_handler_t *h);
 l2_result_t   l2_channel_configure  (l2_channel_t *ch, const char *fmt, ...);
 l2_result_t   l2_channel_open       (l2_channel_t *ch);
-l2_result_t   l2_channel_write      (l2_channel_t *ch, const char *buf, size_t bufsize);
+l2_result_t   l2_channel_write      (l2_channel_t *ch, l2_level_t level, const char *buf, size_t bufsize);
 l2_result_t   l2_channel_flush      (l2_channel_t *ch);
 l2_result_t   l2_channel_close      (l2_channel_t *ch);
 l2_result_t   l2_channel_destroy    (l2_channel_t *ch);
@@ -205,8 +205,8 @@
 l2_result_t   l2_stream_channel    (l2_stream_t *st, l2_channel_t *ch, unsigned int levelmask);
 l2_result_t   l2_stream_formatter  (l2_stream_t *st, char id, l2_formatter_t cb, l2_context_t *ctx);
 l2_result_t   l2_stream_levels     (l2_stream_t *st, unsigned int levelmask);
-l2_result_t   l2_stream_log        (l2_stream_t *st, unsigned int level, const char *fmt, ...);
-l2_result_t   l2_stream_vlog       (l2_stream_t *st, unsigned int level, const char *fmt, va_list ap);
+l2_result_t   l2_stream_log        (l2_stream_t *st, l2_level_t level, const char *fmt, ...);
+l2_result_t   l2_stream_vlog       (l2_stream_t *st, l2_level_t level, const char *fmt, va_list ap);
 l2_result_t   l2_stream_destroy    (l2_stream_t *st);
 
 /* utility operations */


ossp-pkg/l2/l2_ch_file.c 1.16 -> 1.17

--- l2_ch_file.c 2001/09/06 16:10:05     1.16
+++ l2_ch_file.c 2001/09/12 09:42:34     1.17
@@ -100,8 +100,8 @@
 }
 
 /* write to channel */
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                      const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     l2_ch_file_t *cfg = (l2_ch_file_t *)ctx->vp;
     


ossp-pkg/l2/l2_ch_filter.c 1.7 -> 1.8

--- l2_ch_filter.c       2001/09/05 07:47:12     1.7
+++ l2_ch_filter.c       2001/09/12 09:42:34     1.8
@@ -44,8 +44,8 @@
     return L2_OK;
 }
 
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                      const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     return L2_OK;
 }


ossp-pkg/l2/l2_ch_null.c 1.7 -> 1.8

--- l2_ch_null.c 2001/09/05 07:47:12     1.7
+++ l2_ch_null.c 2001/09/12 09:42:34     1.8
@@ -44,7 +44,7 @@
     return L2_OK;
 }
 
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, l2_level_t level, const char *buf, size_t buf_size)
 {
     return L2_OK;
 }


ossp-pkg/l2/l2_ch_pipe.c 1.7 -> 1.8

--- l2_ch_pipe.c 2001/09/05 07:47:12     1.7
+++ l2_ch_pipe.c 2001/09/12 09:42:34     1.8
@@ -44,8 +44,7 @@
     return L2_OK;
 }
 
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                      const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, l2_level_t level, const char *buf, size_t buf_size)
 {
     return L2_OK;
 }


ossp-pkg/l2/l2_ch_prefix.c 1.11 -> 1.12

--- l2_ch_prefix.c       2001/09/11 11:59:59     1.11
+++ l2_ch_prefix.c       2001/09/12 09:42:34     1.12
@@ -83,8 +83,8 @@
 }
 
 /* write to channel */
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                              const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     l2_ch_prefix_t *cfg = (l2_ch_prefix_t *)ctx->vp;
     l2_channel_t *downstream = l2_channel_downstream(ch);
@@ -104,12 +104,12 @@
             return L2_ERR_ARG;
         if ((n = strftime(cfg->timebuf, sizeof(cfg->timebuf), cfg->timefmt, tm)) == 0)
             return L2_ERR_SYS;
-        if ((rv = l2_channel_write(downstream, cfg->timebuf, n)) != L2_OK)
+        if ((rv = l2_channel_write(downstream, level, cfg->timebuf, n)) != L2_OK)
             return rv;
     }
 
     /* write to downstream channel */
-    if ((rv = l2_channel_write(downstream, buf, buf_size)) != L2_OK)
+    if ((rv = l2_channel_write(downstream, level, buf, buf_size)) != L2_OK)
         return rv;
 
     return L2_OK;


ossp-pkg/l2/l2_ch_smtp.c 1.1 -> 1.2

--- l2_ch_smtp.c 2001/09/09 15:57:10     1.1
+++ l2_ch_smtp.c 2001/09/12 09:42:34     1.2
@@ -135,8 +135,8 @@
 }
 
 /* write to channel */
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                              const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     l2_ch_smtp_t *cfg = (l2_ch_smtp_t *)ctx->vp;
     char caLine[1024];


ossp-pkg/l2/l2_ch_socket.c 1.24 -> 1.25

--- l2_ch_socket.c       2001/09/11 10:37:04     1.24
+++ l2_ch_socket.c       2001/09/12 09:42:34     1.25
@@ -273,8 +273,8 @@
 }
 
 /* write to channel */
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                      const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     struct sockaddr_in IP4Sockaddr, IP6Sockaddr;
     l2_ch_socket_t    *cfg = (l2_ch_socket_t *)ctx->vp;


ossp-pkg/l2/l2_ch_syslog.c 1.19 -> 1.20

--- l2_ch_syslog.c       2001/09/10 14:33:24     1.19
+++ l2_ch_syslog.c       2001/09/12 09:42:34     1.20
@@ -94,8 +94,8 @@
 }
 
 /* write to channel */
-static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch, 
-                      const char *buf, size_t buf_size)
+static l2_result_t hook_write(l2_context_t *ctx, l2_channel_t *ch,
+                              l2_level_t level, const char *buf, size_t buf_size)
 {
     l2_ch_syslog_t *cfg = (l2_ch_syslog_t *)ctx->vp;
 


ossp-pkg/l2/l2_channel.c 1.16 -> 1.17

--- l2_channel.c 2001/09/06 14:37:53     1.16
+++ l2_channel.c 2001/09/12 09:42:34     1.17
@@ -117,7 +117,7 @@
 }
 
 /* write to channel (stack) */
-l2_result_t l2_channel_write(l2_channel_t *ch, const char *buf, size_t bufsize)
+l2_result_t l2_channel_write(l2_channel_t *ch, l2_level_t level, const char *buf, size_t bufsize)
 {
     l2_result_t rv;
 
@@ -140,7 +140,7 @@
         return L2_ERR_USE;
 
     /* pass operation to handler */
-    rv = ch->handler.write(&ch->context, ch, buf, bufsize);
+    rv = ch->handler.write(&ch->context, ch, level, buf, bufsize);
 
     return rv;
 }


ossp-pkg/l2/l2_stream.c 1.14 -> 1.15

--- l2_stream.c  2001/09/06 14:37:53     1.14
+++ l2_stream.c  2001/09/12 09:42:34     1.15
@@ -120,7 +120,7 @@
 }
 
 /* log a message to stream */
-l2_result_t l2_stream_log(l2_stream_t *st, unsigned int level, const char *fmt, ...)
+l2_result_t l2_stream_log(l2_stream_t *st, l2_level_t level, const char *fmt, ...)
 {
     va_list ap;
     l2_result_t rv;
@@ -176,7 +176,7 @@
 }
 
 /* log a message to stream (va_list-variant) */
-l2_result_t l2_stream_vlog(l2_stream_t *st, unsigned int level, const char *fmt, va_list ap)
+l2_result_t l2_stream_vlog(l2_stream_t *st, l2_level_t level, const char *fmt, va_list ap)
 {
     int i;
     int l, j;
@@ -223,7 +223,7 @@
     rv = L2_OK;
     for (i = 0; i < L2_MAX_CHANNELS && st->channels[i].ch != NULL; i++) {
         if (st->channels[i].levelmask & level) {
-            if ((rv = l2_channel_write(st->channels[i].ch, st->message, len)) != L2_OK)
+            if ((rv = l2_channel_write(st->channels[i].ch, level, st->message, len)) != L2_OK)
                 break;
         }
     }

CVSTrac 2.0.1