Logo Search packages:      
Sourcecode: pulseaudio version File versions

struct timeval* pa_timeval_store ( struct timeval *  tv,
pa_usec_t  v 
) [read]

Store the specified uec value in the timeval struct.

Since:
0.9.7

Definition at line 193 of file timeval.c.

References PA_USEC_INVALID, and PA_USEC_PER_SEC.

                                                                  {
    pa_assert(tv);

    if (PA_UNLIKELY(v == PA_USEC_INVALID)) {
        tv->tv_sec = PA_INT_TYPE_MAX(time_t);
        tv->tv_usec = (suseconds_t) (PA_USEC_PER_SEC-1);

        return tv;
    }

    tv->tv_sec = (time_t) (v / PA_USEC_PER_SEC);
    tv->tv_usec = (suseconds_t) (v % PA_USEC_PER_SEC);

    return tv;
}


Generated by  Doxygen 1.6.0   Back to index