UDF 2.00 - OSTA - Optical Storage Technology Association
UDF 2.00 - OSTA - Optical Storage Technology Association
UDF 2.00 - 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.
*<br />
* Number of unicode characters in translated name.<br />
*/<br />
int <strong>UDF</strong>TransName(<br />
unicode_t *newName,/*(Output)Translated name. Must be of length MAXLEN*/<br />
unicode_t *udfName, /* (Input) Name from <strong>UDF</strong> volume.*/<br />
int udfLen, /* (Input) Length of <strong>UDF</strong> Name. */<br />
{<br />
int index, newIndex = 0, needsCRC = FALSE;<br />
int extIndex, newExtIndex = 0, hasExt = FALSE;<br />
#ifdef (OS2 | WIN_95 | WIN_NT)<br />
int trailIndex = 0;<br />
#endif<br />
unsigned short valueCRC;<br />
unicode_t current;<br />
const char hexChar[] = "0123456789ABCDEF";<br />
for (index = 0; index < udfLen; index++)<br />
{<br />
current = udfName[index];<br />
if (IsIllegal(current) || !UnicodeIsPrint(current))<br />
{<br />
needsCRC = TRUE;<br />
/* Replace Illegal and non-displayable chars with underscore. */<br />
current = ILLEGAL_CHAR_MARK;<br />
/* Skip any other illegal or non-displayable characters. */<br />
while(index+1 < udfLen && (IsIllegal(udfName[index+1])<br />
|| !UnicodeIsPrint(udfName[index+1])))<br />
{<br />
index++;<br />
}<br />
}<br />
/* Record position of extension, if one is found. */<br />
if (current == PERIOD && (udfLen - index -1)