2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2003-2006 Match Grun and the Sylpheed-Claws team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * Functions necessary to define an LDAP query.
24 #ifndef __LDAPQUERY_H__
25 #define __LDAPQUERY_H__
35 #include "addrquery.h"
37 #include "ldapserver.h"
39 #include "addrcache.h"
41 typedef struct _LdapQuery LdapQuery;
45 LdapServer *server; /* Reference to (parent) LDAP server */
55 pthread_mutex_t *mutexStop;
56 pthread_mutex_t *mutexBusy;
57 pthread_mutex_t *mutexEntry;
58 void (*callBackEntry)( void *, gint, void *, void * );
59 void (*callBackEnd)( void *, gint, gint, void * );
64 typedef struct _NameValuePair NameValuePair;
65 struct _NameValuePair {
70 /* Function prototypes */
71 void ldapqry_initialize ( void );
72 LdapQuery *ldapqry_create ( void );
73 void ldapqry_set_control ( LdapQuery *qry, LdapControl *ctl );
74 void ldapqry_set_name ( LdapQuery* qry, const gchar *value );
75 void ldapqry_set_search_value ( LdapQuery *qry, const gchar *value );
76 void ldapqry_set_error_status ( LdapQuery* qry, const gint value );
77 void ldapqry_set_search_type ( LdapQuery *qry, const AddrSearchType value );
78 void ldapqry_set_query_id ( LdapQuery* qry, const gint value );
79 void ldapqry_set_entries_read ( LdapQuery* qry, const gint value );
80 void ldapqry_set_callback_start ( LdapQuery *qry, void *func );
81 void ldapqry_set_callback_entry ( LdapQuery *qry, void *func );
82 void ldapqry_set_callback_end ( LdapQuery *qry, void *func );
83 void ldapqry_clear ( LdapQuery *qry );
84 void ldapqry_free ( LdapQuery *qry );
85 void ldapqry_print ( const LdapQuery *qry, FILE *stream );
86 void ldapqry_set_stop_flag ( LdapQuery *qry, const gboolean value );
87 gboolean ldapqry_get_stop_flag ( LdapQuery *qry );
88 void ldapqry_set_busy_flag ( LdapQuery *qry, const gboolean value );
89 gboolean ldapqry_get_busy_flag ( LdapQuery *qry );
90 void ldapqry_set_aged_flag ( LdapQuery *qry, const gboolean value );
91 gboolean ldapqry_get_aged_flag ( LdapQuery *qry );
92 void ldapqry_set_data ( LdapQuery *qry, const gpointer value );
93 gpointer ldapqry_get_data ( LdapQuery *qry );
95 gboolean ldapqry_check_search ( LdapQuery *qry );
96 void ldapqry_touch ( LdapQuery *qry );
97 gint ldapqry_search ( LdapQuery *qry );
98 gint ldapqry_read_data_th ( LdapQuery *qry );
99 void ldapqry_cancel ( LdapQuery *qry );
100 void ldapqry_age ( LdapQuery *qry, gint maxAge );
101 void ldapqry_delete_folder ( LdapQuery *qry );
102 gboolean ldapquery_remove_results( LdapQuery *qry );
103 void ldapqry_free_list_name_value( GList *list );
104 void ldapqry_free_name_value( NameValuePair *nvp );
105 #endif /* USE_LDAP */
107 #endif /* __LDAPQUERY_H__ */