next up previous
Next: scan_these() Up: Brain Volume I/O Handling Previous: new_description()

read_lhs_rhs()  

Parse a string for lhs = rhs



Synopsis


int
read_lhs_rhs (char *line, char *lhs, char *rhs, char *maxc)


Description
This function parses the string in line for abc=defg
and returns "abs" in *lhs and "defg" in *rhs.

If no "=" in line, lhs=line and rhs is a null string. maxc is an optional pointer to where the string line should end (if not terminated by a 0 character).

Usage

  char line[100], rhs[100], lhs[100];
  strcpy(line, "  abra=ca dabra");
  read_lhs_rhs(line, rhs, lhs);  
     // Now rhs="ca dabra" and lhs="abra"

Revision


1.0  29/10-96   Ulrik Kjems


Program listing






Ulrik Kjems
6/3/1998