
#include <stdlib.h>

#include "request_handler_entry.h"
#include "command.h"


struct s_RequestHandlerEntry
{
    const CommandHandler *handler;
    void *context;
};

RequestHandlerEntry *
request_handler_entry_new (const CommandHandler *handler, void *context)
{
    RequestHandlerEntry *entry = malloc (sizeof (RequestHandlerEntry));

    entry->handler = handler;
    entry->context = context;

    return (entry);
}

void
request_handler_entry_destroy (void *ptr)
{
    RequestHandlerEntry *entry = (RequestHandlerEntry *) ptr;

    free (entry);
}

const CommandHandler *
request_handler_entry_getHandler (RequestHandlerEntry *entry)
{
    return (entry->handler);
}

void *
request_handler_entry_getContext (RequestHandlerEntry *entry)
{
    return (entry->context);
}
