// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // // // xbmLangPathList // // // string [] Array of directory names // // // Returns the directories in the // XBMLANGPATH environment variable. // // // None. // // // xbmLangPathList; // // global proc string [] xbmLangPathList() { global string $gXBMLANGPATH[]; if (size($gXBMLANGPATH) == 0) { string $xbmPath = `getenv "XBMLANGPATH"`; string $paths[]; string $buff, $buff2; int $i, $j, $ndx, $nArr; int $isOkay = true; if (`about -win`) { tokenize $xbmPath ";" $paths; } else { tokenize $xbmPath ":" $paths; } $nArr = size($paths); for ($i = 0, $ndx = 0; $i < $nArr; $i++) { $isOkay = true; $buff2 = $paths[$i]; $buff = `substitute "/%L" $buff2 ""`; $buff2 = `substitute "/%T" $buff ""`; $buff = `substitute "/%N" $buff2 ""`; $buff2 = `substitute "/%S" $buff ""`; $buff = `substitute "/%C" $buff2 ""`; $buff2 = `substitute "%B" $buff ""`; if ($buff2 == "") { $buff = `system "pwd"`; // GG: need command for pwd $buff2 = `substitute "\n" $buff "/"`; } // check for duplicates // for ($j = 0; $j < $ndx; $j++) { if ($gXBMLANGPATH[$j] == $buff2) { $isOkay = false; break; } } if (`about -win`) { if ($isOkay) { $gXBMLANGPATH[$ndx++] = $buff2; } } else { if ($isOkay && ("1\n" == system("test -d " + $buff2 + " && echo 1 || echo 0"))) // GG: Irix Only { $gXBMLANGPATH[$ndx++] = $buff2; } } } } return $gXBMLANGPATH; }