home *** CD-ROM | disk | FTP | other *** search
-
- The HASWIN window library.
- ===========================
- Copyright H.A. Shaw 1990.
- ===========================
-
- Error handling under the HASWIN system.
- ---------------------------------------
- A basic error display system is provided. This is basically so that
- HASWIN can report its errors correctly to the user. I have tried, and
- failed, to provide proper error trapping of low level errors such as hardware
- errors. This awaits future releases.
-
- int haswin_hourglass(int onoff);
- - This routine turns the hourglass on and off. It uses the stack
- and displays a simple hourglass without LEDS or %ages. It is used
- by HASWIN at times. If "onoff" is HASWIN_TRUE the hourglass is
- turned on, and if HASWIN_FALSE it is turned off.
-
- int haswin_initerrorhandlers();
- - This initialises the error handler code. At present it does
- nothing except set one of HASWIN's internal flags. It is called
- by "haswin_initialise()" and therefore the user should not need to
- call it directly.
-
- void haswin_errorbox(char *err);
- - This routine calls the WIMP swi Wimp_ErrorBox to display the string
- "err" in an error box. An OK icon is provided and the window title
- is "Error from <taskname>".
-
- void haswin_internalerror(char *err);
- - This is the main way HASWIN reports errors to the screen. If the
- global HASWIN flag HASWIN_FLAGS_VERBOSE is set then the string
- "err" is displayed using "haswin_errorbox()". If it is clear the
- routine returns winthout doing anything.
-
- int haswin_errorprintf(char *fmt, ...);
- - This routine is a printf-like interface to haswin_errorbox().
- "fmt" is the printf-like format string and the other arguments
- follow. vsprintf() is used to process the format string, and the
- result passed to haswin_errorbox(). A maximum length of 1000
- characters may be passed to haswin_errorbox().
- - Returns the number of characters processed by the vsprintf() call
- and passed to haswin_errorbox(), or 0 on any error.
-
- int haswin_interrorprintf(char *fmt, ...);
- - This routine is a printf-like interface to haswin_internalerror().
- "fmt" is the printf-like format string and the other arguments
- follow. vsprintf() is used to process the format string, and the
- result passed to haswin_internalerror(). A maximum length of 1000
- characters may be passed to haswin_internalerror().
- - Returns the number of characters processed by the vsprintf() call
- and passed to haswin_internalerror(), or 0 on any error.
-
- int haswin_ok_cancel(char *err);
- #define HASWIN_OK 1
- #define HASWIN_CANCEL 2
- - This routine calls the WIMP swi Wimp_ErrorBox to display the string
- "err" in an error box. Both OK and Cancel icons are provided and
- the window title is "Error from <taskname>".
- - returns either HASWIN_OK or HASWIN_CANCEL depending upon which
- icon was clicked, or HASWIN_FALSE on any error.
-
- int haswin_ok_cancelprintf(char *fmt, ...);
- - This routine provides a printf-like interface to haswin_ok_cancel()
- "fmt" is the printf-like format string and the other arguments
- follow. vsprintf() is used to process the format string, and the
- result passed to haswin_internalerror(). A maximum length of 1000
- characters may be passed to haswin_internalerror().
- - returns either HASWIN_OK or HASWIN_CANCEL depending upon which
- icon was clicked, or HASWIN_FALSE on any error.
-
- void haswin_restoreerrorhandlers();
- - This routine returns the error handlers to their default state. It
- is called by the routine "haswin_exit()" and therefore should never
- need to be used by the user. At present it actually does nothing.
-
- int haswin_setexittrap(int (*usercode)(int code));
- - This routine sets a user routine "usercode" to be called upon a
- call to "haswin_exit()". When called it is passed the exit code.
- It may clear up in any way required, but when it returns HASWIN
- will exit. If "usercode" is 0 then any existing exit routine is
- removed.
-
-