home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0905.lha / MultiUser / C.src / LimitDOSSetProtection.c < prev    next >
C/C++ Source or Header  |  1993-08-26  |  2KB  |  61 lines

  1. /************************************************************
  2. * MultiUser - MultiUser Task/File Support System                *
  3. * ---------------------------------------------------------    *
  4. * LimitDOSSetProtection                                                    *
  5. * ---------------------------------------------------------    *
  6. * ⌐ Copyright 1993 by Geert Uytterhoeven                            *
  7. * All Rights Reserved.                                                    *
  8. ************************************************************/
  9.  
  10.  
  11. #include <exec/types.h>
  12. #include <dos/dos.h>
  13. #include <proto/exec.h>
  14. #include <proto/dos.h>
  15. #include <utility/tagitem.h>
  16. #include <libraries/multiuser.h>
  17. #include <proto/multiuser.h>
  18.  
  19. #include "LimitDOSSetProtection_rev.h"
  20.  
  21.  
  22. char __VersTag__[] = VERSTAG;
  23.  
  24.  
  25. int __saveds Start(char *arg)
  26. {
  27.     struct ExecBase *SysBase;
  28.     struct DosLibrary *DOSBase;
  29.     struct muBase *muBase = NULL;
  30.     struct RDArgs *args;
  31.     LONG argarray[] = {
  32.         NULL, NULL
  33.     };
  34.     int rc = RETURN_ERROR;
  35.  
  36.     SysBase = *(struct ExecBase **)4;
  37.  
  38.     if ((!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 37))) ||
  39.          (!(muBase = (struct muBase *)OpenLibrary("multiuser.library", 39)))) {
  40.         rc = RETURN_FAIL;
  41.         goto Exit;
  42.     }
  43.  
  44.     args = ReadArgs("ON/S,OFF/S", argarray, NULL);
  45.     if (!args)
  46.         PrintFault(IoErr(), NULL);
  47.     else if (argarray[0] && argarray[1])
  48.         PutStr("You can't specify both ON and OFF\n");
  49.     else if (!argarray[0] && !argarray[1])
  50.         PutStr("You must specify one of ON and OFF\n");
  51.     else
  52.         muLimitDOSSetProtection((BOOL)argarray[0]);
  53.     FreeArgs(args);
  54.  
  55. Exit:
  56.     CloseLibrary((struct Library *)muBase);
  57.     CloseLibrary((struct Library *)DOSBase);
  58.  
  59.     return(rc);
  60. }
  61.