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