paraslash.git
7 weeks agoMerge topic branch t/doxygen into pu
Andre Noll [Thu, 12 Jun 2025 23:16:38 +0000 (01:16 +0200)]
Merge topic branch t/doxygen into pu

This revamps the doxygen part of the documentation web page, adding a couple
of entry points for users to get started with the code base. We provide links
to header files which descripe the API of central subsystems and links to
the main file of each paraslash executable.

The \file comment of the source files reachable through these links have been
extended to contain a detailed description of the API or executable. Unlike
the introductory text of the manual pages, these comments focus on the code,
particularly the interaction between the various subsystems.

This also reactivates the source browser, since it is actually quite useful
to quickly check for some detail.

<!--

- Major revamp of the source code documention and the documentation web page.

-->

* refs/heads/t/doxygen: (38 commits)
  crypt
  gui
  doc-page
  f
  filter api
  recv
  afs
  afs
  afs
  fec
  doc-site
  send.h
  senders
  send/source-browser
  write
  afh
  afh.h
  f
  afh
  Move detailed desc to top
  ...

# Conflicts:
# crypt.h

7 weeks agocrypt
Andre Noll [Thu, 12 Jun 2025 23:03:26 +0000 (01:03 +0200)]
crypt

7 weeks agogui
Andre Noll [Thu, 12 Jun 2025 21:41:19 +0000 (23:41 +0200)]
gui

7 weeks agodoc-page
Andre Noll [Thu, 12 Jun 2025 20:47:50 +0000 (22:47 +0200)]
doc-page

7 weeks agof
Andre Noll [Thu, 12 Jun 2025 19:24:36 +0000 (21:24 +0200)]
f

7 weeks agofilter api
Andre Noll [Thu, 12 Jun 2025 19:18:46 +0000 (21:18 +0200)]
filter api

8 weeks agorecv
Andre Noll [Wed, 11 Jun 2025 19:03:27 +0000 (21:03 +0200)]
recv

8 weeks agoafs
Andre Noll [Wed, 11 Jun 2025 17:54:18 +0000 (19:54 +0200)]
afs

8 weeks agoafs
Andre Noll [Wed, 11 Jun 2025 17:22:34 +0000 (19:22 +0200)]
afs

8 weeks agoafs
Andre Noll [Wed, 11 Jun 2025 17:11:52 +0000 (19:11 +0200)]
afs

8 weeks agofec
Andre Noll [Wed, 11 Jun 2025 14:02:25 +0000 (16:02 +0200)]
fec

8 weeks agodoc-site
Andre Noll [Wed, 11 Jun 2025 13:04:34 +0000 (15:04 +0200)]
doc-site

8 weeks agoMerge branch 'master' into next
Andre Noll [Tue, 10 Jun 2025 14:09:17 +0000 (16:09 +0200)]
Merge branch 'master' into next

* master:
  i9e: Constify completer arrays.
  Prefer __func__ to __FUNCTION__.
  imdct: Kill fftsample_t typedef.
  Doxgen: Do not omit brief descriptions.
  fd: Modify xwrite() and write_all() to take void * buffer argument.

# Conflicts:
# interactive.h

8 weeks agosend.h
Andre Noll [Mon, 9 Jun 2025 21:38:50 +0000 (23:38 +0200)]
send.h

8 weeks agosenders
Andre Noll [Mon, 9 Jun 2025 18:59:03 +0000 (20:59 +0200)]
senders

8 weeks agosend/source-browser
Andre Noll [Mon, 9 Jun 2025 18:48:39 +0000 (20:48 +0200)]
send/source-browser

8 weeks agowrite
Andre Noll [Mon, 9 Jun 2025 15:39:01 +0000 (17:39 +0200)]
write

8 weeks agoafh
Andre Noll [Sun, 8 Jun 2025 21:09:46 +0000 (23:09 +0200)]
afh

8 weeks agoafh.h
Andre Noll [Sun, 8 Jun 2025 19:54:40 +0000 (21:54 +0200)]
afh.h

8 weeks agof
Andre Noll [Sun, 8 Jun 2025 18:05:21 +0000 (20:05 +0200)]
f

8 weeks agoafh
Andre Noll [Sun, 8 Jun 2025 17:59:08 +0000 (19:59 +0200)]
afh

8 weeks agoMove detailed desc to top
Andre Noll [Wed, 4 Jun 2025 19:59:18 +0000 (21:59 +0200)]
Move detailed desc to top

8 weeks agolayout
Andre Noll [Wed, 4 Jun 2025 19:56:59 +0000 (21:56 +0200)]
layout

8 weeks ago.
Andre Noll [Wed, 4 Jun 2025 19:54:29 +0000 (21:54 +0200)]
.

8 weeks ago.
Andre Noll [Wed, 4 Jun 2025 17:57:16 +0000 (19:57 +0200)]
.

8 weeks ago.
Andre Noll [Mon, 2 Jun 2025 22:57:25 +0000 (00:57 +0200)]
.

8 weeks ago.
Andre Noll [Mon, 2 Jun 2025 22:35:37 +0000 (00:35 +0200)]
.

8 weeks ago.
Andre Noll [Sun, 1 Jun 2025 15:26:41 +0000 (17:26 +0200)]
.

8 weeks ago.
Andre Noll [Sun, 1 Jun 2025 01:36:59 +0000 (03:36 +0200)]
.

8 weeks ago.
Andre Noll [Sat, 31 May 2025 22:19:15 +0000 (00:19 +0200)]
.

8 weeks agodox
Andre Noll [Sat, 31 May 2025 19:02:19 +0000 (21:02 +0200)]
dox

8 weeks agodox
Andre Noll [Wed, 28 May 2025 17:55:46 +0000 (19:55 +0200)]
dox

8 weeks agorecv.c: Do not include fd.h
Andre Noll [Wed, 28 May 2025 17:36:08 +0000 (19:36 +0200)]
recv.c: Do not include fd.h

8 weeks agodoxygen
Andre Noll [Wed, 28 May 2025 00:24:09 +0000 (02:24 +0200)]
doxygen

8 weeks agodox
Andre Noll [Tue, 27 May 2025 23:09:28 +0000 (01:09 +0200)]
dox

8 weeks agodoxygen
Andre Noll [Tue, 27 May 2025 22:06:58 +0000 (00:06 +0200)]
doxygen

8 weeks agoRevamp documentation of filter.c
Andre Noll [Tue, 27 May 2025 20:16:04 +0000 (22:16 +0200)]
Revamp documentation of filter.c

8 weeks agodoxygen: Hide undocumented members.
Andre Noll [Mon, 26 May 2025 21:11:14 +0000 (23:11 +0200)]
doxygen: Hide undocumented members.

8 weeks agocss: Remove a lot of unused cruft.
Andre Noll [Mon, 26 May 2025 13:55:44 +0000 (15:55 +0200)]
css: Remove a lot of unused cruft.

None of these are actually used in the pages generated by doxyen-1.8.

8 weeks agodoxygen: Use a more sane default output directory.
Andre Noll [Mon, 26 May 2025 20:45:21 +0000 (22:45 +0200)]
doxygen: Use a more sane default output directory.

Put the pages below build/ so that make distclean removes them.

8 weeks agoi9e: Constify completer arrays.
Andre Noll [Mon, 2 Jun 2025 21:25:47 +0000 (23:25 +0200)]
i9e: Constify completer arrays.

This way the array of completers goes into the rodata section.

8 weeks agoPrefer __func__ to __FUNCTION__.
Andre Noll [Mon, 2 Jun 2025 20:48:41 +0000 (22:48 +0200)]
Prefer __func__ to __FUNCTION__.

The former is part of the C99 standard, while the latter is only provided
for backward compatibility. This change also silences many gcc warnings when
compiling with -Wpendantic (disabled in the default build).

8 weeks agoimdct: Kill fftsample_t typedef.
Andre Noll [Mon, 2 Jun 2025 19:45:34 +0000 (21:45 +0200)]
imdct: Kill fftsample_t typedef.

There is no advantage in not using plain float here.

8 weeks agoDoxgen: Do not omit brief descriptions.
Andre Noll [Mon, 2 Jun 2025 22:36:31 +0000 (00:36 +0200)]
Doxgen: Do not omit brief descriptions.

Commit 3107d2411a7a was a bit overzealous because with BRIEF_MEMBER_DESC
and REPEAT_BRIEF both set to NO the short text does not even make it into
the detailed description. This was unintended, so partially revert this change.

Fixes: 3107d2411a7a8f4085d0db65851483f2cb3c4f6e
2 months agofd: Modify xwrite() and write_all() to take void * buffer argument.
Andre Noll [Mon, 2 Jun 2025 21:34:21 +0000 (23:34 +0200)]
fd: Modify xwrite() and write_all() to take void * buffer argument.

That's what the underlying call to writev(2) expects.

2 months agoMerge branch 'master' into next
Andre Noll [Mon, 2 Jun 2025 19:44:05 +0000 (21:44 +0200)]
Merge branch 'master' into next

* master:
  net.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.

2 months agoMerge topic branch t/wmadec into master
Andre Noll [Mon, 2 Jun 2025 19:42:21 +0000 (21:42 +0200)]
Merge topic branch t/wmadec into master

A few patches which remove unused code from the wma decoder and audio
format handler. Notably, noise coding was removed completely since
it was only used for unusual bit rates. Most likely, it never worked
in the first place.

* refs/heads/t/wmadec:
  wmadec: Fix typo in comment.
  wmadec: Remove a stale comment in wma_init().
  wmadec: Kill pointless start/end computations.
  wmadec: Remove noise coding.
  wmadec: Simplify wma_init().
  wmadec: Remove fft().

2 months agonet.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.
Andre Noll [Sat, 31 May 2025 17:30:31 +0000 (19:30 +0200)]
net.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.

It's not a macro, after all. Remove the superfluous braces and fix
a whitespace issue while at it.

2 months agoMerge branch 'master' into next
Andre Noll [Fri, 30 May 2025 11:24:40 +0000 (13:24 +0200)]
Merge branch 'master' into next

* master:
  Shrink struct rmatt_event_data.
  filter.c: Constify dummy variable.
  filter.c: Remove unused status_item_list[].
  audiod.c: Make slots[] static.
  server.c: Remove unused server_get_tasks().

2 months agoShrink struct rmatt_event_data.
Andre Noll [Mon, 26 May 2025 18:38:37 +0000 (20:38 +0200)]
Shrink struct rmatt_event_data.

The aft event handler needs to know the bit number of the attribute which is
being removed in order to clear the bit in the afs info structure of each row
of the audio file table. The handler does not need to know the attribute's
name, though, and remove_attribute() already prints it, so remove this field
from the event data structure.

2 months agofilter.c: Constify dummy variable.
Andre Noll [Tue, 27 May 2025 19:19:30 +0000 (21:19 +0200)]
filter.c: Constify dummy variable.

It needs to be non-static, but it may be const because the amp filter
only reads the values of this array.

2 months agofilter.c: Remove unused status_item_list[].
Andre Noll [Tue, 27 May 2025 19:15:51 +0000 (21:15 +0200)]
filter.c: Remove unused status_item_list[].

para_filter does not need this at all, and never has, afaict.

2 months agoaudiod.c: Make slots[] static.
Andre Noll [Tue, 27 May 2025 23:28:02 +0000 (01:28 +0200)]
audiod.c: Make slots[] static.

It's only used in audiod.c.

2 months agoserver.c: Remove unused server_get_tasks().
Andre Noll [Tue, 27 May 2025 21:51:40 +0000 (23:51 +0200)]
server.c: Remove unused server_get_tasks().

The last caller was removed when the tasks server subcommand was disabled
eight years ago.

Fixes: bb91597b9ecf650a63a40753f7f7c771576d252e
2 months agoMerge branch 'master' into next
Andre Noll [Mon, 26 May 2025 16:02:20 +0000 (18:02 +0200)]
Merge branch 'master' into next

* master:
  css: Remove memItem tweaks.
  css: Fix a typo in comment.
  fec.c: Remove an unused #include.
  Move public key to web/.
  INSTALL: Remove installation instructions of lopsub.
  http sender: Kill pointless macro.

2 months agoMerge topic branch t/select- into master
Andre Noll [Mon, 26 May 2025 16:00:34 +0000 (18:00 +0200)]
Merge topic branch t/select- into master

A single patch which implements the new "select -" feature to switch
back to the previous mood or playlist.

* refs/heads/t/select-:
  com_select(): Support '-' to reactivate the previous mood/playlist.

2 months agocss: Remove memItem tweaks.
Andre Noll [Sun, 25 May 2025 20:35:27 +0000 (22:35 +0200)]
css: Remove memItem tweaks.

The pages look better without this since the tables no longer contain
horizontal lines above all entities.

2 months agocss: Fix a typo in comment.
Andre Noll [Sun, 25 May 2025 17:56:47 +0000 (19:56 +0200)]
css: Fix a typo in comment.

2 months agofec.c: Remove an unused #include.
Andre Noll [Sun, 25 May 2025 17:45:58 +0000 (19:45 +0200)]
fec.c: Remove an unused #include.

The fec code does not need the helpers from portable_io.h.

2 months agoMove public key to web/.
Andre Noll [Sun, 25 May 2025 17:33:36 +0000 (19:33 +0200)]
Move public key to web/.

It's only needed for the web pages, so it should not be contained in the
top-level directory.

2 months agoINSTALL: Remove installation instructions of lopsub.
Andre Noll [Sun, 25 May 2025 17:29:57 +0000 (19:29 +0200)]
INSTALL: Remove installation instructions of lopsub.

These days, people should just install the Debian package. If lopsub is not
installed, the configure script prints detailed instructions about how to
obtain lopsub with and without apt.

2 months agohttp sender: Kill pointless macro.
Andre Noll [Sun, 25 May 2025 17:18:42 +0000 (19:18 +0200)]
http sender: Kill pointless macro.

The code is shorter and easier to read without the macro.

2 months agoMerge branch 'master' into next
Andre Noll [Sun, 25 May 2025 17:11:17 +0000 (19:11 +0200)]
Merge branch 'master' into next

* master:
  Introduce VSS_NEW_AUDIO_FILE to fix playlist updates.

2 months agoIntroduce VSS_NEW_AUDIO_FILE to fix playlist updates.
Andre Noll [Wed, 19 Mar 2025 21:05:16 +0000 (22:05 +0100)]
Introduce VSS_NEW_AUDIO_FILE to fix playlist updates.

The playlist event handler handles afsi change events by moving the affected
entry to the end of the playlist. This is the right thing to do if the
event was triggered by virtual streaming system streaming a new file. It is
incorrect, however, if the event was triggered by a subcommand such as touch.

This commit introduces the new afs event type VSS_NEW_AUDIO_FILE to distinguish
between the two different use cases. The audio file table event handler
ignores the VSS_NEW_AUDIO_FILE event while the playlist event handler ignores
the AFSI_CHANGE event. The moods event handler treats both events equally,

Get rid of a pointless static one-liner function in playlist.c while at it.

2 months agoMerge topic branch t/wmadec into next
Andre Noll [Sat, 24 May 2025 17:41:41 +0000 (19:41 +0200)]
Merge topic branch t/wmadec into next

Started on 2025-01-22

A few patches which remove unused code from the wma decoder and audio
format handler. Notably, noise coding was removed completely since
it was only used for unusual bit rates. Most likely, it never worked
in the first place.

* refs/heads/t/wmadec:
  wmadec: Fix typo in comment.
  wmadec: Remove a stale comment in wma_init().
  wmadec: Kill pointless start/end computations.

2 months agoMerge topic branch t/deprecate_setatt into next
Andre Noll [Sat, 24 May 2025 17:41:33 +0000 (19:41 +0200)]
Merge topic branch t/deprecate_setatt into next

A single patch which deprecates the setatt server subcommand. This subcommand
fails, for example, if the name of an audio file happens to end in '+'
or '-'. The replacement for setatt are the two new options to the touch
subcommand to set or unset attributes.

* refs/heads/t/deprecate_setatt:
  server: Deprecate setatt in favor of touch.

2 months agoMerge branch 'master' into next
Andre Noll [Sat, 24 May 2025 17:41:30 +0000 (19:41 +0200)]
Merge branch 'master' into next

* master:
  aft: Pass correct afsi argument to AFSI_CHANGE event handlers.

2 months agoMerge topic branch t/rm_sha1 into next
Andre Noll [Thu, 22 May 2025 17:13:09 +0000 (19:13 +0200)]
Merge topic branch t/rm_sha1 into next

The series first drops the para_upgrade_db executable because it is no longer
needed. This removes the penultimate user of the sha1 infrastructure. The
remaining user is the handshake between para_client and para_server.

Since paraslash-0.7.0, client and server employ sha256 by default, but fall
back to sha1 in order to stay compatible to old 0.6.x versions. This series
instructs server and client to always employ sha256 as the hash algorithm,
breaking compatibility with 0.6.x clients. As a result, the sha1 hash algorithm
is no longer used anywhere, so the corresponding infrastructure is no longer
needed. This gets rid of a fair amount of code.

<!--

- The para_upgrade_db executable to convert old paraslash databases has
been removed. paraslash-0.7.0 was released more than three years ago, so
everybody should have upgraded by now.

- Authentication now rejects the weak sha1 hash algorithm, breaking
compatibility with 0.6.x versions. Older 0.7.x clients are still compatible
to current server versions and current clients can still talk to servers
running older 0.7.x versions.

-->

* refs/heads/t/rm_sha1:
  Rename hash2 -> hash.
  Remove sha1.
  Remove para_upgrade_db.
  aft: Compare the full hash, not just the first 20 bytes.

2 months agoRename hash2 -> hash.
Andre Noll [Sun, 18 May 2025 18:31:33 +0000 (20:31 +0200)]
Rename hash2 -> hash.

Now that sha1 is no longer supported, the hash2 naming has become meaningless.
Rename it back to "hash".

2 months agoRemove sha1.
Andre Noll [Sun, 18 May 2025 18:17:12 +0000 (20:17 +0200)]
Remove sha1.

Server and client prefer sha256 in the authentication protocol since
paraslash-0.7.0, while 0.6.x clients and servers only know about sha1. This
patch drops the compatibility code which enabled old clients to connect to
new servers and vice versa.

Now the client code no longer checks whether the sha256 feature is supported,
but requests and uses the feature unconditionally. The server still announces
the sha256 feature and accepts the corresponding feature request, but uses
sha256 unconditionally.

With this approach older 0.7.x clients are still compatible to current
server versions and current clients can still talk to servers running older
0.7.x versions.

2 months agoMerge branch 'master' into next
Andre Noll [Thu, 22 May 2025 16:47:09 +0000 (18:47 +0200)]
Merge branch 'master' into next

* master:
  Improve documentation of set_max_chunk_size().
  Warn about old (0.5.x or earlier) on-disk afhi.
  doxyen: Completely suppress brief descriptions.
  buffer_tree: Assert that we don't pass NULL to memcpy().
  mp.c: Remove a dead store.
  mood.c: Remove a dead store and fix the documentation of mood_load().
  flac_afh: Check for possible integer overflows.
  gcc-compat.h: Drop inline #define.

2 months agoRemove para_upgrade_db.
Andre Noll [Mon, 19 May 2025 20:01:36 +0000 (22:01 +0200)]
Remove para_upgrade_db.

It is no longer needed since everybody should have upgraded by now, and it
blocks the road towards the removal of sha1.

2 months agoaft: Compare the full hash, not just the first 20 bytes.
Andre Noll [Sun, 18 May 2025 18:12:24 +0000 (20:12 +0200)]
aft: Compare the full hash, not just the first 20 bytes.

In 0.7.0 the hash algorithm for the hash column of the audio file table
changed from the 20 byte sha1 to the 32 byte sha256. However, the audio file
selector kept calling hash_compare() as the comparator, which looks only at
the first 20 bytes of the buffers passed.

This omission is clearly a bug, but given that we still accept old clients
which only know about sha1, it's benign because the truncated sha256 should
not be worse than sha1. Fix the bug anyway.

Fixes: 126b950f1bd70d1e5c200bc4157bbbb2798fc838
2 months agoaft: Pass correct afsi argument to AFSI_CHANGE event handlers.
Andre Noll [Wed, 14 May 2025 22:27:47 +0000 (00:27 +0200)]
aft: Pass correct afsi argument to AFSI_CHANGE event handlers.

Each time a new audio file is opened for streaming, we update the numplayed
and lastplayed fields of its afs info entry of the audio file table, then
update the global afsi and ahfi structures, then trigger an AFSI_CHANGE event,
which calls all table event handlers. The event handlers receive as arguments
a pointer to the old afsi and a pointer to the already modified aft row.

The AFSI_CHANGE event handler of the audio file table gets called in the
situation described above, and also via the touch and cpsi subcommands,
because these also change the afsi info structure and therefore trigger
AFSI_CHANGE events as well. The handler checks whether the affected audio
file is the current audio file, and if it is, extracts the modified afsi
from the audio file table into the global afsi structure.

The problem is that in case of the above "next audio file" scenario, the
old afsi pointer points to the global afsi structure, which gets updated
by the aft event handler. Therefore the event handlers which happen to run
after the event handler of the audio file table see the already updated afsi
through the old_afsi pointer.

Since the audio file table happens to be the first table of the 7-element
afs_tables[] array iterated by afs_event(), all six other event handlers see
the incorrect afsi. However, only the moods event handler looks at the old afsi
to update the mean and quadratic variation of the lastplayed and numplayed
values of the afs statistics. Due to the bug described above, the old and
new lastplayed and numplayed values coincide, and therefore the statistics
update is a no-op. In practice, at least for moods with many admissible files,
the values will only be slightly off, so the bug is rather benign.

Fix this by renaming the on-stack new_afsi to old_afsi, adjusting
initializations accordingly, and passing a pointer to this instance instead.

2 months agoImprove documentation of set_max_chunk_size().
Andre Noll [Wed, 21 May 2025 18:36:52 +0000 (20:36 +0200)]
Improve documentation of set_max_chunk_size().

The old text implied that the function could be removed at some point, which
is not the case. Remove this part of the documentation and clarify what the
function actually does.

2 months agoWarn about old (0.5.x or earlier) on-disk afhi.
Andre Noll [Wed, 21 May 2025 18:23:23 +0000 (20:23 +0200)]
Warn about old (0.5.x or earlier) on-disk afhi.

Nine years ago, starting with commit 234647bb5, old on-disk entries are
reported with a notice to re-add the file in order to update the audio file
table. Bump the loglevel for now, and add a comment to turn the check into
a hard error eventually.

2 months agodoxyen: Completely suppress brief descriptions.
Andre Noll [Wed, 21 May 2025 18:03:54 +0000 (20:03 +0200)]
doxyen: Completely suppress brief descriptions.

This shortens the doxygen pages, removing lots of pointless duplications.

2 months agobuffer_tree: Assert that we don't pass NULL to memcpy().
Andre Noll [Tue, 20 May 2025 20:47:46 +0000 (22:47 +0200)]
buffer_tree: Assert that we don't pass NULL to memcpy().

The buffer pointer cannot be NULL here because this only happens when the
buffer tree area is full, which is not the case thanks to the previous n <=
btr_pool_unused(btrp) check.

2 months agomp.c: Remove a dead store.
Andre Noll [Tue, 20 May 2025 20:13:54 +0000 (22:13 +0200)]
mp.c: Remove a dead store.

Found by the clang analyzer.

2 months agowmadec: Fix typo in comment.
Andre Noll [Wed, 21 May 2025 19:38:26 +0000 (21:38 +0200)]
wmadec: Fix typo in comment.

2 months agowmadec: Remove a stale comment in wma_init().
Andre Noll [Wed, 21 May 2025 19:03:02 +0000 (21:03 +0200)]
wmadec: Remove a stale comment in wma_init().

Noise coding has been removed.

Fixes: 9fe8a674535a00c6011f86b4ece3344200d00aa2
2 months agoMerge branch 'master' into next
Andre Noll [Wed, 21 May 2025 16:42:53 +0000 (18:42 +0200)]
Merge branch 'master' into next

* master:
  play.c: Kill pointless typedef.
  afs.h: Omit superfluous semicolons.
  Makefile: Drop redundant -Wuninitialized.

2 months agomood.c: Remove a dead store and fix the documentation of mood_load().
Andre Noll [Tue, 20 May 2025 20:10:31 +0000 (22:10 +0200)]
mood.c: Remove a dead store and fix the documentation of mood_load().

The function returns 1 on success, not the number of admissible files.

Found by the clang analyzer.

2 months agoflac_afh: Check for possible integer overflows.
Andre Noll [Tue, 20 May 2025 18:56:36 +0000 (20:56 +0200)]
flac_afh: Check for possible integer overflows.

This is a callback function which should carefully check its inputs.

2 months agogcc-compat.h: Drop inline #define.
Andre Noll [Tue, 20 May 2025 18:00:50 +0000 (20:00 +0200)]
gcc-compat.h: Drop inline #define.

There is no reason to believe that the programmer does a better job than
the compiler here.

2 months agowmadec: Kill pointless start/end computations.
Andre Noll [Tue, 20 May 2025 20:58:13 +0000 (22:58 +0200)]
wmadec: Kill pointless start/end computations.

Neither start nor end are used. The loop simply adds up the entries of one
line of the exponent_bands matrix.

Found by the clang analyzer.

2 months agoplay.c: Kill pointless typedef.
Andre Noll [Sun, 18 May 2025 19:40:31 +0000 (21:40 +0200)]
play.c: Kill pointless typedef.

The signature of the function pointer is too simple to warrant a typedef.

2 months agoafs.h: Omit superfluous semicolons.
Andre Noll [Sun, 18 May 2025 20:42:00 +0000 (22:42 +0200)]
afs.h: Omit superfluous semicolons.

The DECLARE_BLOB_SYMBOLS macro expands to a bunch of declarations, each of
which is terminated by a semicolon. So don't add another one.

2 months agoMakefile: Drop redundant -Wuninitialized.
Andre Noll [Sun, 18 May 2025 20:26:15 +0000 (22:26 +0200)]
Makefile: Drop redundant -Wuninitialized.

It is implied by -Wextra, which is the same as -W, but more descriptive.

2 months agoMerge branch 'master' into next
Andre Noll [Tue, 20 May 2025 19:39:15 +0000 (21:39 +0200)]
Merge branch 'master' into next

* master:
  Include regex.h from para.h.

2 months agoMerge topic branch t/build into master
Andre Noll [Tue, 20 May 2025 19:33:04 +0000 (21:33 +0200)]
Merge topic branch t/build into master

A medium sized series for the build system which improves the way the git
version string is stored in the executables and man pages. Subsequent patches
of the series remove some warts from the makefile: we no longer use order-only
dependencies and the .PRECIOUS target.

The merge results in a conflict against the "remove regex include" commit
67388cd4fae0. This is trivial to resolve, though.

* refs/heads/t/build:
  Doxify version functions.
  Doxify OV_EXCLUDE_STATIC_CALLBACKS #define.
  Makefile: Fix braino in tarball target.
  build: Remove superfluous dependency in Makefile.real.
  build: Remove the .PRECIOUS target.
  build: Improve clean targets.
  build: Get rid of directory order-only dependencies.
  build: Compile with -Wunused -Wall also on BSD.
  build: Revamp git versioning.
  build: Merge version.{c,h} into string.{c,h}.

2 months agoserver: Deprecate setatt in favor of touch.
Andre Noll [Sun, 16 Mar 2025 23:15:40 +0000 (00:15 +0100)]
server: Deprecate setatt in favor of touch.

This adds --set-attribute and --unset-attribute to the touch subcommand,
re-implementing the features of the setatt command with a saner syntax.

We augment the change_atts_data structure using pre-computed values for
verbose and dry-run mode and pass a pointer to this structure rather than
the general callback arg pointer. The existing setatt subcommand neither
sets nor consults the two new booleans.

The touch completer of para_client is updated to complete the two new options,
executing the lsatt subcommand to get the attribute names. The manual and
the test suite also need minor adjustments.

2 months agoInclude regex.h from para.h.
Andre Noll [Sun, 18 May 2025 20:05:45 +0000 (22:05 +0200)]
Include regex.h from para.h.

Every .c file includes it anyway.

2 months agoMerge topic branch t/completion into next
Andre Noll [Sun, 18 May 2025 17:26:10 +0000 (19:26 +0200)]
Merge topic branch t/completion into next

The completers for para_client and para_audioc handle some cases
incorrectly or not at all. This series improves on that.

Started on 2025-04-07.

* 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().

2 months agoRevamp bash_completion.
Andre Noll [Sat, 19 Apr 2025 11:39:26 +0000 (13:39 +0200)]
Revamp bash_completion.

This rewrite of the bash_completion script improves completion for the
para_client and para_audioc commands significantly.

One flaw which is fixed by this patch is related to the fact that by default
readline creates COMP_WORDS by splitting at characters that separate a shell
command, including "=", but for paraslash commands we only want to split at
spaces. So we modify the completer to return the special code 124 to instruct
readline to try split again with space as the only delimiter.

2 months agobash completion: Fix help option parsing.
Andre Noll [Sat, 3 May 2025 18:07:34 +0000 (20:07 +0200)]
bash completion: Fix help option parsing.

If we complete on para_client or para_audioc options rather than on server
or audiod subcommands, we parse the --help output to determine the options to
complete on. The regular expression we currently use for that is too lenient
because it also matches the options in the synopsis section of the help output.

Fix this by prefixing the expression with '^' to extract only the options
of the subsequent help text.

2 months agoaudioc: Fix option completion of version and stat.
Andre Noll [Sun, 4 May 2025 00:35:49 +0000 (02:35 +0200)]
audioc: Fix option completion of version and stat.

If the current word starts with a dash, we should always complete on options,
regardless of the word number.

2 months agoi9e: Introduce i9e_get_nonopt_argnum().
Andre Noll [Mon, 28 Apr 2025 14:37:14 +0000 (16:37 +0200)]
i9e: Introduce i9e_get_nonopt_argnum().

Call the new function from various subcommand completers to attempt completion
only on the first or the first two non-option arguments.

2 months agoi9e: Introduce i9e_cword_is_option_arg().
Andre Noll [Sun, 6 Apr 2025 20:14:43 +0000 (22:14 +0200)]
i9e: Introduce i9e_cword_is_option_arg().

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.

2 months agoi9e: Constify i9e_complete_option().
Andre Noll [Sun, 6 Apr 2025 17:30:53 +0000 (19:30 +0200)]
i9e: Constify i9e_complete_option().

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.