| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
The file writer was an early experiment, introduced in 2006 mainly as as POC,
and to have at least two writers. It was never really useful for anything,
so schedule its removal to some point after 0.9.0.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
These just clutter the generated documentation, particularly the list of
global variables.
|
| |
|
|
| |
Every .c file includes it anyway.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This series implements a new memory allocation API which checks
for overflows. The first part of the series just renames the main
allocation functions. Later patches in the series implement allocators
which take two size_t arguments (like calloc(3)) and check whether the
multiplication overflows by employing the __builtin_mul_overflow()
primitive supported by gcc and clang. This requires us to bump the
lowest supported gcc and clang version.
* refs/heads/t/overflow:
build: Compile with -ftrapv.
string: Introduce arr_zalloc().
string: Introduce arr_alloc().
string: Introduce arr_realloc() and check for integer overflow.
string: Rename para_calloc() -> zalloc().
string: Rename para_malloc() -> alloc().
string: Overhaul para_strdup().
|
| | |
| |
| |
| |
| | |
Reword the documentation a bit since the function has never been a
wrapper for calloc(3). No code changes.
|
| | |
| |
| |
| |
| |
| |
| | |
The word "monitor" is neutral and continues to be correct after the
switch from select(2) to poll(2).
Pure rename, nothing to see here.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This preparatory patch for replacing select() renames para_fd_set()
to sched_fd_set(), moves it to sched.c and makes it static. All
users are modified to call either of the two new public functions
sched_monitor_{read,write}fd() which take a pointer to struct sched
rather than an fd set pointer.
|
| |/
|
|
|
| |
Two trivial wrappers for FD_ISSET() which hide the fact that we're
still using the select(2) API.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GPLv2 line does not add any additional information, so drop
it. This leaves a single line of legalese text for most files, which
is about the amount of screen real estate it deserves.
This patch was created with the following script (plus some manual
fixups):
awk '{
if (NR <= 5) {
gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g")
if (gs != $0)
year = gs
next
}
if (NR == 6 && year != "")
printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year)
print
}'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Similar to the previous commits for receivers and filters, this
commit replaces the five gengetopt parsers for the alsa, ao, file,
oss, osx writers by a lopsub suite and links para_write with -llopsub.
This allows to get rid of the WRITER_ENUM and the writers array as a
reference to each writer structure are stored in the lopsub user_data
pointer. Moreover, ->init(), ->parse_config(), ->free_config()
and ->ggo_help() of struct writer are not needed any more and can
be removed.
The patch also removes write_common.h and moves the few prototypes
write.h.
Now that receivers, filters and writers have all been converted, we
may also stop to include ggo.h from audiod_command.c and play.c.
As for the receivers and filters, t0005 needs slight adjustments due
to the new section header in the man page.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compiling with -Wformat-signedness (not enabled so far) causes many
warnings because of format strings which specify an unsigned type but
correspond to an argument of signed type, or vice versa. This commit
fixes all these mismatches.
For "%u", "%d", "%lu", "%ld" we let the format string match the
type of the argument, but for "%x" we need to cast the argument to
a suitable unsigned type.
After this patch the tree compiles cleanly with -Wformat-signedness
given. The warning will be enabled in a subsequent commit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Done with
files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll')
sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files
In previous years we ran a similar script to set the second year in
the range to the current year. This is kind of silly, so let's get
rid of this useless information.
This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in
all file headers, i.e. only the first year (A) is left in. Accurate
information including time stamps for each change can be obtained
from the git history.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mail server on systemlinux.org was down for more than a week
lately, so let's use an alternative official address. This commit
changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de.
Most .c and .h files contain the email address in the copyright header,
so they must all be patched. Three other files contain the address
for a different reason:
* README lists email and git, gitweb and home page URLs
* configure.ac needs it for configure -h
* version.c contains it for the -V option of all commands
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch is large, but it's fairly straight forward: Instead of
a task pointer all ->pre_select() and ->post_select() methods now
receive the context pointer that was passed to the scheduler when
the task was registered. This allows to kill the public task_context().
Two pre_select/post_select functions are not directly called by the
scheduler: session_post_select(), generic_recv_pre_select(). These
are changed to receive a proper struct rather than a void pointer.
Note that generic_filter_pre_select() is not changed in this
manner because some filters do not provide a pre_select wrapper but set
task->pre_select to generic_filter_pre_select().
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This year, we're really on time. The changes in this patch were
created by the following silly script:
files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll')
sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files
sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds usage and description fields to struct ggo_help and
changes ggo_print_help() to optionally print these.
The boolean detailed_help flag of ggo_print_help() is replaced by a
bitmask which lets the caller specify what to print. Four pre-defined
masks are used to print the normal help, the detailed help, the help
for modules (receivers, filters, writers) and the detailed module help.
The new macro DEFINE_GGO_HELP can be employed to create a struct
ggo_help from a gengetopt structure.
|
| |
|
|
|
|
|
|
|
| |
Currently the file writer's ->post_select() sets t->error to -1 on
errors, rather than using a proper error code. This may result in
a segfault when this number is passed to para_strerror().
Replacing the call to write() by xwrite() not only gives a proper
error code but also treats EAGAIN as a non-fatal error.
|
| | |
|
| |
|
|
| |
It has no more users.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX.1-2008 marks gettimeofday() as obsolete, so let's switch to
clock_gettime().
clock_gettime() operates on timespecs rather than on timevals like
gettimeofday() does. Since timevals are extensively used in all
parts of paraslash, and select() takes a timeval pointer as the
timeout parameter, it seems to be easiest to add a new wrapper,
clock_get_realtime(). It calls clock_gettime(), performs error
checking (all errors are treated fatal and abort the program), and
converts the result to a timeval.
Another difference between gettimeofday() and clock_gettime()
is that sys/time.h needs to be included for gettimeofday(), while
clock_gettime() is declared in time.h which gets included from para.h.
Hence we can remove the include statement for sys/time.h everywhere.
Programs which call clock_gettime need to be linked against librt on
glibc versions before 2.17 while BSD and newer glibc-based systems
have no such requirement. To make matters more interesting,
MacOS lacks clock_gettime() completely although this function conforms
to SUSv2 and POSIX.1-2001.
We'd like to avoid the unnecessary dependence on librt on systems that
have clock_gettime() in -lc, and we must fall back to gettimeofday()
on MacOS. Hence this commit also introduces a check in configure.ac
which determines whether clock_gettime() is available and, if it is,
whether -lrt is needed. Executables are only linked with -lrt if
configure found that this is necessary.
|
| |
|
|
| |
Better late than never.
|
| |
|
|
|
|
| |
Currently, nobody is notifying any writer node but the para_play
executable, which will be introduced in subsequent patches, will use
this facility to terminate the audio stream.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we have three different targets for creating *_cmdline.[ch]
files. This is because receivers, filters and writers need slightly
different command line options.
This patch defines the common options in the ggo makefile and moves
additional parameters to the individual .m4 files so that a single
target to create *_cmdline.[ch] is now sufficient.
The name of the command line parsers of some filters and writers
changed due to this unification, so these are updated accordingly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It causes gengetopt to generate quite some additional code for
the string parsers of all writers. Moreover, this string parser is
inferior to create_argv() and create_shifted_argv() of string.c as
gengetopt's parser does not honor any quoting at all.
This commit changes the signature of the ->parse_config_or_die method
of struct writer to take an (argc, argv) pair instead of a string. All
writers can thus call the vanilla command line parser of gengetopt. The
single user in write_common.c now calls ->parse_config_or_die()
with an (argc, argv) pair obtained from create_shifted_argv().
|
| |
|
|
|
|
|
|
|
| |
This has turned out to be source for bugs. Deallocate everything
in btr_remove_node() hence making removing the node and freeing
its resources an atomic operation.
To avoid dangling pointers to freed btrn nodes, the argument of
btr_remove_node() is changed to to struct btr_node **btrnp.
|
| |
|
|
|
| |
No writer implements this method, and nobody even looks at this
pointer. Remove it.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This adds the #include statement for stdbool.h to para.h. This allows
to get rid of the individual includes in *.c.
More importantly, since all *.c files include para.h, booleans will
now be available everywhere so that we won't need to touch dozens of
files anymore whenever a boolean is added to a public structure.
|
| |
|
|
|
|
|
|
| |
This gets rid of quite some inclusions of <dirent.h> which are not needed
as most .c files do not deal with directories at all.
afs.c doe not mmap anything and needs nothing from sys/time.h so remove
these includes as well.
|
| | |
|
| |
|
|
|
| |
Now that ->open is a dummy function for all writers, we may safely remove
this method from struct writer and kill the dummy functions.
|
| |
|
|
|
|
|
|
|
| |
Move the allocation of the private_file_write_data struct to ->post_select()
and adjust the the check whether the output file has already been opened
accordingly.
If the output file has just been opened, pfwd->fd will never be set in
the write fd set of the scheduler, so we can skip this test.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Always treat the easy cases "nothing to do", "error", and "not yet initialized"
first. For the alsa writer, this change fixes two minor bugs:
First, if data is available but alsa has not yet been initialized, we return
from ->pre_select() without setting a delay. This is wrong, we should init
the alsa handle ASAP in this case.
Second, on errors we wait 20ms which is both ugly and unnecessary.
Requesting a minimal delay is the right thing to do here as well.
|
| |
|
|
|
| |
These methods always succeed. Add missing documentation of the public
register_writer_node() function while we're at it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
register_writer_node() is the only caller of the ->open method for paraslash
writers. It does not check its return value, which is OK for alsa, oss and osx
as these writer's ->open method always succeeds. However, the ->open() method
of the file writer may fail, for example because the output file could not be
opened. This error will be ignored and the writer node task is registered as
usual with ->fd being initialized to zero.
Fix this bug by splitting the ->open method of the file writer into the part which
merely allocates the private_file_write_data structure, hence always succeeds,
and the part which actually opens the output file. This second part is called later
from ->post_select as soon as there is data available to be written.
After this patch the ->open methods of all writers always succeed and we
may change its return value to void which is done in the next patch.
|
| |
|
|
|
|
| |
These functions all call the gengetopt parser which aborts on errors. It is therefore
pointless to check the return value. Document this fact and make it explicit by renaming
->parse_config of struct writer to ->parse_config_or_die().
|
| |
|
|
| |
Hey, this is earlier than last year :)
|
| | |
|
| |
|
|
|
| |
Everything uses btr now, so there's no need for a suffix any more.
Update the documentation a bit.
|
| | |
|
| |
|
|
| |
Also, simplify the logic in file_write_post_select_btr() a bit.
|
| |
|
|
| |
Also, don't free the config on close.
|
| |
|
|
| |
This is what receivers/filters do as well.
|
| |
|
|
| |
Still a bit rough and there are too many btr merges.
|
| |
|
|
|
|
| |
This allows to have a single function which can be called from
both the pre_select and the post_select methods of all receivers/
filters/writers and from the stdin and stdout tasks.
|
| | |
|
| | |
|