2015-07-07 16:46:23 +02:00
|
|
|
/* Pinos
|
|
|
|
|
* Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __PINOS_SUBSCRIBE_H__
|
|
|
|
|
#define __PINOS_SUBSCRIBE_H__
|
|
|
|
|
|
2016-11-24 17:00:42 +01:00
|
|
|
#include <stdint.h>
|
2015-07-07 16:46:23 +02:00
|
|
|
|
2016-11-24 17:00:42 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2015-07-07 16:46:23 +02:00
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_SUBSCRIPTION_STATE_UNCONNECTED = 0,
|
|
|
|
|
PINOS_SUBSCRIPTION_STATE_CONNECTING = 1,
|
|
|
|
|
PINOS_SUBSCRIPTION_STATE_READY = 2,
|
|
|
|
|
PINOS_SUBSCRIPTION_STATE_ERROR = 3,
|
|
|
|
|
} PinosSubscriptionState;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2015-08-04 17:34:11 +02:00
|
|
|
PINOS_SUBSCRIPTION_FLAG_DAEMON = (1 << 0),
|
2016-07-20 17:55:02 +02:00
|
|
|
PINOS_SUBSCRIPTION_FLAG_CLIENT = (1 << 1),
|
|
|
|
|
PINOS_SUBSCRIPTION_FLAG_NODE = (1 << 2),
|
2016-08-18 12:17:31 +02:00
|
|
|
PINOS_SUBSCRIPTION_FLAG_LINK = (1 << 3)
|
2015-07-07 16:46:23 +02:00
|
|
|
} PinosSubscriptionFlags;
|
|
|
|
|
|
2016-08-18 12:17:31 +02:00
|
|
|
#define PINOS_SUBSCRIPTION_FLAGS_ALL 0x0f
|
2015-07-07 16:46:23 +02:00
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_SUBSCRIPTION_EVENT_NEW = 0,
|
|
|
|
|
PINOS_SUBSCRIPTION_EVENT_CHANGE = 1,
|
|
|
|
|
PINOS_SUBSCRIPTION_EVENT_REMOVE = 2,
|
|
|
|
|
} PinosSubscriptionEvent;
|
|
|
|
|
|
2016-11-24 17:00:42 +01:00
|
|
|
typedef void (*PinosSubscriptionFunc) (PinosContext *context,
|
|
|
|
|
PinosSubscriptionFlags flags,
|
|
|
|
|
PinosSubscriptionEvent event,
|
|
|
|
|
uint32_t id,
|
|
|
|
|
void *data);
|
2015-07-07 16:46:23 +02:00
|
|
|
|
2016-11-24 17:00:42 +01:00
|
|
|
void pinos_context_subscribe (PinosContext *context,
|
|
|
|
|
PinosSubscriptionFlags mask,
|
|
|
|
|
PinosSubscriptionFunc func,
|
|
|
|
|
void *data);
|
2015-07-07 16:46:23 +02:00
|
|
|
|
2016-11-24 17:00:42 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2015-07-07 16:46:23 +02:00
|
|
|
|
|
|
|
|
#endif /* __PINOS_SUBSCRIBE_H__ */
|