]> git.sur5r.net Git - openldap/blob - include/srchpref.h
ber_int_t, ber_tag_t, ber_socket_t, ber_len_t
[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 /*
64  * global search object options
65  */
66 #define LDAP_SEARCHOBJ_OPT_INTERNAL     0x00000001
67
68 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )      \
69         (((so)->so_options & (option) ) != 0 )
70
71 #define LDAP_SEARCHPREF_VERSION_ZERO    0
72 #define LDAP_SEARCHPREF_VERSION         1
73
74 #define LDAP_SEARCHPREF_ERR_VERSION     1
75 #define LDAP_SEARCHPREF_ERR_MEM         2
76 #define LDAP_SEARCHPREF_ERR_SYNTAX      3
77 #define LDAP_SEARCHPREF_ERR_FILE        4
78
79
80 LDAP_F( int )
81 ldap_init_searchprefs LDAP_P(( char *file,
82         struct ldap_searchobj **solistp ));
83
84 LDAP_F( int )
85 ldap_init_searchprefs_buf LDAP_P(( char *buf,
86         ber_len_t buflen,
87         struct ldap_searchobj **solistp ));
88
89 LDAP_F( void )
90 ldap_free_searchprefs LDAP_P(( struct ldap_searchobj *solist ));
91
92 LDAP_F( struct ldap_searchobj * )
93 ldap_first_searchobj LDAP_P(( struct ldap_searchobj *solist ));
94
95 LDAP_F( struct ldap_searchobj * )
96 ldap_next_searchobj LDAP_P(( struct ldap_searchobj *sollist,
97         struct ldap_searchobj *so ));
98
99
100 LDAP_END_DECL
101
102 #endif /* _SRCHPREF_H */