05.07.2014 Views

UDF 2.00 - OSTA - Optical Storage Technology Association

UDF 2.00 - OSTA - Optical Storage Technology Association

UDF 2.00 - OSTA - Optical Storage Technology Association

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

for (index = 0 ; index < udfLen ; index++)<br />

{<br />

current = udfName[index];<br />

current = UnicodeToUpper(current);<br />

if (current == PERIOD)<br />

{<br />

if (dosIndex==0 || hasExt)<br />

{<br />

/* Ignore leading periods or any other than<br />

* used for extension.<br />

*/<br />

needsCRC = TRUE;<br />

}<br />

else<br />

{<br />

/* First, find last character which is NOT a period<br />

* or space.<br />

*/<br />

lastPeriodIndex = udfLen - 1;<br />

while(lastPeriodIndex >=0 &&<br />

(udfName[lastPeriodIndex]== PERIOD ||<br />

udfName[lastPeriodIndex] == SPACE))<br />

{<br />

lastPeriodIndex--;<br />

}<br />

/* Now search for last remaining period. */<br />

while(lastPeriodIndex >= 0 &&<br />

udfName[lastPeriodIndex] != PERIOD)<br />

{<br />

lastPeriodIndex--;<br />

}<br />

/* See if the period we found was the last or not. */<br />

if (lastPeriodIndex != index)<br />

{<br />

needsCRC = TRUE; /* If not, name needs translation. */<br />

}<br />

}<br />

}<br />

else<br />

{<br />

/* As long as the period was not trailing,<br />

* the file name has an extension.<br />

*/<br />

if (lastPeriodIndex >= 0)<br />

{<br />

hasExt = TRUE;<br />

}<br />

if ((!hasExt && dosIndex == DOS_NAME_LEN) ||<br />

extIndex == DOS_EXT_LEN)<br />

{<br />

/* File name or extension is too long for DOS. */<br />

needsCRC = TRUE;

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

Saved successfully!

Ooh no, something went wrong!