File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / h / quipu / ds_search.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* ds_search.h - structures for searching */

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/h/quipu/ds_search.h,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: ds_search.h,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.2  90/07/09  14:38:27  mrose
 * sync
 * 
 * Revision 7.1  90/03/15  11:18:05  mrose
 * quipu-sync
 * 
 * Revision 7.0  89/11/23  21:56:31  mrose
 * Release 6.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#ifndef QUIPUSRCH
#define QUIPUSRCH

#include "quipu/commonarg.h"
#include "quipu/ds_error.h"
#include "quipu/dap.h"

typedef struct {
	    AttributeType fi_sub_type;
	    AV_Sequence fi_sub_initial;
	    AV_Sequence fi_sub_any;
	    AV_Sequence fi_sub_final;
				/* initial and final should be zero or  */
				/* one components only                  */
	    char       *fi_sub_match; /* for DSA use */
	} Filter_Substrings;

struct filter_item {
    int         fi_type;
#define FILTERITEM_EQUALITY 0
#define FILTERITEM_SUBSTRINGS 1
#define FILTERITEM_GREATEROREQUAL 2
#define FILTERITEM_LESSOREQUAL 3
#define FILTERITEM_PRESENT 4
#define FILTERITEM_APPROX 5
    union {
	AttributeType fi_un_type;
	AVA fi_un_ava;
	Filter_Substrings fi_un_substrings;
    } fi_un;
	/* field for DSA use - no need to fill is DUA */
    IFP	    fi_ifp;
};

#define NULLFITEM (struct filter_item *) NULL
#define UNSUB    fi_un.fi_un_substrings
#define UNAVA    fi_un.fi_un_ava
#define UNTYPE   fi_un.fi_un_type
#define filter_item_alloc() (struct filter_item *) smalloc (sizeof (struct filter_item));

typedef struct filter {
    char        flt_type;
#define FILTER_ITEM 0
#define FILTER_AND 1
#define FILTER_OR 2
#define FILTER_NOT 3
   struct filter *flt_next;
   union {
	struct filter_item flt_un_item;
					/* a basic item                 */
	struct filter *flt_un_filter;
					/* or a pointer to a chain of   */
					/* filters                      */
   } flt_un;
}filter, *Filter;

#define NULLFILTER (Filter)NULL
#define FUITEM   flt_un.flt_un_item
#define FUFILT   flt_un.flt_un_filter
#define filter_alloc() (Filter) smalloc (sizeof (filter));

struct ds_search_arg {
    CommonArgs sra_common;
    DN sra_baseobject;
    int sra_subset;
#define SRA_BASEOBJECT          0
#define SRA_ONELEVEL            1
#define SRA_WHOLESUBTREE        2
    Filter sra_filter;
    char sra_searchaliases;
    EntryInfoSelection sra_eis;
};

struct ds_search_unit {
    CommonResults srr_common;
    DN srr_object;
    EntryInfo *srr_entries;
    int srr_limitproblem;       /* See LIST for definition of values    */
    ContinuationRef     srr_cr;
};

struct ds_search_result {
    char	srr_correlated;
    union {
	struct ds_search_unit	* srr_unit;
	struct ds_search_result * srr_parts;
    } srr_un;
#define CSR_common	srr_un.srr_unit->srr_common
#define CSR_object	srr_un.srr_unit->srr_object
#define CSR_entries	srr_un.srr_unit->srr_entries
#define CSR_limitproblem	srr_un.srr_unit->srr_limitproblem
#define CSR_cr	srr_un.srr_unit->srr_cr
    struct ds_search_result * srr_next;
};
#define NULLSRR	((struct ds_search_result *) 0)

/* following used by search for scheduling */

struct ds_search_task {
   DN  st_baseobject;
   DN  st_alias;
   int st_subset;
   int st_size;
   struct di_block	* st_di;
   struct ds_search_task * st_next;	
   ContinuationRef	st_cr;
   struct ds_search_task * st_save;	
   char st_entryonly;
};
#define NULL_ST ((struct ds_search_task *) NULL)
#define st_alloc() (struct ds_search_task *) smalloc (sizeof(struct ds_search_task));

/* search max 1000 entries before worrying about time limits */
#define SEARCH_DELTA_SIZE 1000	

#endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.