Additional test for args in gadget text
[tangerine.git] / rom / timer / addtime.c
blob42414d27d18cf61a74d966893c9f55d7f480fbd6
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: AddTime() - add two timeval's together.
6 Lang: english
7 */
8 #include "timer_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <devices/timer.h>
14 #include <proto/timer.h>
16 AROS_LH2(void, AddTime,
18 /* SYNOPSIS */
19 AROS_LHA(struct timeval *, dest, A0),
20 AROS_LHA(struct timeval *, src, A1),
22 /* LOCATION */
23 struct Device *, TimerBase, 7, Timer)
25 /* FUNCTION
26 Add two timeval's together. The result will be the sum
27 dest + src --> dest.
29 The values of A0 and A1 will not be changed.
31 INPUTS
32 dest - Destination timeval.
33 src - Source timeval.
35 RESULT
36 dest will contain (src + dest).
38 NOTES
39 This function can be called from Interrupts.
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 SubTime(), CmpTime()
48 INTERNALS
50 HISTORY
51 27-11-96 digulla automatically created from
52 timer_lib.fd and clib/timer_protos.h
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
57 AROS_LIBBASE_EXT_DECL(struct Device *,TimerBase)
59 dest->tv_micro += src->tv_micro;
60 dest->tv_secs += src->tv_secs;
62 /* Normalize the result. */
63 while(dest->tv_micro > 999999)
65 dest->tv_secs++;
66 dest->tv_micro -= 1000000;
69 AROS_LIBFUNC_EXIT
70 } /* AddTime */