summaryrefslogtreecommitdiff
path: root/grab_client.h (follow)
Commit message (Collapse)AuthorAge
* Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | Generated with sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h followed by manually tweaking the result a bit. No license change intended.
* Remove support for audioc/audiod v1 protocol.Andre Noll2026-01-27
| | | | This breaks compatibility with v0.7, but also simplifies the code nicely.
* Employ sideband API for audioc-audiod connections.Andre Noll2026-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, para_audioc writes the data it received over the local socket from audiod to stdout. This include error messages, if any. Also, para_audioc does not know whether the subcommand passed to para_audiod was successful, and exits successfully even if the subcommand failed. Thanks to the sideband API, para_client is much smarter in this regard. This patch employs the existing API also for the connection between para_audioc and para_audiod. Besides comment updates and the new sideband_log() helper, no changes to the sideband API are necessary. The client code stays unmodified as well. The new helper has three callers, two in audioc.c and one in client_common.c. Remove a pointless NULL check and a debug log message from dispatch_sbb() of client_common.c while at it. The message was useful for testing but is no longer needed. The new code is backwards compatible, i.e., an old para_audioc can still communicate with a new para_audiod and vice versa. Thus, we have to maintain two "protocols" for the audioc-audiod communication, named v1 and v2 in the code and in what follows. For example, if audioc or audiod are unpatched (so that v1 is in use), then ./para_audioc aaa > /dev/null prints nothing because with v1 the error message goes to stdout, and the command exits successfully (exit code 0). If both sides support v2, the same command prints audiod: errctx: aaa audiod: invalid subcommand main: audiod dispatch error to stderr, then exits unsuccessfully (exit code 1). Only the server reply is sideband-encoded. The way how command line arguments are passed from audioc to audiod is also changed, though. Instead of terminating the arguments with newlines, a v2 audioc prepends an additional \0 byte to the argument list, and terminates each argument with \0 in the same way the --print0 directive of GNU find(1) does. An v1 audiod interprets the leading NUL as an empty command line and closes the connection without sending any data. This can never happen with a v2 audiod because that always sends an empty sideband package to indicate success/failure. So the v2 code of audioc.c retries with v1 in this case. Conversely, a v1 client never sends an empty string, so a leading \0 identifies a v2 client. Thus, the patched audiod only needs to check the first byte of the received buffer to select the right "protocol" version. The stat and grab subcommands need special treatment because these may stay active after the command handler returns. Thus, the command handler must not send an EXIT_SUCCESS sideband packet in this case. Moreover, the protocol version needs to be communicated with the status/grab client tasks. This is done by adding a flag to the existing flags bitmask of struct stat_client and struct grab_client. After v0.8.0 has been released, the compatibility code can be dropped.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | 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 }'
* Convert audiod commands to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The four command lists (server, afs, audiod, play) and all executables will be converted to the long option parser library (lopsub). This first patch converts the audiod commands (on, off, cycle...) and adds the necessary infrastructure to the build system. The option parser for para_audiod is still generated by gengetopt and will be converted in a subsequent patch. The build system is updated to include an autoconf test which checks for the lopsub library and the lopsubgen executable. If the check fails, it prints instructions on how to download the lopsub package. Moreover, a section on lopsub is added to the INSTALL file and the library is listed as a required tool in the manual. The options and help texts of all audiod commands are moved from audiod.cmd to the new file audiod_cmd.suite.m4. Until all command lists are converted, man_util.bash needs an ugly hack to deal with the two kinds of files. The help texts have been reworked slightly, but no syntactical changes were performed. However, one side effect of the change is that options to audiod commands now accept short and long options, and that short options may be combined in the usual way. The error subsystem of paraslash is extended to treat lopsub errors analogous to errors from the osl libary: we reserve a new bit for error codes returned from lopsub library functions and a lls() wrapper function that must be used for all lopsub functions which return a lopsub error code on failure. The E_INVALID_AUDIOD_CMD error code can be removed since invalid commands are now detected by the lopsub library, which returns its own error code in this case. As a result of the conversion, struct audiod_command can be removed. Command handlers now take a pointer to a lopsub parse result instead of the (argc, argv) pair. The patch also changes the completers for audiod commands in audioc.c. to use the information in the generated audioc_cmd.lsg.h header file instead of duplicating this information. With the patch applied, para_audiod and para_audioc need to be linked with -llopsub. We still need to include ggo.h from audiod_command.c until receivers, filters and writers have been converted as well.
* Update year in copyright headers.Andre Noll2015-01-12
| | | | | | | | | | | | | | | | 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.deAndre Noll2014-08-18
| | | | | | | | | | | | | | 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
* Change copyright year to 2014.Andre Noll2014-02-22
| | | | | | | | | 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
* Change copyright year to 2013.Andre Noll2013-03-25
| | | | Better late than never.
* Change year in copyright message to 2012.Andre Noll2012-01-07
|
* sched: Allow more than one running scheduler instance.Andre Noll2011-11-20
| | | | | | | | | | | | | | | | The interactive completion code must be able to run a second, independent scheduler instance for generating the possible completions. This is currently not possible because the pre_select and post_select list heads of the scheduler are defined globally in sched.c. This patch moves these list heads from sched.c to struct sched. This leaves only the global "now" variable in sched.c, but it is OK to update this from all scheduler instances, so it can stay. Moving the two list heads to struct sched requires that several public functions, among them register_task(), grow an additional parameter. The (mostly trivial) changes that update all callers to provide the new argument make the patch rather invasive, unfortunately.
* Replace 2010 in copyright message by 2011.Andre Noll2011-01-17
|
* Major grab_client cleanups.Andre Noll2010-01-10
| | | | | | | | - Move struct declarations from grab_client.h to grab_client.c. - Kill init_grabbing(). We can do this at compile time. - Rename some functions and improve documentation.
* Fix stream grabbing.Andre Noll2010-01-10
| | | | | | | | The new code uses a buffer tree node which is inserted into an existing buffer tree if possible, or put to the inactive list. The grab command now takes the name of an existing parent node. The new grab client node will be inserted as a child of this parent node.
* Rewrite grab-client code.Andre Noll2009-07-05
| | | | | This gets rid of the gengetopt grab client command line parser and all the special treatment it caused.
* filter: Switch from linked lists to arrays.Andre Noll2008-04-01
| | | | | The number of filters is known and never changes, so it's easier to use arrays.
* replace standard GPL header by a one-line pointer to COPYINGAndre Noll2007-06-28
|
* grab: use grab_client_cmdline_parser_string()Andre2006-05-16
| | | | No more need to use split_args().
* specify the three grab modes as values in grab_client.ggoAndre2006-03-27
| | | | | | | | | | | | That makes gengetopt check that the argument to the --mode option is one of sloppy, pedantic, or aggressive, so get rid of E_INVALID_GRAB_MODE, the gc_modes array and of the error check in grab_client.c. Another nice side-effect is that also "s", "p", "a" work as abreviations for the grab mode argument. Reformat grab_client.ggo as we are at it.
* initial git commitAndre2006-02-20
Let's try if this works out.