summaryrefslogtreecommitdiff
path: root/error.h (follow)
Commit message (Collapse)AuthorAge
* Remove unused E_BAD_TABLE_NAME.Andre Noll2026-08-30
| | | | Fixes: f57809b6f950380ceaee9bb2b47915441dd9c7b0
* Kill E_CLIENT_SYNTAX.Andre Noll2026-08-30
| | | | | | Only one reference: client_open() errors out if the argument vector does not include any subcommand. The plain EINVAL seems to be a better fit for this particular case, so..
* gui/audiod: Replace for_each_stat_item() by parse_status_items().Andre Noll2026-07-14
| | | | | | | | | | | | | | The old function received a callback, and called it once per item received. This inevitably leads to situations where one status item is already uptodate but others are not. The replacement function no longer takes a callback pointer but a pointer to the array of status items to update, and returns the mask of items that have changed. Parse errors are now regarded as implementation bugs. We still detect them and log an error, but the function can no longer fail. Remove print_all_items() from gui.c since this can now be done in one line by passing ~0 to print_stat_items().
* Kill E_SIZE_PREFIX.Andre Noll2026-05-24
| | | | E_STAT_ITEM_PARSE is a good fit as well.
* Merge topic branch t/spdx into masterAndre Noll2026-03-26
|\ | | | | | | | | | | | | | | | | | | | | Switch to SPDX licence identifiers A single patch which replaces the first comment line of most .c and .h files containing the copyright notice by standardized SPDX (Software/System Package Data Exchange) nomenclature. * t/spdx: Switch to SPDX identifiers.
| * Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | | | | | | | | | 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.
* | aft: Remove return value of sort_matching_paths().Andre Noll2026-03-17
|/ | | | | This function never fails. The single condition under which it used to return negative is never true, so assert() that this is the case.
* Merge topic branch t/rm_pem into masterAndre Noll2026-02-25
|\ | | | | | | | | | | | | | | | | | | Remove support for PEM keys A single patch which removes support for old style PEM keys. The old key format has been deprecated since paraslash-0.7.3, released in March 2024. * refs/heads/t/rm_pem: Remove support for PEM private keys.
| * Remove support for PEM private keys.Andre Noll2026-01-28
| | | | | | | | | | This gets us rid of a couple of hand-written parsers, which can only be a good thing. The shortstat says it all...
* | Merge topic branch t/rm_dccp into masterAndre Noll2026-02-18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove dccp support The first patch of this series removes the dccp sender and receiver. Both are deprecated as of paraslash-0.7.6, released in 2025-11. The short depreciation period should not be a problem because dccp was never adopted widely, and the linux kernel no longer supports the protocol. The removal paves the way for quite some subsequent cleanups. In particular, the acl and chunk queue APIs, which used to be shared between the http and the dccp sender, no longer need to be public, so subsequent patches of the series move acl.c and chunk_queue.c into http_send.c. * refs/heads/t/rm_dccp: http_send.c: Simplify format_url(). Move format_url() from net.c to http_send.c. Merge acl.c into http_send.c. Merge chunk_queue.c into http_send.c. http_send.c: Move header_sent to struct private_http_sender_data. http_send.c: Move chunk queue into struct private_http_sender_data. struct sender: Remove unused sched pointer argument of ->post_monitor(). struct sender: Remove unused chunks_sent parameter of ->send(). http_send.c: Kill http_send_ok_msg() and http_send_err_msg(). http_send.c: Remove trivial shutdown wrapper. http_send.c: Merge free_sender_status() into http_shutdown(). http_send.c: Merge init_sender_status() into http_send_init(). http_send.c: Rename or remove generic_foo(). http_send.c: Remove sender_status pointer arguments. Move struct sender_status into http_send.c. Move send_common.c into http_send.c. Remove dccp.
| * | Remove dccp.Andre Noll2026-01-26
| |/ | | | | | | | | | | | | | | | | | | | | This removes all traces of dccp, specifically dccp_recv.c and dccp_send.c. The flowops related functions of net.c can go away as well, as flowops were only needed for the dccp transport. A few other functions are simplified by dropping the flowops or protocol parameter. Further cleanups are possible, but are deferred to subsequent commits. In particular, some functions of send_common.c are only called by the http transport now. These can be moved to http_send.c and then be made static.
* | Merge topic branch t/rm-resample into masterAndre Noll2026-02-02
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the resample filter The resample filter did not turn out to be very useful in the 10+ years of its existence, so this series removes it. A few follow-up patches combine source files and simplify the API related to the wav format. * refs/heads/t/rm-resample: write.c: Remove struct wav_params and LLS_COPY_WAV_PARMS. write.c: Simplify check_wav_init(). para_write: Move check_wav.{c,h} into write.c. Remove the resample filter.
| * | Remove the resample filter.Andre Noll2026-01-27
| |/ | | | | | | | | | | | | | | The resample filter did not turn out to be very useful in the 10+ years of its existence, so remove it. This filter was the penultimate user of the check_wav API, so the removal clears the way for further cleanups. No changes to audiod.c, filter.c play.c are necessary.
* / Remove the setatt server subcommand.Andre Noll2026-01-28
|/ | | | | The subcommand was deprecated in paraslash-0.7.5, when the touch subcommand grew equivalent functionality.
* Employ sideband API for audioc-audiod connections.Andre Noll2026-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, para_audioc writes the data it received over the local socket from audiod to stdout. This include error messages, if any. Also, para_audioc does not know whether the subcommand passed to para_audiod was successful, and exits successfully even if the subcommand failed. Thanks to the sideband API, para_client is much smarter in this regard. This patch employs the existing API also for the connection between para_audioc and para_audiod. Besides comment updates and the new sideband_log() helper, no changes to the sideband API are necessary. The client code stays unmodified as well. The new helper has three callers, two in audioc.c and one in client_common.c. Remove a pointless NULL check and a debug log message from dispatch_sbb() of client_common.c while at it. The message was useful for testing but is no longer needed. The new code is backwards compatible, i.e., an old para_audioc can still communicate with a new para_audiod and vice versa. Thus, we have to maintain two "protocols" for the audioc-audiod communication, named v1 and v2 in the code and in what follows. For example, if audioc or audiod are unpatched (so that v1 is in use), then ./para_audioc aaa > /dev/null prints nothing because with v1 the error message goes to stdout, and the command exits successfully (exit code 0). If both sides support v2, the same command prints audiod: errctx: aaa audiod: invalid subcommand main: audiod dispatch error to stderr, then exits unsuccessfully (exit code 1). Only the server reply is sideband-encoded. The way how command line arguments are passed from audioc to audiod is also changed, though. Instead of terminating the arguments with newlines, a v2 audioc prepends an additional \0 byte to the argument list, and terminates each argument with \0 in the same way the --print0 directive of GNU find(1) does. An v1 audiod interprets the leading NUL as an empty command line and closes the connection without sending any data. This can never happen with a v2 audiod because that always sends an empty sideband package to indicate success/failure. So the v2 code of audioc.c retries with v1 in this case. Conversely, a v1 client never sends an empty string, so a leading \0 identifies a v2 client. Thus, the patched audiod only needs to check the first byte of the received buffer to select the right "protocol" version. The stat and grab subcommands need special treatment because these may stay active after the command handler returns. Thus, the command handler must not send an EXIT_SUCCESS sideband packet in this case. Moreover, the protocol version needs to be communicated with the status/grab client tasks. This is done by adding a flag to the existing flags bitmask of struct stat_client and struct grab_client. After v0.8.0 has been released, the compatibility code can be dropped.
* Remove E_RECVMSG and E_SENDMSG.Andre Noll2026-01-04
| | | | | | Both error codes have only one single user. The corresponding system calls return an error code in errno on failure, and it is generally preferred to pass through this error code rather than inventing a new one.
* error.h: Improve documentation.Andre Noll2025-10-08
| | | | | Show error codes and expand the documentation of the few inline functions of error.h.
* error.h: Remove some macros.Andre Noll2025-07-13
| | | | | | | | Each is only used once in the same file, and they are all rather obvious, so open-code them. The exception is ERRNO_TO_PARA_ERROR() which is used pervasively, so leave this macro unmodified.
* Kill OSL_ERRNO_TO_PARA_ERROR.Andre Noll2025-07-13
| | | | | The users outside of error.h may as well call osl(), which leaves only a single caller in error.h. Open-code the macro there and remove it.
* openssl: Use the EVP library for RSA private decryption.Andre Noll2024-05-17
| | | | | | This is the counterpart of the previous commit which converted the public RSA encryption. We employ the HAVE_OSSL_PARAM macro again to distinguish between the openssl-1 and openssl-3 cases.
* openssl: Introduce openssl_perror().Andre Noll2024-05-17
| | | | | | | | | | | Openssl has a decent error reporting framework, but we only employ it if get_random_bytes_or_die() fails. This patch abstracts out a new helper which prints the error string of the earliest error code from the thread's error queue. We make the helper return -E_OPENSSL unconditionally as this simplifies callers a bit. Only get_random_bytes_or_die() calls the new helper for now but additional callers will be added in subsequent commits.
* Merge branch 'maint'Andre Noll2023-05-11
|\ | | | | | | | | | | | | | | | | | | Two fixes for gcc-12 warnings, and another fix for a benign but embarrassing braino in gcrypt.c. * maint: gcrypt: Fix return value of apc_get_pubkey(). error.h: Be more careful with error code masking. mp3_afh: Drop unused fields from struct mp3header.
| * error.h: Be more careful with error code masking.Andre Noll2023-05-09
| | | | | | | | | | | | | | | | | | | | | | | | It should never happen that two or more of the three special high bits (osl, lopsub, system) are set in an integer that stores a paraslash error value, but gcc-12 can't prove this and complains as follows: error.h:304:28: warning: array subscript 268435456 is above array bounds of 'const char * const[220]' [-Warray-bounds] 304 | return para_errlist[num]; | ~~~~~~~~~~~~^~~~~ Avoid this warning by always clearing all three special bits.
* | Consolidate EOF error codes.Andre Noll2023-03-11
| | | | | | | | | | | | Currently we have ~15 error codes which indicate an EOF condition. One should suffice, so drop all codes except the generic E_EOF and use that everywhere.
* | server: Improve error diagnostics of com_select().Andre Noll2023-03-11
| | | | | | | | | | | | | | | | | | | | The attempt to select a non-existing mood or playlist currently results in remote: key not found in rbtree This is a bit cryptic, so be a bit more user-friendy and provide a paraslash error code for this case.
* | Merge topic branch t/afs-cleanups into masterAndre Noll2022-11-20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A fair number of patches which clean up all parts of the audio file selector. The most visible change is probably that error messages from afs callbacks are sent with a proper sideband designator so that they are written to stderr on the client side. * refs/heads/t/afs-cleanups: (30 commits) Introduce afs_error(). afs.c: Move com_select() and its callback down. Rename mood_switch(), mood_close(), playlist_{open/close}. Assume that score_open() and score_clear() always succeed. playlist.c: Rename playlist_info -> playlist_instance. mood.c: Rename struct mood to mood_instance. afs.c: Rename ->handler of struct callback_query to ->cb. Simplify and improve activate_mood_or_playlist(). afs: Replace ->init of afs tables by table operations. Merge load_playlist() into playlist_open() and simplify. Simplify row_belongs_to_score_table(). Remove mood.h. Clean up and rename change_current_mood(). mood.c: Simplify and rename load_mood(). mood.c: Move struct statistics into struct mood. afs.c: Improve activate_mood_or_playlist(). Improve playlist_open(). blob.c: Don't initialize table pointer in table->init(). blob: Constify name argument of blob_get_def_by_name(). Rename admissible_file_loop() -> score_loop(). ...
| * | Merge load_playlist() into playlist_open() and simplify.Andre Noll2022-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are reasonably small. Remove the weird calling convention with the PLAYLIST_LOADED error code and the pointless check for the dummy row because they only obfuscate the code. Moreover, the comment of load_playlist() is actively misleading because this function is not a loop callback. Extend the documentation of the combined public playlist_open() while at it. The code can be simplified by calling pl_get_def_by_name() rather than osl_get_row() followed by pl_get_name_and_def_by_row().
| * | Remove E_NO_MOOD,Andre Noll2022-10-17
| | | | | | | | | | | | row_is_admissible() is never called with a NULL mood pointer.
* | | Exclude status items and error list from doxygen.Andre Noll2022-11-08
|/ / | | | | | | | | These lists are rather long and make the doxygen source code documentation harder to read without providing a real benefit.
* | Open-code find_arg().Andre Noll2022-10-03
| | | | | | | | | | There is only one caller in client_common.c, so open-code the logic there and get rid of the public function and the unused error code.
* | Remove unused error code MOOD_SYNTAX.Andre Noll2022-09-25
| | | | | | | | | | | | The error code became unused when version 1 moods were removed. Fixes: 184ea897a9b446611a9d02315160b6d77c0926fe
* | Merge branch 'refs/heads/t/ll'Andre Noll2022-09-18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two little cleanups related to the logging facility and two commits which add the ll command to para_server and para_audiod. The merge resulted in a conflict in afs.c due to the earlier merge of the poll topic branch which replaced all calls to select() by calls to poll(). The implementation of the ll server command introduced a new caller of select(), afs_select(), which needs to be replaced by afs_poll() to resolve the conflict. * refs/heads/t/ll: New server command: ll to change the log level at runtime. New audiod command: ll to change the log level at runtime. daemon: Kill get_loglevel_by_name(). server/audiod: Don't parse loglevel argument unnecessarily.
| * | daemon: Kill get_loglevel_by_name().Andre Noll2022-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Open-code the logic in daemon_set_log_color_or_die() and get the values from the new SEVERTIES macro rather than duplicating the severity list in get_loglevel_by_name(). The SEVERTIES macro will turn out to be handy for the ll subcommands of para_server and para_audiod which are introduced in subsequent commits.
* | | mp4: Remove E_MP4_BAD_CHANNEL_COUNT.Andre Noll2022-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the mp4 file does not contain an m4a atom, the channel count stays at zero and open_file() returns -E_MP4_TRACK in this case. So the check in aac_afh.c for a non-positive return value from mp4_get_channel_count() can never trigger. Replace the check by an assertion and remove the error code. Also, let mp4_get_channel_count() return uint16_t as the number of channels is stored as an unsigned 16 bit number in the mp4 file.
* | | mp4: Provide proper error codes for all errors.Andre Noll2022-06-06
| | | | | | | | | | | | | | | | | | This changes the few remaining places where we return -1 to indicate failure by proper error codes which can be turned into a meaningful error message.
* | | mp4: Implement error checking for the write path.Andre Noll2022-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the ->write callback has a return value, it is of unsigned type and is never checked. Fix this by changing the prototype to match that of the write(2) system call, check the return value of the callback in the write_data() wrapper of mp4.c and propagate paraslash error codes back to aac_afh.c via the public mp4_meta_update(). While at it, handle short writes and EINTR properly, and fix the indentation of the callback structure in mp4.h.
* | | mp4: Assume udta, meta and ilst are always present.Andre Noll2022-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Under normal circumstances these atoms exist or can at least be created by other means (e.g., by running mp4tags -a foo bar.m4a). This patch makes mp4_open_meta() fail early if at least one of the three atoms is missing. This allows to remove the (never tested hence probably buggy) code which creates these atoms.
* | | mp4: Introduce mp4_get_meta().Andre Noll2022-05-30
| | | | | | | | | | | | | | | Simplify the API by returning a pointer to the metadata structure stored inside struct mp4. This is easier than having two accessor functions.
* | | mp4: Replace mp4ff prefix by mp4.Andre Noll2022-05-30
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The additional "ff" does not convey any useful information. This patch was produced by running sed -i 's/mp4ff/mp4/g' mp4.c mp4.h aac_afh.c followed by sed -i 's/MP4FF/MP4/g' aac_afh.c error.h and the manual removal of the "ff" suffix in the error strings.
* | Remove E_PERM.Andre Noll2022-05-18
| | | | | | | | There is only one user which may as well use the standard error code.
* | com_ls(): Drop "audio file table syntax error" messsage.Andre Noll2022-03-13
| | | | | | | | | | | | This error message is printed if ls is called with an invalid argument for the listing mode or sort order. That's not a syntax error, so use the standard EINVAL error code instead.
* | error.h: Document the error code enumeration.Andre Noll2021-11-20
| | | | | | | | Doxygen complains about the missing comment.
* | Remove unused error code E_OGG_STREAM_FLUSH.Andre Noll2021-11-07
|/ | | | | | The last user was removed four years ago. Fixes: c8466194a4842e319abdedfb38ddc93630e25471
* Merge branch 'refs/heads/t/para_play'Andre Noll2020-05-16
|\ | | | | | | | | | | | | | | | | | | A single patch which adds --end-of-playlist to control the behaviour of para_play when the end of the playlist is reached. Cooking for three weeks. * refs/heads/t/para_play: play: New option: --end-of-playlist.
| * play: New option: --end-of-playlist.Andre Noll2019-05-18
| | | | | | | | | | | | | | | | If the end of the playlist is reached, para_play starts over with the first file of the playlist. This commit provides the --end-of-playlist option to control the behaviour. The new option has three pre-defined values: stop, loop, quit with "loop" being the default. Since lopsub features multi-valued options, the implementation is pretty simple.
* | Merge branch 'refs/heads/t/ssh'Andre Noll2019-11-23
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A medium sized series which teaches both crypto backends about the RFC4716 key format, which has become the default for ssh-keygen as of openssh-7.8. Was cooking for almost a year. * refs/heads/t/ssh: manual: Instruct the user to create RFC4716 keys. openssl: Add support for RFC4716 keys openssl: Move get_private_key() down. gcrypt: Add support for RFC4716 private keys. crypt: Rename decoding functions. gcrypt: Introduce read_openssh_bignum(). gcrypt: Factor out read_pem_rsa_params(). gcrypt: Let read_bignum() return bits, not bytes. gcrypt: Let decode_key() return blob size through additional argument. gcrypt: Drop unnecessary arguments of decode_key().
| * | gcrypt: Add support for RFC4716 private keys.Andre Noll2018-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches the gcrypt backend to parse private keys generated with ssh-keygen -m RFC4716. Support for the openssl backend will be implemented in a subsequent patch. The new find_openssh_bignum_offset() is independent of the gcrypt API. We put this function into crypt_common.c rather then into gcrypt.c so that openssh.c can also use it.
* | | error.h: Document LLS_ERROR_BIT.Andre Noll2019-10-12
| |/ |/| | | | | | | Also reformat the similar comment of OSL_ERROR_BIT to make it fit into a single line.
* | error.h: Clarify difference between para_errlist[] and DEFINE_PARA_ERRLIST.Andre Noll2018-12-25
|/
* ao: Get rid of E_AO_BAD_SAMPLE_FORMAT.Andre Noll2018-09-30
| | | | | This error code is pointless as the generic E_BAD_SAMPLE_FORMAT is just fine here.