]> git.sesse.net Git - vlc/commit
Add facilities to report and enrich error messages.
authorClément Stenac <zorglub@videolan.org>
Fri, 22 Dec 2006 21:14:11 +0000 (21:14 +0000)
committerClément Stenac <zorglub@videolan.org>
Fri, 22 Dec 2006 21:14:11 +0000 (21:14 +0000)
commit65d2183365ccbd6321ecb8fcbf8bbf42362ca1ba
treed44d0bab232c4d954ffa74dbd74f493c918ffbcf
parent7e5c6ea5492fb3167fee4670c323601e06661c24
Add facilities to report and enrich error messages.

The idea is that a given error should be reported only once to the user.
At the moment, for example, we can get:
- "no suitable access module" (printed by module_Need)
 - "unable to create access" (printed by input/access)
 - "unable to open stream" (printed by input/input)
 - ...

The facilities provided here are:
* msg_StackSet( code, message ) : "throw" a new error
* msg_StackAdd( message ) : Append a message allowing to trace the message
* msg_StackMsg() : Retrieve the message

So, in the previous example, module_Need would msg_StackSet( code, "no
suitable access module"), then input/input would add "unable to create
access" and finally, input/input can print the "unable to open stream:
unable to create access: no suitable module" message.

The three functions are context-free, you don't need a vlc_object, so
that we can add verbose error reporting everywhere.
include/vlc_common.h
include/vlc_messages.h
include/vlc_threads.h
include/vlc_threads_funcs.h
src/input/access.c
src/input/input.c
src/misc/messages.c
src/misc/modules.c
src/misc/threads.c