srchpref.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
*
* Portions Copyright %G% Sun Microsystems, Inc.
* All Rights Reserved
*
*/
#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.
*
* searchpref.c: search preferences library routines for LDAP clients
* 17 May 1994 by Gordon Good
*/
#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"
#ifndef NEEDPROTOS
int next_line_tokens();
void free_strarray();
static void free_searchobj();
static int read_next_searchobj();
#else /* !NEEDPROTOS */
void free_strarray( char **sap );
#endif /* !NEEDPROTOS */
static char *sobjoptions[] = {
"internal",
};
static unsigned int sobjoptvals[] = {
};
int
{
char *buf;
return( LDAP_SEARCHPREF_ERR_FILE );
}
return( LDAP_SEARCHPREF_ERR_FILE );
}
return( LDAP_SEARCHPREF_ERR_FILE );
}
return( LDAP_SEARCHPREF_ERR_MEM );
}
return( LDAP_SEARCHPREF_ERR_FILE );
}
return( rc );
}
int
struct ldap_searchobj **solistp )
{
char **toks;
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
free_strarray( toks );
if ( version != LDAP_SEARCHPREF_VERSION &&
return( LDAP_SEARCHPREF_ERR_VERSION );
}
if ( prevso == NULLSEARCHOBJ ) {
} else {
}
}
if ( rc != 0 ) {
}
return( rc );
}
void
{
free_searchobj( so );
}
}
/* XXX XXX need to do some work here */
}
static void
{
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
struct ldap_searchobj *
{
return( solist );
}
struct ldap_searchobj *
{
}
static int
int soversion )
{
int i, j, tokcnt;
char **toks;
struct ldap_searchobj *so;
struct ldap_searchattr **sa;
struct ldap_searchmatch **sm;
/*
* Object type prompt comes first
*/
free_strarray( toks );
return( tokcnt == 0 ? 0 : LDAP_SEARCHPREF_ERR_SYNTAX );
}
sizeof( struct ldap_searchobj ))) == NULL ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_MEM );
}
/*
* if this is post-version zero, options come next
*/
if ( soversion > LDAP_SEARCHPREF_VERSION_ZERO ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
for ( j = 0; sobjoptions[ j ] != NULL; ++j ) {
}
}
}
free_strarray( toks );
}
/*
* "Fewer choices" prompt is next
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Filter prefix for "More Choices" searching is next
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* "Fewer Choices" filter tag comes next
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Selection (disambiguation) attribute comes next
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Label for selection (disambiguation) attribute
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
/*
* Search scope is next
*/
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
} else {
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
free_strarray( toks );
/*
* "More Choices" search option list comes next
*/
if ( tokcnt < 5 ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
sizeof( struct ldap_searchattr ))) == NULL ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_MEM );
}
/* Deal with bitmap */
( *sa )->sa_matchtypebitmap = 0;
}
}
}
/*
* Match types are last
*/
if ( tokcnt < 2 ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_SYNTAX );
}
sizeof( struct ldap_searchmatch ))) == NULL ) {
free_strarray( toks );
return( LDAP_SEARCHPREF_ERR_MEM );
}
}
return( 0 );
}