Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/pubsub/lib/msg.h

22 lines
622 B
C

#ifndef __PUBSUB_MSG_H__
#define __PUBSUB_MSG_H__
#define PUBSUB_MSG_TYPE_SUB 1
#define PUBSUB_MSG_TYPE_UNSUB 2
#define PUBSUB_MSG_TYPE_PUB 3
struct pubsub_msg {
unsigned char type; // message type : alert, notification, …
char *chan;
size_t chanlen;
char *data;
size_t datalen;
};
void pubsub_message_serialize (const struct pubsub_msg *msg, char **data, size_t *len);
void pubsub_message_unserialize (struct pubsub_msg *msg, const char *data, size_t len);
void pubsub_message_free (struct pubsub_msg *msg);
void pubsub_message_print (const struct pubsub_msg *msg);
#endif