]> code.delx.au - pulseaudio/blob - src/pulse/timeval.h
big s/polyp/pulse/g
[pulseaudio] / src / pulse / timeval.h
1 #ifndef footimevalhfoo
2 #define footimevalhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of PulseAudio.
8
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
13
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <pulse/cdecl.h>
26 #include <pulse/sample.h>
27
28 /** \file
29 * Utility functions for handling timeval calculations */
30
31 PA_C_DECL_BEGIN
32
33 struct timeval;
34
35 /** Return the current timestamp, just like UNIX gettimeofday() */
36 struct timeval *pa_gettimeofday(struct timeval *tv);
37
38 /** Calculate the difference between the two specified timeval
39 * structs. */
40 pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b);
41
42 /** Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwse */
43 int pa_timeval_cmp(const struct timeval *a, const struct timeval *b);
44
45 /** Return the time difference between now and the specified timestamp */
46 pa_usec_t pa_timeval_age(const struct timeval *tv);
47
48 /** Add the specified time inmicroseconds to the specified timeval structure */
49 struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v);
50
51 PA_C_DECL_END
52
53 #endif