When dealing with such problems, I always ended up coding very
simple loops looking for the start and end of the keywords etc. using
char pointers, then moving the data out of the line buffer and doing
the compare, like the following

char *cp1;
char *cp2;
int l;
char bufx [MAXL_KEYWORD];

cp1 = line_buffer;
while (*cp1 == ' ') cp1 ++;
cp2 = cp1;
while (*cp2 != ' ' && *cp2 != '=' & *cp2 != 0x00) cp2 ++;
l = cp2 - cp1;
memcpy (bufx, cp1, l);
cp1 = cp2;
while (*cp1 != '=' & *cp1 != 0x00) cp1++;

/* now bufx contains keyword, cp1 points at = sign */

etc. etc.

It's easy, because you're always sure that the line will be terminated by a hex zero which will throw you out of the loops. So you can add the error checking for non-existence of the keyword, missing equal sign, keyword too long etc., as needed ...

Kind regards

Bernd




Am 25.04.2013 08:35, schrieb Scott Ford:
Guys,

I would love to look at C++ but the powers to be want C. I am but a mere worker 
bee

Scott ford
www.identityforge.com
from my IPAD

'Infinite wisdom through infinite means'



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to