home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / workbench / c / wait.c < prev   
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.1 KB  |  56 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: wait.c,v 1.6 1997/01/27 00:22:38 ldp Exp $
  4.     $Log: wait.c,v $
  5.     Revision 1.6  1997/01/27 00:22:38  ldp
  6.     Include proto instead of clib
  7.  
  8.     Revision 1.5  1996/09/17 16:43:02  digulla
  9.     Use general startup code
  10.  
  11.     Revision 1.4  1996/09/13 17:52:12  digulla
  12.     Use IPTR
  13.  
  14.     Revision 1.3  1996/08/13 15:34:04  digulla
  15.     #include <exec/execbase.h> was missing
  16.  
  17.     Revision 1.2  1996/08/01 17:40:46  digulla
  18.     Added standard header for all files
  19.  
  20.     Desc:
  21.     Lang:
  22. */
  23. #include <exec/execbase.h>
  24. #include <exec/libraries.h>
  25. #include <proto/exec.h>
  26. #include <dos/dos.h>
  27. #include <proto/dos.h>
  28.  
  29. int main (int argc, char ** argv)
  30. {
  31.     IPTR args[4]={ 0, 0, 0, 0 };
  32.     struct RDArgs *rda;
  33.     LONG error=0;
  34.     ULONG delay = 1;
  35. #define ERROR(a) { error=a; goto end; }
  36.  
  37.     rda=ReadArgs("time/N,SEC=SECS/S,MIN=MINS/S,UNTIL/K",args,NULL);
  38.     if(rda==NULL)
  39.     ERROR(RETURN_FAIL);
  40.  
  41.     if (args[0])
  42.     delay = *((ULONG *)args[0]);
  43.  
  44.     if (args[2])
  45.     delay *= 60L;
  46.  
  47.     if (delay > 0)
  48.     Delay (delay * 50L);
  49.  
  50. end:
  51.     FreeArgs(rda);
  52.     if(error)
  53.     PrintFault(IoErr(),"Echo");
  54.     return error;
  55. }
  56.