+ printf("\n");
+ exit(EXIT_FAILURE);
+}
+
+static void handle_help_flags(void)
+{
+ char *help;
+
+ if (OPT_GIVEN(DETAILED_HELP))
+ help = lls_long_help(CMD_PTR);
+ else if (OPT_GIVEN(HELP))
+ help = lls_short_help(CMD_PTR);
+ else
+ return;
+ printf("%s\n", help);
+ free(help);
+ exit(EXIT_SUCCESS);
+}
+
+/**
+ * The main function of para_fade.
+ *
+ * The executable is linked with the alsa or the oss mixer API, or both. It has
+ * a custom log function which prefixes log messages with the current date.
+ *
+ * \param argc Argument counter.
+ * \param argv Argument vector.
+ *
+ * \return EXIT_SUCCESS or EXIT_FAILURE.
+ */
+int main(int argc, char *argv[])
+{
+ const struct lls_command *cmd = CMD_PTR;
+ int ret;
+ char *cf, *errctx;
+ struct mixer *m;
+ struct mixer_handle *h;
+ void *map;
+ size_t sz;
+
+ ret = lls(lls_parse(argc, argv, cmd, &lpr, &errctx));
+ if (ret < 0)
+ goto fail;
+ loglevel = OPT_UINT32_VAL(LOGLEVEL);
+ version_handle_flag("fade", OPT_GIVEN(VERSION));
+ handle_help_flags();
+
+ if (OPT_GIVEN(CONFIG_FILE))
+ cf = para_strdup(OPT_STRING_VAL(CONFIG_FILE));
+ else {
+ char *home = para_homedir();
+ cf = make_message("%s/.paraslash/fade.conf", home);
+ free(home);