Back to index

lightning-sunbird  0.9+nobinonly
srchpref.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code, released
00015  * March 31, 1998.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 /*
00039  * Copyright (c) 1993, 1994 Regents of the University of Michigan.
00040  * All rights reserved.
00041  *
00042  * Redistribution and use in source and binary forms are permitted
00043  * provided that this notice is preserved and that due credit is given
00044  * to the University of Michigan at Ann Arbor. The name of the University
00045  * may not be used to endorse or promote products derived from this
00046  * software without specific prior written permission. This software
00047  * is provided ``as is'' without express or implied warranty.
00048  *
00049  * searchpref.h:  display template library defines
00050  */
00051 
00052 
00053 #ifndef _SRCHPREF_H
00054 #define _SRCHPREF_H
00055 
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059 
00060 /* calling conventions used by library */
00061 #ifndef LDAP_CALL
00062 #if defined( _WINDOWS ) || defined( _WIN32 )
00063 #define LDAP_C __cdecl
00064 #ifndef _WIN32 
00065 #define __stdcall _far _pascal
00066 #define LDAP_CALLBACK _loadds
00067 #else
00068 #define LDAP_CALLBACK
00069 #endif /* _WIN32 */
00070 #define LDAP_PASCAL __stdcall
00071 #define LDAP_CALL LDAP_PASCAL
00072 #else /* _WINDOWS */
00073 #define LDAP_C
00074 #define LDAP_CALLBACK
00075 #define LDAP_PASCAL
00076 #define LDAP_CALL
00077 #endif /* _WINDOWS */
00078 #endif /* LDAP_CALL */
00079 
00080 struct ldap_searchattr {
00081        char                        *sa_attrlabel;
00082        char                        *sa_attr;
00083                                    /* max 32 matchtypes for now */
00084        unsigned long               sa_matchtypebitmap;
00085        char                        *sa_selectattr;
00086        char                        *sa_selecttext;
00087        struct ldap_searchattr             *sa_next;
00088 };
00089 
00090 struct ldap_searchmatch {
00091        char                        *sm_matchprompt;
00092        char                        *sm_filter;
00093        struct ldap_searchmatch            *sm_next;
00094 };
00095 
00096 struct ldap_searchobj {
00097        char                        *so_objtypeprompt;
00098        unsigned long               so_options;
00099        char                        *so_prompt;
00100        short                       so_defaultscope;
00101        char                        *so_filterprefix;
00102        char                        *so_filtertag;
00103        char                        *so_defaultselectattr;
00104        char                        *so_defaultselecttext;
00105        struct ldap_searchattr             *so_salist;
00106        struct ldap_searchmatch            *so_smlist;
00107        struct ldap_searchobj              *so_next;
00108 };
00109 
00110 #define NULLSEARCHOBJ                     ((struct ldap_searchobj *)0)
00111 
00112 /*
00113  * global search object options
00114  */
00115 #define LDAP_SEARCHOBJ_OPT_INTERNAL       0x00000001
00116 
00117 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option )      \
00118        (((so)->so_options & option ) != 0 )
00119 
00120 #define LDAP_SEARCHPREF_VERSION_ZERO      0
00121 #define LDAP_SEARCHPREF_VERSION           1
00122 
00123 #define LDAP_SEARCHPREF_ERR_VERSION       1
00124 #define LDAP_SEARCHPREF_ERR_MEM           2
00125 #define LDAP_SEARCHPREF_ERR_SYNTAX 3
00126 #define LDAP_SEARCHPREF_ERR_FILE   4
00127 
00128 
00129 LDAP_API(int)
00130 LDAP_CALL
00131 ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
00132 
00133 LDAP_API(int)
00134 LDAP_CALL
00135 ldap_init_searchprefs_buf( char *buf, long buflen,
00136        struct ldap_searchobj **solistp );
00137 
00138 LDAP_API(void)
00139 LDAP_CALL
00140 ldap_free_searchprefs( struct ldap_searchobj *solist );
00141 
00142 LDAP_API(struct ldap_searchobj *)
00143 LDAP_CALL
00144 ldap_first_searchobj( struct ldap_searchobj *solist );
00145 
00146 LDAP_API(struct ldap_searchobj *)
00147 LDAP_CALL
00148 ldap_next_searchobj( struct ldap_searchobj *sollist,
00149        struct ldap_searchobj *so );
00150 
00151 #ifdef __cplusplus
00152 }
00153 #endif
00154 #endif /* _SRCHPREF_H */