Ignore:
Timestamp:
Nov 26, 2002, 10:24:54 PM (23 years ago)
Author:
bird
Message:

Import of RELENG_4_7_0_RELEASE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FREEBSD/src/kmk/str.c

    r10 r24  
    3535 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    3636 * SUCH DAMAGE.
    37  *
    38  * @(#)str.c    5.8 (Berkeley) 6/1/90
    39  */
    40 
    41 #include <sys/cdefs.h>
    42 __FBSDID("$FreeBSD: src/usr.bin/make/str.c,v 1.25 2002/10/09 03:42:10 jmallett Exp $");
     37 */
     38
     39#ifndef lint
     40#if 0
     41static char sccsid[] = "@(#)str.c       5.8 (Berkeley) 6/1/90";
     42#else
     43static const char rcsid[] =
     44  "$FreeBSD: src/usr.bin/make/str.c,v 1.12.2.1 2002/06/17 04:30:48 jmallett Exp $";
     45#endif
     46#endif /* not lint */
    4347
    4448#include "make.h"
     
    5357 */
    5458void
    55 str_init(void)
     59str_init()
    5660{
    5761    char *p1;
     
    6771 */
    6872void
    69 str_end(void)
     73str_end()
    7074{
    7175    if (argv) {
    7276        if (argv[0])
    7377            free(argv[0]);
    74         free(argv);
     78        free((Address) argv);
    7579    }
    7680    if (buffer)
     
    8791 */
    8892char *
    89 str_concat(char *s1, char *s2, int flags)
    90 {
    91         int len1, len2;
    92         char *result;
     93str_concat(s1, s2, flags)
     94        char *s1, *s2;
     95        int flags;
     96{
     97        register int len1, len2;
     98        register char *result;
    9399
    94100        /* get the length of both strings */
     
    116122        /* free original strings */
    117123        if (flags & STR_DOFREE) {
    118                 (void)efree(s1);
    119                 (void)efree(s2);
     124                (void)free(s1);
     125                (void)free(s2);
    120126        }
    121127        return(result);
     
    133139 */
    134140char **
    135 brk_string(char *str, int *store_argc, Boolean expand)
    136 {
    137         int argc, ch;
    138         char inquote, *p, *start, *t;
     141brk_string(str, store_argc, expand)
     142        register char *str;
     143        int *store_argc;
     144        Boolean expand;
     145{
     146        register int argc, ch;
     147        register char inquote, *p, *start, *t;
    139148        int len;
    140149
     
    237246                                ch = '\t';
    238247                                break;
    239                         default:
    240                                 break;
    241                         }
    242                         break;
    243                 default:
     248                        }
    244249                        break;
    245250                }
     
    262267 *
    263268 * Side effects: None.
    264  *
    265  * XXX should be strstr(3).
    266269 */
    267270char *
    268 Str_FindSubstring(char *string, char *substring)
    269 {
    270         char *a, *b;
     271Str_FindSubstring(string, substring)
     272        register char *string;          /* String to search. */
     273        char *substring;                /* Substring to find in string */
     274{
     275        register char *a, *b;
    271276
    272277        /*
     
    303308 */
    304309int
    305 Str_Match(char *string, char *pattern)
     310Str_Match(string, pattern)
     311        register char *string;          /* String */
     312        register char *pattern;         /* Pattern */
    306313{
    307314        char c2;
     
    406413 */
    407414char *
    408 Str_SYSVMatch(char *word, char *pattern, int *len)
     415Str_SYSVMatch(word, pattern, len)
     416    char        *word;          /* Word to examine */
     417    char        *pattern;       /* Pattern to examine against */
     418    int         *len;           /* Number of characters to substitute */
    409419{
    410420    char *p = pattern;
     
    469479 */
    470480void
    471 Str_SYSVSubst(Buffer buf, char *pat, char *src, int len)
     481Str_SYSVSubst(buf, pat, src, len)
     482    Buffer buf;
     483    char *pat;
     484    char *src;
     485    int   len;
    472486{
    473487    char *m;
Note: See TracChangeset for help on using the changeset viewer.