/*
* Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 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
* 7 March 1994 by Mark C Smith
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#ifdef MACOS
#include "macos.h"
#else /* MACOS */
#ifdef DOS
#include <malloc.h>
#include "msdos.h"
#else /* DOS */
#ifndef VMS
#include <unistd.h>
#endif /* VMS */
#endif /* DOS */
#endif /* MACOS */
#include "lber.h"
#include "ldap.h"
#include "ldap-private.h"
#include "ldap-int.h"
#ifndef NEEDPROTOS
static void free_disptmpl();
static int read_next_tmpl();
int next_line_tokens();
#else /* !NEEDPROTOS */
#endif /* !NEEDPROTOS */
static char *tmploptions[] = {
"addable", "modrdn",
"altview",
};
static unsigned int tmploptvals[] = {
};
static char *itemtypes[] = {
"cis", "mls", "dn",
"bool", "jpeg", "jpegbtn",
"fax", "faxbtn", "audiobtn",
"time", "date", "url",
"searchact", "linkact", "adddnact",
"addact", "verifyact", "mail",
#ifdef SUN
"protected",
#endif
};
static unsigned int itemsynids[] = {
#ifdef SUN
#endif
};
static char *itemoptions[] = {
"ro", "sort",
"1val", "hide",
"required", "hideiffalse",
};
static unsigned int itemoptvals[] = {
};
#ifdef SUN
/* LP@Sun : right_trim */
{
theEnd--;
*theEnd= '\0';
}
#endif
int
{
char *buf;
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_FILE );
}
return( LDAP_TMPL_ERR_MEM );
}
return( LDAP_TMPL_ERR_FILE );
}
return( rc );
}
int
struct ldap_disptmpl **tmpllistp )
{
char **toks;
free_strarray( toks );
return( LDAP_TMPL_ERR_SYNTAX );
}
free_strarray( toks );
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
{
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
struct ldap_disptmpl *
{
return( tmpllist );
}
struct ldap_disptmpl *
struct ldap_disptmpl *tmpl )
{
}
struct ldap_disptmpl *
{
return( dtp );
}
}
return( NULLDISPTMPL );
}
struct ldap_disptmpl *
{
return( NULLDISPTMPL );
}
#ifdef SUN
/* LP@Sun : remove ending space from objectclass */
right_trim(oclist[j]);
#endif
== 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 int 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 ) {
}
}
return( NULL );
}
return( attrs );
}
static int
int dtversion )
{
/*
* template name comes first
*/
free_strarray( toks );
return( tokcnt == 0 ? 0 : LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_disptmpl ))) == NULL ) {
free_strarray( toks );
return( LDAP_TMPL_ERR_MEM );
}
/*
* template plural name comes next
*/
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* template icon name is next
*/
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* template options come next
*/
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
for ( j = 0; tmploptions[ j ] != NULL; ++j ) {
}
}
}
free_strarray( toks );
/*
* object class list is next
*/
sizeof( struct ldap_oclist ))) == NULL ) {
free_strarray( toks );
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_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
} else {
}
/*
* read default attribute to use for RDN
*/
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read default location for new entries
*/
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
} else {
}
/*
* read list of rules used to define default values for new entries
*/
} else {
adsource = 0;
}
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_adddeflist ))) == NULL ) {
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
if ( adsource == LDAP_ADSRC_CONSTANTVALUE ) {
}
} else {
}
}
/*
* item list is next
*/
samerow = 0;
if ( tokcnt < 4 ) {
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
sizeof( struct ldap_tmplitem ))) == NULL ) {
free_strarray( toks );
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_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
break;
}
}
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
} else {
}
;
}
== NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
}
}
} else if ( samerow ) {
} else {
}
samerow = 0;
free_strarray( toks );
samerow = 1;
} else {
free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
if ( tokcnt < 0 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
return( 0 );
}