next up previous
Next: get_description_...() Up: Brain Volume I/O Handling Previous: get_description()

scanf_description()  

Parse header description entry beloning to a key



Synopsis


int 
scanf_description( header *h, char *lhs, char *format, void *dest)


Description
Search through all description strings to find the one that has a matching key (lhs). The corresponding value is scanned using sscanf and format string format destination is *dest.

OK is returned on success, ERROR if either the matching lhs string is not found or if the sscanf() did not succeed.

Usage

  float min;
  header *hdr;
  hdr = new_header();
  read_header("myvolume.vol", hdr);
  if (scanf_description(hdr, "min", "0.000000", &min) == OK)
    print(STD, "File header says minimum scan value is 0.000000\n", min);
  else
    print(STD, "No information about scan minimum found in header.");
  free_header(hdr);

Revision


1.0  29/10-96   Ulrik Kjems


Program listing






Ulrik Kjems
6/3/1998