home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff284.lzh / ARPTools / src / Treq.c < prev    next >
C/C++ Source or Header  |  1989-11-27  |  1KB  |  65 lines

  1. /*
  2.           Treq - Enable/disable AmigaDOS requesters.
  3.  
  4.           Original effort by Fabio Rossetti.
  5.  
  6.       (c) 1989 by Fabio Rossetti
  7.  
  8.       To compile under Lattice C v5.0x use:
  9.  
  10.         LC -cus -v treq.c
  11.         BLINK lib:arpc.o treq.o TO treq LIB lib:arp.lib lib:lc.lib
  12.  
  13. */
  14.  
  15. #include <exec/types.h>
  16. #include <exec/exec.h>
  17. #include <exec/libraries.h>
  18. #include <libraries/dos.h>
  19. #include <libraries/dosextens.h>
  20. #include <libraries/arpbase.h>
  21. #include <arpfunctions.h>
  22. #include <proto/exec.h>
  23.  
  24. struct Process *Pr;
  25. struct ArpBase *ArpBase;
  26.  
  27. /* tricks */
  28.  
  29. VOID MemCleanup()
  30. {
  31. }
  32.  
  33. /*
  34.    _main() used instead of main() to override unnecessary ARP parser and
  35.    keep down code size.
  36. */
  37.  
  38. VOID _main() 
  39. {
  40.  
  41.     Pr = (struct Process *)FindTask(NULL);
  42.  
  43.     if(!(ArpBase = (struct ArpBase*)OpenLibrary(ArpName,ArpVersion))){
  44.         Pr->pr_Result2=ERROR_INVALID_RESIDENT_LIBRARY;
  45.         exit(RETURN_FAIL);
  46.         }
  47.  
  48.  
  49.     
  50.     
  51.     if (Pr->pr_WindowPtr==(APTR)-1) 
  52.         {
  53.             Pr->pr_WindowPtr=NULL;
  54.             Puts("Requesters for this Console Process are now ON\n");
  55.         }
  56.     else
  57.         {
  58.             Pr->pr_WindowPtr=(APTR)-1;
  59.             Puts("Requesters for this Console Process are now OFF\n");
  60.         }
  61.     CloseLibrary((struct Library*)ArpBase);        
  62. }
  63.  
  64.  
  65.