Check-in Number:
|
999 | |
Date: |
2001-Sep-13 21:20:48 (local)
2001-Sep-13 19:20:48 (UTC) |
User: | rse |
Branch: | |
Comment: |
For consistency reasons provide a l2_stream_flush() function
which allows one to flush all channel (stacks) in one action. |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/l2/l2.h.in 1.8 -> 1.9
--- l2.h.in 2001/09/13 19:18:34 1.8
+++ l2.h.in 2001/09/13 19:20:48 1.9
@@ -208,6 +208,7 @@
l2_result_t l2_stream_levels (l2_stream_t *st, unsigned int levelmask, unsigned int flushmask);
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_flush (l2_stream_t *st);
l2_result_t l2_stream_destroy (l2_stream_t *st);
/* utility operations */
|
|
ossp-pkg/l2/l2_stream.c 1.19 -> 1.20
--- l2_stream.c 2001/09/13 16:18:42 1.19
+++ l2_stream.c 2001/09/13 19:20:48 1.20
@@ -232,6 +232,24 @@
return rv;
}
+/* flush stream */
+l2_result_t l2_stream_flush(l2_stream_t *st)
+{
+ int i;
+ l2_result_t rv;
+
+ /* argument sanity check */
+ if (st == NULL)
+ return L2_ERR_ARG;
+
+ /* flush all attached channels */
+ for (i = 0; i < L2_MAX_CHANNELS && st->channels[i].ch != NULL; i++)
+ if ((rv = l2_channel_flush(st->channels[i].ch)) != L2_OK)
+ return rv;
+
+ return L2_OK;
+}
+
/* destroy stream */
l2_result_t l2_stream_destroy(l2_stream_t *st)
{
|
|