/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* disptmpl.c: display template library routines for LDAP clients
*/
#include "ldap-int.h"
#include "disptmpl.h"
static char *tmploptions[] = {
"addable", "modrdn",
"altview",
};
static unsigned long tmploptvals[] = {
};
static char *itemtypes[] = {
"cis", "mls", "dn",
"bool", "jpeg", "jpegbtn",
"fax", "faxbtn", "audiobtn",
"time", "date", "url",
"searchact", "linkact", "adddnact",
"addact", "verifyact", "mail",
};
static unsigned long itemsynids[] = {
};
static char *itemoptions[] = {
"ro", "sort",
"1val", "hide",
"required", "hideiffalse",
};
static unsigned long itemoptvals[] = {
};
int
{
char *buf;
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_MEM );
}
NSLDAPI_FREE( buf );
return( LDAP_TMPL_ERR_FILE );
}
NSLDAPI_FREE( buf );
return( rc );
}
int
struct ldap_disptmpl **tmpllistp )
{
char **toks;
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( version != LDAP_TEMPLATE_VERSION ) {
return( LDAP_TMPL_ERR_VERSION );
}
if ( prevtmpl == NULLDISPTMPL ) {
} else {
}
}
if ( rc != 0 ) {
}
return( rc );
}
void
{
free_disptmpl( tp );
}
}
}
static void
{
}
}
}
}
}
}
NSLDAPI_FREE( ocp );
}
}
}
}
NSLDAPI_FREE( adp );
}
}
}
}
}
NSLDAPI_FREE( colp );
}
}
}
NSLDAPI_FREE( tmpl );
}
}
struct ldap_disptmpl *
{
return( tmpllist );
}
struct ldap_disptmpl *
struct ldap_disptmpl *tmpl )
{
}
struct ldap_disptmpl *
{
return( dtp );
}
}
return( NULLDISPTMPL );
}
struct ldap_disptmpl *
{
return( NULLDISPTMPL );
}
== 0 ) {
++matchcnt;
}
}
++needcnt;
}
return( dtp );
}
}
}
return( NULLDISPTMPL );
}
struct ldap_tmplitem *
{
}
struct ldap_tmplitem *
{
}
struct ldap_tmplitem *
{
return( row );
}
struct ldap_tmplitem *
struct ldap_tmplitem *col )
{
}
char **
int exclude, unsigned long syntaxmask )
{
/*
* this routine should filter out duplicate attributes...
*/
char **attrs;
attrcnt = 0;
memerr = 0;
return( NULL );
}
if ( includeattrs != NULL ) {
memerr = 1;
} else {
}
}
}
ticolp != NULLTMPLITEM;
if ( syntaxmask != 0 ) {
if (( exclude &&
( !exclude &&
continue;
}
}
memerr = 1;
} else {
}
}
}
}
for ( i = 0; i < attrcnt; ++i ) {
NSLDAPI_FREE( attrs[ i ] );
}
}
NSLDAPI_FREE( (char *)attrs );
return( NULL );
}
return( attrs );
}
static int
int dtversion )
{
/*
* template name comes first
*/
return( tokcnt == 0 ? 0 : LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_disptmpl ))) == NULL ) {
return( LDAP_TMPL_ERR_MEM );
}
NSLDAPI_FREE( (char *)toks );
/*
* template plural name comes next
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
NSLDAPI_FREE( (char *)toks );
/*
* template icon name is next
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
NSLDAPI_FREE( (char *)toks );
/*
* template options come next
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
for ( j = 0; tmploptions[ j ] != NULL; ++j ) {
}
}
}
/*
* object class list is next
*/
sizeof( struct ldap_oclist ))) == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
} else {
}
}
if ( tokcnt < 0 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read name of attribute to authenticate as
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
} else {
NSLDAPI_FREE( toks[ 0 ] );
}
NSLDAPI_FREE( (char *)toks );
/*
* read default attribute to use for RDN
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
NSLDAPI_FREE( (char *)toks );
/*
* read default location for new entries
*/
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
} else {
NSLDAPI_FREE( toks[ 0 ] );
}
NSLDAPI_FREE( (char *)toks );
/*
* read list of rules used to define default values for new entries
*/
} else {
adsource = 0;
}
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_adddeflist ))) == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
if ( adsource == LDAP_ADSRC_CONSTANTVALUE ) {
}
NSLDAPI_FREE( toks[ 0 ] );
NSLDAPI_FREE( (char *)toks );
} else {
}
}
/*
* item list is next
*/
samerow = 0;
if ( tokcnt < 4 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_tmplitem ))) == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
/*
* find syntaxid from config file string
*/
*itemopts++ = '\0';
for ( i = 0; itemoptions[ i ] != NULL; ++i ) {
break;
}
}
if ( itemoptions[ i ] == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
break;
}
}
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
NSLDAPI_FREE( toks[ 0 ] );
} else {
}
;
}
sizeof( char * ))) == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
}
}
NSLDAPI_FREE( (char *)toks );
} else if ( samerow ) {
} else {
}
samerow = 0;
samerow = 1;
} else {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
if ( tokcnt < 0 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
return( 0 );
}
struct tmplerror {
int e_code;
char *e_reason;
};
#ifdef SUN
{ LDAP_TMPL_ERR_VERSION, 0},
{ LDAP_TMPL_ERR_MEM, 0},
{ LDAP_TMPL_ERR_SYNTAX, 0},
{ LDAP_TMPL_ERR_FILE, 0},
{ -1, 0 }
};
#else
{ LDAP_TMPL_ERR_VERSION, "Bad template version" },
{ LDAP_TMPL_ERR_MEM, "Out of memory" },
{ LDAP_TMPL_ERR_SYNTAX, "Bad template syntax" },
{ LDAP_TMPL_ERR_FILE, "File error reading template" },
{ -1, 0 }
};
#endif
char *
{
static int init_flag = 0;
int i;
/* Multiple threads should be ok since they assign same strings */
if (init_flag == 0) {
ldap_tmplerrlist[0].e_reason =
init_flag = 1;
}
return( ldap_tmplerrlist[i].e_reason );
}
}