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