05.07.2014 Views

here - OSTA - Optical Storage Technology Association

here - OSTA - Optical Storage Technology Association

here - OSTA - Optical Storage Technology Association

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if (index < udfLabelLen || index == 0)<br />

needsCRC = TRUE;<br />

/* Append the CRC code to the file name, if needed. */<br />

if (needsCRC) {<br />

/* Get the CRC value for the original Unicode string */<br />

UINT16 udfCRCValue = CalculateCRC(udfName, udfNameLen);<br />

/* Determine the character index w<strong>here</strong> the CRC should */<br />

/* begin. */<br />

targetIndex = crcIndex;<br />

/* If the character being overlayed is a two-byte BCS */<br />

/* character, replace the first byte with an underscore. */<br />

if (overlayBytes > 0)<br />

dosLabel[targetIndex++] = '_';<br />

}<br />

/* Append the encoded CRC value with delimiter. */<br />

dosLabel[targetIndex++] = '#';<br />

dosLabel[targetIndex++] =<br />

crcChar[udfCRCValue / (DOS_CRC_MODULUS * DOS_CRC_MODULUS)];<br />

udfCRCValue %= DOS_CRC_MODULUS * DOS_CRC_MODULUS;<br />

dosLabel[targetIndex++] =<br />

crcChar[udfCRCValue / DOS_CRC_MODULUS];<br />

udfCRCValue %= DOS_CRC_MODULUS;<br />

dosLabel[targetIndex++] = crcChar[udfCRCValue];<br />

}<br />

/* Return the length of the resulting Unicode string. */<br />

return (UINT16)targetIndex;<br />

/*******************************************************************/<br />

/* UnicodeToUpper() */<br />

/* Convert the given character to upper-case Unicode. */<br />

/*******************************************************************/<br />

UNICODE_CHAR UnicodeToUpper(UNICODE_CHAR value)<br />

{<br />

/* Actual implementation will vary to accommodate the target */<br />

/* operating system API services. */<br />

/* Just handle the ASCII range for the time being. */<br />

return (value >= 'a' && value

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!