home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / SourceCode / Classes / AppExceptions / AppExceptions.h next >
Text File  |  1992-07-09  |  1KB  |  43 lines

  1. /* AppExceptions
  2.  *
  3.  * A category of Application that provides methods for mapping
  4.  * ASCII names to integers for use in NeXTSTEP exception handling.
  5.  *
  6.  * Copyright 1991, 1992 Scott Hess.  This source code may be
  7.  * redistributed and modified without restriction.  Well, one
  8.  * restriction - do not claim that you wrote it.
  9.  *
  10.  * Scott Hess
  11.  * 12901 Upton Avenue South, #326
  12.  * Burnsville, MN  55337
  13.  * (612) 895-1208
  14.  * scott@gac.edu
  15.  * shess@ssesco.com
  16.  */
  17. #import <appkit/Application.h>
  18.  
  19. @interface Application (AppExceptions)
  20. /* I store this category in an ar(1) library of code shared between
  21.  * a number of applications.  Unfortunately, categories generate no
  22.  * symbols that allow them to be pulled from the library on link.  I
  23.  * put "appExceptionsReference=0;" somewhere else in the app just to
  24.  * reference the object module and make certain it's in the app.  Most
  25.  * people can simply ignore this ...
  26.  */
  27. extern int appExceptionsReference;
  28.  
  29. /* Return a unique integer for the named exception, between
  30.  * NX_APPBASE and NX_APPBASE+999.
  31.  */
  32. -(int)exceptionFor:(const char *)name;
  33. /* Return the name for exception.  Return NULL if no mapping.
  34.  */
  35. -(const char *)nameForException:(int)exception;
  36.  
  37. /* Raise the named exception. */
  38. - raiseException:(const char *)name with:(const void *)data1 with:(const void *)data2;
  39. - raiseException:(const char *)name with:(const void *)data1;
  40. - raiseException:(const char *)name;
  41. @end
  42.  
  43.