1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/wsfs/message.c
2019-02-10 14:19:15 +01:00

25 lines
558 B
C

#include "wsfs/message.h"
#include <stdlib.h>
#include <libwebsockets.h>
struct wsfs_message * wsfs_message_create(size_t length)
{
char * data = malloc(sizeof(struct wsfs_message) + LWS_PRE + length);
struct wsfs_message * message = (struct wsfs_message *) data;
if (NULL != message)
{
message->data = &data[sizeof(struct wsfs_message) + LWS_PRE];
message->length = length;
message->next = NULL;
}
return message;
}
void wsfs_message_dispose(
struct wsfs_message * message)
{
free(message);
}