poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4] libpoke,poke,testsuite: Make error handling of public API


From: Jose E. Marchesi
Subject: Re: [PATCH v4] libpoke,poke,testsuite: Make error handling of public API consistent
Date: Wed, 18 Nov 2020 09:21:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

[Sorry for the delay on reviewing this.]

Hi Mohammad.

> diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
> index 96ea0da4..3a70544c 100644
> --- a/libpoke/libpoke.h
> +++ b/libpoke/libpoke.h
> @@ -38,6 +38,13 @@ typedef uint64_t pk_val;
>  #define PK_OK 0
>  #define PK_ERROR 1
>  
> +/* The following status codes (along with the above status codes) are
> +   returned by pk_errno function.  */
> +
> +#define PK_ENOMEM 2
> +#define PK_EEOF 3
> +#define PK_EINVAL 4

PK_OK and PK_ERROR can also be returned by pk_errno functions.  I would
put them all together.

>  /* Terminal output callbacks.  */
>  
>  struct pk_term_if
> @@ -90,13 +97,22 @@ pk_compiler pk_compiler_new (const char *rtpath,
>  
>  void pk_compiler_free (pk_compiler pkc) LIBPOKE_API;
>  
> +/* Error code of last operation.
> +
> +   This function returns the status corresponding to the given PK
> +   compiler.  This status is updated by the last call performed in
> +   the API, and is one of the PK_* status codes defined above.
> +   If PKC is NULL returns PK_ERROR.  */

"updated by every call performed..."

Other than that, this is OK for master.
Thank you! :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]