Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.sysv386 Subject: "index" and "strchr" (was Re: uudecode on ISC 386/ix 1.0.6) Message-ID: <4050@auspex.auspex.com> Date: 11 Sep 90 18:39:19 GMT References: <755@sci34hub.UUCP> Distribution: usa Organization: Auspex Systems, Santa Clara Lines: 17 >I pulled uudecode.c from uunet, but it needs something called index() >which isn't defined in a SysV environment. No, it just needs something that does what "index()" does. AT&T renamed "index()" (which is what it was called in V7) to "strchr()" somewhere along the line; just replace all calls to "index()" (and declarations of same; if there's a "#include ", replace it with "#include ") with calls to (and declarations of) "strchr()". The same applies to "rindex()" and "strrchr()". 4.3BSD and later releases have both the "*index()" and "str*chr()" routines, and S5R4 will have "index()" and "rindex()" either in a standard or BSD-compatibility library. ANSI C specifies "strchr()" and "strrchr()", so future programs should probably be written using them, with #defines or whatever to enable them to compile on older systems with the older routines.