NAME

RgetMinVal - get minimum cell value

SYNOPSIS

#include "csf.h"

int RgetMinVal
(
	const MAP *map,
	void *minVal
);

PARAMETERS

const MAP *map
map handle
void *minVal
write-only. Minimum value or missing value

DESCRIPTION

RgetMinVal returns the value stored in the header as the minimum value. If the minMaxStatus is MM_WRONGVALUE then a missing value is returned.

RETURNS

0 if argument minVal is returned with a missing value, nonzero if not.

EXAMPLE

#include 
#include "csf.h"

/* write some features of
 * a map to stdout
 * use REAL8 (biggest type),
 * works for all maps.
 */

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

  REAL8 min,max;
  MAP *map;                      

  if (argc != 2)
  {
   fprintf(stderr,"%s: no file specified\n",argv[0]);
   exit(1);
  }

  map = Mopen(argv[1], M_READ);
  if (map == NULL)  
  {  
     Mperror(argv[1]);
     exit(1);
  }

  RuseAs(map, CR_REAL8); 

  /* min/max value */
  printf("min/max (header): ");
  if (RgetMinVal(map,&min))
      printf("%g ",min);
  else
      printf("MV ");
  if (RgetMaxVal(map,&max))
      printf("%g \n",max);
  else
      printf("MV \n");

  Mclose(map);

  exit(0);
}