/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This module is the application interface to the multi-threaded functionality in the Library. It contains a set of functions that the application can either use as are or they can be overwritten by the application.
This module is implemented by HTEvntrg.c, and it is a part of the W3C Reference Library.
#ifndef HTEVNTRG_H #define HTEVNTRG_H #include "HTReq.h" #include "tcp.h"
#if defined(WWW_WIN_ASYNC) || defined(WWW_WIN_DLL) extern BOOL HTEvent_winHandle (HTRequest * request); extern BOOL HTEvent_setWinHandle (HWND window, unsigned long message); extern HWND HTEvent_getWinHandle (unsigned long * pMessage); extern LRESULT CALLBACK AsyncWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); #endif
typedef u_long SockOps; #define FD_NONE 0 #define FD_ALL (FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT |FD_CLOSE) #define FD_UNREGISTER (((FD_ALL) << 1) & (~(FD_ALL))) typedef enum _HTPriority { HT_PRIORITY_INV = -1, HT_PRIORITY_OFF = 0, HT_PRIORITY_MIN = 1, HT_PRIORITY_MAX = 20 } HTPriority; typedef int HTEventCallback (SOCKET, HTRequest *, SockOps);
extern int HTEvent_RegisterTTY (SOCKET, HTRequest *, SockOps, HTEventCallback *, HTPriority);
extern int HTEvent_UnRegisterTTY (SOCKET, SockOps);
extern int HTEvent_Register (SOCKET, HTRequest *, SockOps, HTEventCallback *, HTPriority);
extern int HTEvent_UnRegister (SOCKET, SockOps);
extern int HTEvent_UnregisterAll (void);
select()
call and registers a timeout function that is
called if select times out. This does only works on NON windows
platforms as we need to poll for the console on windows If tv =
NULL
then timeout is disabled. Default is no timeout. If
always=YES then the callback is called at all times, if NO
then only when Library sockets are active. Returns YES if OK else NO.
typedef int HTEventTimeout (HTRequest *); extern BOOL HTEvent_registerTimeout (struct timeval *tp, HTRequest * request, HTEventTimeout *tcbf, BOOL always);
extern int HTEvent_Loop (HTRequest * request);
extern void HTEvent_stopLoop (void);
#endif /* HTEvent_H */End of declartion module