home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / source / stub.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-24  |  2.1 KB  |  62 lines

  1. #include <exec/types.h>
  2. #include <intuition/intuition.h>
  3. #include <proto/exec.h>
  4. #include <proto/intuition.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7.  
  8. static struct IntuiText Text2 = {-1,-1, /* pen numbers */
  9.                              0,         /* draw mode */
  10.                              14,14,     /* starting offsets */
  11.                              NULL,      /* text attribute pointer */
  12.                              "** Undefined Stub Routine Called **",
  13.                              NULL };
  14.  
  15. static struct IntuiText BodyText = {-1,-1,      /* pen numbers */
  16.                              0,         /* draw mode */
  17.                              4,4,       /* starting offsets */
  18.                              NULL,      /* text attribute pointer */
  19.                              NULL,
  20.                              &Text2 };
  21.  
  22. static struct IntuiText ContinueText = {-1,-1,  /* pen numbers */
  23.                              0,         /* draw mode */
  24.                              4,4,       /* starting offsets */
  25.                              NULL,      /* text attribute pointer */
  26.                              "CONTINUE",
  27.                              NULL };
  28.  
  29. static struct IntuiText AbortText = {-1,-1,     /* pen numbers */
  30.                              0,         /* draw mode */
  31.                              4,4,       /* starting offsets */
  32.                              NULL,      /* text attribute pointer */
  33.                              "ABORT",
  34.                              NULL };
  35.  
  36. extern char *_ProgramName;
  37.  
  38. /**
  39. *
  40. * name          stub - default routine for undefined routines
  41. *
  42. * synopsis      stub();
  43. *
  44. * description   This function is the default routine resolved by Blink for routines
  45. *               not found in libraries.
  46. *
  47. **/
  48. int stub()
  49.    {
  50.    char temp[80];
  51.  
  52.    if (IntuitionBase == NULL)
  53.         IntuitionBase = (struct IntuitionBase *)
  54.                         OpenLibrary("intuition.library",0);
  55.    memcpy(temp, _ProgramName, (long) _ProgramName[-1]);
  56.    temp[(int) _ProgramName[-1]] = '\0';
  57.    BodyText.IText = temp;
  58.    if (AutoRequest(NULL,&BodyText,&ContinueText,&AbortText,0,0,320,60) != TRUE)
  59.       exit(1);
  60.    return(0);
  61. }
  62.