|
|
1.1 root 1: /* ds_search.h - structures for searching */
2:
3: /*
4: * $Header: /f/osi/h/quipu/RCS/ds_search.h,v 7.2 90/07/09 14:38:27 mrose Exp $
5: *
6: *
7: * $Log: ds_search.h,v $
8: * Revision 7.2 90/07/09 14:38:27 mrose
9: * sync
10: *
11: * Revision 7.1 90/03/15 11:18:05 mrose
12: * quipu-sync
13: *
14: * Revision 7.0 89/11/23 21:56:31 mrose
15: * Release 6.0
16: *
17: */
18:
19: /*
20: * NOTICE
21: *
22: * Acquisition, use, and distribution of this module and related
23: * materials are subject to the restrictions of a license agreement.
24: * Consult the Preface in the User's Manual for the full terms of
25: * this agreement.
26: *
27: */
28:
29:
30: #ifndef QUIPUSRCH
31: #define QUIPUSRCH
32:
33: #include "quipu/commonarg.h"
34: #include "quipu/ds_error.h"
35: #include "quipu/dap.h"
36:
37: typedef struct {
38: AttributeType fi_sub_type;
39: AV_Sequence fi_sub_initial;
40: AV_Sequence fi_sub_any;
41: AV_Sequence fi_sub_final;
42: /* initial and final should be zero or */
43: /* one components only */
44: char *fi_sub_match; /* for DSA use */
45: } Filter_Substrings;
46:
47: struct filter_item {
48: int fi_type;
49: #define FILTERITEM_EQUALITY 0
50: #define FILTERITEM_SUBSTRINGS 1
51: #define FILTERITEM_GREATEROREQUAL 2
52: #define FILTERITEM_LESSOREQUAL 3
53: #define FILTERITEM_PRESENT 4
54: #define FILTERITEM_APPROX 5
55: union {
56: AttributeType fi_un_type;
57: AVA fi_un_ava;
58: Filter_Substrings fi_un_substrings;
59: } fi_un;
60: /* field for DSA use - no need to fill is DUA */
61: IFP fi_ifp;
62: };
63:
64: #define NULLFITEM (struct filter_item *) NULL
65: #define UNSUB fi_un.fi_un_substrings
66: #define UNAVA fi_un.fi_un_ava
67: #define UNTYPE fi_un.fi_un_type
68: #define filter_item_alloc() (struct filter_item *) smalloc (sizeof (struct filter_item));
69:
70: typedef struct filter {
71: char flt_type;
72: #define FILTER_ITEM 0
73: #define FILTER_AND 1
74: #define FILTER_OR 2
75: #define FILTER_NOT 3
76: struct filter *flt_next;
77: union {
78: struct filter_item flt_un_item;
79: /* a basic item */
80: struct filter *flt_un_filter;
81: /* or a pointer to a chain of */
82: /* filters */
83: } flt_un;
84: }filter, *Filter;
85:
86: #define NULLFILTER (Filter)NULL
87: #define FUITEM flt_un.flt_un_item
88: #define FUFILT flt_un.flt_un_filter
89: #define filter_alloc() (Filter) smalloc (sizeof (filter));
90:
91: struct ds_search_arg {
92: CommonArgs sra_common;
93: DN sra_baseobject;
94: int sra_subset;
95: #define SRA_BASEOBJECT 0
96: #define SRA_ONELEVEL 1
97: #define SRA_WHOLESUBTREE 2
98: Filter sra_filter;
99: char sra_searchaliases;
100: EntryInfoSelection sra_eis;
101: };
102:
103: struct ds_search_unit {
104: CommonResults srr_common;
105: DN srr_object;
106: EntryInfo *srr_entries;
107: int srr_limitproblem; /* See LIST for definition of values */
108: ContinuationRef srr_cr;
109: };
110:
111: struct ds_search_result {
112: char srr_correlated;
113: union {
114: struct ds_search_unit * srr_unit;
115: struct ds_search_result * srr_parts;
116: } srr_un;
117: #define CSR_common srr_un.srr_unit->srr_common
118: #define CSR_object srr_un.srr_unit->srr_object
119: #define CSR_entries srr_un.srr_unit->srr_entries
120: #define CSR_limitproblem srr_un.srr_unit->srr_limitproblem
121: #define CSR_cr srr_un.srr_unit->srr_cr
122: struct ds_search_result * srr_next;
123: };
124: #define NULLSRR ((struct ds_search_result *) 0)
125:
126: /* following used by search for scheduling */
127:
128: struct ds_search_task {
129: DN st_baseobject;
130: DN st_alias;
131: int st_subset;
132: int st_size;
133: struct di_block * st_di;
134: struct ds_search_task * st_next;
135: ContinuationRef st_cr;
136: struct ds_search_task * st_save;
137: char st_entryonly;
138: };
139: #define NULL_ST ((struct ds_search_task *) NULL)
140: #define st_alloc() (struct ds_search_task *) smalloc (sizeof(struct ds_search_task));
141:
142: /* search max 1000 entries before worrying about time limits */
143: #define SEARCH_DELTA_SIZE 1000
144:
145: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.