]> git.tuebingen.mpg.de Git - paraslash.git/commit
afs: Provide pbout para_buffer for each callback.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 8 Apr 2015 03:35:21 +0000 (03:35 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 12 Aug 2015 21:23:48 +0000 (23:23 +0200)
commitb4418a6993c2c146c6da048d027254c8dd56799e
tree98a55df305f8deccb675987251b9a5365b0e41e5
parent59a4f545566f77a22a8c27ece5155ecd154d4145
afs: Provide pbout para_buffer for each callback.

Most afs callbacks define a para_buffer to pass output from the
callback to the command handler. Hence the code which defines and
initializes the para_buffer is duplicated many times.

This commit gets rid of the duplication by moving the initialization
to the common call_callback(). The para_buffer becomes part of
struct afs_callback_arg, a pointer to which is passed to every
callback. The buffer is also flushed and freed in call_callback()
so that the callbacks don't need to care about it any more. This also
allows to make flush_and_free_pb() static since only a single caller
in afs.c remains.

This change simplifies the callbacks considerably. The callbacks of the
rm, setatt, lsatt, lsblob and touch commands don't even need their own
"action_data" structure any more since it was only necessary to pass
the para_buffer to the ->action method.
afs.c
afs.h
aft.c
attribute.c
blob.c
mood.c
playlist.c