2 OpenChange MAPI implementation.
4 Copyright (C) Julien Kerihuel 2007.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __MAPI_NOTIFICATION_H__
21 #define __MAPI_NOTIFICATION_H__
23 /* notification which takes:
24 * - ulEvenType = type of notification
25 * - void * = notification data
26 * - void * = private data pointer
28 typedef int (*mapi_notify_callback_t)(uint16_t, void *, void *);
30 typedef int (*mapi_notify_continue_callback_t)(void *);
32 struct notifications {
33 uint32_t ulConnection; /* connection number */
34 uint32_t NotificationFlags; /* events mask associated */
35 mapi_id_t parentID; /* parent EntryID == FID here */
36 mapi_notify_callback_t callback; /* callback to run when */
37 void *private_data; /* private data for the callback */
38 struct mapi_object obj_notif; /* notification object */
39 struct notifications *prev;
40 struct notifications *next;
43 struct mapi_notify_ctx {
44 struct NOTIFKEY key; /* unique identifier */
45 int fd; /* UDP socket file descriptor */
46 struct sockaddr *addr;
47 struct notifications *notifications;
50 struct mapi_notify_continue_callback_data {
51 mapi_notify_continue_callback_t callback; /* Consulted for continuing processing events*/
52 void *data; /* Data for callback */
53 struct timeval tv; /* Timeout for Select call */
56 #define DFLT_NOTIF_PORT 2500
58 #endif /*!__MAPI_NOTIFICATION_H__ */