Re: BSD systems may have this problem with intermud: (fwd)

From: Chaotic (chaotic@eskimo.com)
Date: 05/08/96


On Wed, 8 May 1996, Michael Scott mumbled:

[stuff about 'discon'/'connect' deleted]

> 	So to solve this problem, I had to re-write a personal version
> of strtok command which would return what it was supposed to, (named 
> str_tok) and then rename all the function calls through out intermud.c
> and act.intermud.c from strtok to str_tok.  (I added the new str_tok into
> utils.c and put a prototype in utils.h for it.

[code sample deleted]

why not just #define it in/out of the system instead of changing all
occurances of strtok()?  other os's besides netbsd could be added if
needed in the future, otherwise use the standard lib functions.  for
example:

#if defined(NETBSD)
  #if !defined(STR_TOK)
    char *str_tok(char *string, char *token) /* strtok() replacement */
    {
      ...
      ...
    }
    #define strtok(x,y) str_tok(x,y)    /* redefine the lib function */
    #define STR_TOK                     /* only do this once!        */
  #endif
#endif

the same thing could be done for the prototyping in your .h file.

no flame... just a thought.  why reinvent the wheel if the one you have
already rolls straight?  but if your wheel is broken... :)

Lauren



This archive was generated by hypermail 2b30 : 12/18/00 PST