/*  Hipparcos ASCII CD-ROM load and search routines Release 1.1 June 1997
    William O'Mullane 
    Astrophysics Division, ESTEC, Noordwijk, The Netherlands. 
    See the readme.pdf file for more information */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "utils.h" 
#include "hp_notes.h"  
#include "ihpnotes.h" 

main (int argc,char **argv)
{
   array_hp_notes anentry ;
   int headPrinted=0;

   if (argc == 1) 
   { 
        fprintf (stderr,"You must pass a key value on the command line \n");
   }
   else /* some numbers on the command line */
   { 
	int i,decode=ASRAW,cols=0,quite=0;
	long multiRecs=0,recNo;
	FILE* dataFile;
	for (i=1; i<argc ; i++)
	{
	   INT rec; 
	   
   	   checkIfCommandLineFlag(argv,argc,&i,&cols,&decode,&quite,&multiRecs);
	   

	strAsINT( argv[i], &rec);
	if ((dataFile = search_hp_notes (&rec,&anentry)) != 0)
	{
	    if (multiRecs > 1)
		{
		   printf("WARNING: +n option not supported for this program\n");
		}
		if (cols)
	    	   {
	    	      
	    	      print_array_hp_notes_cols (&anentry, decode); 
	    	   }
	    	   else
	       	      print_array_hp_notes (&anentry, decode); 
	}

	   else
	      printf("%d not found\n",rec.value);
	}
   }
 
} /* End Main for idx_hp_notes_test */

