/*****************************************************************************/
/*
                                  WebSock.h
*/
/*****************************************************************************/

#ifndef WEBSOCK_H_LOADED
#define WEBSOCK_H_LOADED 1

#include "wasd.h"

/* minimum mailbox sizes */
#define WEBSOCKET_INPUT_MIN 512
#define WEBSOCKET_OUTPUT_MIN 512

#define WEBSOCKET_REQUEST(rqptr) \
   (rqptr && \
    rqptr->rqHeader.ConnectionUpgrade && \
    rqptr->rqHeader.UpgradeWebSocket)

/***********************/
/* function prototypes */
/***********************/

BOOL WebSockRequest (REQUEST_STRUCT*);
WebSockCreateMailboxes (REQUEST_STRUCT*);
WebSockClose (REQUEST_STRUCT*);
WebSockDassgnInput (unsigned short);
BOOL WebSockCloseMailboxes (REQUEST_STRUCT*);
BOOL WebSockEnd (REQUEST_STRUCT*);
WebSockIfEnd (REQUEST_STRUCT*);

WebSockInput (REQUEST_STRUCT*);
WebSockInputAst (REQUEST_STRUCT*);
WebSockInputWriteAst (REQUEST_STRUCT*);

WebSockOutput (REQUEST_STRUCT*);
WebSockOutputAst (REQUEST_STRUCT*);
WebSockOutputWriteAst (REQUEST_STRUCT*);

WebSockCallout (REQUEST_STRUCT*);
WebSockCalloutQio (REQUEST_STRUCT*, char*, int);
WebSockCalloutQioAst (REQUEST_STRUCT*);
WebSockRemove (REQUEST_STRUCT*);
int WebSockCount (unsigned long);
int WebSockControl (int, char*, char*);
WebSockReport (REQUEST_STRUCT*);

#endif /* WEBSOCK_H_LOADED */

/*****************************************************************************/

