<feed xmlns='http://www.w3.org/2005/Atom'>
<title>paraslash/interactive.h, branch master</title>
<subtitle>paraslash - network audio streaming tools</subtitle>
<id>https://git.tue.mpg.de/cgit/paraslash/atom?h=master</id>
<link rel='self' href='https://git.tue.mpg.de/cgit/paraslash/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/'/>
<updated>2026-03-17T22:45:43Z</updated>
<entry>
<title>Switch to SPDX identifiers.</title>
<updated>2026-03-17T22:45:43Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2026-03-15T14:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=ea0cecf96e08c489fdcc94d046019f4ce46f58e2'/>
<id>urn:sha1:ea0cecf96e08c489fdcc94d046019f4ce46f58e2</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Improve i9e documentation.</title>
<updated>2025-10-08T18:58:23Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-06-16T18:04:13Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=cb4d6ef9151a6e1f1eacc183d64ec2783dff5a2a'/>
<id>urn:sha1:cb4d6ef9151a6e1f1eacc183d64ec2783dff5a2a</id>
<content type='text'>
The new file comment for interactive.h, a few reworded comments and a bit
of dedox for interactive.c.
</content>
</entry>
<entry>
<title>Merge topic branch t/completion into master</title>
<updated>2025-06-14T16:49:14Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-06-14T16:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=73659c617719bf40a6cc45faa649c1ebfcce908b'/>
<id>urn:sha1:73659c617719bf40a6cc45faa649c1ebfcce908b</id>
<content type='text'>
The completers for para_client and para_audioc handle some cases incorrectly
or not at all. This series improves on that.

* refs/heads/t/completion:
  Revamp bash_completion.
  bash completion: Fix help option parsing.
  audioc: Fix option completion of version and stat.
  i9e: Introduce i9e_get_nonopt_argnum().
  i9e: Introduce i9e_cword_is_option_arg().
  i9e: Constify i9e_complete_option().
</content>
</entry>
<entry>
<title>i9e: Constify completer arrays.</title>
<updated>2025-06-10T13:25:48Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-06-02T21:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=231c2dda1c9f13df1d956dd2790992689b3f4838'/>
<id>urn:sha1:231c2dda1c9f13df1d956dd2790992689b3f4838</id>
<content type='text'>
This way the array of completers goes into the rodata section.
</content>
</entry>
<entry>
<title>i9e: Introduce i9e_get_nonopt_argnum().</title>
<updated>2025-05-18T17:19:02Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-04-28T14:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=9f4e112de873bca8f947e7e80ef5048172515f1b'/>
<id>urn:sha1:9f4e112de873bca8f947e7e80ef5048172515f1b</id>
<content type='text'>
Call the new function from various subcommand completers to attempt completion
only on the first or the first two non-option arguments.
</content>
</entry>
<entry>
<title>i9e: Introduce i9e_cword_is_option_arg().</title>
<updated>2025-05-18T17:19:02Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-04-06T20:14:43Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=65c4d2835975203a45fadde20bae7a4f1b8dbd85'/>
<id>urn:sha1:65c4d2835975203a45fadde20bae7a4f1b8dbd85</id>
<content type='text'>
Call the new function to complete --admissible, --sort and --listing-mode of
the ls subcommand and teach the touch completer to prevent filename completion
if a numerical argument is expected. The grab subcommand of para_audiod
also benefits from the new helper: para_audioc learned to complete the three
different grab modes.

Since --admissible expects a mood or playlist argument, factor out the code
from the select completer which returns the list of all moods and playlists
so that it can be called by the ls completer as well.
</content>
</entry>
<entry>
<title>i9e: Constify i9e_complete_option().</title>
<updated>2025-05-18T17:19:02Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-04-06T17:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=351d7cdd95425ca23f1592e82701159a27720330'/>
<id>urn:sha1:351d7cdd95425ca23f1592e82701159a27720330</id>
<content type='text'>
i9e_extract_completions() and i9e_complete_option() both take a char **
argument for the option/string list although they do not modify the pointers
of the list. This commit marks these pointer variables constant.
</content>
</entry>
<entry>
<title>i9e: Improve documentation of i9e_completion_info().</title>
<updated>2025-04-23T19:41:14Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2025-04-19T08:58:27Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=d824ae0b1132cf95389ab1fd9194995e34eaea11'/>
<id>urn:sha1:d824ae0b1132cf95389ab1fd9194995e34eaea11</id>
<content type='text'>
Emphasize that -&gt;word is *not* the same as -&gt;argv[i], where i is the index of
the current word.
</content>
</entry>
<entry>
<title>Merge branch 'refs/heads/t/ll'</title>
<updated>2022-09-18T14:35:09Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2022-09-18T14:28:33Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=5967ac5353739c3ff571dd12d4c6814fa8493ad8'/>
<id>urn:sha1:5967ac5353739c3ff571dd12d4c6814fa8493ad8</id>
<content type='text'>
Two little cleanups related to the logging facility and two commits
which add the ll command to para_server and para_audiod.

The merge resulted in a conflict in afs.c due to the earlier merge of
the poll topic branch which replaced all calls to select() by calls
to poll(). The implementation of the ll server command introduced a
new caller of select(), afs_select(), which needs to be replaced by
afs_poll() to resolve the conflict.

* refs/heads/t/ll:
  New server command: ll to change the log level at runtime.
  New audiod command: ll to change the log level at runtime.
  daemon: Kill get_loglevel_by_name().
  server/audiod: Don't parse loglevel argument unnecessarily.
</content>
</entry>
<entry>
<title>Switch from select(2) to poll(2).</title>
<updated>2022-08-28T15:36:05Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@tuebingen.mpg.de</email>
</author>
<published>2021-10-10T20:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.tue.mpg.de/cgit/paraslash/commit/?id=cdbc8067a2e27ee7f9e0d8ff11cf415603fc0558'/>
<id>urn:sha1:cdbc8067a2e27ee7f9e0d8ff11cf415603fc0558</id>
<content type='text'>
The select(2) API is kind of obsolete because it does not work for
file descriptors greater or equal than 1024, The general advice is
to switch to poll(2), which offers equivalent functionality and does
not suffer from this restriction. This patch implements this switch.

The fd sets of select(2) have one nice feature: One can determine in
O(1) time whether the bit for a given fd is turned on in an fd set.

For poll(2), the monitored file descriptors are organized in an array
of struct pollfd. Without information about the given fd's index in the
pollfd array, one can only perform a linear search which requires O(n)
time, with n being the number of fds being watched. Since this would
have to be done for each fd, the running time becomes quadratic in
the number of monitored fds, which is bad. Keeping the pollfd array
sorted would reduce that to n * log(n) at the cost of additional work
at insert time.

This patch implements a different approach. The scheduler now maintains
an additional array of unsigned integers which map fds to indices
into the pollfd array. This new index array is transparent to the
individual tasks, which still simply pass one or more fds from their
-&gt;pre_monitor() method to the scheduler. The length of the index array
equals the highest fd given. This might become prohibitive in theory,
but should not be an issue for the time being.

Care needs to be taken in order to deal with callers which ask for
the readiness of an fd without having called sched_monitor_readfd() or
sched_monitor_writefd() in the -&gt;pre_monitor() step. Before the patch,
thanks to the FD_ZERO() call at the beginning of each iteration of
the scheduler's main loop, both sched_read_ok() and sched_write_ok()
returned false for fds which were not asked to be watched. We need
to keep it this way for a seamless transition.

We achieve this by replacing the FD_ZERO() call by a memset(3) call
which fills the index array with 0xff bytes. Both sched_read_ok() and
sched_write_ok() call the new get_revents() helper, where we check the
fd argument against the allocation sizes of the two arrays. If either
function is called with an fd that was not asked to be monitored in
the -&gt;pre_monitor() step, the checks notice that the index of this
fd, 0xffffffff, is larger than the highest open fd and we return
"not ready for I/O".

Another issue is the case where the same file descriptor is submitted
twice in -&gt;pre_monitor() to check for readiness with respect to both
reading and writing. The code in client_comon.c currently does that.
To keep it working, the scheduler needs to detect this case and re-use
the existing slot in both arrays.
</content>
</entry>
</feed>
