remove SYSV and is68k ifdef's
[unix-history] / usr / src / usr.bin / make / str.c
index fd1c6f9..50c9bf9 100644 (file)
@@ -1,18 +1,32 @@
-/*-
- * str.c --
- *     General utilites for handling strings.
- *
- * Copyright (c) 1988, 1989 by the Regents of the University of California
+/*
+ * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
  * Copyright (c) 1988, 1989 by Adam de Boor
  * Copyright (c) 1989 by Berkeley Softworks
  * Copyright (c) 1988, 1989 by Adam de Boor
  * Copyright (c) 1989 by Berkeley Softworks
+ * All rights reserved.
  *
  *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any non-commercial purpose
- * and without fee is hereby granted, provided that the above copyright
- * notice appears in all copies.  The University of California,
- * Berkeley Softworks and Adam de Boor make no representations about
- * the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
+ * This code is derived from software contributed to Berkeley by
+ * Adam de Boor.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)str.c      5.4 (Berkeley) %G%";
+#endif /* not lint */
+
+/*-
+ * str.c --
+ *     General utilites for handling strings.
  *
  * Interface:
  *     Str_Concat              Concatenate two strings, placing some sort
  *
  * Interface:
  *     Str_Concat              Concatenate two strings, placing some sort
  *                             the two strings, all this under the control
  *                             of the STR_ flags given as the third arg.
  *
  *                             the two strings, all this under the control
  *                             of the STR_ flags given as the third arg.
  *
- *     Str_New                 Duplicate a string and return the copy.
- *
- *     Str_FindSubstring       Find a substring within a string (from
- *                             original Sprite libc).
+ *     Str_FindSubstring       Find a substring within a string
  *
  *     Str_Match               Pattern match two strings.
  */
  *
  *     Str_Match               Pattern match two strings.
  */
-#ifndef lint
-static char     *rcsid = "$Id: str.c,v 1.22 89/11/14 13:44:07 adam Exp $ SPRITE (Berkeley)";
-#endif lint
 
 #include    "make.h"
 
 
 #include    "make.h"
 
@@ -97,30 +105,7 @@ Str_Concat (s1, s2, flags)
     }
     return (result);
 }
     }
     return (result);
 }
-\f
-/*-
- *-----------------------------------------------------------------------
- * Str_New  --
- *     Create a new unique copy of the given string
- *
- * Results:
- *     A pointer to the new copy of it
- *
- * Side Effects:
- *     None
- *-----------------------------------------------------------------------
- */
-char *
-Str_New (str)
-    char           *str;       /* string to duplicate */
-{
-    register char  *cp;                /* new space */
 
 
-    cp = malloc (strlen (str) + 1);
-    (void) strcpy (cp, str);
-    return (cp);
-}
-\f
 static char
 DoBackslash (c)
     char c;
 static char
 DoBackslash (c)
     char c;
@@ -134,7 +119,7 @@ DoBackslash (c)
        default:  return (c);
     }
 }
        default:  return (c);
     }
 }
-\f
+
 /*-
  *-----------------------------------------------------------------------
  * Str_BreakString --
 /*-
  *-----------------------------------------------------------------------
  * Str_BreakString --
@@ -265,7 +250,7 @@ Str_BreakString (str, breaks, end, argcPtr)
     
     return av;
 }
     
     return av;
 }
-\f
+
 /*-
  *-----------------------------------------------------------------------
  * Str_FreeVec --
 /*-
  *-----------------------------------------------------------------------
  * Str_FreeVec --
@@ -290,8 +275,7 @@ Str_FreeVec (count, vecPtr)
     }
     free (vecPtr);
 }
     }
     free (vecPtr);
 }
-#ifndef Sprite
-\f
+
 /*
  *----------------------------------------------------------------------
  * Str_FindSubstring --
 /*
  *----------------------------------------------------------------------
  * Str_FindSubstring --
@@ -341,8 +325,6 @@ Str_FindSubstring(string, substring)
     return (char *) NULL;
 }
 
     return (char *) NULL;
 }
 
-#endif /* !Sprite */
-\f
 /*
  *----------------------------------------------------------------------
  *
 /*
  *----------------------------------------------------------------------
  *