[vlc-devel] Announce: brand new python bindings (ctypes-based)
olivier.aubert at liris.cnrs.fr
Fri Jul 31 13:38:16 CEST 2009
> Currently, we do not use error codes. The exception structure supports it,
> but there are no "users". I am not confident that we come up with a
> meaningful and stable error code set anyway. Really error codes make sense
> if and only if the application may be able to handle different errors from
> the same function differently; otherwise an error message is sufficient.
> Considering the current state, I have no reason to believe that this would
> be the case.
Alright, forget about the error code. The only thing that actually
interests me here is the error message, for reporting and debugging.
Global variables are not good either (I am not thinking only for error
code specification, but also simply for error signalling), for they
would need to be reset before each invocation to clear their state.
jpd's proposal (imposing passing values as pointer for functions
returning values which can generate errors) seems a good compromise. The
compromise "for all functions that cannot return with an error" is
however not that easy to sort out. How can you be sure that a function
cannot return with an error? And anyway, if this was adopted, it would
be necessary (from the bindings generation POV) to clearly indicate in
prototypes the behaviour.
More information about the vlc-devel