]> git.tuebingen.mpg.de Git - paraslash.git/log
paraslash.git
2 weeks 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 weeks 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.

3 weeks 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.

3 weeks 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".

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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
3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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}.

3 weeks 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.

3 weeks 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.

3 weeks 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().

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks 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.

3 weeks agoMerge branch 'master' into next
Andre Noll [Sun, 18 May 2025 17:16:06 +0000 (19:16 +0200)]
Merge branch 'master' into next

* master:
  doxygen: Don't show includes.
  load_afd(): Double check shared memory sizes.
  about: Mention that paraslash works without internet access.
  mp3_afh: Kill FOR_EACH_FIELD().
  mp3_afh: Document id3_field_init() and id3_field_finish().

3 weeks agodoxygen: Don't show includes.
Andre Noll [Fri, 16 May 2025 20:36:35 +0000 (22:36 +0200)]
doxygen: Don't show includes.

They use a lot of space and don't help much to understand the API or code.

3 weeks agoload_afd(): Double check shared memory sizes.
Andre Noll [Mon, 5 May 2025 21:52:42 +0000 (23:52 +0200)]
load_afd(): Double check shared memory sizes.

The shared memory ID is sent by a trusted source, so it is a programming error
(rather than a runtime error that could be handled) if the size of the shared
memory area is smaller than the size of an audio file data structure. Thus,
the right thing to do is to abort immediately in this case.

3 weeks agoabout: Mention that paraslash works without internet access.
Andre Noll [Sat, 3 May 2025 15:17:58 +0000 (17:17 +0200)]
about: Mention that paraslash works without internet access.

It's a noteworthy feature if software works without relying on third-party
internet services.

3 weeks agomp3_afh: Kill FOR_EACH_FIELD().
Andre Noll [Tue, 13 May 2025 21:44:41 +0000 (23:44 +0200)]
mp3_afh: Kill FOR_EACH_FIELD().

The macro has only one user. Open-code it to shorten the code and improve
readability.

4 weeks agomp3_afh: Document id3_field_init() and id3_field_finish().
Andre Noll [Mon, 28 Apr 2025 22:03:26 +0000 (00:03 +0200)]
mp3_afh: Document id3_field_init() and id3_field_finish().

These functions are somewhat obscure because they are not part of the
libid3tag API. They are not part of the internal paraslash API either,
so their documentation should not be shown on the API page. Exclude the
documentation with the doxygen \cond and \endcond markers.

4 weeks agoMerge branch 'master' into next
Andre Noll [Wed, 14 May 2025 18:22:19 +0000 (20:22 +0200)]
Merge branch 'master' into next

* master:
  aft.c: Remove unused enum touch_flags.

5 weeks agoMerge branch 'master' into next
Andre Noll [Fri, 9 May 2025 17:20:59 +0000 (19:20 +0200)]
Merge branch 'master' into next

* master:
  server: Add missing non-opts name to help text.

5 weeks agoaft.c: Remove unused enum touch_flags.
Andre Noll [Sun, 4 May 2025 21:19:26 +0000 (23:19 +0200)]
aft.c: Remove unused enum touch_flags.

This enum became unused ten years ago when the touch command learned to use
the lopsub library.

Fixes: fdf416e9af730a1df9eec8d7acb108d7ca881926
5 weeks agoserver: Add missing non-opts name to help text.
Andre Noll [Mon, 5 May 2025 23:39:54 +0000 (01:39 +0200)]
server: Add missing non-opts name to help text.

5 weeks agoMerge branch 'master' into next
Andre Noll [Sun, 4 May 2025 00:15:08 +0000 (02:15 +0200)]
Merge branch 'master' into next

* master:
  blob: Get rid of the two dummy event handlers.
  Check return value of lsu_com_help().
  afs.c: Improve documentation.

6 weeks agoblob: Get rid of the two dummy event handlers.
Andre Noll [Sun, 23 Mar 2025 20:53:15 +0000 (21:53 +0100)]
blob: Get rid of the two dummy event handlers.

The four blob operation structures defined in blob.c are created by
a macro which initializes the function pointer for the event handler
to ${name}_event_handler, where $name is the blob type, i.e. one of
images, lyrics, moods, playlists.

Only two of the four, moods and playlists, need an event handler
because the images and lyrics tables ignore events. Currently we
have to define dummy functions {images,lyrics}_event_handler() to
avoid link errors. This extra code can easily be avoided by making
the macros a little smarter.

6 weeks agoCheck return value of lsu_com_help().
Andre Noll [Tue, 18 Mar 2025 18:31:33 +0000 (19:31 +0100)]
Check return value of lsu_com_help().

This function fails if an invalid command name is passed as the argument, yet
all callers ignore the error. Modify the callers to print the strerror text as
appropriate and no longer do that in lsu_lopsub_error(). Rename this function
and introduce the error type argument to print more meaningful error messages.

One visible consequence is that

para_client help does-not-exist

used to succeed while it now exits with status 1.

6 weeks agoafs.c: Improve documentation.
Andre Noll [Mon, 24 Mar 2025 00:31:59 +0000 (01:31 +0100)]
afs.c: Improve documentation.

Add an overview of the file and expand the description of
open_next_audio_file() and afs_init().

6 weeks agoMerge topic branch t/wmadec into next
Andre Noll [Mon, 28 Apr 2025 15:45:04 +0000 (17:45 +0200)]
Merge topic branch t/wmadec into next

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.

Started on 2025-01-22

* refs/heads/t/wmadec:
  wmadec: Remove noise coding.
  wmadec: Simplify wma_init().
  wmadec: Remove fft().

6 weeks agoMerge branch 'master' into next
Andre Noll [Sun, 27 Apr 2025 19:18:08 +0000 (21:18 +0200)]
Merge branch 'master' into next

* master:
  client: Fix completion for the select subcommand.
  i9e: Rename i9e_completer() -> attempt_completion().
  i9e: Improve documentation of i9e_completion_info().

6 weeks agowmadec: Remove noise coding.
Andre Noll [Tue, 7 Jan 2025 23:09:21 +0000 (00:09 +0100)]
wmadec: Remove noise coding.

It is not used anyway in most cases, and it complicates the code
considerably.

6 weeks agowmadec: Simplify wma_init().
Andre Noll [Tue, 7 Jan 2025 22:27:35 +0000 (23:27 +0100)]
wmadec: Simplify wma_init().

This equivalent transformation saves a few lines and one level of
indentation.

6 weeks agowmadec: Remove fft().
Andre Noll [Fri, 27 Dec 2024 17:38:01 +0000 (18:38 +0100)]
wmadec: Remove fft().

It has only one caller, imdct_half(), so get rid of the trivial
function. Dedox the static imdct_half() while at it.

7 weeks agoclient: Fix completion for the select subcommand.
Andre Noll [Mon, 7 Apr 2025 11:07:13 +0000 (13:07 +0200)]
client: Fix completion for the select subcommand.

We missed to complete the -v option that was added recently.

Fixes: 1f31fcdd74ab1aab01cbc70942f9d69bb779156a
7 weeks agoi9e: Rename i9e_completer() -> attempt_completion().
Andre Noll [Sat, 19 Apr 2025 09:00:06 +0000 (11:00 +0200)]
i9e: Rename i9e_completer() -> attempt_completion().

The old name is confusing since we also have struct i9e_completer,
which is a completely different beast. Rewrite the documentation
of the function while at it.

7 weeks agoi9e: Improve documentation of i9e_completion_info().
Andre Noll [Sat, 19 Apr 2025 08:58:27 +0000 (10:58 +0200)]
i9e: Improve documentation of i9e_completion_info().

Emphasize that ->word is *not* the same as ->argv[i], where i is the index of
the current word.

8 weeks agoMerge topic branch t/select- into next
Andre Noll [Sat, 19 Apr 2025 14:17:35 +0000 (16:17 +0200)]
Merge topic branch t/select- into next

A single patch which implements the new feature.

Started on 2024-11-30, cooking since 2025-04-19.

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

8 weeks agocom_select(): Support '-' to reactivate the previous mood/playlist.
Andre Noll [Mon, 25 Nov 2024 20:55:43 +0000 (21:55 +0100)]
com_select(): Support '-' to reactivate the previous mood/playlist.

This adds two static global variables to afs.c which track the
previously active mood or playlist. The select subcommand now makes
use of this information if the argument is the special string '-'. The
subcommand then follows common Unix conventions and reactivates the
previous mood or playlist.

2 months agoMerge branch 'master' into next
Andre Noll [Mon, 7 Apr 2025 17:00:00 +0000 (19:00 +0200)]
Merge branch 'master' into next

* master:
  Add missing newline in mp_init() error string.
  com_check(): Report inconsistencies consistently.
  aft: Simplify print_list_item().
  vss_init(): Adjust loglevel.
  manual: s/pipe/socket in the section on AFS.
  base64: Document PAD64.
  Teach the mood parser to not leak on errors.

2 months agoAdd missing newline in mp_init() error string.
Andre Noll [Sun, 6 Apr 2025 22:50:52 +0000 (00:50 +0200)]
Add missing newline in mp_init() error string.

Because callers expect this. Also print the message to the server log.

2 months agocom_check(): Report inconsistencies consistently.
Andre Noll [Wed, 19 Mar 2025 17:10:42 +0000 (18:10 +0100)]
com_check(): Report inconsistencies consistently.

Currently the various checkers report the inconsistencies they detect
in one of the osl tables to either stdout via the pbout para_buffer
or to stderr by calling afs_error(), Unify this by replacing all
calls to afs_error().

2 months agoaft: Simplify print_list_item().
Andre Noll [Sun, 23 Mar 2025 14:52:03 +0000 (15:52 +0100)]
aft: Simplify print_list_item().

The function performs no cleanup, so we don't need to jump to "out"
just to return ret.

2 months agovss_init(): Adjust loglevel.
Andre Noll [Mon, 24 Mar 2025 21:59:16 +0000 (22:59 +0100)]
vss_init(): Adjust loglevel.

These messages are not that interesting, so decrease their log level
by one.

2 months agomanual: s/pipe/socket in the section on AFS.
Andre Noll [Mon, 24 Mar 2025 01:53:32 +0000 (02:53 +0100)]
manual: s/pipe/socket in the section on AFS.

The AFS process passes an open file descriptor to the server process,
which is only possible with sockets but not with pipes.

2 months agobase64: Document PAD64.
Andre Noll [Tue, 25 Mar 2025 00:45:31 +0000 (01:45 +0100)]
base64: Document PAD64.

This fixes another warning when doxygen is run with EXTRACT_ALL=NO.

2 months agoDoxify version functions.
Andre Noll [Tue, 25 Mar 2025 00:15:34 +0000 (01:15 +0100)]
Doxify version functions.

The two auto-generated public functions come undoxified, so document
their declarations in string.h.

Fixes: 69bace22205b4bb01673f7c9873f57a43bd6a0f7
2 months agoDoxify OV_EXCLUDE_STATIC_CALLBACKS #define.
Andre Noll [Mon, 24 Mar 2025 23:48:17 +0000 (00:48 +0100)]
Doxify OV_EXCLUDE_STATIC_CALLBACKS #define.

That's useful information that should make it into the generated web
pages.

2 months agoMakefile: Fix braino in tarball target.
Andre Noll [Mon, 24 Mar 2025 01:15:01 +0000 (02:15 +0100)]
Makefile: Fix braino in tarball target.

$(RM) implies -f, but not -r.

Fixes: 35a7569b2a7c66e40246aeaa135224f469584209
2 months agobuild: Remove superfluous dependency in Makefile.real.
Andre Noll [Thu, 2 Jan 2025 01:43:09 +0000 (02:43 +0100)]
build: Remove superfluous dependency in Makefile.real.

This dependency is also covered by the CC_PREREQUISITES variable.

2 months agobuild: Remove the .PRECIOUS target.
Andre Noll [Thu, 2 Jan 2025 00:06:03 +0000 (01:06 +0100)]
build: Remove the .PRECIOUS target.

Instruct make(1) to never remove any intermediate files by defining
.SECONDARY. This way we don't need to maintain the list of precious
targets.

2 months agobuild: Improve clean targets.
Andre Noll [Wed, 1 Jan 2025 21:24:03 +0000 (22:24 +0100)]
build: Improve clean targets.

In a "fresh build" (e.g. after a make clean) we create the .d and the
.o file in one go to speed up this common case. However, if one runs
"make clean" followed by e.g. "make para_audioc", this will create
*all* object and dependency files, not just the ones needed to build
para_audioc. This behaviour is unfortunate because most dependencies
are irrelevant for a single target, and even the few which do matter
are ignored as well in this case because the object file does not
exist and needs to be recreated anyway,

Work around this shortcoming by shuffling the commands of the four
rules a little so that the clean target only removes object files
but keeps the dependency files.

Also remove the calls to SAY in the recipe of the clean targets because
with the rm commands spelled out it is clear what is being removed.

2 months agobuild: Get rid of directory order-only dependencies.
Andre Noll [Wed, 1 Jan 2025 16:19:47 +0000 (17:19 +0100)]
build: Get rid of directory order-only dependencies.

They only clutter the Makefile for no good reason. Just create all
build directories beforehand when running ./version-gen.sh.

One order-only dependency remains: We want to invoke the compiler
only after all generated .h files have been created. Otherwise the
.d files may be created incorrectly.

2 months agobuild: Compile with -Wunused -Wall also on BSD.
Andre Noll [Wed, 1 Jan 2025 15:36:23 +0000 (16:36 +0100)]
build: Compile with -Wunused -Wall also on BSD.

The new #define in oggdec_filter.c gets rid of the warnings such as

'OV_CALLBACKS_STREAMONLY_NOCLOSE' defined but not used [-Wunused-variable]

on NetBSD. With the patch applied, the code still compiles without
warnings. Tested on Linux, FreeBSD and NetBSD.

2 months agobuild: Revamp git versioning.
Andre Noll [Wed, 1 Jan 2025 00:16:48 +0000 (01:16 +0100)]
build: Revamp git versioning.

This rewrites GIT-VERSION-GEN and renames it to version-gen.sh. The
main difference is that the script now generates version.c rather
than version.h, speeding up the build because switching branches
or transitioning from a clean to a dirty work-tree (or vice versa)
changes the version string. Before the patch, all files which included
version.h were recompiled. With the patch applied, only the short
version.c needs to be recompiled.

The generated version,c defines one function which returns the
single-line version string and a second function which returns
the multi-line version information (author, copyright, git URL
etc). This information is now passed to version-gen.sh via environment
variables. The CPP macros we had before are removed.

2 months agobuild: Merge version.{c,h} into string.{c,h}.
Andre Noll [Tue, 31 Dec 2024 23:48:26 +0000 (00:48 +0100)]
build: Merge version.{c,h} into string.{c,h}.

This is a preparatory patch for the upcoming revamp of the git
version script. The revamped script generates version.c, a file
which is currently tracked by git. We can easily get rid of it (and
of version.h) since all paraslash executables link in both string.o
and version.o. So let's move the three small functions of version.c
to string.c and their declarations from version.h to string.h.

2 months agoTeach the mood parser to not leak on errors.
Andre Noll [Wed, 19 Mar 2025 23:18:30 +0000 (00:18 +0100)]
Teach the mood parser to not leak on errors.

Attempting to load an incomplete mood definition such as "1 &&"
currently causes memory leaks because the memory for the partial
syntax tree is never freed.

Employ bison's %destructor directive to call mp_free_ast() whenever
a syntax error happens.

2 months agomp.y: Fix some trivialities.
Andre Noll [Wed, 19 Mar 2025 23:17:40 +0000 (00:17 +0100)]
mp.y: Fix some trivialities.

Some lines were indented with spaces rather than tabs, and the file
contained a few stray semicolons with no effect.

2 months agostring.c: Remove an unused local variable in for_each_line().
Andre Noll [Tue, 18 Mar 2025 22:53:30 +0000 (23:53 +0100)]
string.c: Remove an unused local variable in for_each_line().

This set but not used variable existed for a long time, but only now
the first compiler, clang-19 on FreeBSD, started to complain.

Streamline the documentation a bit while at it.

2 months agoFix memory leak in mood parser.
Andre Noll [Mon, 17 Mar 2025 20:43:15 +0000 (21:43 +0100)]
Fix memory leak in mood parser.

If a mood definition contains an invalid regular expression, we leak
one ast node structure per yyparse() call.

4 months agogui: Switch to white foreground for command output.
Andre Noll [Sun, 5 Jan 2025 19:56:28 +0000 (20:56 +0100)]
gui: Switch to white foreground for command output.

The new color scheme is easier to read, and is more pleasant on the eye.

4 months agogui: Improve "closing command fd" log message.
Andre Noll [Fri, 17 Jan 2025 19:52:48 +0000 (20:52 +0100)]
gui: Improve "closing command fd" log message.

Make the EOF case silent because this is no real error, but print the
log message with a high severity level if the read operation failed
for any other reason.

4 months agoKill BINDIR.
Andre Noll [Wed, 1 Jan 2025 20:39:34 +0000 (21:39 +0100)]
Kill BINDIR.

When executing para_client or para_audioc from para_mixer or para_gui
we currently pass an absolute path whose directory part is BINDIR
to execvp(2). This is unnecessary because execvp(2) honors $PATH.
This commit modifies gui.c and mixer.c to pass only the basename of
the executable instead, allowing us to remove the BINDIR preprocessor
define. We still need the bindir make variable, though, because it
is referenced in the recipe of the two install targets.

5 months agoparaslash 0.7.4 v0.7.4
Andre Noll [Wed, 8 Jan 2025 17:56:42 +0000 (18:56 +0100)]
paraslash 0.7.4

5 months agoconfigure: Suggest to install liblopsub-dev.
Andre Noll [Thu, 2 Jan 2025 20:47:16 +0000 (21:47 +0100)]
configure: Suggest to install liblopsub-dev.

5 months agoexec: Improve documentation.
Andre Noll [Wed, 1 Jan 2025 20:21:08 +0000 (21:21 +0100)]
exec: Improve documentation.

Clarify the documentation of the public para_exec_cmdline_pid()
and dedox the static para_exec().

5 months agoUpdate copyright year.
Andre Noll [Tue, 31 Dec 2024 22:27:51 +0000 (23:27 +0100)]
Update copyright year.

Happy new year!

5 months agogui: Kill also child processes of external commands.
Andre Noll [Mon, 19 Aug 2024 19:41:23 +0000 (21:41 +0200)]
gui: Kill also child processes of external commands.

When a command is executed as a display command from para_gui, and
the command is interrupted from within para_gui by pressing any key,
para_gui only kills the spawned process but leaves alone its child
processes.

Address this problem by putting the spawned process into a separate
process group so that we can easily kill all processes of the group
by passing the negated PID of the child to kill(2).

In theory, the change in exec.c also affects para_mixer, which executes
para_client and para_audioc. However, para_mixer never kills any of
its child processes.

5 months agoFix memory leak in playlist.c.
Andre Noll [Mon, 25 Nov 2024 23:28:53 +0000 (00:28 +0100)]
Fix memory leak in playlist.c.

If the result pointer is NULL. we currently leak one playlist instance
structure (12 bytes on 32 bit, 20 bytes on 64 bit) each time a playlist
is loaded.

Found by valgrind.

Fixes: 2d2637cb4c9ab76fea6bc336b9af88fd00bf5e08
5 months agoRemove the documentation of the maint branch.
Andre Noll [Sun, 1 Dec 2024 16:56:25 +0000 (17:56 +0100)]
Remove the documentation of the maint branch.

paraslash-0.6.5 was the last maintenance release. As of today,
the "maint" branch no longer exists in the git repo, so adjust the
documentation at two places: the user manual and the download page.
Streamline the text a bit, while at it.

6 months agoMerge branch 'maint'
Andre Noll [Sun, 1 Dec 2024 16:10:27 +0000 (17:10 +0100)]
Merge branch 'maint'

The merge conflicted in NEWS.md because both branches modified the
top of this file.

* maint:
  paraslash 0.6.5

6 months agoparaslash 0.6.5 v0.6.5
Andre Noll [Sun, 1 Dec 2024 16:02:32 +0000 (17:02 +0100)]
paraslash 0.6.5

6 months agoMerge topic branch t/sf_float into master
Andre Noll [Tue, 26 Nov 2024 16:19:19 +0000 (17:19 +0100)]
Merge topic branch t/sf_float into master

A single patch which adds two new sample formats for 32 bit IEEE
float waveform data. Cooking for two months.

* refs/heads/t/sf_float:
  New audio formats: 32 bit float (little and big endian).

6 months agomanual: Streamline lopsub install instructions.
Andre Noll [Mon, 25 Nov 2024 20:05:07 +0000 (21:05 +0100)]
manual: Streamline lopsub install instructions.

These days one can install the distribution's lopsub package, so
suggest getting it with apt-get(8) rather than by compiling from
source.

Switch the protocol in the URL for the lopsub web page from http to
https while at it.

8 months agoMerge topic branch t/openssl-3 into master
Andre Noll [Tue, 17 Sep 2024 15:52:07 +0000 (17:52 +0200)]
Merge topic branch t/openssl-3 into master

The series starts with a few cleanups and crypto-backend tweaks to
beat the openssl specific code into shape for the main objective:
the switch of the RSA encryption and decryption routines to the
high-level EVP API. This has become necessary because the old RSA
API functions have been deprecated in openssl-3.

This merge conflicted against commit a18458cff51c (No longer check
for CRYPTO_cleanup_all_ex_data()). The resolution is to remove the
checks which that commit removed and to add the checks which commit
0485079436ad (openssl: Use the EVP library for RSA public encryption)
of this series introduced.

Cooking for four months.

* refs/heads/t/openssl-3:
  openssl: Reactivate openssl warnings.
  openssl: Use the EVP library for RSA private decryption.
  openssl: Use the EVP library for RSA public encryption.
  apc_priv_decrypt: Let the callee allocate the buffer.
  apc_pub_encrypt: Let the callee allocate the buffer.
  openssl: Assume that openssl allocation functions functions succeed.
  openssl: Introduce openssl_perror().
  openssl: Don't pass pointers to RSA structures around.
  openssl: Kill rsa coefficient computations.
  client: Check buffer size returned by apc_priv_decrypt().

8 months agoaac_afh: Remove noisy debug message.
Andre Noll [Tue, 17 Sep 2024 10:42:58 +0000 (12:42 +0200)]
aac_afh: Remove noisy debug message.

This may be printed thousands of times. which is a bit over the top,
even for the debug loglevel.

8 months agoNew audio formats: 32 bit float (little and big endian).
Andre Noll [Sat, 8 Sep 2018 10:11:33 +0000 (12:11 +0200)]
New audio formats: 32 bit float (little and big endian).

At least the little endian version seems to be popular these days. It
is only supported by ALSA, however. To check whether a given wave
file employs one of the two SF_FLOAT formats (aka IEEE float) we have
to consult the format code, a 16 bit integer stored at offset 20 of
the wave header which describes the waveform data according to the
table below.

0x0001 PCM
0x0003 IEEE float
0x0006 8-bit ITU-T G.711 A-law
0x0007 8-bit ITU-T G.711 MU-law
0xFFFE Determined by SubFormat

Additional checks are added to check_wav_post_select() which make
sure that the format code is either 1 or 3, and that the number is
compatible with the bits per sample value.

8 months agoMerge topic branch t/ls-l into master
Andre Noll [Sun, 15 Sep 2024 16:23:24 +0000 (18:23 +0200)]
Merge topic branch t/ls-l into master

A single commit which deprecates the chunk table and mbox listing
modes. The chunk table can still be listed with para_afh(1), and the
mbox format was never really useful to begin with. The idea is to
remove support after 0.8.0 has been released.

Cooking for three months.

* refs/heads/t/ls-l:
  server: Deprecate -l=c and -l=m of com_ls().

9 months agogui: Fix formatting of amp value.
Andre Noll [Fri, 9 Aug 2024 20:53:00 +0000 (22:53 +0200)]
gui: Fix formatting of amp value.

It was observed on a 178 column wide xterm window that for the colorful
blackness theme the amp value shown in the top window of para_gui
wrapped into the subsequent line under some circumstances. Adjust
the corresponding value in gui_theme.c to fix this.

Also add the missing space character to the prefix and fix a whitespace
issue while at it.

9 months agoMerge topic branch t/btr into master
Andre Noll [Tue, 10 Sep 2024 13:41:49 +0000 (15:41 +0200)]
Merge topic branch t/btr into master

Some helpers such as btr_get_input_queue_size() are very expensive
if the buffer tree contains many buffers, which is the case for mp3
and aac streams. This is noticeable in particular with para_play,
which spends more time in the btr subsystem than in the mp3 decoder
if the file is large enough. This branch contains a few patches to
improve that.

Cooking for four months.

* refs/heads/t/btr:
  btr: Streamline the documentation of buffer_tree.h.
  Constify buffer tree API.
  btr: Merge buffers on insertion.
  btr: Speed up btr_node_status().
  Speed up mp3dec filter.

9 months agoMerge topic branch t/play into master
Andre Noll [Wed, 4 Sep 2024 13:49:50 +0000 (15:49 +0200)]
Merge topic branch t/play into master

This small series contains a few minor tweaks for para_play. The most
obvious change is that para_play is no longer built on systems which
lack libreadline.

The merge conflicted badly in configure.ac due to the changes
introduced by the earlier merge of the "built" topic branch. The
resolution needs to modify the non-conflicting Makefile.real to exclude
para_play from the list of executables if libreadline is not present
while the corresponding commit of the "play" topic branch implemented
the logic in configure.ac.

Cooking for a month.

* refs/heads/t/play:
  play: Shut down alsa on input EOF.
  play: Simplify and improve get_key_map_seq().
  play: Remove pointless goto in play_post_monitor().
  Return from filter_setup() so callers can reset the terminal.
  Let para_play depend on libreadline.

9 months agoplay: Shut down alsa on input EOF.
Andre Noll [Thu, 6 Oct 2022 14:11:55 +0000 (16:11 +0200)]
play: Shut down alsa on input EOF.

para_play leaks a lot of memory on exit because we didn't bother
to shut down the alsa subsystem. While this is harmless from the
correctness point of view, it does make it harder to spot real
memory leaks.

Rework the error handling to always shut down alsa via kill_stream().
Combine play_post_monitor() and session_post_monitor() because they
are small enough and the latter was badly named anyway.

9 months agoplay: Simplify and improve get_key_map_seq().
Andre Noll [Sun, 25 Jun 2023 12:29:07 +0000 (14:29 +0200)]
play: Simplify and improve get_key_map_seq().

Combine it with get_user_key_map_seq() and replace the NULL check
with an assertion since the condition can never be true here. This
makes gcc's static analyzer happy, which complained about a possible
NULL pointer dereference.