version 1.1.3.1.2.1, 1998/08/09 00:52:09
|
version 1.3.10.1, 1998/10/20 23:24:28
|
Line 1
|
Line 1
|
/* filter.c - routines for parsing and dealing with filters */ |
/* filter.c - routines for parsing and dealing with filters */ |
|
|
|
#include "portable.h" |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
#include <sys/types.h> |
#include <sys/types.h> |
Line 135 get_filter( Connection *conn, BerElement
|
Line 137 get_filter( Connection *conn, BerElement
|
Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); |
Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); |
if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp )) |
if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp )) |
== 0 ) { |
== 0 ) { |
if (ftmp == NULL) ftmp = strdup(""); |
if (ftmp == NULL) ftmp = strdup(""); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
sprintf( *fstr, "(&%s)", ftmp ); |
sprintf( *fstr, "(&%s)", ftmp ); |
free( ftmp ); |
free( ftmp ); |
Line 146 get_filter( Connection *conn, BerElement
|
Line 148 get_filter( Connection *conn, BerElement
|
Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); |
Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); |
if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp )) |
if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp )) |
== 0 ) { |
== 0 ) { |
if (ftmp == NULL) ftmp = strdup(""); |
if (ftmp == NULL) ftmp = strdup(""); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
sprintf( *fstr, "(|%s)", ftmp ); |
sprintf( *fstr, "(|%s)", ftmp ); |
free( ftmp ); |
free( ftmp ); |
Line 157 get_filter( Connection *conn, BerElement
|
Line 159 get_filter( Connection *conn, BerElement
|
Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); |
Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); |
(void) ber_skip_tag( ber, &len ); |
(void) ber_skip_tag( ber, &len ); |
if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) { |
if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) { |
if (ftmp == NULL) ftmp = strdup(""); |
if (ftmp == NULL) ftmp = strdup(""); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
*fstr = ch_malloc( 4 + strlen( ftmp ) ); |
sprintf( *fstr, "(!%s)", ftmp ); |
sprintf( *fstr, "(!%s)", ftmp ); |
free( ftmp ); |
free( ftmp ); |