]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - osx_write.c
Simplify ggo makefile.
[paraslash.git] / osx_write.c
index 429c713945dc799011efeaeb68a9670408067430..8dcfb4cd1fcc32082abeae34bdff3a23214a2f20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2012 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -13,7 +13,6 @@
 
 #include <regex.h>
 #include <sys/types.h>
-#include <stdbool.h>
 
 #include "para.h"
 #include "fd.h"
@@ -218,18 +217,18 @@ e0:
        return ret;
 }
 
-__malloc static void *osx_write_parse_config_or_die(const char *options)
+__malloc static void *osx_write_parse_config_or_die(int argc, char **argv)
 {
        struct osx_write_args_info *conf = para_calloc(sizeof(*conf));
 
        /* exits on errors */
-       osx_cmdline_parser_string(options, conf, "osx_write");
+       osx_write_cmdline_parser(argc, argv, conf);
        return conf;
 }
 
 static void osx_free_config(void *conf)
 {
-       osx_cmdline_parser_free(conf);
+       osx_write_cmdline_parser_free(conf);
 }
 
 static void osx_write_close(struct writer_node *wn)
@@ -310,10 +309,9 @@ static void osx_write_post_select(__a_unused struct sched *s, struct task *t)
        AudioOutputUnitStop(powd->audio_unit);
        AudioUnitUninitialize(powd->audio_unit);
        CloseComponent(powd->audio_unit);
-       btr_remove_node(powd->callback_btrn);
-       btr_free_node(powd->callback_btrn);
+       btr_remove_node(&powd->callback_btrn);
 remove_btrn:
-       btr_remove_node(btrn);
+       btr_remove_node(&wn->btrn);
        PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
 out:
        t->error = ret;
@@ -328,16 +326,15 @@ void osx_write_init(struct writer *w)
 {
        struct osx_write_args_info dummy;
 
-       osx_cmdline_parser_init(&dummy);
+       osx_write_cmdline_parser_init(&dummy);
        w->close = osx_write_close;
        w->pre_select = osx_write_pre_select;
        w->post_select = osx_write_post_select;
        w->parse_config_or_die = osx_write_parse_config_or_die;
        w->free_config = osx_free_config;
-       w->shutdown = NULL; /* nothing to do */
        w->help = (struct ggo_help) {
                .short_help = osx_write_args_info_help,
                .detailed_help = osx_write_args_info_detailed_help
        };
-       osx_cmdline_parser_free(&dummy);
+       osx_write_cmdline_parser_free(&dummy);
 }