]> git.sur5r.net Git - openldap/blob - include/srchpref.h
More lint removal from Hallvard.
[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 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 struct ldap_searchattr {
26         char                            *sa_attrlabel;
27         char                            *sa_attr;
28                                         /* max 32 matchtypes for now */
29         unsigned long                   sa_matchtypebitmap;
30         char                            *sa_selectattr;
31         char                            *sa_selecttext;
32         struct ldap_searchattr          *sa_next;
33 };
34
35 struct ldap_searchmatch {
36         char                            *sm_matchprompt;
37         char                            *sm_filter;
38         struct ldap_searchmatch         *sm_next;
39 };
40
41 struct ldap_searchobj {
42         char                            *so_objtypeprompt;
43         unsigned long                   so_options;
44         char                            *so_prompt;
45         short                           so_defaultscope;
46         char                            *so_filterprefix;
47         char                            *so_filtertag;
48         char                            *so_defaultselectattr;
49         char                            *so_defaultselecttext;
50         struct ldap_searchattr          *so_salist;
51         struct ldap_searchmatch         *so_smlist;
52         struct ldap_searchobj           *so_next;
53 };
54
55 #define NULLSEARCHOBJ                   ((struct ldap_searchobj *)0)
56
57 /*
58  * global search object options
59  */
60 #define LDAP_SEARCHOBJ_OPT_INTERNAL     0x00000001
61
62 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )      \
63         (((so)->so_options & (option) ) != 0 )
64
65 #define LDAP_SEARCHPREF_VERSION_ZERO    0
66 #define LDAP_SEARCHPREF_VERSION         1
67
68 #define LDAP_SEARCHPREF_ERR_VERSION     1
69 #define LDAP_SEARCHPREF_ERR_MEM         2
70 #define LDAP_SEARCHPREF_ERR_SYNTAX      3
71 #define LDAP_SEARCHPREF_ERR_FILE        4
72
73
74 #ifndef NEEDPROTOS
75 int                     ldap_init_searchprefs();
76 int                     ldap_init_searchprefs_buf();
77 void                    ldap_free_searchprefs();
78 struct ldap_searchobj   *ldap_first_searchobj();
79 struct ldap_searchobj   *ldap_next_searchobj();
80
81 #else /* !NEEDPROTOS */
82
83 LDAPFUNCDECL int
84 ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
85
86 LDAPFUNCDECL int
87 ldap_init_searchprefs_buf( char *buf, long buflen,
88         struct ldap_searchobj **solistp );
89
90 LDAPFUNCDECL void
91 ldap_free_searchprefs( struct ldap_searchobj *solist );
92
93 LDAPFUNCDECL struct ldap_searchobj *
94 ldap_first_searchobj( struct ldap_searchobj *solist );
95
96 LDAPFUNCDECL struct ldap_searchobj *
97 ldap_next_searchobj( struct ldap_searchobj *sollist,
98         struct ldap_searchobj *so );
99
100 #endif /* !NEEDPROTOS */
101
102
103 #ifdef __cplusplus
104 }
105 #endif
106 #endif /* _SRCHPREF_H */