Index: ossp-pkg/l2/l2_ch_fd.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_fd.c,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_fd.c,v' 2>/dev/null --- l2_ch_fd.c 2001/09/08 11:07:51 1.9 +++ l2_ch_fd.c 2001/09/12 09:35:57 1.10 @@ -33,15 +33,15 @@ /* declare private channel configuration */ typedef struct { int fd; -} l2_ch_file_t; +} l2_ch_fd_t; /* create channel */ static l2_result_t hook_create(l2_context_t *ctx, l2_channel_t *ch) { - l2_ch_file_t *cfg; + l2_ch_fd_t *cfg; /* allocate private channel configuration */ - if ((cfg = (l2_ch_file_t *)malloc(sizeof(l2_ch_file_t))) == NULL) + if ((cfg = (l2_ch_fd_t *)malloc(sizeof(l2_ch_fd_t))) == NULL) return L2_ERR_MEM; /* initialize configuration with reasonable defaults */ @@ -56,12 +56,12 @@ /* configure channel */ static l2_result_t hook_configure(l2_context_t *ctx, l2_channel_t *ch, const char *fmt, va_list ap) { - l2_ch_file_t *cfg; + l2_ch_fd_t *cfg; l2_param_t pa[1]; l2_result_t rv; /* parameter checks */ - if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + if ((cfg = (l2_ch_fd_t *)ctx->vp) == NULL) return L2_ERR_ARG; /* feed and call generic parameter parsing engine */ @@ -75,10 +75,10 @@ /* open channel */ static l2_result_t hook_open(l2_context_t *ctx, l2_channel_t *ch) { - l2_ch_file_t *cfg; + l2_ch_fd_t *cfg; /* parameter checks */ - if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + if ((cfg = (l2_ch_fd_t *)ctx->vp) == NULL) return L2_ERR_ARG; if ((cfg->fd == -1)) return L2_ERR_ARG; @@ -87,18 +87,18 @@ } /* 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_fd_t *cfg; /* parameter checks */ - if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + if ((cfg = (l2_ch_fd_t *)ctx->vp) == NULL) return L2_ERR_ARG; if (cfg->fd == -1) return L2_ERR_ARG; - /* write message to channel file */ + /* write message to channel fd */ if (write(cfg->fd, buf, buf_size) == -1) return L2_ERR_SYS; @@ -116,15 +116,15 @@ /* close channel */ static l2_result_t hook_close(l2_context_t *ctx, l2_channel_t *ch) { - l2_ch_file_t *cfg; + l2_ch_fd_t *cfg; /* parameter checks */ - if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL) + if ((cfg = (l2_ch_fd_t *)ctx->vp) == NULL) return L2_ERR_ARG; if (cfg->fd == -1) return L2_ERR_ARG; - /* close channel file */ + /* close channel fd */ /* nothing to close */ return L2_OK;