[PATCH] simple: Improve pa_simple_read() documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> There was a question in IRC about whether pa_simple_read() blocks or
> not. It's already documented on the simple API overview page, but it's
> good to say it also in the function reference. As a bonus, I added
> some words about the error handling as well.

pa_simple_new() already has a better description of error handling:

(i) "a pointer where the error code is stored" is clearer than "stored in 
it"

(ii) no uncertainty whether a code is stored if the function 
returns success and error != NULL

regards, p.

> ---
>  src/pulse/simple.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/pulse/simple.h b/src/pulse/simple.h
> index 0fab8ee..4a8162b 100644
> --- a/src/pulse/simple.h
> +++ b/src/pulse/simple.h
> @@ -137,7 +137,10 @@ int pa_simple_write(pa_simple *s, const void *data, size_t bytes, int *error);
>  /** Wait until all data already written is played by the daemon. */
>  int pa_simple_drain(pa_simple *s, int *error);
>  
> -/** Read some data from the server. */
> +/** Read some data from the server. This function blocks until \a bytes amount
> + * of data has been received from the server, or until an error occurs.
> + * Returns a negative value on failure. If \a error is non-NULL, the error code
> + * is stored in it. */
>  int pa_simple_read(pa_simple *s, void *data, size_t bytes, int *error);
>  
>  /** Return the playback latency. */
> 

-- 

Peter Meerwald
+43-664-2444418 (mobile)


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux