projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
complete documentation of stdin.* and stdout.*
[paraslash.git]
/
filter.c
diff --git
a/filter.c
b/filter.c
index 79ae4dcbd22ef01e9ae44cdb90d02c9d6c5c570e..608bb8b3bf5eedd8c1bac69d6454f857cb6efaeb 100644
(file)
--- a/
filter.c
+++ b/
filter.c
@@
-30,8
+30,6
@@
INIT_FILTER_ERRLISTS;
INIT_FILTER_ERRLISTS;
-#define INBUF_SIZE 32 * 1024
-
static struct stdin_task stdin_task_struct;
static struct stdin_task *sit = &stdin_task_struct;
static struct filter_chain filter_chain_struct;
static struct stdin_task stdin_task_struct;
static struct stdin_task *sit = &stdin_task_struct;
static struct filter_chain filter_chain_struct;
@@
-55,7
+53,7
@@
__printf_2_3 void para_log(int ll, const char* fmt,...)
void filter_event_handler(struct task *t)
{
void filter_event_handler(struct task *t)
{
- PARA_
ERROR
_LOG("%s\n", PARA_STRERROR(-t->ret));
+ PARA_
NOTICE
_LOG("%s\n", PARA_STRERROR(-t->ret));
unregister_task(t);
}
unregister_task(t);
}
@@
-81,7
+79,13
@@
static int init_filter_chain(void)
fc->inbuf = sit->buf;
fc->in_loaded = &sit->loaded;
fc->inbuf = sit->buf;
fc->in_loaded = &sit->loaded;
- fc->reader_eof = &sit->eof;
+ fc->input_eof = &sit->eof;
+ fc->eof = 0;
+ fc->output_eof = &sot->eof;
+ fc->task.private_data = fc;
+ fc->task.pre_select = filter_pre_select;
+ fc->task.event_handler = filter_event_handler;
+ sprintf(fc->task.status, "filter chain");
for (i = 0; i < conf.filter_given; i++) {
char *fa = conf.filter_arg[i];
for (i = 0; i < conf.filter_given; i++) {
char *fa = conf.filter_arg[i];
@@
-99,10
+103,6
@@
static int init_filter_chain(void)
}
if (list_empty(&fc->filters))
return -E_NO_FILTERS;
}
if (list_empty(&fc->filters))
return -E_NO_FILTERS;
- fc->task.private_data = fc;
- fc->task.pre_select = filter_pre_select;
- fc->task.event_handler = filter_event_handler;
- sprintf(fc->task.status, "filter chain");
open_filters();
return 1;
}
open_filters();
return 1;
}
@@
-155,7
+155,7
@@
int main(int argc, char *argv[])
stdout_set_defaults(sot);
sot->buf = fc->outbuf;
sot->loaded = fc->out_loaded;
stdout_set_defaults(sot);
sot->buf = fc->outbuf;
sot->loaded = fc->out_loaded;
- sot->eof = &fc->eof;
+ sot->
input_
eof = &fc->eof;
register_task(&sot->task);
register_task(&fc->task);
register_task(&sot->task);
register_task(&fc->task);
@@
-165,8
+165,8
@@
int main(int argc, char *argv[])
ret = sched(&s);
out:
free(sit->buf);
ret = sched(&s);
out:
free(sit->buf);
+ close_filters(fc);
if (ret < 0)
PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
if (ret < 0)
PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
- close_filters(fc);
return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
}
return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
}