return name;
}
-/*
- * Test whether string appears in list of strings, ignoring case. NULL or empty
- * strings will be ignored.
- * Enter: list List to process.
- * str String to test.
- * Return: TRUE if string is unique.
- */
-gboolean mgu_slist_test_unq_nc( GSList *list, gchar *str ) {
- GSList *node;
-
- if( str ) {
- if( strlen( str ) > 0 ) {
- node = list;
- while( node ) {
- if( g_utf8_collate( str, node->data ) == 0 )
- return FALSE;
- node = g_slist_next( node );
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- * Test whether string appears in list of strings, ignoring case. NULL or empty
- * strings will be ignored.
- * Enter: list List to process.
- * str String to test.
- * Return: TRUE if string is unique.
- */
-gboolean mgu_list_test_unq_nc( GList *list, gchar *str ) {
- GList *node;
-
- if( str ) {
- if( strlen( str ) > 0 ) {
- node = list;
- while( node ) {
- if( g_utf8_collate( str, node->data ) == 0 )
- return FALSE;
- node = g_list_next( node );
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
/*
* End of Source.
*/
void mgu_str_unescape ( gchar *str );
void mgu_str_ltc2space ( gchar *str, gchar chlead, gchar chtail );
gchar *mgu_slist_longest_entry ( GSList *list );
-gboolean mgu_slist_test_unq_nc ( GSList *list, gchar *str );
-gboolean mgu_list_test_unq_nc ( GList *list, gchar *str );
#endif /* __MGUTILS_H__ */
void ldapctl_criteria_list_add( LdapControl *ctl, gchar *attr ) {
cm_return_if_fail( ctl != NULL );
if( attr != NULL ) {
- if( mgu_list_test_unq_nc( ctl->listCriteria, attr ) ) {
+ if( !g_list_find_custom( ctl->listCriteria, attr,
+ (GCompareFunc)g_utf8_collate ) ) {
debug_print("adding to criteria list: %s\n", attr);
ctl->listCriteria = g_list_append(
ctl->listCriteria, g_strdup( attr ) );