next up previous
Next: Busy Callback Up: Callback Functions Previous: Intro


Message Callback

For portability reasons, the library does not assume the availability of a terminal, so it does not initially know where to print messages to. The library generates some messages about its progress as well as more serious warnings and errors. An application should provide a message callback that displays them. The function might also choose to ignore informative messages and only display the fatal ones.

A Message Callback takes three parameters. The first one is the opaque data pointer of type void*. The second one is a text message of more or less arbitrary length without line breaks. The last parameter is an indicator of the seriousness of this message. A string representation of the warning level is also prefixed to the message.

UUMSG_MESSAGE
This is just a plain informative message, nothing important. The application can choose to simply ignore the message. If a log file is available, it should be logged, but the message should never result in a modal dialogue.
UUMSG_NOTE
``Note:'' Still an informative message, meaning that the library made a decision on its own that might interest the user. One example for a note is that the setuid bit has been stripped from a file mode for security reasons. Notes are nothing serious and may still be ignored.
UUMSG_WARNING
``Warning:'' A warning indicates that a non-serious problem occurred which did not stop the library from proceeding with the current action. One example is a temporary file that could not be removed. Warnings should be displayed, but an application may decide to continue even without user intervention.
UUMSG_ERROR
``ERROR:'' A problem occurred that caused termination of the current request, for example if the library tried to access a non-existing file. After an error has occurred, the application should closely examine the resulting return code of the operation. Error messages are usually printed in modal dialogues; another option is to save the error message string somewhere and later print the error message after the application has examined the operation's return value.
UUMSG_FATAL
``Fatal Error:'' This would indicate that a serious problem has occurred that prevents the library from processing any more requests. Currently unused.
UUMSG_PANIC
``Panic:'' Such a message would indicate a panic condition, meaning the application should terminate without further clean-up handling. Unused so far.3


next up previous
Next: Busy Callback Up: Callback Functions Previous: Intro
Debian/Alpha Build Daemon 2002-04-14