| 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 |
+ |
#include <string.h> |
| 16 |
+ |
|
| 17 |
|
/* |
| 18 |
|
* rexpr.c - regular expression parser (ala grep) |
| 19 |
|
*/ |
| 134 |
|
char * |
| 135 |
|
expsave() /* save compiled string */ |
| 136 |
|
{ |
| 129 |
– |
extern char *malloc(); |
| 137 |
|
register char *ep; |
| 138 |
|
|
| 139 |
|
if (explen == 0) |
| 140 |
|
return(NULL); |
| 141 |
< |
if ((ep = malloc(explen+3)) == NULL) |
| 141 |
> |
if ((ep = (char *)malloc(explen+3)) == NULL) |
| 142 |
|
return(NULL); |
| 143 |
|
ep[0] = iflag; |
| 144 |
|
ep[1] = circf; |
| 147 |
|
return(ep); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
+ |
void |
| 151 |
|
expset(ep) /* install saved string */ |
| 152 |
|
register char *ep; |
| 153 |
|
{ |
| 272 |
|
cclass(set, c, af) |
| 273 |
|
register char *set; |
| 274 |
|
register c; |
| 275 |
+ |
int af; |
| 276 |
|
{ |
| 277 |
|
register n; |
| 278 |
|
|