/* ---------------------------------------------------------------------- */ 
/* Begin Timestamp.h                                                      */ 
/*                                                                        */ 
/* ---------------------------------------------------------------------- */ 
/*                                                                        */ 
/* (c) Copyright 1998  EdgeTech,                                          */ 
/*                                                                        */ 
/* This file contains proprietary information, and trade secrets of       */ 
/* EdgeTech, and may not be disclosed or reproduced without the prior     */ 
/* written consent of EdgeTech.                                           */ 
/*                                                                        */ 
/* EdgeTech is not responsible for the consequences of the use or misuse  */ 
/* of this software, even if they result from defects in it.              */ 
/*                                                                        */ 
/* A timestamp is a time accurate to the millisecond, unlike a time_t     */ 
/* ---------------------------------------------------------------------- */ 

#ifndef __TIMESTAMP_H__
#define __TIMESTAMP_H__


/* ---------------------------------------------------------------------- */ 
/* includes                                                               */ 
/* ---------------------------------------------------------------------- */ 

#include <time.h>


/* ---------------------------------------------------------------------- */ 
/* structures                                                             */ 
/* ---------------------------------------------------------------------- */ 

typedef struct
{
  /* Time in seconds since the dawn of time                               */ 
  time_t time;

  /* Milliseconds supplement to time                                      */ 
  long int milliseconds;
} TimestampType;


/* ---------------------------------------------------------------------- */ 

#ifdef _MSC_VER 

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */ 


/* ---------------------------------------------------------------------- */ 
/* prototypes                                                             */ 
/* ---------------------------------------------------------------------- */ 

/* Set the current timestamp time                                         */ 
void TimestampSetTime(TimestampType *time);

/* Get the current timestamp time                                         */ 
void TimestampGetTime(TimestampType *time);

/* Create a timestamp from its components                                 */ 
void TimestampCreateTime(TimestampType *time, time_t baseTime, 
                         long int milliseconds);

/* Return time difference in milliseconds                                 */ 
long TimestampDiffTime(TimestampType *time1, TimestampType *time2);


/* ---------------------------------------------------------------------- */ 

#ifdef __cplusplus
}
#endif  /* __cplusplus */ 

#endif  /* _MSC_VER */ 

#endif  /* Not __TIMESTAMP_H__ */ 

/* ---------------------------------------------------------------------- */ 
/*                         end Timestamp.h                                */ 
/* ---------------------------------------------------------------------- */ 