/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#ifndef SIMPLE_STOMP_H
#define SIMPLE_STOMP_H

typedef void (*error_handler)(char *msg);

struct simple_stomp_t
{
   int sd;
   error_handler eh;
};

typedef struct simple_stomp_t simple_stomp_t ;

void simple_stomp_debug(int debug);
int simple_stomp_init(simple_stomp_t *ctx, const char *host, int port, error_handler eh);
int simple_stomp_write(simple_stomp_t *ctx, const char *qname, const char *msg);
int simple_stomp_read(simple_stomp_t *ctx, const char *qname, char *msg);
int simple_stomp_close(simple_stomp_t *ctx);

#endif
