17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * Copyright (c) 2001 by Sun Microsystems, Inc.
37c478bd9Sstevel@tonic-gate  * All rights reserved.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate /*
77c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the Netscape Public
87c478bd9Sstevel@tonic-gate  * License Version 1.1 (the "License"); you may not use this file
97c478bd9Sstevel@tonic-gate  * except in compliance with the License. You may obtain a copy of
107c478bd9Sstevel@tonic-gate  * the License at http://www.mozilla.org/NPL/
117c478bd9Sstevel@tonic-gate  *
127c478bd9Sstevel@tonic-gate  * Software distributed under the License is distributed on an "AS
137c478bd9Sstevel@tonic-gate  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
147c478bd9Sstevel@tonic-gate  * implied. See the License for the specific language governing
157c478bd9Sstevel@tonic-gate  * rights and limitations under the License.
167c478bd9Sstevel@tonic-gate  *
177c478bd9Sstevel@tonic-gate  * The Original Code is Mozilla Communicator client code, released
187c478bd9Sstevel@tonic-gate  * March 31, 1998.
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * The Initial Developer of the Original Code is Netscape
217c478bd9Sstevel@tonic-gate  * Communications Corporation. Portions created by Netscape are
227c478bd9Sstevel@tonic-gate  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
237c478bd9Sstevel@tonic-gate  * Rights Reserved.
247c478bd9Sstevel@tonic-gate  *
257c478bd9Sstevel@tonic-gate  * Contributor(s):
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * Copyright (c) 1993, 1994 Regents of the University of Michigan.
307c478bd9Sstevel@tonic-gate  * All rights reserved.
317c478bd9Sstevel@tonic-gate  *
327c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms are permitted
337c478bd9Sstevel@tonic-gate  * provided that this notice is preserved and that due credit is given
347c478bd9Sstevel@tonic-gate  * to the University of Michigan at Ann Arbor. The name of the University
357c478bd9Sstevel@tonic-gate  * may not be used to endorse or promote products derived from this
367c478bd9Sstevel@tonic-gate  * software without specific prior written permission. This software
377c478bd9Sstevel@tonic-gate  * is provided ``as is'' without express or implied warranty.
387c478bd9Sstevel@tonic-gate  *
397c478bd9Sstevel@tonic-gate  * searchpref.h:  display template library defines
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate #ifndef _SRCHPREF_H
447c478bd9Sstevel@tonic-gate #define _SRCHPREF_H
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #ifdef __cplusplus
477c478bd9Sstevel@tonic-gate extern "C" {
487c478bd9Sstevel@tonic-gate #endif
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate /* calling conventions used by library */
517c478bd9Sstevel@tonic-gate #ifndef LDAP_CALL
527c478bd9Sstevel@tonic-gate #if defined( _WINDOWS ) || defined( _WIN32 )
537c478bd9Sstevel@tonic-gate #define LDAP_C __cdecl
54*1da57d55SToomas Soome #ifndef _WIN32
557c478bd9Sstevel@tonic-gate #define __stdcall _far _pascal
567c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK _loadds
577c478bd9Sstevel@tonic-gate #else
587c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK
597c478bd9Sstevel@tonic-gate #endif /* _WIN32 */
607c478bd9Sstevel@tonic-gate #define LDAP_PASCAL __stdcall
617c478bd9Sstevel@tonic-gate #define LDAP_CALL LDAP_PASCAL
627c478bd9Sstevel@tonic-gate #else /* _WINDOWS */
637c478bd9Sstevel@tonic-gate #define LDAP_C
647c478bd9Sstevel@tonic-gate #define LDAP_CALLBACK
657c478bd9Sstevel@tonic-gate #define LDAP_PASCAL
667c478bd9Sstevel@tonic-gate #define LDAP_CALL
677c478bd9Sstevel@tonic-gate #endif /* _WINDOWS */
687c478bd9Sstevel@tonic-gate #endif /* LDAP_CALL */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #ifndef _SOLARIS_SDK
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate struct ldap_searchattr {
737c478bd9Sstevel@tonic-gate 	char				*sa_attrlabel;
747c478bd9Sstevel@tonic-gate 	char				*sa_attr;
757c478bd9Sstevel@tonic-gate 					/* max 32 matchtypes for now */
767c478bd9Sstevel@tonic-gate 	unsigned long			sa_matchtypebitmap;
777c478bd9Sstevel@tonic-gate 	char				*sa_selectattr;
787c478bd9Sstevel@tonic-gate 	char				*sa_selecttext;
797c478bd9Sstevel@tonic-gate 	struct ldap_searchattr		*sa_next;
807c478bd9Sstevel@tonic-gate };
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate struct ldap_searchmatch {
837c478bd9Sstevel@tonic-gate 	char				*sm_matchprompt;
847c478bd9Sstevel@tonic-gate 	char				*sm_filter;
857c478bd9Sstevel@tonic-gate 	struct ldap_searchmatch		*sm_next;
867c478bd9Sstevel@tonic-gate };
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate struct ldap_searchobj {
897c478bd9Sstevel@tonic-gate 	char				*so_objtypeprompt;
907c478bd9Sstevel@tonic-gate 	unsigned long			so_options;
917c478bd9Sstevel@tonic-gate 	char				*so_prompt;
927c478bd9Sstevel@tonic-gate 	short				so_defaultscope;
937c478bd9Sstevel@tonic-gate 	char				*so_filterprefix;
947c478bd9Sstevel@tonic-gate 	char				*so_filtertag;
957c478bd9Sstevel@tonic-gate 	char				*so_defaultselectattr;
967c478bd9Sstevel@tonic-gate 	char				*so_defaultselecttext;
977c478bd9Sstevel@tonic-gate 	struct ldap_searchattr		*so_salist;
987c478bd9Sstevel@tonic-gate 	struct ldap_searchmatch		*so_smlist;
997c478bd9Sstevel@tonic-gate 	struct ldap_searchobj		*so_next;
1007c478bd9Sstevel@tonic-gate };
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #define NULLSEARCHOBJ			((struct ldap_searchobj *)0)
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate /*
1057c478bd9Sstevel@tonic-gate  * global search object options
1067c478bd9Sstevel@tonic-gate  */
1077c478bd9Sstevel@tonic-gate #define LDAP_SEARCHOBJ_OPT_INTERNAL	0x00000001
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )	\
1107c478bd9Sstevel@tonic-gate 	(((so)->so_options & option ) != 0 )
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_VERSION_ZERO	0
1137c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_VERSION		1
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_VERSION	1
1167c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_MEM		2
1177c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_SYNTAX	3
1187c478bd9Sstevel@tonic-gate #define LDAP_SEARCHPREF_ERR_FILE	4
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate LDAP_API(int)
1227c478bd9Sstevel@tonic-gate LDAP_CALL
1237c478bd9Sstevel@tonic-gate ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate LDAP_API(int)
1267c478bd9Sstevel@tonic-gate LDAP_CALL
1277c478bd9Sstevel@tonic-gate ldap_init_searchprefs_buf( char *buf, long buflen,
1287c478bd9Sstevel@tonic-gate 	struct ldap_searchobj **solistp );
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate LDAP_API(void)
1317c478bd9Sstevel@tonic-gate LDAP_CALL
1327c478bd9Sstevel@tonic-gate ldap_free_searchprefs( struct ldap_searchobj *solist );
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate LDAP_API(struct ldap_searchobj *)
1357c478bd9Sstevel@tonic-gate LDAP_CALL
1367c478bd9Sstevel@tonic-gate ldap_first_searchobj( struct ldap_searchobj *solist );
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate LDAP_API(struct ldap_searchobj *)
1397c478bd9Sstevel@tonic-gate LDAP_CALL
1407c478bd9Sstevel@tonic-gate ldap_next_searchobj( struct ldap_searchobj *sollist,
1417c478bd9Sstevel@tonic-gate 	struct ldap_searchobj *so );
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #endif /* _SOLARIS_SDK */
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #ifdef __cplusplus
1467c478bd9Sstevel@tonic-gate }
1477c478bd9Sstevel@tonic-gate #endif
1487c478bd9Sstevel@tonic-gate #endif /* _SRCHPREF_H */
149