regfree.c

Go to the documentation of this file.
00001 /*
00002  * regfree - free an RE
00003  *
00004  * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
00005  *
00006  * Development of this software was funded, in part, by Cray Research Inc.,
00007  * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
00008  * Corporation, none of whom are responsible for the results.  The author
00009  * thanks all of them.
00010  *
00011  * Redistribution and use in source and binary forms -- with or without
00012  * modification -- are permitted for any purpose, provided that
00013  * redistributions in source form retain this entire copyright notice and
00014  * indicate the origin and nature of any modifications.
00015  *
00016  * I'd appreciate being given credit for this package in the documentation of
00017  * software which uses it, but that is not a requirement.
00018  *
00019  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
00020  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00021  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
00022  * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *
00030  * You might think that this could be incorporated into regcomp.c, and that
00031  * would be a reasonable idea... except that this is a generic function (with
00032  * a generic name), applicable to all compiled REs regardless of the size of
00033  * their characters, whereas the stuff in regcomp.c gets compiled once per
00034  * character size.
00035  */
00036 
00037 #include "regguts.h"
00038 
00039 /*
00040  - regfree - free an RE (generic function, punts to RE-specific function)
00041  *
00042  * Ignoring invocation with NULL is a convenience.
00043  */
00044 void
00045 regfree(
00046     regex_t *re)
00047 {
00048     if (re == NULL) {
00049         return;
00050     }
00051     (*((struct fns *)re->re_fns)->free)(re);
00052 }
00053 
00054 /*
00055  * Local Variables:
00056  * mode: c
00057  * c-basic-offset: 4
00058  * fill-column: 78
00059  * End:
00060  */



Generated on Wed Mar 12 12:18:10 2008 by  doxygen 1.5.1