/* NO SMOKING ALERT  - by T. Kermanidis */

/* this program will display a recoverable GURU with an appropriate message */

#include <exec/types.h>
#include <intuition/intuition.h>

/* intuition bits */

#define IBASE  31
struct IntuitionBase *IntuitionBase = NULL;

/* alert message */

#define MESSAGE_HEIGHT 63

UBYTE NoSmokingMessage[] =
   "\x00\x6C\x14The GURU advises that smoking is bad for your health.\x00\xFF\x01\x16\x22so please,\x00\xFF\x01\x14\x30No Smoking!\x00";

/* If you want to customize your message then you must change the text in
   the above string.

   The necessary format of the string for the ALERT routines to properly
   display your message is as follows,

   xxxx yy <text....> zz cc     -- format of alert text string

   the meaning of the of the above characters in the format are explained as
   follows, (note: each character x,y,z,c represents 4 bits of data, a
   hexadecimal digit.)

   xxxx  -  a 16 bit number representing the x position of the start of
            the message.
   yy    -  an 8 bit number representing the y position of the message.

   <text...>  this just means the text of the message

   zz    -  must be set to zero always. i.e. \0

   cc    -  continuation byte, if zero ...... no more text messages
                               if non zero .. more text to follow.

   Note when the format is done as in this program the end (continuation
   byte) is missing. This is because C automatically make strings null
   terminated. */



/* display a recoverable alert */

VOID NoSmoking()
  {
   (VOID )DisplayAlert (RECOVERY_ALERT,NoSmokingMessage,MESSAGE_HEIGHT);
  }

/* main entry point */

main()
  {
   if ((IntuitionBase = (struct IntuitionBase *)
        OpenLibrary("intuition.library",IBASE)) != NULL)
     {
      NoSmoking();
      CloseLibrary (IntuitionBase);
     }
  }
