- PARA_ERROR_LOG("writer not found\n");
- return NULL;
-}
-
-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);
- wn->task.post_select = w->post_select;
- wn->task.pre_select = w->pre_select;
- register_task(&wn->task);
+ PARA_EMERG_LOG("invalid writer %s\n", wa);
+ exit(EXIT_FAILURE);
+check:
+ ret = create_shifted_argv(cmdline, " \t", &argv);
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s: %s\n", wa, para_strerror(-ret));
+ exit(EXIT_FAILURE);
+ }
+ argc = ret;
+ argv[0] = make_message("%s_write", writer_names[i]);
+ *writer_num = i;
+ conf = writers[i].parse_config_or_die(argc, argv);
+ free_argv(argv);
+ return conf;