#!@PHP@ -q 3) { print "Usage:\n\tbibformat [itype=] [otype=]\n"; exit; } foreach($argv as $value) { if ($value == "-V" || $value == "--version") { print $__version__."\n"; exit(); } if ($value == "-h" || $value == "--help") { print "Usage:\n\tbibformat [itype=] [otype=]\n"; exit(); } $par=explode("=", strtoupper(trim($value))); if(count($par)>1) { if($par[0]=="ITYPE") { if(trim($par[1])!="") { $itype=$par[1]; } } elseif($par[0]=="OTYPE") { if(trim($par[1])!="") { $otype=explode(",", $par[1]); } } } } $fxk=new FlexElink(); $error=$fxk->initialise("OAIMARC"); $err_fh=fopen("php://stderr", "w"); if($error) { fputs($err_fh, "Error initialising: $error"); exit; } $stime=getTime(); $code=0; $count_rec=0; while(1) { list($code, $res)=$fxk->getRecordResult($otype); if($code<0) break; if($code==0) { fputs($err_fh, "--------------------------------------------------------\n"); fputs($err_fh, "Errors processing record# $count_rec\n"); fputs($err_fh, "$res\n"); fputs($err_fh, "--------------------------------------------------------\n"); continue; } print eval("?>$res