os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/regfree.c
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/regfree.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,53 @@
1.4 +/*
1.5 + * regfree - free an RE
1.6 + *
1.7 + * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
1.8 + *
1.9 + * Development of this software was funded, in part, by Cray Research Inc.,
1.10 + * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
1.11 + * Corporation, none of whom are responsible for the results. The author
1.12 + * thanks all of them.
1.13 + *
1.14 + * Redistribution and use in source and binary forms -- with or without
1.15 + * modification -- are permitted for any purpose, provided that
1.16 + * redistributions in source form retain this entire copyright notice and
1.17 + * indicate the origin and nature of any modifications.
1.18 + *
1.19 + * I'd appreciate being given credit for this package in the documentation
1.20 + * of software which uses it, but that is not a requirement.
1.21 + *
1.22 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
1.23 + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
1.24 + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
1.25 + * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
1.26 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
1.27 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
1.28 + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
1.29 + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
1.30 + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1.31 + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.32 + *
1.33 + *
1.34 + *
1.35 + * You might think that this could be incorporated into regcomp.c, and
1.36 + * that would be a reasonable idea... except that this is a generic
1.37 + * function (with a generic name), applicable to all compiled REs
1.38 + * regardless of the size of their characters, whereas the stuff in
1.39 + * regcomp.c gets compiled once per character size.
1.40 + */
1.41 +
1.42 +#include "regguts.h"
1.43 +
1.44 +/*
1.45 + - regfree - free an RE (generic function, punts to RE-specific function)
1.46 + *
1.47 + * Ignoring invocation with NULL is a convenience.
1.48 + */
1.49 +VOID
1.50 +regfree(re)
1.51 +regex_t *re;
1.52 +{
1.53 + if (re == NULL)
1.54 + return;
1.55 + (*((struct fns *)re->re_fns)->free)(re);
1.56 +}