Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

clock.h File Reference


Detailed Description

Maintain an accurate clock skew of our host's clock with respect to the absolute time.

Author:
Raphael Manfredi
Date:
2003

#include "common.h"
#include "lib/host_addr.h"

Go to the source code of this file.

Functions

void clock_init (void)
 Called at startup time to initialize local structures.

void clock_close (void)
 Called at shutdown time to cleanup local structures.

void clock_update (time_t update, gint precision, const host_addr_t addr)
 Update clock information, with given precision in seconds.

time_t clock_loc2gmt (time_t stamp)
 Given a local timestamp, use our skew to correct it to GMT.

time_t clock_gmt2loc (time_t stamp)
 Given a GMT timestamp, convert it to a local stamp using our skew.


Function Documentation

void clock_close void   ) 
 

Called at shutdown time to cleanup local structures.

time_t clock_gmt2loc time_t  stamp  ) 
 

Given a GMT timestamp, convert it to a local stamp using our skew.

void clock_init void   ) 
 

Called at startup time to initialize local structures.

time_t clock_loc2gmt time_t  stamp  ) 
 

Given a local timestamp, use our skew to correct it to GMT.

void clock_update time_t  update,
gint  precision,
const host_addr_t  addr
 

Update clock information, with given precision in seconds.

The `ip' is used to avoid using the same source more than once per REUSE_DELAY seconds.


Generated on Sun Feb 12 10:49:59 2006 for Gtk-Gnutella by doxygen 1.3.6