1 |
– |
/* Copyright (c) 1990 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
+ |
/* |
5 |
+ |
* Regular expression parsing routines. |
6 |
+ |
* |
7 |
+ |
* External symbols declared in standard.h |
8 |
+ |
*/ |
9 |
|
|
10 |
+ |
#include "copyright.h" |
11 |
+ |
|
12 |
|
#include <stdio.h> |
13 |
+ |
#include <stdlib.h> |
14 |
|
#include <ctype.h> |
15 |
|
/* |
16 |
|
* rexpr.c - regular expression parser (ala grep) |
132 |
|
char * |
133 |
|
expsave() /* save compiled string */ |
134 |
|
{ |
129 |
– |
extern char *malloc(); |
135 |
|
register char *ep; |
136 |
|
|
137 |
|
if (explen == 0) |
138 |
|
return(NULL); |
139 |
< |
if ((ep = malloc(explen+3)) == NULL) |
139 |
> |
if ((ep = (char *)malloc(explen+3)) == NULL) |
140 |
|
return(NULL); |
141 |
|
ep[0] = iflag; |
142 |
|
ep[1] = circf; |
145 |
|
return(ep); |
146 |
|
} |
147 |
|
|
148 |
+ |
void |
149 |
|
expset(ep) /* install saved string */ |
150 |
|
register char *ep; |
151 |
|
{ |