Back to index

openldap  2.4.31
Functions
str2filter.c File Reference
#include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/socket.h>
#include "slap.h"

Go to the source code of this file.

Functions

Filterstr2filter_x (Operation *op, const char *str)
Filterstr2filter (const char *str)

Function Documentation

Filter* str2filter ( const char *  str)

Definition at line 74 of file str2filter.c.

{
       Operation op = {0};
       Opheader ohdr = {0};

       op.o_hdr = &ohdr;
       op.o_tmpmemctx = NULL;
       op.o_tmpmfuncs = &ch_mfuncs;

       return str2filter_x( &op, str );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Filter* str2filter_x ( Operation op,
const char *  str 
)

Definition at line 39 of file str2filter.c.

{
       int rc;
       Filter *f = NULL;
       BerElementBuffer berbuf;
       BerElement *ber = (BerElement *)&berbuf;
       const char *text = NULL;

       Debug( LDAP_DEBUG_FILTER, "str2filter \"%s\"\n", str, 0, 0 );

       if ( str == NULL || *str == '\0' ) {
              return NULL;
       }

       ber_init2( ber, NULL, LBER_USE_DER );
       if ( op->o_tmpmemctx ) {
              ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
       }

       rc = ldap_pvt_put_filter( ber, str );
       if( rc < 0 ) {
              goto done;
       }

       ber_reset( ber, 1 );

       rc = get_filter( op, ber, &f, &text );

done:
       ber_free_buf( ber );

       return f;
}

Here is the call graph for this function:

Here is the caller graph for this function: