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