]> git.sur5r.net Git - openldap/blob - include/srchpref.h
merged with autoconf branch
[openldap] / include / srchpref.h
1 /*
2  * Copyright (c) 1993, 1994 Regents of the University of Michigan.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of Michigan at Ann Arbor. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  *
12  * searchpref.h:  display template library defines
13  * 16 May 1994 by Gordon Good
14  */
15
16
17 #ifndef _SRCHPREF_H
18 #define _SRCHPREF_H
19
20 #include <ldap_cdefs.h>
21
22 LDAP_BEGIN_DECL
23
24 struct ldap_searchattr {
25         char                            *sa_attrlabel;
26         char                            *sa_attr;
27                                         /* max 32 matchtypes for now */
28         unsigned long                   sa_matchtypebitmap;
29         char                            *sa_selectattr;
30         char                            *sa_selecttext;
31         struct ldap_searchattr          *sa_next;
32 };
33
34 struct ldap_searchmatch {
35         char                            *sm_matchprompt;
36         char                            *sm_filter;
37         struct ldap_searchmatch         *sm_next;
38 };
39
40 struct ldap_searchobj {
41         char                            *so_objtypeprompt;
42         unsigned long                   so_options;
43         char                            *so_prompt;
44         short                           so_defaultscope;
45         char                            *so_filterprefix;
46         char                            *so_filtertag;
47         char                            *so_defaultselectattr;
48         char                            *so_defaultselecttext;
49         struct ldap_searchattr          *so_salist;
50         struct ldap_searchmatch         *so_smlist;
51         struct ldap_searchobj           *so_next;
52 };
53
54 #define NULLSEARCHOBJ                   ((struct ldap_searchobj *)0)
55
56 /*
57  * global search object options
58  */
59 #define LDAP_SEARCHOBJ_OPT_INTERNAL     0x00000001
60
61 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )      \
62         (((so)->so_options & (option) ) != 0 )
63
64 #define LDAP_SEARCHPREF_VERSION_ZERO    0
65 #define LDAP_SEARCHPREF_VERSION         1
66
67 #define LDAP_SEARCHPREF_ERR_VERSION     1
68 #define LDAP_SEARCHPREF_ERR_MEM         2
69 #define LDAP_SEARCHPREF_ERR_SYNTAX      3
70 #define LDAP_SEARCHPREF_ERR_FILE        4
71
72
73 LDAP_F int
74 ldap_init_searchprefs LDAP_P(( char *file,
75         struct ldap_searchobj **solistp ));
76
77 LDAP_F int
78 ldap_init_searchprefs_buf LDAP_P(( char *buf,
79         long buflen,
80         struct ldap_searchobj **solistp ));
81
82 LDAP_F void
83 ldap_free_searchprefs LDAP_P(( struct ldap_searchobj *solist ));
84
85 LDAP_F struct ldap_searchobj *
86 ldap_first_searchobj LDAP_P(( struct ldap_searchobj *solist ));
87
88 LDAP_F struct ldap_searchobj *
89 ldap_next_searchobj LDAP_P(( struct ldap_searchobj *sollist,
90         struct ldap_searchobj *so ));
91
92
93 LDAP_END_DECL
94
95 #endif /* _SRCHPREF_H */