mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
add pa_timeval_load() API
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1954 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
ce5250e3e4
commit
ca744a4ac5
2 changed files with 12 additions and 1 deletions
|
|
@ -156,3 +156,11 @@ struct timeval* pa_timeval_store(struct timeval *tv, pa_usec_t v) {
|
|||
|
||||
return tv;
|
||||
}
|
||||
|
||||
pa_usec_t pa_timeval_load(const struct timeval *tv) {
|
||||
pa_assert(tv);
|
||||
|
||||
return
|
||||
(pa_usec_t) tv->tv_sec * PA_USEC_PER_SEC +
|
||||
(pa_usec_t) tv->tv_usec;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,9 +56,12 @@ pa_usec_t pa_timeval_age(const struct timeval *tv);
|
|||
/** Add the specified time inmicroseconds to the specified timeval structure */
|
||||
struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v) PA_GCC_PURE;
|
||||
|
||||
/** Store the specified uec value in the timeval struct */
|
||||
/** Store the specified uec value in the timeval struct. \since 0.9.7 */
|
||||
struct timeval* pa_timeval_store(struct timeval *tv, pa_usec_t v);
|
||||
|
||||
/** Load the specified tv value and return it in usec. \since 0.9.7 */
|
||||
pa_usec_t pa_timeval_load(const struct timeval *tv);
|
||||
|
||||
PA_C_DECL_END
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue