home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / c / wait.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.1 KB  |  53 lines

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