// --------------------------------------------------------------------------------------------------------------
//
//   AmiGnut 0.9.0 Error Module
//
//   Copyright (C) 2001 Jay Cornwall <jay@realfantasy.demon.co.uk>
//
//   This is free software distributed under the terms of the GNU Public License. See the file License.txt for
//   details.
//
// --------------------------------------------------------------------------------------------------------------

#include "Error.h"

// --------------------------------------------------------------------------------------------------------------

void ShowErrorMessage(char *errormsg, UBYTE msgtype)
{
    struct EasyStruct easystruct;

    // Display a given error message via different methods

    // Check the method we should use to display the message

    switch(msgtype)
    {
        case ERRORMSG_EASYREQ:

            // Display the error message with intuition.library/EasyRequest()

            // Fill in the EasyStruct

            easystruct.es_StructSize = sizeof(struct EasyStruct);
            easystruct.es_Flags = 0;
            easystruct.es_Title = "AmiGnut Error";
            easystruct.es_TextFormat = errormsg;
            easystruct.es_GadgetFormat = "OK";

            // Display the error message

            EasyRequest(NULL, &easystruct, NULL, NULL);

            break;

        case ERRORMSG_LOWMEM:

            // Display the error message with printf()

            printf("%s\n", errormsg);

            break;
    } /* switch */
} /* ShowErrorMessage() */

// --------------------------------------------------------------------------------------------------------------

// End Of Text
