]> git.tuebingen.mpg.de Git - paraslash.git/commit - m4/lls/server_cmd.suite.m4
Implement ls --admissible=m/foo.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 23 Mar 2022 22:19:55 +0000 (23:19 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 12 May 2023 10:16:23 +0000 (12:16 +0200)
commit2d2637cb4c9ab76fea6bc336b9af88fd00bf5e08
tree89a95cbbb63bb0bfbad2e6acca707ca88a6b6d8b
parentac03b19b1693fbb7b1d558989ac81c79ed1284ae
Implement ls --admissible=m/foo.

Currently there can be only one score table at a time because the
functions of score.c refer to the global score_table variable.
To implement the new feature, we need to overcome this restriction
so that the callback of the ls command can populate an independent
score table to print its output without interfering with the score
table that is currently active.

This commit changes most functions of score.c to receive an additional
table pointer argument. All current users of the score table pass a
NULL pointer to instruct the functions to operate on the global score
table as before.

However, if the ls command is invoked with an optional mood argument
to -a. the callback calls mood_load(), followed by mood_loop() and
mood_unload(). The former returns an opaque handle which is then
passed to the other two functions to instruct them to operate on the
temporary score table instead of the global one.

To make the feature work for playlists as well, analogous functionality
is implemented in playlist.c. The new mop_loop() of aft.c performs
the disambiguation in a similar way as the activate_mood_or_playlist()
does. It is a bit simpler though, since the ls command does not have
to deal with NULL arguments and does not need to fall back to the
dummy mood.
afs.c
afs.h
aft.c
m4/lls/server_cmd.suite.m4
mood.c
playlist.c
score.c