extern "C" {
# endif
+#include <stdarg.h>
#include <vlc/libvlc_structures.h>
/*****************************************************************************
libvlc_exception_raised( const libvlc_exception_t *p_exception );
/**
- * Raise an exception using a user-provided message.
+ * Raise an exception.
*
* \param p_exception the exception to raise
- * \param psz_format the exception message format string
- * \param ... the format string arguments
*/
VLC_PUBLIC_API void
-libvlc_exception_raise( libvlc_exception_t *p_exception,
- const char *psz_format, ... );
+libvlc_exception_raise( libvlc_exception_t *p_exception );
/**
* Clear an exception object so it can be reused.
*/
VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
+/**@} */
+
+/*****************************************************************************
+ * Error handling
+ *****************************************************************************/
+/** \defgroup libvlc_error libvlc_error
+ * \ingroup libvlc_core
+ * LibVLC error handling
+ * @{
+ */
+
/**
- * Get an exception's message.
+ * A human-readable error message for the last LibVLC error in the calling
+ * thread. The resulting string is valid until another error occurs (at least
+ * until the next LibVLC call).
*
- * \param p_exception the exception to query
- * \return the exception message or NULL if not applicable (exception not
- * raised, for example)
+ * @warning
+ * This will be NULL if there was no error.
*/
-VLC_PUBLIC_API const char *
-libvlc_exception_get_message( const libvlc_exception_t *p_exception );
+VLC_PUBLIC_API const char *libvlc_errmsg (void);
+
+/**
+ * Clears the LibVLC error status for the current thread. This is optional.
+ * By default, the error status is automatically overriden when a new error
+ * occurs, and destroyed when the thread exits.
+ */
+VLC_PUBLIC_API void libvlc_clearerr (void);
+
+/**
+ * Sets the LibVLC error status and message for the current thread.
+ * Any previous error is overriden.
+ * @return a nul terminated string in any case
+ */
+const char *libvlc_vprinterr (const char *fmt, va_list ap);
+
+/**
+ * Sets the LibVLC error status and message for the current thread.
+ * Any previous error is overriden.
+ * @return a nul terminated string in any case
+ */
+const char *libvlc_printerr (const char *fmt, ...);
/**@} */
+
/*****************************************************************************
* Core handling
*****************************************************************************/
*
* \param p_instance the instance
* \param name interface name, or NULL for default
- * \param p_exception an initialized exception pointer
* \return 0 on success, -1 on error.
*/
VLC_PUBLIC_API
-int libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
- libvlc_exception_t *p_exception );
+int libvlc_add_intf( libvlc_instance_t *p_instance, const char *name );
/**
* Waits until an interface causes the instance to exit.
* Frees an heap allocation (char *) returned by a LibVLC API.
* If you know you're using the same underlying C run-time as the LibVLC
* implementation, then you can call ANSI C free() directly instead.
+ *
+ * \param ptr the pointer
*/
VLC_PUBLIC_API void libvlc_free( void *ptr );
* Returns the number of messages in a log instance.
*
* \param p_log libvlc log instance or NULL
- * \param p_e an initialized exception pointer
* \return number of log messages, 0 if p_log is NULL
*/
VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *p_log );
# endif
#endif /* <vlc/libvlc.h> */
+
+/** @} */