What does index() and rindex() do ??

Dave Decot decot at hpisod2.cup.hp.com
Fri Mar 29 07:59:02 AEST 1991


> Could anyone please tell me what rindex() and index() are supposed to do ??
> 
> I found these in a bsd-source and since I'm on a SYSV I can't find them.

They are supposed to do precisely what strrchr() and strchr() do,
respectively.

You can solve the problem by adding this:

#define index	strchr
#define rindex	strrchr

to all the source files that use them (or to a global header file), or
by adding:

   -Dindex=strchr -Drindex=strrchr

to your CFLAGS environment variable, either directly or in the Makefile.

Dave Decot



More information about the Comp.unix.programmer mailing list