xref: /illumos-gate/usr/src/lib/libldap5/include/ldap/srchpref.h (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2001 by Sun Microsystems, Inc.
3*7c478bd9Sstevel@tonic-gate  * All rights reserved.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate /*
7*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the Netscape Public
8*7c478bd9Sstevel@tonic-gate  * License Version 1.1 (the "License"); you may not use this file
9*7c478bd9Sstevel@tonic-gate  * except in compliance with the License. You may obtain a copy of
10*7c478bd9Sstevel@tonic-gate  * the License at http://www.mozilla.org/NPL/
11*7c478bd9Sstevel@tonic-gate  *
12*7c478bd9Sstevel@tonic-gate  * Software distributed under the License is distributed on an "AS
13*7c478bd9Sstevel@tonic-gate  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
14*7c478bd9Sstevel@tonic-gate  * implied. See the License for the specific language governing
15*7c478bd9Sstevel@tonic-gate  * rights and limitations under the License.
16*7c478bd9Sstevel@tonic-gate  *
17*7c478bd9Sstevel@tonic-gate  * The Original Code is Mozilla Communicator client code, released
18*7c478bd9Sstevel@tonic-gate  * March 31, 1998.
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * The Initial Developer of the Original Code is Netscape
21*7c478bd9Sstevel@tonic-gate  * Communications Corporation. Portions created by Netscape are
22*7c478bd9Sstevel@tonic-gate  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
23*7c478bd9Sstevel@tonic-gate  * Rights Reserved.
24*7c478bd9Sstevel@tonic-gate  *
25*7c478bd9Sstevel@tonic-gate  * Contributor(s):
26*7c478bd9Sstevel@tonic-gate  */
27*7c478bd9Sstevel@tonic-gate 
28*7c478bd9Sstevel@tonic-gate /*
29*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1993, 1994 Regents of the University of Michigan.
30*7c478bd9Sstevel@tonic-gate  * All rights reserved.
31*7c478bd9Sstevel@tonic-gate  *
32*7c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms are permitted
33*7c478bd9Sstevel@tonic-gate  * provided that this notice is preserved and that due credit is given
34*7c478bd9Sstevel@tonic-gate  * to the University of Michigan at Ann Arbor. The name of the University
35*7c478bd9Sstevel@tonic-gate  * may not be used to endorse or promote products derived from this
36*7c478bd9Sstevel@tonic-gate  * software without specific prior written permission. This software
37*7c478bd9Sstevel@tonic-gate  * is provided ``as is'' without express or implied warranty.
38*7c478bd9Sstevel@tonic-gate  *
39*7c478bd9Sstevel@tonic-gate  * searchpref.h:  display template library defines
40*7c478bd9Sstevel@tonic-gate  */
41*7c478bd9Sstevel@tonic-gate 
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate #ifndef _SRCHPREF_H
44*7c478bd9Sstevel@tonic-gate #define _SRCHPREF_H
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
47*7c478bd9Sstevel@tonic-gate extern "C" {
48*7c478bd9Sstevel@tonic-gate #endif
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate /* calling conventions used by library */
51*7c478bd9Sstevel@tonic-gate #ifndef LDAP_CALL
52*7c478bd9Sstevel@tonic-gate #if defined( _WINDOWS ) || defined( _WIN32 )
53*7c478bd9Sstevel@tonic-gate #define LDAP_C __cdecl
54*7c478bd9Sstevel@tonic-gate #ifndef _WIN32
55*7c478bd9Sstevel@tonic-gate #define __stdcall _far _pascal
56*7c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK _loadds
57*7c478bd9Sstevel@tonic-gate #else
58*7c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK
59*7c478bd9Sstevel@tonic-gate #endif /* _WIN32 */
60*7c478bd9Sstevel@tonic-gate #define LDAP_PASCAL __stdcall
61*7c478bd9Sstevel@tonic-gate #define LDAP_CALL LDAP_PASCAL
62*7c478bd9Sstevel@tonic-gate #else /* _WINDOWS */
63*7c478bd9Sstevel@tonic-gate #define LDAP_C
64*7c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK
65*7c478bd9Sstevel@tonic-gate #define LDAP_PASCAL
66*7c478bd9Sstevel@tonic-gate #define LDAP_CALL
67*7c478bd9Sstevel@tonic-gate #endif /* _WINDOWS */
68*7c478bd9Sstevel@tonic-gate #endif /* LDAP_CALL */
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate #ifndef _SOLARIS_SDK
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate struct ldap_searchattr {
73*7c478bd9Sstevel@tonic-gate 	char				*sa_attrlabel;
74*7c478bd9Sstevel@tonic-gate 	char				*sa_attr;
75*7c478bd9Sstevel@tonic-gate 					/* max 32 matchtypes for now */
76*7c478bd9Sstevel@tonic-gate 	unsigned long			sa_matchtypebitmap;
77*7c478bd9Sstevel@tonic-gate 	char				*sa_selectattr;
78*7c478bd9Sstevel@tonic-gate 	char				*sa_selecttext;
79*7c478bd9Sstevel@tonic-gate 	struct ldap_searchattr		*sa_next;
80*7c478bd9Sstevel@tonic-gate };
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate struct ldap_searchmatch {
83*7c478bd9Sstevel@tonic-gate 	char				*sm_matchprompt;
84*7c478bd9Sstevel@tonic-gate 	char				*sm_filter;
85*7c478bd9Sstevel@tonic-gate 	struct ldap_searchmatch		*sm_next;
86*7c478bd9Sstevel@tonic-gate };
87*7c478bd9Sstevel@tonic-gate 
88*7c478bd9Sstevel@tonic-gate struct ldap_searchobj {
89*7c478bd9Sstevel@tonic-gate 	char				*so_objtypeprompt;
90*7c478bd9Sstevel@tonic-gate 	unsigned long			so_options;
91*7c478bd9Sstevel@tonic-gate 	char				*so_prompt;
92*7c478bd9Sstevel@tonic-gate 	short				so_defaultscope;
93*7c478bd9Sstevel@tonic-gate 	char				*so_filterprefix;
94*7c478bd9Sstevel@tonic-gate 	char				*so_filtertag;
95*7c478bd9Sstevel@tonic-gate 	char				*so_defaultselectattr;
96*7c478bd9Sstevel@tonic-gate 	char				*so_defaultselecttext;
97*7c478bd9Sstevel@tonic-gate 	struct ldap_searchattr		*so_salist;
98*7c478bd9Sstevel@tonic-gate 	struct ldap_searchmatch		*so_smlist;
99*7c478bd9Sstevel@tonic-gate 	struct ldap_searchobj		*so_next;
100*7c478bd9Sstevel@tonic-gate };
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate #define NULLSEARCHOBJ			((struct ldap_searchobj *)0)
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate /*
105*7c478bd9Sstevel@tonic-gate  * global search object options
106*7c478bd9Sstevel@tonic-gate  */
107*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHOBJ_OPT_INTERNAL	0x00000001
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )	\
110*7c478bd9Sstevel@tonic-gate 	(((so)->so_options & option ) != 0 )
111*7c478bd9Sstevel@tonic-gate 
112*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_VERSION_ZERO	0
113*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_VERSION		1
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_VERSION	1
116*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_MEM		2
117*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_SYNTAX	3
118*7c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_FILE	4
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate 
121*7c478bd9Sstevel@tonic-gate LDAP_API(int)
122*7c478bd9Sstevel@tonic-gate LDAP_CALL
123*7c478bd9Sstevel@tonic-gate ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate LDAP_API(int)
126*7c478bd9Sstevel@tonic-gate LDAP_CALL
127*7c478bd9Sstevel@tonic-gate ldap_init_searchprefs_buf( char *buf, long buflen,
128*7c478bd9Sstevel@tonic-gate 	struct ldap_searchobj **solistp );
129*7c478bd9Sstevel@tonic-gate 
130*7c478bd9Sstevel@tonic-gate LDAP_API(void)
131*7c478bd9Sstevel@tonic-gate LDAP_CALL
132*7c478bd9Sstevel@tonic-gate ldap_free_searchprefs( struct ldap_searchobj *solist );
133*7c478bd9Sstevel@tonic-gate 
134*7c478bd9Sstevel@tonic-gate LDAP_API(struct ldap_searchobj *)
135*7c478bd9Sstevel@tonic-gate LDAP_CALL
136*7c478bd9Sstevel@tonic-gate ldap_first_searchobj( struct ldap_searchobj *solist );
137*7c478bd9Sstevel@tonic-gate 
138*7c478bd9Sstevel@tonic-gate LDAP_API(struct ldap_searchobj *)
139*7c478bd9Sstevel@tonic-gate LDAP_CALL
140*7c478bd9Sstevel@tonic-gate ldap_next_searchobj( struct ldap_searchobj *sollist,
141*7c478bd9Sstevel@tonic-gate 	struct ldap_searchobj *so );
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate #endif /* _SOLARIS_SDK */
144*7c478bd9Sstevel@tonic-gate 
145*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
146*7c478bd9Sstevel@tonic-gate }
147*7c478bd9Sstevel@tonic-gate #endif
148*7c478bd9Sstevel@tonic-gate #endif /* _SRCHPREF_H */
149