function parse_palmdesktop($file, $exc_private = 1)
{
    exec(EscapeShellCmd("perl tools/palm_datebook.pl {$file} {$exc_private}"), $Entries);
    $data = array();
    while (list($line_num, $line) = each($Entries)) {
        $data[] = ParseLine($line);
    }
    return $data;
}
function ReadAirspace($openairFilename) {

  global $Rotation ,$CenterX , $CenterY ,$Radius, $LineCount;
  global $NumberOfAirspaceAreas;
  global $bWaiting ;
  global $TempArea , $TempPoint, $TempString;
  
  DEBUG("checkAirspace",128,"ReadAirspace");


  $NumberOfAirspaceAreas=0;



  $TempString=array();
  $TempArea=new AIRSPACE_AREA();
  $TempPoint=new AIRSPACE_POINT();

  $LineCount = 0;
  $CenterY = $CenterX = $Radius = 0;
  $Rotation = 1;
  $bWaiting = true;

  DEBUG("checkAirspace",128,"Loading Airspace File...");


  $fp = fopen($openairFilename,"r");
  if (!$fp ) {
  	echo "Cannot read airspace file: $openairFilename<BR>";
	return 0;
  }
  
  while( ($nLineType = GetNextLine($fp, $TempString) )  >= 0 )
  {
		// DEBUG("checkAirspace",128,"GetNextLine(outside): type: $nLineType got: $TempString");	
		if ( !ParseLine($nLineType) ){
			DEBUG("checkAirspace",128,"Error in result from ParseLine()");
			return;
		}
  }
  // Process final area (if any).
  if (!$bWaiting) AddArea($TempArea);


  FindAirspaceBounds();
  // StoreAirspace();
  
}