Back to index

openldap  2.4.31
Functions
print.c File Reference
#include "portable.h"
#include <stdio.h>
#include <ac/ctype.h>
#include <ac/stdarg.h>
#include <ac/string.h>
#include <ac/time.h>
#include "ldap-int.h"

Go to the source code of this file.

Functions

static int ldap_log_check (LDAP *ld, int loglvl)
int ldap_log_printf (LDAP *ld, int loglvl, const char *fmt,...)

Function Documentation

static int ldap_log_check ( LDAP *  ld,
int  loglvl 
) [static]

Definition at line 31 of file print.c.

{
       int errlvl;

       if(ld == NULL) {
              errlvl = ldap_debug;
       } else {
              errlvl = ld->ld_debug;
       }

       return errlvl & loglvl ? 1 : 0;
}

Here is the caller graph for this function:

int ldap_log_printf ( LDAP *  ld,
int  loglvl,
const char *  fmt,
  ... 
)

Definition at line 44 of file print.c.

{
       char buf[ 1024 ];
       va_list ap;

       if ( !ldap_log_check( ld, loglvl )) {
              return 0;
       }

       va_start( ap, fmt );

       buf[sizeof(buf) - 1] = '\0';
       vsnprintf( buf, sizeof(buf)-1, fmt, ap );

       va_end(ap);

       (*ber_pvt_log_print)( buf );
       return 1;
}

Here is the call graph for this function: