home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 122.lha / Arp_v1.1 / Demos / nostartup.c < prev    next >
C/C++ Source or Header  |  1986-11-20  |  1KB  |  55 lines

  1. /* nostartup.c -- Example of how to use ARP without using the supplied
  2.  *          startup code.
  3.  *
  4.  * Note the way we pick up IntuitionBase and GfxBase for free.
  5.  *
  6.  * Copyright (c) 1987, Scott Ballantyne
  7.  * use and abuse as you please.
  8.  *
  9.  * Manx:
  10.  * cc nostartup.c
  11.  * ln nostartup.o -la -lc    ; to link with a.lib
  12.  *
  13.  * Lattice:
  14.  * lc nostartup.c
  15.  * blink lib:c.o nostartup.o to nostartup lib lib:a.lib lib:lc.lib lib:amiga.lib
  16.  *
  17.  * -+=SDB+=-
  18.  */
  19.  
  20. #include <exec/types.h>
  21. #include <libraries/arpbase.h>
  22. #include <arpfunctions.h>
  23.  
  24. struct ArpBase *OpenLibrary();
  25. struct ArpBase *ArpBase;    /* Declare our library base variable */
  26.  
  27. /* We can get intuition and graphics almost for free */
  28. /* You don't need to do this, of course. */
  29.  
  30. struct Library *IntuitionBase, *GfxBase;
  31.  
  32. /* Example of how to open ARP */
  33.  
  34. VOID main()
  35. {
  36.     char    buffer[MaxInputBuf];
  37.  
  38.     if (!(ArpBase = OpenLibrary(ArpName, ArpVersion)) )
  39.         exit(20);
  40.     /* Opened arp!, now get intuitionbase and graphics */
  41.     GfxBase = ArpBase->GfxBase;
  42.     IntuitionBase = ArpBase->IntuiBase;
  43.  
  44.     Printf("Type something: ");
  45.     ReadLine(buffer);
  46.     Printf("You typed \"%s\"\n", buffer);
  47.  
  48.     /* This is the recommended sequence for exiting when using arp
  49.      * from 'C'.  It is better not to use ArpExit().
  50.      */
  51.     CloseLibrary(ArpBase);
  52.     exit(0);    /* Or fall off end of world */
  53. }
  54.  
  55.