Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gwsd.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!ittatc!dcdwest!sdcsvax!gwsd!revc From: revc@gwsd.UUCP (Bob Van Cleef) Newsgroups: net.micro.att Subject: BSD - SYS V compatability (Org: Shar Archiver on 3b2) Message-ID: <137@gwsd.UUCP> Date: Tue, 23-Jul-85 11:21:08 EDT Article-I.D.: gwsd.137 Posted: Tue Jul 23 11:21:08 1985 Date-Received: Fri, 26-Jul-85 04:16:04 EDT Organization: Gateway Computer Systems, San Diego Lines: 45 Keywords: index rindex SYSV [] I would like to thank everyone who responded to my question on the function index(). It seems that I got bit by a well known difference between BSD and SYS V. In fact, if I had checked my notes... -------------- If you are running SYS V you should already have getopt. It is on page 3-103 in the SYS V Rel.1 "C Programming Manual". (Which doesn't have the Sect. 3 man pages or an index to the functions.) You can make the posted routines work, by changing index to strchr and rindex to strrchr. -------------- When compiling: cc -O -o xxx -Dindex=strchr xxx.c or cc -O -o xxx -Drindex=strrchr xxx.c -------------- Or add to the source file: #define index(a,b) strchr(a,b) -------------- For standard distribution files: (Lets make them portable people!) Add -DUSG in your makefile: #ifdef USG #define index strchr #define rindex strchr #endif -------------- Thanks again to everyone who responded. Bob -- Bob Van Cleef ...sdcsvax!gwsd!revc Gateway Computer Systems (619) 457-2701 4980 Carroll Canyon Road San Diego, CA 92121