KMSAgentStringUtilities.cpp revision 4f14b0f29aa144cc03efdde5508ae126ae197acf
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef WIN32
#include <ctype.h>
#ifndef METAWARE
#include <wctype.h>
#endif
#endif
#ifndef METAWARE
#endif
#include "KMSAgentStringUtilities.h"
#ifdef WIN32
#include <stdlib.h>
#include <time.h>
#endif
// Find header in KMSAgentStringUtilities.h
{
#ifdef WIN32
#else
#endif
}
void Int64ToUTF8(char* const o_psUTF8,
int i_bPad,
int i_bHex )
{
//string sFormat;
char sFormat[10];
{
#ifdef WIN32
#else
#endif
}
{
#ifdef WIN32
#else
#endif
}
{
#ifdef WIN32
#else
#endif
}
else //( !i_bPad && !i_bHex )
{
#ifdef WIN32
#else
#endif
}
#ifndef METAWARE
//int iReturn = K_snprintf(o_psUTF8, iBufferSize, sFormat, i_iNumber);
#else
#endif
if ( iReturn < 0 )
{
// Our buffer wasn't big enough. Shouldn't happen.
FATAL_ASSERT(0);
}
return;
}
// Find header in KMSAgentStringUtilities.h
const char* i_sHexString,
unsigned char* o_pBinaryBuffer)
{
FATAL_ASSERT( (iHexLen % 2) == 0 ); // to be valid, the hex string must have an even number of characters
if ( !o_pBinaryBuffer )
{
return ( iHexLen / 2 );
}
if ( iHexLen <= 0 )
{
return 0;
}
int iDigitValue = 0;
for ( int i = 0; i < iHexLen; i++)
{
{
}
{
}
{
}
else
{
iDigitValue = 0;
}
if (i % 2 == 0)
{
}
else
{
}
}
return ( iHexLen / 2 );
}
// Find header in KMSAgentStringUtilities.h
char* const o_sHexString,
const unsigned char* const i_pBinaryBuffer,
int i_iBinaryBufferSize )
{
const char HEXCHARS[] = "0123456789ABCDEF";
if ( (i_pBinaryBuffer == 0) || (i_iBinaryBufferSize == 0) )
{
return;
}
for ( int i = 0; i < (2 * i_iBinaryBufferSize); i++ )
{
if ( (i % 2) == 0 ) // high four bits of the current byte
else // low four bits of the current byte
}
return;
}
// Find header in StringUtilities.h
void GetCurrentDateTimeISO8601UTC(char* const o_psDateTimeISO8601UTC,
int i_iLength)
{
#ifndef METAWARE
"%04d-%02d-%02d %02d:%02d:%02d.%03dZ",
#else
// no time functions for the metaware environment
#endif
return;
}