From 8eb5a15bfcc068e8d2504bb84b14455e9fc7c3ba Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 12 Jan 2009 00:43:21 +0100 Subject: [PATCH] Various small cleanups and documentation improvements. --- NEWS | 1 + afs.h | 1 - attribute.c | 6 +++++- ggo.c | 13 ++++++++++++- ggo.h | 15 ++++++++++++++- mp3_afh.c | 2 +- vss.c | 10 ++++++++++ 7 files changed, 43 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 1b0de7b9..44dfbf62 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ The new udp sender and several small improvements. - Improved help/man pages: The documentation of para_audiod, para_recv, para_filter and para_write now also contains all options of the available receivers/filters/writers. + - vss timing fixes. -------------------------------------------- 0.3.3 (2008-12-01) "axiomatic perspectivity" diff --git a/afs.h b/afs.h index 4be5aaa9..ecec685c 100644 --- a/afs.h +++ b/afs.h @@ -87,7 +87,6 @@ struct afs_table { /** Handles afs events. */ int (*event_handler)(enum afs_events event, struct para_buffer *pb, void *data); - /* int *(check)() */ }; enum play_mode {PLAY_MODE_MOOD, PLAY_MODE_PLAYLIST}; diff --git a/attribute.c b/attribute.c index 569c8922..d22511de 100644 --- a/attribute.c +++ b/attribute.c @@ -598,7 +598,11 @@ static int attribute_create(const char *dir) return osl_create_table(&attribute_table_desc); } - +/** + * Initialize the attribute table structure. + * + * \param t The table structure to initialize. + */ void attribute_init(struct afs_table *t) { t->name = attribute_table_desc.name; diff --git a/ggo.c b/ggo.c index 86642eb5..b9852b99 100644 --- a/ggo.c +++ b/ggo.c @@ -10,6 +10,11 @@ #include "para.h" #include "ggo.h" +/** + * Wrapper for printf() that exits on errors. + * + * \param fmt Usual format string. + */ __printf_1_2 void printf_or_die(const char *fmt, ...) { va_list argp; @@ -20,9 +25,15 @@ __printf_1_2 void printf_or_die(const char *fmt, ...) va_end(argp); if (ret >= 0) return; - fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(errno)); + exit(EXIT_FAILURE); } +/** + * Print one of the two given help texts. + * + * \param help contains the help texts. + * \param detailed_help Whether to print the detailed help text. + */ void ggo_print_help(struct ggo_help *help, int detailed_help) { const char **p; diff --git a/ggo.h b/ggo.h index c9111b16..4d452b1d 100644 --- a/ggo.h +++ b/ggo.h @@ -1,7 +1,20 @@ +/* + * Copyright (C) 2008-2009 Andre Noll + * + * Licensed under the GPL v2. For licencing details see COPYING. + */ + +/** \file ggo.h Functions and structures for help text handling. */ + +/** + * Used by exexutables that can not use gengetopt's generated help function. + */ struct ggo_help { + /** The lines of the short help text. */ const char **short_help; + /** The lines of the detailed help text. */ const char **detailed_help; }; void ggo_print_help(struct ggo_help *help, int detailed_help); -void printf_or_die(const char *fmt, ...); +__printf_1_2 void printf_or_die(const char *fmt, ...); diff --git a/mp3_afh.c b/mp3_afh.c index f7334488..41874b86 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -82,7 +82,7 @@ static char *get_latin1(id3_ucs4_t const *string) return (char *)id3_ucs4_latin1duplicate(string); } -char *get_stringlist(union id3_field *field) +static char *get_stringlist(union id3_field *field) { unsigned int k, nstrings = id3_field_getnstrings(field); char *result = NULL; diff --git a/vss.c b/vss.c index 1bd74de6..c1189702 100644 --- a/vss.c +++ b/vss.c @@ -65,15 +65,25 @@ enum afs_socket_status { /** The task structure for the virtual streaming system. */ struct vss_task { + /** Copied from the -announce_time command line option. */ struct timeval announce_tv; + /** End of the announcing interval. */ struct timeval data_send_barrier; + /** End of the EOF interval. */ struct timeval eof_barrier; + /** Only used if --autoplay_delay was given. */ struct timeval autoplay_barrier; + /** Used for afs-server communication. */ int afs_socket; + /** The current state of \a afs_socket. */ enum afs_socket_status afsss; + /** The memory mapped audio file. */ char *map; + /** Used by the scheduler. */ struct task task; + /** Pointer to the header of the mapped audio file. */ const char *header_buf; + /** Length of the audio file header. */ size_t header_len; }; -- 2.39.5