2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2003 Match Grun
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Functions necessary to define an LDAP query.
24 #ifndef __LDAPQUERY_H__
25 #define __LDAPQUERY_H__
35 #include "ldapserver.h"
37 #include "addrcache.h"
42 #define LDAPQUERY_NONE 0
43 #define LDAPQUERY_STATIC 1
44 #define LDAPQUERY_DYNAMIC 2
47 #define LDAPRC_SUCCESS 0
48 #define LDAPRC_CONNECT -1
49 #define LDAPRC_INIT -2
50 #define LDAPRC_BIND -3
51 #define LDAPRC_SEARCH -4
52 #define LDAPRC_TIMEOUT -5
53 #define LDAPRC_CRITERIA -6
54 #define LDAPRC_NOENTRIES -7
56 typedef struct _LdapQuery LdapQuery;
72 pthread_mutex_t *mutexStop;
73 pthread_mutex_t *mutexBusy;
74 pthread_mutex_t *mutexEntry;
75 void (*callBackStart)( void * );
76 void (*callBackEntry)( void *, void * );
77 void (*callBackEnd)( void * );
78 ItemFolder *folder; /* Reference to folder in cache */
79 LdapServer *server; /* Reference to (parent) LDAP server */
82 /* Function prototypes */
83 void ldapqry_initialize ( void );
84 LdapQuery *ldapqry_create ( void );
85 void ldapqry_set_control ( LdapQuery *qry, LdapControl *ctl );
86 void ldapqry_set_name ( LdapQuery* qry, const gchar *value );
87 void ldapqry_set_search_value ( LdapQuery *qry, const gchar *value );
88 void ldapqry_set_error_status ( LdapQuery* qry, const gint value );
89 void ldapqry_set_query_type ( LdapQuery* qry, const gint value );
90 void ldapqry_set_query_id ( LdapQuery* qry, const gint value );
91 void ldapqry_set_entries_read ( LdapQuery* qry, const gint value );
92 void ldapqry_set_callback_start ( LdapQuery *qry, void *func );
93 void ldapqry_set_callback_entry ( LdapQuery *qry, void *func );
94 void ldapqry_set_callback_end ( LdapQuery *qry, void *func );
95 void ldapqry_clear ( LdapQuery *qry );
96 void ldapqry_free ( LdapQuery *qry );
97 void ldapqry_print ( const LdapQuery *qry, FILE *stream );
98 void ldapqry_set_stop_flag ( LdapQuery *qry, const gboolean value );
99 gboolean ldapqry_get_stop_flag ( LdapQuery *qry );
100 void ldapqry_set_busy_flag ( LdapQuery *qry, const gboolean value );
101 gboolean ldapqry_get_busy_flag ( LdapQuery *qry );
102 void ldapqry_set_aged_flag ( LdapQuery *qry, const gboolean value );
103 gboolean ldapqry_get_aged_flag ( LdapQuery *qry );
105 gboolean ldapqry_check_search ( LdapQuery *qry );
106 void ldapqry_touch ( LdapQuery *qry );
107 gint ldapqry_search ( LdapQuery *qry );
108 gint ldapqry_read_data_th ( LdapQuery *qry );
109 void ldapqry_join_thread ( LdapQuery *qry );
110 void ldapqry_cancel ( LdapQuery *qry );
111 void ldapqry_age ( LdapQuery *qry, gint maxAge );
112 void ldapqry_delete_folder ( LdapQuery *qry );
114 #endif /* USE_LDAP */
116 #endif /* __LDAPQUERY_H__ */