netmsgs/libnetmsgs/nmLibPack.c
int nmPackP64(void *val, byte_t buf[], size_t bufSize, NMEndian_T eEndian)
{
  static size_t fvalLen = NMFVAL_LEN_P64;     // message field value length

  ulong_t               luVal;
  uint_t                uMSB;     // Most Signifcant Bytes
  uint_t                uLSB;     // Least Signifcant Bytes

  _NM_CHK_MEM(bufSize, fvalLen);

  // long's are same size as void *'s. exceptions?
  luVal = *((ulong_t *)val);

  // 8-byte pointer
  if( sizeof(void *) == fvalLen )
  {
#if HOST_WORD_SIZE == 64
    uMSB  = (uint_t)(luVal >> 32);
    uLSB  = (uint_t)(luVal & 0xffffffff);
#else
    uMSB  = 0;
    uLSB  = (uint_t)luVal;
#endif // HOST_WORD_SIZE
  }

  // 4-byte pointer
  else
  {
    _NM_CHK_ARCH(val, (size_t)NMFVAL_LEN_P32);

    uMSB  = 0;
    uLSB  = (uint_t)luVal;
  }

  PACK64NATIVE(uMSB, uLSB, buf);

  return (int)fvalLen;
}
/*!
 * \brief Pack a 64-bit pointer into the message buffer.
 *
 * If the machine architecture only supports 32-bit pointers, then
 * the 4 MSBs are padded with 0's.
 *
 * \note Pointer is always packed in native byte order.
 *
 * \copydoc doc_params_pack_std
 * \copydoc doc_return_pack_std 
 */
\brief Pack a 64-bit pointer into the message buffer.
If the machine architecture only supports 32-bit pointers, then
the 4 MSBs are padded with 0's.

\note Pointer is always packed in native byte order.


\ brief Pack a 64 - bit pointer into the message buffer . If the machine architecture only supports 32 - bit pointers then the 4 MSBs are padded with 0 ' s . \ note Pointer is always packed in native byte order .
int nmPackP64(void *val, byte_t buf[], size_t bufSize, NMEndian_T eEndian)
{
  static size_t fvalLen = NMFVAL_LEN_P64;     
  ulong_t               luVal;
  uint_t                uMSB;     
  uint_t                uLSB;     
  _NM_CHK_MEM(bufSize, fvalLen);
  luVal = *((ulong_t *)val);
  if( sizeof(void *) == fvalLen )
  {
#if HOST_WORD_SIZE == 64
    uMSB  = (uint_t)(luVal >> 32);
    uLSB  = (uint_t)(luVal & 0xffffffff);
#else
    uMSB  = 0;
    uLSB  = (uint_t)luVal;
#endif 
  }
  else
  {
    _NM_CHK_ARCH(val, (size_t)NMFVAL_LEN_P32);
    uMSB  = 0;
    uLSB  = (uint_t)luVal;
  }
  PACK64NATIVE(uMSB, uLSB, buf);
  return (int)fvalLen;
}
int nmPackP64 ( void * val , byte_t buf [ ] , size_t bufSize , NMEndian_T eEndian ) { static size_t fvalLen = NMFVAL_LEN_P64 ; ulong_t luVal ; uint_t uMSB ; uint_t uLSB ; _NM_CHK_MEM ( bufSize , fvalLen ) ; luVal = * ( ( ulong_t * ) val ) ; if ( sizeof ( void * ) == fvalLen ) { #if HOST_WORD_SIZE == 64 uMSB = ( uint_t ) ( luVal >> 32 ) ; uLSB = ( uint_t ) ( luVal & 0xffffffff ) ; #else uMSB = 0 ; uLSB = ( uint_t ) luVal ; #endif } else { _NM_CHK_ARCH ( val , ( size_t ) NMFVAL_LEN_P32 ) ; uMSB = 0 ; uLSB = ( uint_t ) luVal ; } PACK64NATIVE ( uMSB , uLSB , buf ) ; return ( int ) fvalLen ; }
\brief Pack a 64-bit pointer into the message buffer.
\ brief Pack a 64 - bit pointer into the message buffer .
// message field value length // Most Signifcant Bytes // Least Signifcant Bytes // long's are same size as void *'s. exceptions? // 8-byte pointer // HOST_WORD_SIZE // 4-byte pointer