X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=write_common.c;h=5bfba37d9197b7910046fa9efd6685167166164b;hb=d56a8447f418cf9046077e743772a416b6f7b826;hp=5352356b5835ea5e398392332447a7188fe50444;hpb=bb991c66000ea867d0fcbd692ffdc5473eb785fb;p=paraslash.git diff --git a/write_common.c b/write_common.c index 5352356b..5bfba37d 100644 --- a/write_common.c +++ b/write_common.c @@ -66,8 +66,6 @@ void *check_writer_arg(const char *wa, int *writer_num) c = wa[len]; if (c && c != ' ') continue; - if (c && !writers[i].parse_config_or_die) - return NULL; *writer_num = i; return writers[i].parse_config_or_die(c? wa + len + 1 : ""); } @@ -75,18 +73,26 @@ void *check_writer_arg(const char *wa, int *writer_num) return NULL; } +/** + * Open a writer node and register the corresponding task. + * + * \param wn The writer node to open. + * \param parent The parent btr node (the source for the writer node). + * + * The configuration of the writer node stored in \p wn->conf must be + * initialized before this function may be called. + */ void register_writer_node(struct writer_node *wn, struct btr_node *parent) { struct writer *w = writers + wn->writer_num; char *name = make_message("%s writer", writer_names[wn->writer_num]); - int ret; wn->btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = name, .parent = parent, .handler = w->execute, .context = wn)); strcpy(wn->task.status, name); free(name); - ret = w->open(wn); + w->open(wn); wn->task.post_select = w->post_select; wn->task.pre_select = w->pre_select; register_task(&wn->task);