<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>libnjb: /builddir/build/BUILD/libnjb-2.2.6/src/njbtime.c File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_a231d544ee85f784af5e92462fb4d8ea.html">src</a> </div> </div> <div class="contents"> <h1>njbtime.c File Reference</h1><code>#include <stdlib.h></code><br> <code>#include <string.h></code><br> <code>#include "<a class="el" href="libnjb_8h_source.html">libnjb.h</a>"</code><br> <code>#include "njbtime.h"</code><br> <code>#include "njb_error.h"</code><br> <code>#include "defs.h"</code><br> <code>#include "base.h"</code><br> <code>#include "byteorder.h"</code><br> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__time__struct.html">njb_time_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#1592d006e576ff1ccfeca9ff283773f6">time_unpack</a> (void *data)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__time__struct.html">njb_time_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#21e911c8e262165cc6413330ce8e09cb">time_unpack3</a> (void *data)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#4f7a29c170277b10b63863b19d5d70d3">time_pack</a> (<a class="el" href="structnjb__time__struct.html">njb_time_t</a> *time)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#a63ac6fcb9203c1b22443cd28d51cba6">time_pack3</a> (<a class="el" href="structnjb__time__struct.html">njb_time_t</a> *time)</td></tr> <tr><td colspan="2"><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a></td></tr> </table> <hr><h2>Detailed Description</h2> This file deals with the time structures used by the internal clock of the devices. <hr><h2>Function Documentation</h2> <a class="anchor" name="4f7a29c170277b10b63863b19d5d70d3"></a><!-- doxytag: member="njbtime.c::time_pack" ref="4f7a29c170277b10b63863b19d5d70d3" args="(njb_time_t *time)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* time_pack </td> <td>(</td> <td class="paramtype"><a class="el" href="structnjb__time__struct.html">njb_time_t</a> * </td> <td class="paramname"> <em>time</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Packs a libnjb time structure to the raw format used by the NJB1<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>time</em> </td><td>the libnjb time structure to pack </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>a pointer to raw bytes representing the NJB1 time structure in a newly allocated byte array. The caller shall free this memory after use. </dd></dl> <p>References <a class="el" href="libnjb_8h_source.html#l00406">njb_time_struct::day</a>, <a class="el" href="byteorder_8c_source.html#l00183">from_16bit_to_njb1_bytes()</a>, <a class="el" href="libnjb_8h_source.html#l00408">njb_time_struct::hours</a>, <a class="el" href="libnjb_8h_source.html#l00409">njb_time_struct::minutes</a>, <a class="el" href="libnjb_8h_source.html#l00405">njb_time_struct::month</a>, <a class="el" href="libnjb_8h_source.html#l00410">njb_time_struct::seconds</a>, <a class="el" href="libnjb_8h_source.html#l00407">njb_time_struct::weekday</a>, and <a class="el" href="libnjb_8h_source.html#l00404">njb_time_struct::year</a>.</p> </div> </div><p> <a class="anchor" name="a63ac6fcb9203c1b22443cd28d51cba6"></a><!-- doxytag: member="njbtime.c::time_pack3" ref="a63ac6fcb9203c1b22443cd28d51cba6" args="(njb_time_t *time)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* time_pack3 </td> <td>(</td> <td class="paramtype"><a class="el" href="structnjb__time__struct.html">njb_time_t</a> * </td> <td class="paramname"> <em>time</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Packs a libnjb time structure to the raw format used by the series 3 devices.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>time</em> </td><td>the libnjb time structure to pack </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>a pointer to raw bytes representing the series 3 time structure in a newly allocated byte array. The caller shall free this memory after use. </dd></dl> <p>References <a class="el" href="libnjb_8h_source.html#l00406">njb_time_struct::day</a>, <a class="el" href="libnjb_8h_source.html#l00408">njb_time_struct::hours</a>, <a class="el" href="libnjb_8h_source.html#l00409">njb_time_struct::minutes</a>, <a class="el" href="libnjb_8h_source.html#l00405">njb_time_struct::month</a>, <a class="el" href="libnjb_8h_source.html#l00410">njb_time_struct::seconds</a>, <a class="el" href="libnjb_8h_source.html#l00407">njb_time_struct::weekday</a>, and <a class="el" href="libnjb_8h_source.html#l00404">njb_time_struct::year</a>.</p> </div> </div><p> <a class="anchor" name="1592d006e576ff1ccfeca9ff283773f6"></a><!-- doxytag: member="njbtime.c::time_unpack" ref="1592d006e576ff1ccfeca9ff283773f6" args="(void *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structnjb__time__struct.html">njb_time_t</a>* time_unpack </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"> <em>data</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Unpacks a raw NJB1 time structure into libnjb representation.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>raw memory representing a NJB1 timestamp </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>a libnjb time structure </dd></dl> <p>References <a class="el" href="libnjb_8h_source.html#l00406">njb_time_struct::day</a>, <a class="el" href="libnjb_8h_source.html#l00408">njb_time_struct::hours</a>, <a class="el" href="libnjb_8h_source.html#l00409">njb_time_struct::minutes</a>, <a class="el" href="libnjb_8h_source.html#l00405">njb_time_struct::month</a>, <a class="el" href="byteorder_8c_source.html#l00146">njb1_bytes_to_16bit()</a>, <a class="el" href="libnjb_8h_source.html#l00410">njb_time_struct::seconds</a>, <a class="el" href="libnjb_8h_source.html#l00407">njb_time_struct::weekday</a>, and <a class="el" href="libnjb_8h_source.html#l00404">njb_time_struct::year</a>.</p> </div> </div><p> <a class="anchor" name="21e911c8e262165cc6413330ce8e09cb"></a><!-- doxytag: member="njbtime.c::time_unpack3" ref="21e911c8e262165cc6413330ce8e09cb" args="(void *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structnjb__time__struct.html">njb_time_t</a>* time_unpack3 </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"> <em>data</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Unpacks a raw series 3 time structure into libnjb representation.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>raw memory representing a series 3 timestamp </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>a libnjb time structure </dd></dl> <p>References <a class="el" href="libnjb_8h_source.html#l00406">njb_time_struct::day</a>, <a class="el" href="libnjb_8h_source.html#l00408">njb_time_struct::hours</a>, <a class="el" href="libnjb_8h_source.html#l00409">njb_time_struct::minutes</a>, <a class="el" href="libnjb_8h_source.html#l00405">njb_time_struct::month</a>, <a class="el" href="libnjb_8h_source.html#l00410">njb_time_struct::seconds</a>, <a class="el" href="libnjb_8h_source.html#l00407">njb_time_struct::weekday</a>, and <a class="el" href="libnjb_8h_source.html#l00404">njb_time_struct::year</a>.</p> </div> </div><p> <hr><h2>Variable Documentation</h2> <a class="anchor" name="60db410c9e82d9e61b1bf0be607922ed"></a><!-- doxytag: member="njbtime.c::__sub_depth" ref="60db410c9e82d9e61b1bf0be607922ed" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="usb__io_8c.html#60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a> </td> </tr> </table> </div> <div class="memdoc"> <p> The current subroutine depth for all of libnjb (global) </div> </div><p> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 17:17:26 2009 for libnjb by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>