#ifndef AMARQUEE_PROTOS_H
#define AMARQUEE_PROTOS_H

#ifndef AMARQUEE_H
#include <libraries/Amarquee.h>
#endif

#define LibCall __geta4 __regargs

/* Open or close a connection */
extern LibCall struct QSession * QNewSession(char * hostname, LONG port, char * progname);  /* returns socket descriptor */
extern LibCall void QFreeSession(struct QSession * session);

/* Transactions--these return their transaction ID #, or zero on no memory. */
extern LibCall LONG QDebugOp(struct QSession * session, char * string);
extern LibCall LONG QGetOp(struct QSession * session, char * wildpath, LONG maxBytes);
extern LibCall LONG QDeleteOp(struct QSession * session, char * wildpath);
extern LibCall LONG QRenameOp(struct QSession * session, char * path, char * label);
extern LibCall LONG QSubscribeOp(struct QSession * session, char * wildpath, LONG maxBytes);
extern LibCall LONG QSetOp(struct QSession * session, char * path, void * buffer, ULONG bufferLength);
extern LibCall LONG QClearSubscriptionsOp(struct QSession * session, LONG which);
extern LibCall LONG QPingOp(struct QSession * session);
extern LibCall LONG QInfoOp(struct QSession * session);
extern LibCall LONG QSetAccessOp(struct QSession * session, char * newAccess);
extern LibCall LONG QGo(struct QSession * session, ULONG flags);

/* Call this function to free your QMessage! */
extern LibCall void FreeQMessage(struct QSession * session, struct QMessage * qmsg);

/* Use this to open a host QSession to receive connections on. */
extern LibCall struct QSession * QNewHostSession(char * hostnames, LONG port, char * progNames);
extern LibCall LONG QStreamOp(struct QSession * session, char * path, void * buffer, ULONG bufferLength);
extern LibCall struct QSession * QNewServerSession(char * hostNames, char * progNames);

extern LibCall LONG QSetMessageAccessOp(struct QSession * session, char * newAccess, LONG maxBytes);
extern LibCall LONG QMessageOp(struct QSession * session, char * hosts, void * buffer, ULONG bufferLength);

#endif /* AMARQUEE_PROTOS_H */