Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (s) step(3)
EXAMPLES
The following is an example of the regular expression macros and calls from the grep command:
#define INIT register char *sp=instring;
#define GETC( ) (*sp++)
#define PEEKC( ) (*sp)
#define UNGETC(c) (--sp)
#define RETURN(c) return;
#define ERROR(c) regerr( )
#include <regexp.h>
...
compile (patstr, expbuf, &expbuf[ESIZE], ’\0’);
...
if (step (linebuf, expbuf))
succeed( );
...
RETURN VALUES
Whenever a successful match occurs, the step( ) macro returns a nonzero value. Upon failure,
this macro returns a value of 0 (zero).
ERRORS
None. This macro does not set errno.
RELATED INFORMATION
Functions: advance(3), compile(3), isalpha(3), regcomp(3), regexec(3),
Commands: ed(1), sed(1), grep(1).
527187-017 Hewlett-Packard Company 6−129