sl@0
|
1 |
/*
|
sl@0
|
2 |
* regfree - free an RE
|
sl@0
|
3 |
*
|
sl@0
|
4 |
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
|
sl@0
|
5 |
*
|
sl@0
|
6 |
* Development of this software was funded, in part, by Cray Research Inc.,
|
sl@0
|
7 |
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
|
sl@0
|
8 |
* Corporation, none of whom are responsible for the results. The author
|
sl@0
|
9 |
* thanks all of them.
|
sl@0
|
10 |
*
|
sl@0
|
11 |
* Redistribution and use in source and binary forms -- with or without
|
sl@0
|
12 |
* modification -- are permitted for any purpose, provided that
|
sl@0
|
13 |
* redistributions in source form retain this entire copyright notice and
|
sl@0
|
14 |
* indicate the origin and nature of any modifications.
|
sl@0
|
15 |
*
|
sl@0
|
16 |
* I'd appreciate being given credit for this package in the documentation
|
sl@0
|
17 |
* of software which uses it, but that is not a requirement.
|
sl@0
|
18 |
*
|
sl@0
|
19 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
sl@0
|
20 |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
sl@0
|
21 |
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
sl@0
|
22 |
* HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
sl@0
|
23 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
sl@0
|
24 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
sl@0
|
25 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
sl@0
|
26 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
sl@0
|
27 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
sl@0
|
28 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
sl@0
|
29 |
*
|
sl@0
|
30 |
*
|
sl@0
|
31 |
*
|
sl@0
|
32 |
* You might think that this could be incorporated into regcomp.c, and
|
sl@0
|
33 |
* that would be a reasonable idea... except that this is a generic
|
sl@0
|
34 |
* function (with a generic name), applicable to all compiled REs
|
sl@0
|
35 |
* regardless of the size of their characters, whereas the stuff in
|
sl@0
|
36 |
* regcomp.c gets compiled once per character size.
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
|
sl@0
|
39 |
#include "regguts.h"
|
sl@0
|
40 |
|
sl@0
|
41 |
/*
|
sl@0
|
42 |
- regfree - free an RE (generic function, punts to RE-specific function)
|
sl@0
|
43 |
*
|
sl@0
|
44 |
* Ignoring invocation with NULL is a convenience.
|
sl@0
|
45 |
*/
|
sl@0
|
46 |
VOID
|
sl@0
|
47 |
regfree(re)
|
sl@0
|
48 |
regex_t *re;
|
sl@0
|
49 |
{
|
sl@0
|
50 |
if (re == NULL)
|
sl@0
|
51 |
return;
|
sl@0
|
52 |
(*((struct fns *)re->re_fns)->free)(re);
|
sl@0
|
53 |
}
|