home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / exec / alert.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  2.2 KB  |  99 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: alert.c,v 1.8 1996/11/08 11:27:54 aros Exp $
  4.     $Log: alert.c,v $
  5.     Revision 1.8  1996/11/08 11:27:54  aros
  6.     All OS function use now Amiga types
  7.  
  8.     Moved intuition-driver protos to intuition_intern.h
  9.  
  10.     Revision 1.7  1996/10/24 15:50:43  aros
  11.     Use the official AROS macros over the __AROS versions.
  12.  
  13.     Revision 1.6  1996/10/23 14:24:23  aros
  14.     Make sure the Alert is shown to the user
  15.  
  16.     Revision 1.5  1996/08/16 14:04:40  digulla
  17.     Show more infos about the task
  18.  
  19.     Revision 1.4  1996/08/13 13:55:57  digulla
  20.     Replaced AROS_LA by AROS_LHA
  21.     Replaced some AROS_LH*I by AROS_LH*
  22.     Sorted and added includes
  23.  
  24.     Revision 1.3  1996/08/01 17:41:04  digulla
  25.     Added standard header for all files
  26.  
  27.     Desc:
  28.     Lang:
  29. */
  30. #include <exec/execbase.h>
  31. #include <aros/libcall.h>
  32. #include <stdio.h>
  33. #include <stdlib.h>
  34.  
  35. /*****************************************************************************
  36.  
  37.     NAME */
  38.     #include <exec/alerts.h>
  39.     #include <clib/exec_protos.h>
  40.  
  41.     AROS_LH1(void, Alert,
  42.  
  43. /*  SYNOPSIS */
  44.     AROS_LHA(ULONG, alertNum, D7),
  45.  
  46. /*  LOCATION */
  47.     struct ExecBase *, SysBase, 18, Exec)
  48.  
  49. /*  FUNCTION
  50.     Alerts the user of a serious system problem.
  51.  
  52.     INPUTS
  53.     alertNum - This is a number which contains information about
  54.         the reason for the call.
  55.  
  56.     RESULT
  57.     This routine may return, if the alert is not a dead-end one.
  58.  
  59.     NOTES
  60.     You should not call this routine because it halts the machine,
  61.     displays the message and then may reboot it.
  62.  
  63.     EXAMPLE
  64.     // Dead-End alert: 680x0 Access To Odd Address
  65.     Alert (0x80000003);
  66.  
  67.     BUGS
  68.  
  69.     SEE ALSO
  70.  
  71.     INTERNALS
  72.  
  73.     HISTORY
  74.     26-08-95    digulla created after EXEC-Routine
  75.  
  76. ******************************************************************************/
  77. {
  78.     AROS_LIBFUNC_INIT
  79.     struct Task * task;
  80.  
  81.     task = FindTask (NULL);
  82.  
  83.     /* since this is an emulation, we just show the bug in the console */
  84.     fprintf (stderr
  85.     , "GURU Meditation %04lx %04lx %s\nTask: %p (%s)\n"
  86.     , alertNum >> 16
  87.     , alertNum & 0xFFFF
  88.     , (alertNum & 0x80000000) ? "(DEADEND)" : ""
  89.     , task, task->tc_Node.ln_Name
  90.     );
  91.     fflush (stderr);
  92.  
  93.     if (alertNum & AT_DeadEnd)
  94.     exit (20);
  95.  
  96.     AROS_LIBFUNC_EXIT
  97. } /* Alert */
  98.  
  99.