Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
disptmpl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ldap_tmplitem
struct  ldap_oclist
struct  ldap_adddeflist
struct  ldap_disptmpl

Defines

#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
#define LDAP_TEMPLATE_VERSION   1
#define LDAP_SYN_TYPE_TEXT   0x01000000L
#define LDAP_SYN_TYPE_IMAGE   0x02000000L
#define LDAP_SYN_TYPE_BOOLEAN   0x04000000L
#define LDAP_SYN_TYPE_BUTTON   0x08000000L
#define LDAP_SYN_TYPE_ACTION   0x10000000L
#define LDAP_SYN_OPT_DEFER   0x00010000L
#define LDAP_SYN_CASEIGNORESTR   ( 1 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_MULTILINESTR   ( 2 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_DN   ( 3 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_BOOLEAN   ( 4 | LDAP_SYN_TYPE_BOOLEAN )
#define LDAP_SYN_JPEGIMAGE   ( 5 | LDAP_SYN_TYPE_IMAGE )
#define LDAP_SYN_JPEGBUTTON   ( 6 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_FAXIMAGE   ( 7 | LDAP_SYN_TYPE_IMAGE )
#define LDAP_SYN_FAXBUTTON   ( 8 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_AUDIOBUTTON   ( 9 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_TIME   ( 10 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_DATE   ( 11 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_LABELEDURL   ( 12 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_SEARCHACTION   ( 13 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_LINKACTION   ( 14 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_ADDDNACTION   ( 15 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_VERIFYDNACTION   ( 16 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_RFC822ADDR   ( 17 | LDAP_SYN_TYPE_TEXT )
#define LDAP_GET_SYN_TYPE(syid)   ((syid) & 0xFF000000UL )
#define LDAP_GET_SYN_OPTIONS(syid)   ((syid) & 0x00FF0000UL )
#define LDAP_DISP_OPT_AUTOLABELWIDTH   0x00000001L
#define LDAP_DISP_OPT_HTMLBODYONLY   0x00000002L
#define LDAP_DISP_OPT_DOSEARCHACTIONS   0x00000002L
#define LDAP_DISP_OPT_NONLEAF   0x00000004L
#define LDAP_DITEM_OPT_READONLY   0x00000001L
#define LDAP_DITEM_OPT_SORTVALUES   0x00000002L
#define LDAP_DITEM_OPT_SINGLEVALUED   0x00000004L
#define LDAP_DITEM_OPT_HIDEIFEMPTY   0x00000008L
#define LDAP_DITEM_OPT_VALUEREQUIRED   0x00000010L
#define LDAP_DITEM_OPT_HIDEIFFALSE   0x00000020L /* booleans only */
#define NULLTMPLITEM   ((struct ldap_tmplitem *)0)
#define LDAP_SET_TMPLITEM_APPDATA(ti, datap)   (ti)->ti_appdata = (void *)(datap)
#define LDAP_GET_TMPLITEM_APPDATA(ti, type)   (type)((ti)->ti_appdata)
#define LDAP_IS_TMPLITEM_OPTION_SET(ti, option)   (((ti)->ti_options & option ) != 0 )
#define NULLOCLIST   ((struct ldap_oclist *)0)
#define LDAP_ADSRC_CONSTANTVALUE   1
#define LDAP_ADSRC_ADDERSDN   2
#define NULLADLIST   ((struct ldap_adddeflist *)0)
#define LDAP_DTMPL_OPT_ADDABLE   0x00000001L
#define LDAP_DTMPL_OPT_ALLOWMODRDN   0x00000002L
#define LDAP_DTMPL_OPT_ALTVIEW   0x00000004L
#define NULLDISPTMPL   ((struct ldap_disptmpl *)0)
#define LDAP_SET_DISPTMPL_APPDATA(dt, datap)   (dt)->dt_appdata = (void *)(datap)
#define LDAP_GET_DISPTMPL_APPDATA(dt, type)   (type)((dt)->dt_appdata)
#define LDAP_IS_DISPTMPL_OPTION_SET(dt, option)   (((dt)->dt_options & option ) != 0 )
#define LDAP_TMPL_ERR_VERSION   1
#define LDAP_TMPL_ERR_MEM   2
#define LDAP_TMPL_ERR_SYNTAX   3
#define LDAP_TMPL_ERR_FILE   4
#define LDAP_DTMPL_BUFSIZ   8192

Typedefs

typedef int(* writeptype )(void *writeparm, char *p, int len)

Functions

LDAP_CALL ldap_init_templates (char *file, struct ldap_disptmpl **tmpllistp)
LDAP_CALL ldap_init_templates_buf (char *buf, long buflen, struct ldap_disptmpl **tmpllistp)
LDAP_CALL ldap_free_templates (struct ldap_disptmpl *tmpllist)
LDAP_CALL ldap_first_disptmpl (struct ldap_disptmpl *tmpllist)
LDAP_CALL ldap_next_disptmpl (struct ldap_disptmpl *tmpllist, struct ldap_disptmpl *tmpl)
LDAP_CALL ldap_name2template (char *name, struct ldap_disptmpl *tmpllist)
LDAP_CALL ldap_oc2template (char **oclist, struct ldap_disptmpl *tmpllist)
LDAP_CALL ldap_tmplattrs (struct ldap_disptmpl *tmpl, char **includeattrs, int exclude, unsigned long syntaxmask)
LDAP_CALL ldap_first_tmplrow (struct ldap_disptmpl *tmpl)
LDAP_CALL ldap_next_tmplrow (struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row)
LDAP_CALL ldap_first_tmplcol (struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row)
LDAP_CALL ldap_next_tmplcol (struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row, struct ldap_tmplitem *col)
LDAP_CALL ldap_entry2text (LDAP *ld, char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts)
LDAP_CALL ldap_vals2text (LDAP *ld, char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, char *eol, int rdncount)
LDAP_CALL ldap_entry2text_search (LDAP *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts)
LDAP_CALL ldap_entry2html (LDAP *ld, char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts, char *urlprefix, char *base)
LDAP_CALL ldap_vals2html (LDAP *ld, char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, char *eol, int rdncount, char *urlprefix)
LDAP_CALL ldap_entry2html_search (LDAP *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts, char *urlprefix)
LDAP_CALL ldap_tmplerr2string (int err)

Class Documentation

struct ldap_tmplitem

Definition at line 169 of file disptmpl.h.

Collaboration diagram for ldap_tmplitem:
Class Members
void * ti_appdata
char ** ti_args
char * ti_attrname
char * ti_label
struct ldap_tmplitem * ti_next_in_col
struct ldap_tmplitem * ti_next_in_row
unsigned long ti_options
unsigned long ti_syntaxid
struct ldap_oclist

Definition at line 196 of file disptmpl.h.

Collaboration diagram for ldap_oclist:
Class Members
struct ldap_oclist * oc_next
char ** oc_objclasses
struct ldap_adddeflist

Definition at line 207 of file disptmpl.h.

Collaboration diagram for ldap_adddeflist:
Class Members
char * ad_attrname
struct ldap_adddeflist * ad_next
int ad_source
char * ad_value
struct ldap_disptmpl

Definition at line 242 of file disptmpl.h.

Collaboration diagram for ldap_disptmpl:
Class Members
struct ldap_adddeflist * dt_adddeflist
void * dt_appdata
char * dt_authattrname
char * dt_defaddlocation
char * dt_defrdnattrname
char * dt_iconname
struct ldap_tmplitem * dt_items
char * dt_name
struct ldap_disptmpl * dt_next
struct ldap_oclist * dt_oclist
unsigned long dt_options
char * dt_pluralname

Define Documentation

Definition at line 210 of file disptmpl.h.

Definition at line 209 of file disptmpl.h.

Definition at line 72 of file disptmpl.h.

Definition at line 75 of file disptmpl.h.

Definition at line 73 of file disptmpl.h.

Definition at line 137 of file disptmpl.h.

Definition at line 143 of file disptmpl.h.

Definition at line 138 of file disptmpl.h.

#define LDAP_DISP_OPT_NONLEAF   0x00000004L

Definition at line 150 of file disptmpl.h.

Definition at line 160 of file disptmpl.h.

#define LDAP_DITEM_OPT_HIDEIFFALSE   0x00000020L /* booleans only */

Definition at line 162 of file disptmpl.h.

#define LDAP_DITEM_OPT_READONLY   0x00000001L

Definition at line 157 of file disptmpl.h.

Definition at line 159 of file disptmpl.h.

#define LDAP_DITEM_OPT_SORTVALUES   0x00000002L

Definition at line 158 of file disptmpl.h.

Definition at line 161 of file disptmpl.h.

Definition at line 276 of file disptmpl.h.

#define LDAP_DTMPL_OPT_ADDABLE   0x00000001L

Definition at line 226 of file disptmpl.h.

Definition at line 231 of file disptmpl.h.

#define LDAP_DTMPL_OPT_ALTVIEW   0x00000004L

Definition at line 236 of file disptmpl.h.

#define LDAP_GET_DISPTMPL_APPDATA (   dt,
  type 
)    (type)((dt)->dt_appdata)

Definition at line 262 of file disptmpl.h.

#define LDAP_GET_SYN_OPTIONS (   syid)    ((syid) & 0x00FF0000UL )

Definition at line 127 of file disptmpl.h.

#define LDAP_GET_SYN_TYPE (   syid)    ((syid) & 0xFF000000UL )

Definition at line 126 of file disptmpl.h.

#define LDAP_GET_TMPLITEM_APPDATA (   ti,
  type 
)    (type)((ti)->ti_appdata)

Definition at line 186 of file disptmpl.h.

#define LDAP_IS_DISPTMPL_OPTION_SET (   dt,
  option 
)    (((dt)->dt_options & option ) != 0 )

Definition at line 265 of file disptmpl.h.

#define LDAP_IS_TMPLITEM_OPTION_SET (   ti,
  option 
)    (((ti)->ti_options & option ) != 0 )

Definition at line 189 of file disptmpl.h.

Definition at line 74 of file disptmpl.h.

#define LDAP_SET_DISPTMPL_APPDATA (   dt,
  datap 
)    (dt)->dt_appdata = (void *)(datap)

Definition at line 259 of file disptmpl.h.

#define LDAP_SET_TMPLITEM_APPDATA (   ti,
  datap 
)    (ti)->ti_appdata = (void *)(datap)

Definition at line 183 of file disptmpl.h.

Definition at line 118 of file disptmpl.h.

Definition at line 112 of file disptmpl.h.

Definition at line 107 of file disptmpl.h.

Definition at line 104 of file disptmpl.h.

Definition at line 114 of file disptmpl.h.

Definition at line 106 of file disptmpl.h.

Definition at line 111 of file disptmpl.h.

Definition at line 110 of file disptmpl.h.

Definition at line 109 of file disptmpl.h.

Definition at line 108 of file disptmpl.h.

Definition at line 115 of file disptmpl.h.

Definition at line 117 of file disptmpl.h.

Definition at line 105 of file disptmpl.h.

#define LDAP_SYN_OPT_DEFER   0x00010000L

Definition at line 94 of file disptmpl.h.

Definition at line 120 of file disptmpl.h.

Definition at line 116 of file disptmpl.h.

Definition at line 113 of file disptmpl.h.

#define LDAP_SYN_TYPE_ACTION   0x10000000L

Definition at line 88 of file disptmpl.h.

#define LDAP_SYN_TYPE_BOOLEAN   0x04000000L

Definition at line 86 of file disptmpl.h.

#define LDAP_SYN_TYPE_BUTTON   0x08000000L

Definition at line 87 of file disptmpl.h.

#define LDAP_SYN_TYPE_IMAGE   0x02000000L

Definition at line 85 of file disptmpl.h.

#define LDAP_SYN_TYPE_TEXT   0x01000000L

Definition at line 84 of file disptmpl.h.

Definition at line 119 of file disptmpl.h.

Definition at line 79 of file disptmpl.h.

Definition at line 271 of file disptmpl.h.

Definition at line 269 of file disptmpl.h.

Definition at line 270 of file disptmpl.h.

Definition at line 268 of file disptmpl.h.

#define NULLADLIST   ((struct ldap_adddeflist *)0)

Definition at line 216 of file disptmpl.h.

#define NULLDISPTMPL   ((struct ldap_disptmpl *)0)

Definition at line 257 of file disptmpl.h.

#define NULLOCLIST   ((struct ldap_oclist *)0)

Definition at line 201 of file disptmpl.h.

#define NULLTMPLITEM   ((struct ldap_tmplitem *)0)

Definition at line 181 of file disptmpl.h.


Typedef Documentation

typedef int(* writeptype)(void *writeparm, char *p, int len)

Definition at line 278 of file disptmpl.h.


Function Documentation

LDAP_CALL ldap_entry2html ( LDAP *  ld,
char *  buf,
LDAPMessage *  entry,
struct ldap_disptmpl tmpl,
char **  defattrs,
char ***  defvals,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount,
unsigned long  opts,
char *  urlprefix,
char *  base 
)

Definition at line 117 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_entry2html\n", 0, 0, 0 );

    if ( urlprefix == NULL ) {
       urlprefix = DEF_LDAP_URL_PREFIX;
    }

    return( do_entry2text( ld, buf, base, entry, tmpl, defattrs, defvals,
              writeproc, writeparm, eol, rdncount, opts, urlprefix ));
}

Here is the call graph for this function:

LDAP_CALL ldap_entry2html_search ( LDAP *  ld,
char *  dn,
char *  base,
LDAPMessage *  entry,
struct ldap_disptmpl tmpllist,
char **  defattrs,
char ***  defvals,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount,
unsigned long  opts,
char *  urlprefix 
)

Definition at line 419 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_entry2html_search\n", 0, 0, 0 );

    return( do_entry2text_search( ld, dn, base, entry, tmpllist, defattrs,
           defvals, writeproc, writeparm, eol, rdncount, opts, urlprefix ));
}

Here is the call graph for this function:

LDAP_CALL ldap_entry2text ( LDAP *  ld,
char *  buf,
LDAPMessage *  entry,
struct ldap_disptmpl tmpl,
char **  defattrs,
char ***  defvals,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount,
unsigned long  opts 
)

Definition at line 92 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_entry2text\n", 0, 0, 0 );

    return( do_entry2text( ld, buf, NULL, entry, tmpl, defattrs, defvals,
              writeproc, writeparm, eol, rdncount, opts, NULL ));

}

Here is the call graph for this function:

LDAP_CALL ldap_entry2text_search ( LDAP *  ld,
char *  dn,
char *  base,
LDAPMessage *  entry,
struct ldap_disptmpl tmpllist,
char **  defattrs,
char ***  defvals,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount,
unsigned long  opts 
)

Definition at line 394 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_entry2text_search\n", 0, 0, 0 );

    return( do_entry2text_search( ld, dn, base, entry, tmpllist, defattrs,
           defvals, writeproc, writeparm, eol, rdncount, opts, NULL ));
}

Here is the call graph for this function:

Here is the caller graph for this function:

LDAP_CALL ldap_first_disptmpl ( struct ldap_disptmpl tmpllist) [read]

Definition at line 298 of file disptmpl.c.

{
    return( tmpllist );
}

Here is the caller graph for this function:

LDAP_CALL ldap_first_tmplcol ( struct ldap_disptmpl tmpl,
struct ldap_tmplitem row 
) [read]

Definition at line 385 of file disptmpl.c.

{
    return( row );
}

Here is the caller graph for this function:

LDAP_CALL ldap_first_tmplrow ( struct ldap_disptmpl tmpl) [read]

Definition at line 369 of file disptmpl.c.

{
    return( tmpl->dt_items );
}

Here is the caller graph for this function:

Definition at line 204 of file disptmpl.c.

{
    struct ldap_disptmpl    *tp, *nexttp;

    if ( tmpllist != NULL ) {
       for ( tp = tmpllist; tp != NULL; tp = nexttp ) {
           nexttp = tp->dt_next;
           free_disptmpl( tp );
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

LDAP_CALL ldap_init_templates ( char *  file,
struct ldap_disptmpl **  tmpllistp 
)

Definition at line 115 of file disptmpl.c.

{
    FILE      *fp;
    char      *buf;
    long      rlen, len;
    int              rc, eof;

    *tmpllistp = NULLDISPTMPL;

    if (( fp = fopen( file, "r" )) == NULL ) {
       return( LDAP_TMPL_ERR_FILE );
    }

    if ( fseek( fp, 0L, SEEK_END ) != 0 ) {      /* move to end to get len */
       fclose( fp );
       return( LDAP_TMPL_ERR_FILE );
    }

    len = ftell( fp );

    if ( fseek( fp, 0L, SEEK_SET ) != 0 ) {      /* back to start of file */
       fclose( fp );
       return( LDAP_TMPL_ERR_FILE );
    }

    if (( buf = NSLDAPI_MALLOC( (size_t)len )) == NULL ) {
       fclose( fp );
       return( LDAP_TMPL_ERR_MEM );
    }

    rlen = fread( buf, 1, (size_t)len, fp );
    eof = feof( fp );
    fclose( fp );

    if ( rlen != len && !eof ) {   /* error:  didn't get the whole file */
       NSLDAPI_FREE( buf );
       return( LDAP_TMPL_ERR_FILE );
    }

    rc = ldap_init_templates_buf( buf, rlen, tmpllistp );
    NSLDAPI_FREE( buf );

    return( rc );
}

Here is the call graph for this function:

Here is the caller graph for this function:

LDAP_CALL ldap_init_templates_buf ( char *  buf,
long  buflen,
struct ldap_disptmpl **  tmpllistp 
)

Definition at line 163 of file disptmpl.c.

{
    int                            rc = 0, version;
    char                    **toks;
    struct ldap_disptmpl    *prevtmpl, *tmpl;

    *tmpllistp = prevtmpl = NULLDISPTMPL;

    if ( nsldapi_next_line_tokens( &buf, &buflen, &toks ) != 2 ||
           strcasecmp( toks[ 0 ], "version" ) != 0 ) {
       nsldapi_free_strarray( toks );
       return( LDAP_TMPL_ERR_SYNTAX );
    }
    version = atoi( toks[ 1 ] );
    nsldapi_free_strarray( toks );
    if ( version != LDAP_TEMPLATE_VERSION ) {
       return( LDAP_TMPL_ERR_VERSION );
    }

    while ( buflen > 0 && ( rc = read_next_tmpl( &buf, &buflen, &tmpl,
           version )) == 0 && tmpl != NULLDISPTMPL ) {
       if ( prevtmpl == NULLDISPTMPL ) {
           *tmpllistp = tmpl;
       } else {
           prevtmpl->dt_next = tmpl;
       }
       prevtmpl = tmpl;
    }

    if ( rc != 0 ) {
       ldap_free_templates( *tmpllistp );
    }

    return( rc );
}

Here is the call graph for this function:

Here is the caller graph for this function:

LDAP_CALL ldap_name2template ( char *  name,
struct ldap_disptmpl tmpllist 
) [read]

Definition at line 315 of file disptmpl.c.

{
    struct ldap_disptmpl    *dtp;

    for ( dtp = ldap_first_disptmpl( tmpllist ); dtp != NULLDISPTMPL;
           dtp = ldap_next_disptmpl( tmpllist, dtp )) {
       if ( strcasecmp( name, dtp->dt_name ) == 0 ) {
           return( dtp );
       }
    }

    return( NULLDISPTMPL );
}

Here is the call graph for this function:

LDAP_CALL ldap_next_disptmpl ( struct ldap_disptmpl tmpllist,
struct ldap_disptmpl tmpl 
) [read]

Definition at line 306 of file disptmpl.c.

{
    return( tmpl == NULLDISPTMPL ? tmpl : tmpl->dt_next );
}

Here is the caller graph for this function:

LDAP_CALL ldap_next_tmplcol ( struct ldap_disptmpl tmpl,
struct ldap_tmplitem row,
struct ldap_tmplitem col 
) [read]

Definition at line 393 of file disptmpl.c.

{
    return( col == NULLTMPLITEM ? col : col->ti_next_in_row );
}

Here is the caller graph for this function:

LDAP_CALL ldap_next_tmplrow ( struct ldap_disptmpl tmpl,
struct ldap_tmplitem row 
) [read]

Definition at line 377 of file disptmpl.c.

{
    return( row == NULLTMPLITEM ? row : row->ti_next_in_col );
}

Here is the caller graph for this function:

LDAP_CALL ldap_oc2template ( char **  oclist,
struct ldap_disptmpl tmpllist 
) [read]

Definition at line 332 of file disptmpl.c.

{
    struct ldap_disptmpl    *dtp;
    struct ldap_oclist             *oclp;
    int                            i, j, needcnt, matchcnt;

    if ( tmpllist == NULL || oclist == NULL || oclist[ 0 ] == NULL ) {
       return( NULLDISPTMPL );
    }

    for ( dtp = ldap_first_disptmpl( tmpllist ); dtp != NULLDISPTMPL;
              dtp = ldap_next_disptmpl( tmpllist, dtp )) {
       for ( oclp = dtp->dt_oclist; oclp != NULLOCLIST;
              oclp = oclp->oc_next ) {
           needcnt = matchcnt = 0;
           for ( i = 0; oclp->oc_objclasses[ i ] != NULL; ++i ) {
              for ( j = 0; oclist[ j ] != NULL; ++j ) {
                  if ( strcasecmp( oclist[ j ], oclp->oc_objclasses[ i ] )
                         == 0 ) {
                     ++matchcnt;
                  }
              }
              ++needcnt;
           }

           if ( matchcnt == needcnt ) {
              return( dtp );
           }
       }
    }

    return( NULLDISPTMPL );
}

Here is the call graph for this function:

Here is the caller graph for this function:

LDAP_CALL ldap_tmplattrs ( struct ldap_disptmpl tmpl,
char **  includeattrs,
int  exclude,
unsigned long  syntaxmask 
)

Definition at line 402 of file disptmpl.c.

{
/*
 * this routine should filter out duplicate attributes...
 */
    struct ldap_tmplitem    *tirowp, *ticolp;
    int                     i, attrcnt, memerr;
    char             **attrs;

    attrcnt = 0;
    memerr = 0;

    if (( attrs = (char **)NSLDAPI_MALLOC( sizeof( char * ))) == NULL ) {
       return( NULL );
    }

    if ( includeattrs != NULL ) {
       for ( i = 0; !memerr && includeattrs[ i ] != NULL; ++i ) {
           if (( attrs = (char **)NSLDAPI_REALLOC( attrs, ( attrcnt + 2 ) *
                  sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
                  nsldapi_strdup( includeattrs[ i ] )) == NULL ) {
              memerr = 1;
           } else {
              attrs[ attrcnt ] = NULL;
           }
       }
    }

    for ( tirowp = ldap_first_tmplrow( tmpl );
           !memerr && tirowp != NULLTMPLITEM;
           tirowp = ldap_next_tmplrow( tmpl, tirowp )) {
       for ( ticolp = ldap_first_tmplcol( tmpl, tirowp );
              ticolp != NULLTMPLITEM;
              ticolp = ldap_next_tmplcol( tmpl, tirowp, ticolp )) {

           if ( syntaxmask != 0 ) {
              if (( exclude &&
                     ( syntaxmask & ticolp->ti_syntaxid ) != 0 ) ||
                     ( !exclude &&
                     ( syntaxmask & ticolp->ti_syntaxid ) == 0 )) {
                  continue;
              }
           }

           if ( ticolp->ti_attrname != NULL ) {
              if (( attrs = (char **)NSLDAPI_REALLOC( attrs, ( attrcnt + 2 )
                     * sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
                     nsldapi_strdup( ticolp->ti_attrname )) == NULL ) {
                  memerr = 1;
              } else {
                  attrs[ attrcnt ] = NULL;
              }
           }
       }
    }

    if ( memerr || attrcnt == 0 ) {
       for ( i = 0; i < attrcnt; ++i ) {
           if ( attrs[ i ] != NULL ) {
              NSLDAPI_FREE( attrs[ i ] );
           }
       }

       NSLDAPI_FREE( (char *)attrs );
       return( NULL );
    }

    return( attrs );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 762 of file disptmpl.c.

{
       int    i;

       for ( i = 0; ldap_tmplerrlist[i].e_code != -1; i++ ) {
              if ( err == ldap_tmplerrlist[i].e_code )
                     return( ldap_tmplerrlist[i].e_reason );
       }

       return( "Unknown error" );
}

Here is the caller graph for this function:

LDAP_CALL ldap_vals2html ( LDAP *  ld,
char *  buf,
char **  vals,
char *  label,
int  labelwidth,
unsigned long  syntaxid,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount,
char *  urlprefix 
)

Definition at line 595 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_vals2html\n", 0, 0, 0 );

    if ( urlprefix == NULL ) {
       urlprefix = DEF_LDAP_URL_PREFIX;
    }

    return( do_vals2text( ld, buf, vals, label, labelwidth, syntaxid,
              writeproc, writeparm, eol, rdncount, urlprefix ));
}

Here is the call graph for this function:

LDAP_CALL ldap_vals2text ( LDAP *  ld,
char *  buf,
char **  vals,
char *  label,
int  labelwidth,
unsigned long  syntaxid,
writeptype  writeproc,
void writeparm,
char *  eol,
int  rdncount 
)

Definition at line 573 of file tmplout.c.

{
    LDAPDebug( LDAP_DEBUG_TRACE, "ldap_vals2text\n", 0, 0, 0 );

    return( do_vals2text( ld, buf, vals, label, labelwidth, syntaxid,
              writeproc, writeparm, eol, rdncount, NULL ));
}

Here is the call graph for this function: