/* ---------------------------------------------------------------------- */ 
/* Begin Timestamp.h                                                      */ 
/*                                                                        */ 
/* ---------------------------------------------------------------------- */ 
/*                                                                        */ 
/* (c) Copyright 1998, 2005  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__

#define _USE_32BIT_TIME_T 


/* ---------------------------------------------------------------------- */ 
/* includes                                                               */ 
/* ---------------------------------------------------------------------- */ 

#include "sonarMessages.h"


/* ---------------------------------------------------------------------- */ 

#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);

/* Utility functions to convert from / to julian date                     */ 
int TimestampDateConvertDown(int dayOfYear, int year, int *displayDay);
int TimeStampDateConvertUp(int month, int day, int year);


/* ---------------------------------------------------------------------- */ 

#ifdef __cplusplus
}
#endif  /* __cplusplus */ 

#endif  /* _MSC_VER */ 

#endif  /* Not __TIMESTAMP_H__ */ 

/* ---------------------------------------------------------------------- */ 
/*                         end Timestamp.h                                */ 
/* ---------------------------------------------------------------------- */ 