From cdb4eb396109e1659bfbb1c289279f41dd60f0b0 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 1 Feb 2022 11:50:37 -0500 Subject: Rename xas_riff_file_open() to _new() --- examples/test.c | 14 +++++++------- include/xas/riff.h | 10 +++++----- src/riff.c | 34 +++++++++++++++++----------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/examples/test.c b/examples/test.c index 2579952..ec70a8e 100644 --- a/examples/test.c +++ b/examples/test.c @@ -81,12 +81,12 @@ int main(int argc, char **argv) { usage(argc, argv, "No output file provided"); } - if ((wave = xas_riff_file_open(argv[1], - XAS_AUDIO_STREAM_PCM_16_BIT, - sample_rate, - XAS_AUDIO_STREAM_STEREO, - O_WRONLY | O_CREAT | O_TRUNC)) == NULL) { - goto error_riff_file_open; + if ((wave = xas_riff_file_new(argv[1], + XAS_AUDIO_STREAM_PCM_16_BIT, + sample_rate, + XAS_AUDIO_STREAM_STEREO, + O_WRONLY | O_CREAT | O_TRUNC)) == NULL) { + goto error_riff_file_new; } if ((synth_l = xas_synth_new(XAS_AUDIO_STREAM_PCM_16_BIT, @@ -160,6 +160,6 @@ error_synth_new_r: error_synth_new_l: xas_audio_stream_destroy(wave); -error_riff_file_open: +error_riff_file_new: return EX_OSERR; } diff --git a/include/xas/riff.h b/include/xas/riff.h index 4e600da..693aa9a 100644 --- a/include/xas/riff.h +++ b/include/xas/riff.h @@ -44,10 +44,10 @@ typedef struct _xas_riff xas_riff; #pragma pack(pop) -xas_audio_stream *xas_riff_file_open(const char *path, - size_t sample_size, - size_t sample_rate, - size_t channels, - int flags); +xas_audio_stream *xas_riff_file_new(const char *path, + size_t sample_size, + size_t sample_rate, + size_t channels, + int flags); #endif /* _XAS_RIFF_H */ diff --git a/src/riff.c b/src/riff.c index 40aae18..fc4e4c3 100644 --- a/src/riff.c +++ b/src/riff.c @@ -66,11 +66,11 @@ error_io: return -1; } -static xas_riff *file_open(const char *path, - size_t sample_size, - size_t sample_rate, - size_t channels, - int flags) { +static xas_riff *file_new(const char *path, + size_t sample_size, + size_t sample_rate, + size_t channels, + int flags) { xas_riff *riff; if ((riff = malloc(sizeof(*riff))) == NULL) { @@ -165,20 +165,20 @@ error_read: return -1; } -xas_audio_stream *xas_riff_file_open(const char *path, - size_t sample_size, - size_t sample_rate, - size_t channels, - int flags) { +xas_audio_stream *xas_riff_file_new(const char *path, + size_t sample_size, + size_t sample_rate, + size_t channels, + int flags) { xas_audio_stream *stream; xas_riff *riff; - if ((riff = file_open(path, - sample_size, - sample_rate, - channels, - flags)) == NULL) { - goto error_file_open; + if ((riff = file_new(path, + sample_size, + sample_rate, + channels, + flags)) == NULL) { + goto error_file_new; } if (flags & (O_RDWR | O_WRONLY)) { @@ -208,6 +208,6 @@ xas_audio_stream *xas_riff_file_open(const char *path, error_audio_stream_new_sink: file_close(riff, NULL); -error_file_open: +error_file_new: return NULL; } -- cgit v1.2.3