Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ utc_subtime(3dts) — DCE 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

utc_subtime(3dts)  —  Subroutines

Name

utc_subtime - Computes the difference between two binary timestamps

Synopsis

#include <dce/utc.h> int utc_subtime(
utc_t ∗result,
utc_t ∗utc1,
utc_t ∗utc2);

Parameters

Input

utc1Binary timestamp or relative binary timestamp.  Use NULL if you want this routine to use the current time for this parameter. 

utc2Binary timestamp or relative binary timestamp.  Use NULL if you want this routine to use the current time for this parameter. 

Output

resultResulting binary timestamp or relative binary timestamp, depending upon the operation performed:

       •absolute time−absolute time=relative time

       •relative time−relative time=relative time

       •absolute time−relative time=absolute time

       •relative time−absolute time is undefined.  (See the note later in this reference page.) 

Description

The utc_subtime() routine subtracts one binary timestamp from another.  The two binary timestamps express either an absolute time and a relative time, two relative times, or two absolute times.  The resulting timestamp is utc1 minus utc2.  The inaccuracies of the two input timestamps are combined and included in the output timestamp.  The TDF in the first timestamp is copied to the output. 

Notes

Although no error is returned, the combination relative time−absolute time should not be used. 

Return Values

 0Indicates that the routine executed successfully. 

-1Indicates an invalid time argument or invalid results. 

Examples

See the sample program in the utc_binreltime(3dts) reference page. 

Related Information

Functions: utc_addtime(3dts). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026