here - OSTA - Optical Storage Technology Association
here - OSTA - Optical Storage Technology Association
here - OSTA - Optical Storage Technology Association
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
if (needsCRC)<br />
{<br />
unicode_t ext[EXT_SIZE];<br />
int localExtIndex = 0;<br />
if (hasExt)<br />
{<br />
int maxFilenameLen;<br />
/* Translate extension, and store it in ext. */<br />
for(index = 0; index maxFilenameLen)<br />
{<br />
newIndex = maxFilenameLen;<br />
}<br />
else<br />
{<br />
newIndex = newExtIndex;<br />
}<br />
}<br />
else if (newIndex > MAXLEN - 5)<br />
{<br />
/*If no extension, make sure to leave room for CRC. */<br />
newIndex = MAXLEN - 5;<br />
}<br />
newName[newIndex++] = CRC_MARK; /* Add mark for CRC. */<br />
/*Calculate CRC from original filename from FileIdentifier. */<br />
valueCRC = unicode_cksum(udfName, udfLen);<br />
/* Convert 16-bits of CRC to hex characters. */<br />
newName[newIndex++] = hexChar[(valueCRC & 0xf000) >> 12];<br />
newName[newIndex++] = hexChar[(valueCRC & 0x0f00) >> 8];<br />
newName[newIndex++] = hexChar[(valueCRC & 0x00f0) >> 4];<br />
newName[newIndex++] = hexChar[(valueCRC & 0x000f)];<br />
/* Place a translated extension at end, if found. */<br />
if (hasExt)<br />
{<br />
newName[newIndex++] = PERIOD;<br />
for (index = 0;index < localExtIndex ;index++ )<br />
{<br />
newName[newIndex++] = ext[index];<br />
}<br />
}<br />
}<br />
return(newIndex);<br />
UDF 2.01<br />
132<br />
March50 April