[Plib-devel] error message routines
Brought to you by:
sjbaker
From: Dave M. <Dav...@dy...> - 2000-04-05 16:25:06
|
Here is the revised spec based on Steve's comments: ---- enum xxxSeverity { XXX_DEBUG, // Messages that can safely be ignored. XXX_WARNING, // Messages that are important. XXX_FATAL, // Errors that we cannot recover from. } ; void xxxInit ( void ) ; //for now, just calls xxxClearError() void xxxSetError ( int severity, const char *fmt, ... ) ; char* xxxGetError ( void ) ; void xxxClearError ( void ) ; typedef void (*xxxErrorCallback)( char* ) ; xxxErrorCallback xxxGetErrorCallback ( void ) ; void xxxSetErrorCallback ( xxxErrorCallback cb ) ; ----- The default error callback will print the message to stderr. if ( severity == XXX_FATAL ) should the default callback exit(1) the app? This will be something general to all of PLIB - including PUI, SL, etc. As a general library, the application might like to handle it's own errors the same way. What should the new library be called (xxx)? Could we later add some endian support code, a plib version string, and a couple basic types? If so, a more general name than err would be appropriate. How about... ul - utility library Note: This adds a dependency to all the other PLIB libraries. Should I proceed? -- Dave McClurg |