]> git.sur5r.net Git - openldap/blobdiff - libraries/liblunicode/utbm/utbm.c
Merge remote branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / libraries / liblunicode / utbm / utbm.c
index 32904b0aa9b1a263ca8e70e5a152202570436c26..b823efcc23a35ef80f84abeab27152d78bae4fa4 100644 (file)
@@ -1,5 +1,18 @@
-/*
- * 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
@@ -20,9 +33,7 @@
  * 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:
@@ -75,13 +86,7 @@ typedef struct _utbm_pattern_t {
  * 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;
@@ -105,15 +110,8 @@ ucs2_t *start, *end;
 }
 
 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;
@@ -231,26 +229,17 @@ unsigned long *match_start, *match_end;
  *************************************************************************/
 
 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;
@@ -265,15 +254,8 @@ utbm_pattern_t pattern;
 }
 
 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;
@@ -449,15 +431,8 @@ utbm_pattern_t p;
 }
 
 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;