X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fphonetic.c;h=bfd2011be191f8017d61e7f00e830f514f7d54e9;hb=d9e7a7190b5f9e84dc0dba80f5bf1af993190218;hp=f5e402f33039344b794c9c8a665f9f8a912bff10;hpb=9c3ed0310bc6de304f58f74daf967e6d405a19a5;p=openldap diff --git a/servers/slapd/phonetic.c b/servers/slapd/phonetic.c index f5e402f330..bfd2011be1 100644 --- a/servers/slapd/phonetic.c +++ b/servers/slapd/phonetic.c @@ -1,6 +1,7 @@ /* phonetic.c - routines to do phonetic matching */ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -15,15 +16,15 @@ #include "slap.h" -#if !defined(METAPHONE) && !defined(SLAPD_PHONETIC) -#define METAPHONE +#if !defined(SLAPD_METAPHONE) && !defined(SLAPD_PHONETIC) +#define SLAPD_METAPHONE #endif #define iswordbreak(x) (!isascii(x) || isspace((unsigned char) (x)) || \ ispunct((unsigned char) (x)) || \ isdigit((unsigned char) (x)) || (x) == '\0') -char * +static char * first_word( char *s ) { if ( s == NULL ) { @@ -41,7 +42,7 @@ first_word( char *s ) return( s ); } -char * +static char * next_word( char *s ) { if ( s == NULL ) { @@ -63,7 +64,7 @@ next_word( char *s ) return( s ); } -char * +static char * word_dup( char *w ) { char *s, *ret; @@ -160,9 +161,12 @@ phonetic( char *s ) return( ch_strdup( phoneme ) ); } -#else -#if defined(METAPHONE) +#elif defined(SLAPD_METAPHONE) +/* + * Metaphone was originally developed by Lawrence Philips and + * published in the "Computer Language" magazine in 1990. + */ /* * Metaphone copied from C Gazette, June/July 1991, pp 56-57, * author Gary A. Parker, with changes by Bernard Tiffany of the @@ -431,5 +435,4 @@ phonetic( char *Word ) return( ch_strdup( buf ) ); } -#endif /* metaphone */ -#endif /* SLAPD_PHONETIC */ +#endif /* SLAPD_METAPHONE */