text: /*
   * @(#)osapi_ntptime.h    generated by: makeheader    Mon Dec  3 23:07:48 2007
   *
   *		built from:	ntptime.ifc
   */
  
  #ifndef osapi_ntptime_h
  #define osapi_ntptime_h
  
  
  
    #ifndef osapi_type_h
      #include "osapi/osapi_type.h"
    #endif
  
    #ifndef osapi_dll_h
      #include "osapi/osapi_dll.h"
    #endif
  
  #ifdef __cplusplus
      extern "C" {
  #endif
  
  typedef struct RTINtpTime {
      /*e Seconds.**/
      RTI_INT32  sec;
      /*e fraction of a second in 1/2^32 form.*/
      RTI_UINT32 frac;
  } RTINtpTime;
  
  
  /*e \ingroup RTINtpTimeClass
  
    Represents infinite time value. Handy for specifying no timeout or
    sleeping forever.
  */
  #define RTI_NTP_TIME_INFINITE ((RTINtpTime *)NULL)
  
  /*e \ingroup RTINtpTimeClass
  
    @brief Zero time.
  
    This global variable is for convenience. This allows users to
    check and see if a RTITime variable is negative or positive by comparing
    againt this.
  
    @see RtiTimeCompare
  */
  #define RTI_NTP_TIME_ZERO {0,0}
  
  /*e \ingroup RTINtpTimeClass
  
    Represents maximum timevalue that can be represented using the
    NTP time format. For all practical purposes, can be considered
    equivalent to infinity.
  
  */
  #define RTI_NTP_TIME_MAX {RTI_NTP_TIME_SEC_MAX,RTI_NTP_TIME_FRAC_MAX}
  
  /*e \ingroup RTINtpTimeClass
     The maximum number of seconds that can be represented using NTP time.
   */
  #define RTI_NTP_TIME_SEC_MAX ((RTI_INT32)0x7fffffff)
  
  /*e \ingroup RTINtpTimeClass
     The largest possible value of the fraction field in NTP time.
   */
  #define RTI_NTP_TIME_FRAC_MAX ((RTI_UINT32)0xffffffff)
  
  #define RTI_NTP_TIME_STRING_LEN (20)
  
  extern RTIOsapiDllExport void RTINtpTime_setZero(struct RTINtpTime* time);
  
  extern RTIOsapiDllExport void RTINtpTime_setMax(struct RTINtpTime* time);
  
  extern RTIOsapiDllExport double RTINtpTime_toDouble(const struct RTINtpTime* t);
  
  extern RTIOsapiDllExport void RTINtpTime_copy(struct RTINtpTime *out, 
                                                const struct RTINtpTime *in);
  
  extern RTIOsapiDllExport void RTINtpTime_packFromMillisec(struct RTINtpTime* time,
  				 int s, RTI_UINT32 msec);
  
  extern RTIOsapiDllExport void RTINtpTime_unpackToMillisec(int s, unsigned msec, struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_packFromMicrosec(struct RTINtpTime* time,
  				 int s, RTI_UINT32 usec);
  
  extern RTIOsapiDllExport void RTINtpTime_unpackToMicrosec(int s, unsigned usec, struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_packFromNanosec(struct RTINtpTime* time,
  				int s, RTI_UINT32 nsec);
  
  extern RTIOsapiDllExport void RTINtpTime_unpackToNanosec(int s, unsigned nsec, struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_packFromFraction(struct RTINtpTime time,
  				 RTI_UINT32 numerator,
  				 RTI_UINT32 denominator_per_sec);
  
  extern RTIOsapiDllExport void RTINtpTime_unpackToFraction(unsigned numerator,
  				 unsigned denominator_per_sec,
  				 struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_unpackToFractionPrecise(unsigned numerator,
  					unsigned denominator_per_sec,
  					struct RTINtpTime time,
  					unsigned precisionBits);
  
  extern RTIOsapiDllExport int RTINtpTime_compare(const struct RTINtpTime time1,
  		       const struct RTINtpTime time2);
  
  extern RTIOsapiDllExport void RTINtpTime_add(struct RTINtpTime answer,
  		    struct RTINtpTime t1, struct RTINtpTime t2);
  
  extern RTIOsapiDllExport void RTINtpTime_subtract(struct RTINtpTime answer,
  			 struct RTINtpTime t1, struct RTINtpTime t2);
  
  extern RTIOsapiDllExport void RTINtpTime_shiftLeft(struct RTINtpTime answer,
  			  struct RTINtpTime time, int shift);
  
  extern RTIOsapiDllExport void RTINtpTime_shiftRight(struct RTINtpTime answer,
  			   struct RTINtpTime time, int shift);
  
  extern RTIOsapiDllExport void RTINtpTime_increment(struct RTINtpTime answer,
  			  struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_decrement(struct RTINtpTime answer,
  			  struct RTINtpTime time);
  
  extern RTIOsapiDllExport void RTINtpTime_incrementInfinitesimally(struct RTINtpTime time);
  
  extern RTIOsapiDllExport RTIBool RTINtpTime_isInfinite(const struct RTINtpTime* time);
  
  extern RTIOsapiDllExport int RTINtpTime_compareToZero(const struct RTINtpTime* time);
  
  extern RTIOsapiDllExport char* RTINtpTime_toString(const struct RTINtpTime* time, char* str);
  
  
  #ifdef __cplusplus
      }   /* extern "C" */
  #endif
  
    #include "osapi/osapi_ntptime_impl.h"
  
  
  #endif /* osapi_ntptime_h */
  