home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 1 / FFMCD01.bin / useful / dist / other / amicdrom / intui.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-27  |  1.1 KB  |  57 lines

  1. /* intui.c:
  2.  *
  3.  * System requester stuff.
  4.  *
  5.  * ----------------------------------------------------------------------
  6.  * This code is (C) Copyright 1993 by Frank Munkert.
  7.  * All rights reserved.
  8.  * This software may be freely distributed and redistributed for
  9.  * non-commercial purposes, provided this notice is included.
  10.  */
  11.  
  12. #include <stdarg.h>
  13. #include <stdio.h>
  14.  
  15. #include <exec/types.h>
  16. #include <intuition/intuition.h>
  17.  
  18. #include <clib/exec_protos.h>
  19. #include <clib/intuition_protos.h>
  20.  
  21. #include "intui.h"
  22.  
  23. struct Library *IntuitionBase;
  24.  
  25. void Init_Intui (void)
  26. {
  27.   IntuitionBase = OpenLibrary ((UBYTE *) "intuition.library", 36);
  28. }
  29.  
  30. void Close_Intui (void)
  31. {
  32.   if (IntuitionBase)
  33.     CloseLibrary (IntuitionBase);
  34. }
  35.  
  36. void Display_Error (char *p_message, ...)
  37. {
  38.   va_list arg;
  39.   char buf[1000];
  40.  
  41.   static struct EasyStruct req = {
  42.     sizeof (struct EasyStruct),
  43.     0,
  44.     (UBYTE *) "CDROM Handler Error",
  45.     NULL,
  46.     (UBYTE *) "Abort"
  47.   };
  48.   
  49.   va_start (arg, p_message);
  50.   vsprintf (buf, p_message, arg);
  51.   if (IntuitionBase) {
  52.     req.es_TextFormat = (UBYTE *) buf;
  53.     EasyRequest (NULL, &req, NULL, NULL);
  54.   }
  55.   va_end (p_message);
  56. }
  57.