<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;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.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libnjb <span id="projectnumber">2.2.6</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <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 id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_a231d544ee85f784af5e92462fb4d8ea.html">src</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> | <a href="#var-members">Variables</a> </div> <div class="headertitle"> <h1>njbtime.c File Reference</h1> </div> </div> <div class="contents"> <div class="textblock"><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/> </div><table class="memberdecls"> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" 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#a1592d006e576ff1ccfeca9ff283773f6">time_unpack</a> (void *data)</td></tr> <tr><td class="memItemLeft" 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#a21e911c8e262165cc6413330ce8e09cb">time_unpack3</a> (void *data)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#a4f7a29c170277b10b63863b19d5d70d3">time_pack</a> (<a class="el" href="structnjb__time__struct.html">njb_time_t</a> *time)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#aa63ac6fcb9203c1b22443cd28d51cba6">time_pack3</a> (<a class="el" href="structnjb__time__struct.html">njb_time_t</a> *time)</td></tr> <tr><td colspan="2"><h2><a name="var-members"></a> Variables</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="njbtime_8c.html#a60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>This file deals with the time structures used by the internal clock of the devices. </p> </div><hr/><h2>Function Documentation</h2> <a class="anchor" id="a4f7a29c170277b10b63863b19d5d70d3"></a><!-- doxytag: member="njbtime.c::time_pack" ref="a4f7a29c170277b10b63863b19d5d70d3" 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><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">time</td><td>the libnjb time structure to pack </td></tr> </table> </dd> </dl> <dl class="return"><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="structnjb__time__struct.html#af8099ff42d8ebd590e33f676fcc2e6b0">njb_time_struct::day</a>, <a class="el" href="byteorder_8c.html#a922262997ca997a6645fb232e7d6c162">from_16bit_to_njb1_bytes()</a>, <a class="el" href="structnjb__time__struct.html#a3d1df33f2b06d60440f746d9735d6f0d">njb_time_struct::hours</a>, <a class="el" href="structnjb__time__struct.html#aad6d440031c3816280d6584c9ae503eb">njb_time_struct::minutes</a>, <a class="el" href="structnjb__time__struct.html#ae41964a3348673cdd219b847f886bbf9">njb_time_struct::month</a>, <a class="el" href="structnjb__time__struct.html#acd35e31eeac27b23ba9e34b646ded27d">njb_time_struct::seconds</a>, <a class="el" href="structnjb__time__struct.html#a227a86206933473fc61798d4d5e37683">njb_time_struct::weekday</a>, and <a class="el" href="structnjb__time__struct.html#ace156e46767b197b844936654dffb739">njb_time_struct::year</a>.</p> </div> </div> <a class="anchor" id="aa63ac6fcb9203c1b22443cd28d51cba6"></a><!-- doxytag: member="njbtime.c::time_pack3" ref="aa63ac6fcb9203c1b22443cd28d51cba6" 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><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">time</td><td>the libnjb time structure to pack </td></tr> </table> </dd> </dl> <dl class="return"><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="structnjb__time__struct.html#af8099ff42d8ebd590e33f676fcc2e6b0">njb_time_struct::day</a>, <a class="el" href="structnjb__time__struct.html#a3d1df33f2b06d60440f746d9735d6f0d">njb_time_struct::hours</a>, <a class="el" href="structnjb__time__struct.html#aad6d440031c3816280d6584c9ae503eb">njb_time_struct::minutes</a>, <a class="el" href="structnjb__time__struct.html#ae41964a3348673cdd219b847f886bbf9">njb_time_struct::month</a>, <a class="el" href="structnjb__time__struct.html#acd35e31eeac27b23ba9e34b646ded27d">njb_time_struct::seconds</a>, <a class="el" href="structnjb__time__struct.html#a227a86206933473fc61798d4d5e37683">njb_time_struct::weekday</a>, and <a class="el" href="structnjb__time__struct.html#ace156e46767b197b844936654dffb739">njb_time_struct::year</a>.</p> </div> </div> <a class="anchor" id="a1592d006e576ff1ccfeca9ff283773f6"></a><!-- doxytag: member="njbtime.c::time_unpack" ref="a1592d006e576ff1ccfeca9ff283773f6" 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><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">data</td><td>raw memory representing a NJB1 timestamp </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>a libnjb time structure </dd></dl> <p>References <a class="el" href="structnjb__time__struct.html#af8099ff42d8ebd590e33f676fcc2e6b0">njb_time_struct::day</a>, <a class="el" href="structnjb__time__struct.html#a3d1df33f2b06d60440f746d9735d6f0d">njb_time_struct::hours</a>, <a class="el" href="structnjb__time__struct.html#aad6d440031c3816280d6584c9ae503eb">njb_time_struct::minutes</a>, <a class="el" href="structnjb__time__struct.html#ae41964a3348673cdd219b847f886bbf9">njb_time_struct::month</a>, <a class="el" href="byteorder_8c.html#a77340c095fa6b6b32bea9f4132fc4081">njb1_bytes_to_16bit()</a>, <a class="el" href="structnjb__time__struct.html#acd35e31eeac27b23ba9e34b646ded27d">njb_time_struct::seconds</a>, <a class="el" href="structnjb__time__struct.html#a227a86206933473fc61798d4d5e37683">njb_time_struct::weekday</a>, and <a class="el" href="structnjb__time__struct.html#ace156e46767b197b844936654dffb739">njb_time_struct::year</a>.</p> </div> </div> <a class="anchor" id="a21e911c8e262165cc6413330ce8e09cb"></a><!-- doxytag: member="njbtime.c::time_unpack3" ref="a21e911c8e262165cc6413330ce8e09cb" 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><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">data</td><td>raw memory representing a series 3 timestamp </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>a libnjb time structure </dd></dl> <p>References <a class="el" href="structnjb__time__struct.html#af8099ff42d8ebd590e33f676fcc2e6b0">njb_time_struct::day</a>, <a class="el" href="structnjb__time__struct.html#a3d1df33f2b06d60440f746d9735d6f0d">njb_time_struct::hours</a>, <a class="el" href="structnjb__time__struct.html#aad6d440031c3816280d6584c9ae503eb">njb_time_struct::minutes</a>, <a class="el" href="structnjb__time__struct.html#ae41964a3348673cdd219b847f886bbf9">njb_time_struct::month</a>, <a class="el" href="structnjb__time__struct.html#acd35e31eeac27b23ba9e34b646ded27d">njb_time_struct::seconds</a>, <a class="el" href="structnjb__time__struct.html#a227a86206933473fc61798d4d5e37683">njb_time_struct::weekday</a>, and <a class="el" href="structnjb__time__struct.html#ace156e46767b197b844936654dffb739">njb_time_struct::year</a>.</p> </div> </div> <hr/><h2>Variable Documentation</h2> <a class="anchor" id="a60db410c9e82d9e61b1bf0be607922ed"></a><!-- doxytag: member="njbtime.c::__sub_depth" ref="a60db410c9e82d9e61b1bf0be607922ed" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="usb__io_8c.html#a60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a></td> </tr> </table> </div> <div class="memdoc"> <p>The current subroutine depth for all of libnjb (global) </p> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Feb 8 2011 for libnjb by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>