Rename ->{pre,post}_select methods to ->{pre,post}_monitor. The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
Consolidate receiver/filter/writer {pre,post}_select() docs. The documentation of these three ->pre_select() and ->post_select() methods overlapped quite a bit. Some comments stated general properties of the sched API which fit better in the documentation of sched.h, so move these bits there. Improve the text a bit while at it and avoid talking about select(2) and fd sets as these are implementation details. Instead, focus on the general concept of fd monitoring. Pure comment cleanups, no code changes.
Shorten copyright notice. The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
filter: Simplify FOR_EACH_FILTER(). Use the FILTER_CMD() macro rather than open-coding it.
filter: Handle bad filter numbers gracefully. This modifies filter_get() to return NULL if an invalid filter number is given, rather than aborting the process. This way applications can loop over all filters without having to include filter_cmd.lsg.h. filter_name(), which also receives a filter number, has no such sanity check and could possibly access uninitialized memory if an invalid argument was passed. This commit adds the check and makes the function return NULL in this case, just like filter_get(). Moreover, the function lacked documentation, so let's add it now.
Convert para_filter to lopsub. Changes the semantics in case --filter is not given. We used to print an error, but it makes more sense to show the list of supported filters in this case. If no filters are given, we now print the list of available filters. A new function in filter_common.c, print_filter_list(), is introduced for this purpose. The manual page of para_filter has been extended to include an overall description of the command. The only error code of filter.c, E_NO_FILTERS, becomes unused and is removed.
Convert filters to lopsub. This replaces the *_filter.m4 gengetopt files by the filter_cmd lopsub suite, where each filter is realized as a subcommand. Due to this change, para_filter needs to be linked with -llopsub. The filter structure is now stored in the user_data pointer provided by lopsub, allowing to get rid of the global filters[] array, the FILTER_ENUM macro and the corresponding enumeration constants. The removal of the ->goo_help member of struct filter makes this structure constant. Hence ->init() of struct filter can also go away. We still can tell whether a filter is supported by checking the user_data pointer: if it is NULL, the filter is unsupported. The new filter_supported() helper in filter_common.c is provided for convenience. Parsing of the filter command line options is now performed generically, and the ->parse_config() method is renamed to ->setup(), an optional function which is supposed to perform semantic checks and the one-time setup of the filter, if any. It is accompanied by ->teardown() which replaces ->free_config(). The conversion of the individual filters is easy since most filters have a simple syntax or take no arguments at all. The resample_filter, however, needs a different way to copy the wav parameters from the lopsub parse result to the wav parms structure. A suitable macro, LLS_COPY_WAV_PARMS is added to check_wav.h for this purpose. The old COPY_WAV_PARMS needs to stay until para_write, the only other user of the macro, has been converted as well. The section heading of the manual page has changed slightly, causing t0005 to fail. Hence this test needs a slight adjustment.
Fix signedness issues in format strings. Compiling with -Wformat-signedness (not enabled so far) causes many warnings because of format strings which specify an unsigned type but correspond to an argument of signed type, or vice versa. This commit fixes all these mismatches. For "%u", "%d", "%lu", "%ld" we let the format string match the type of the argument, but for "%x" we need to cast the argument to a suitable unsigned type. After this patch the tree compiles cleanly with -Wformat-signedness given. The warning will be enabled in a subsequent commit.
Constify argument of check_filter_arg(). The function does not modify the memory pointed to by "fa".
Fix documentation of check_filter_arg(). Filter name and filter options are separated by whitespace rather than a colon as stated in the documentation.
Add documentation of filter_get(). It's a public function that should be documented.
Constify struct filter access and introduce filter_get(). This modifies all users of the filter API to not access the filter array directly. Instead all callers now obtain a const pointer to the filter structure through the new filter_get() accessor function. However, the filter array can not be made constant yet because the ->init methods modify the filter structure. This requires some casts in filter_common.c unfortunately.
Make FOR_EACH_SUPPORTED_FILTER() local to filter_common.c. The macro is only used in this .c file, so it should not be public. This patch moves the macro from filter.h to filter_common.c.
Update year in copyright headers. Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
doc: Change email address to maan@tuebingen.mpg.de The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
sched: Directly pass context pointer to pre/post_select(). The patch is large, but it's fairly straight forward: Instead of a task pointer all ->pre_select() and ->post_select() methods now receive the context pointer that was passed to the scheduler when the task was registered. This allows to kill the public task_context(). Two pre_select/post_select functions are not directly called by the scheduler: session_post_select(), generic_recv_pre_select(). These are changed to receive a proper struct rather than a void pointer. Note that generic_filter_pre_select() is not changed in this manner because some filters do not provide a pre_select wrapper but set task->pre_select to generic_filter_pre_select().
task_register() conversion: filter tasks
Don't set t->error in ->pre_select(). ->pre_select() methods should never fail, and tasks should not set this variable at all. It is ignored anyway when set there.
Change copyright year to 2014. This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
Provide "purpose" texts. This text will be printed right after the program name in the --help output. For para_afh, the inline text becomes redundant, so this text is removed. Each executable gets a purpose text, and for receivers, filters, writers the purpose will be printed as part of the help output of para_audiod, para_filter. para_recv and para_write.