-/*
- * Copyright 1997, 1998, 1999 Computing Research Labs,
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2013 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* Copyright 1997, 1998, 1999 Computing Research Labs,
* New Mexico State University
*
* Permission is hereby granted, free of charge, to any person obtaining a
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef lint
-static char rcsid[] = "$Id: utbm.c,v 1.1 1999/09/21 15:45:17 mleisher Exp $";
-#endif
+/* $Id: utbm.c,v 1.1 1999/09/21 15:45:17 mleisher Exp $ */
/*
* Assumptions:
* Routine to look up the skip value for a character.
*/
static unsigned long
-#ifdef __STDC__
_utbm_skip(utbm_pattern_t p, ucs2_t *start, ucs2_t *end)
-#else
-_utbm_skip(p, start, end)
-utbm_pattern_t p;
-ucs2_t *start, *end;
-#endif
{
unsigned long i;
ucs4_t c1, c2;
}
static int
-#ifdef __STDC__
_utbm_match(utbm_pattern_t pat, ucs2_t *text, ucs2_t *start, ucs2_t *end,
unsigned long *match_start, unsigned long *match_end)
-#else
-_utbm_match(pat, text, start, end, match_start, match_end)
-utbm_pattern_t pat;
-ucs2_t *text, *start, *end;
-unsigned long *match_start, *match_end;
-#endif
{
int check_space;
ucs4_t c1, c2;
*************************************************************************/
utbm_pattern_t
-#ifdef __STDC__
utbm_create_pattern(void)
-#else
-utbm_create_pattern()
-#endif
{
utbm_pattern_t p;
p = (utbm_pattern_t) malloc(sizeof(_utbm_pattern_t));
- (void) memset((char *) p, 0, sizeof(_utbm_pattern_t));
+ (void) memset((char *) p, '\0', sizeof(_utbm_pattern_t));
return p;
}
void
-#ifdef __STDC__
utbm_free_pattern(utbm_pattern_t pattern)
-#else
-utbm_free_pattern(pattern)
-utbm_pattern_t pattern;
-#endif
{
if (pattern == 0)
return;
}
void
-#ifdef __STDC__
utbm_compile(ucs2_t *pat, unsigned long patlen, unsigned long flags,
utbm_pattern_t p)
-#else
-utbm_compile(pat, patlen, flags, p)
-ucs2_t *pat;
-unsigned long patlen, flags;
-utbm_pattern_t p;
-#endif
{
int have_space;
unsigned long i, j, k, slen;
}
int
-#ifdef __STDC__
utbm_exec(utbm_pattern_t pat, ucs2_t *text, unsigned long textlen,
unsigned long *match_start, unsigned long *match_end)
-#else
-utbm_exec(pat, text, textlen, match_start, match_end)
-utbm_pattern_t pat;
-ucs2_t *text;
-unsigned long textlen, *match_start, *match_end;
-#endif
{
unsigned long k;
ucs2_t *start, *end;