Logo Search packages:      
Sourcecode: avahi version File versions

struct timeval* avahi_timeval_add ( struct timeval *  a,
AvahiUsec  usec 
) [read]

Add a number of microseconds to the specified timeval structure and return it. *a is modified.

Definition at line 61 of file timeval.c.

References AvahiUsec.

                                                                     {
    AvahiUsec u;
    assert(a);

    u = usec + a->tv_usec;

    if (u < 0) {
        a->tv_usec = (long) (1000000 + (u % 1000000));
        a->tv_sec += (long) (-1 + (u / 1000000));
    } else {
        a->tv_usec = (long) (u % 1000000);
        a->tv_sec += (long) (u / 1000000);
    }

    return a;
}


Generated by  Doxygen 1.6.0   Back to index