#include <stdio.h>
#include "evap.h"
#include "qa_pdt_out"

int main(int argc,
	 char *argv[]);

int main (int argc, char *argv[])

/* evap - a typical example, type-converted values, types, lists */

{
  int i;
  evap_List_Value *lve;		/* list value entry */

  evap ( &argc, &argv, pdt, NULL, pvt ); /* evaluate parameters */
  printf( "\nProgram name:\n  %s\n", pvt[P_HELP].unconverted_value );

  printf( "\nverbose = %d\n", pvt[P_verbose].value.switch_value );

  printf( "\ncommand = \"%s\"\n", pvt[P_command].value.string_value );
  printf( "'list of' command2 = " );
  lve = pvt[P_command2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%s\"", lve->value.string_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\nscale_factor = %f\n", pvt[P_scale_factor].value.real_value );
  printf( "'list of' scale_factor2 = " );
  lve = pvt[P_scale_factor2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%lg\"", lve->value.real_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\nmillisecond_update_interval = %d\n",
	 pvt[P_millisecond_update_interval].value.integer_value );
  printf( "'list of' millisecond_update_interval2 = " );
  lve = pvt[P_millisecond_update_interval2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%d\"", lve->value.integer_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\nignore_output_file_column_one = %d\n",
	 pvt[P_ignore_output_file_column_one].value.boolean_value );
  printf( "'list of' ignore_output_file_column_one2 = " );
  lve = pvt[P_ignore_output_file_column_one2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%d\"", lve->value.boolean_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\noutput = %s\n", pvt[P_output].value.file_value );
  printf( "'list of' output2 = " );
  lve = pvt[P_output2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%s\"", lve->value.file_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\nqueue = %s\n", pvt[P_queue].value.key_value );
  printf( "'list of' queue2 = " );
  lve = pvt[P_queue2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%s\"", lve->value.key_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\ndestination = %s\n", pvt[P_destination].value.application_value );
  printf( "'list of' destination2 = " );
  lve = pvt[P_destination2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%s\"", lve->value.application_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  printf( "\ntty = %s\n", pvt[P_tty].value.application_value );
  printf( "'list of' tty2 = " );
  lve = pvt[P_tty2].list;
  while ( lve->unconverted_value != NULL ) {
    printf( "\"%s\"", lve->value.name_value );
    lve++;			/* next list value entry */
    printf( "%s", lve->unconverted_value !=NULL ? ", " : "" );
  } /* whilend */
  printf( "\n" );

  if (argc > 1) {
    printf("\nFile names:\n  ");
    for(i=1; i < argc; i++)
      printf("%s%s", argv[i], (i < argc-1) ? " " : "");
    printf("\n");
  }

  exit( 0 );

} /* end main */
