Annotation of libwww/Library/src/HTEvent.html, revision 2.3

2.1       eric        1: <HTML>
                      2: <HEAD>
2.3     ! frystyk     3:   <!-- Changed by: Eric Prud'hommeaux, 15-May-1996 -->
2.2       frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen, 16-May-1996 -->
2.3     ! frystyk     5: <TITLE>W3C Reference Library libwww Event Class</TITLE>
2.1       eric        6: </HEAD>
                      7: <BODY>
2.3     ! frystyk     8: <H1>The Event Class
        !             9: </H1>
2.1       eric       10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: 
                     16: #ifndef HTEVENT_H
                     17: #define HTEVENT_H
2.2       frystyk    18: #include "sysdep.h"
                     19: 
                     20: typedef enum _HTPriority {
                     21:     HT_PRIORITY_INV = -1,
                     22:     HT_PRIORITY_OFF = 0,
                     23:     HT_PRIORITY_MIN = 1,
                     24:     HT_PRIORITY_MAX = 20
                     25: } HTPriority; 
                     26: 
                     27: typedef u_long SockOps; 
2.1       eric       28: 
                     29: #include "HTReq.h"
                     30: </PRE>
                     31: <P>
2.3     ! frystyk    32: This module provides a way for applications to register their own event models,
        !            33: or use the one in <A HREF="HTEvntrg.html">HTEvntrg.html</A>.
        !            34: <P>
        !            35: This module is implemented by <A HREF="HTEvnt.c">HTEvntrg.c</A>, and it is
        !            36: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/">W3C Reference
        !            37: Library</A>.
        !            38: <P>
        !            39: <H2>
        !            40:   Event Handlers
        !            41: </H2>
        !            42: <P>
        !            43: The appplication registers a set of event handlers to be used on a specified
        !            44: set of sockets. The eventhandlers must be defined as follows:
2.2       frystyk    45: <PRE>
                     46: #define FD_NONE        0
                     47: #define FD_ALL (FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT |FD_CLOSE)
2.3     ! frystyk    48: #define FD_UNREGISTER (((FD_ALL) &lt;&lt; 1) &amp; (~(FD_ALL)))
2.2       frystyk    49: 
                     50: typedef int HTEventCallback (SOCKET, HTRequest *, SockOps);
                     51: </PRE>
2.3     ! frystyk    52: <H2>
        !            53:   Register Event Handler Callbacks
        !            54: </H2>
        !            55: <P>
        !            56: While the event handlers them selves are callback functions the functions
        !            57: that register the event handler callbacks are also callback functions. By
        !            58: doing this we allow the application to register any type of event loop which
        !            59: fits the app.
2.1       eric       60: <PRE>
                     61: typedef int HTEvent_registerCallback(SOCKET, HTRequest *,
                     62:                                     SockOps, HTEventCallback *,
                     63:                                     HTPriority);
                     64: typedef int HTEvent_unregisterCallback(SOCKET, SockOps);
                     65: 
                     66: extern void HTEvent_setRegisterCallback(HTEvent_registerCallback *);
                     67: extern void HTEvent_setUnregisterCallback(HTEvent_unregisterCallback *);
                     68: </PRE>
2.3     ! frystyk    69: <P>
2.1       eric       70: The library and application may call these functions by calling
                     71: <PRE>
                     72: extern int HTEvent_register    (SOCKET, HTRequest *,
                     73:                                 SockOps, HTEventCallback *,
                     74:                                 HTPriority);
                     75: extern int HTEvent_unregister  (SOCKET, SockOps);
                     76: </PRE>
                     77: <PRE>
                     78: #endif /* HTEVENT_H */
                     79: </PRE>
2.3     ! frystyk    80: <P>
        !            81:   <HR>
2.1       eric       82: <ADDRESS>
2.3     ! frystyk    83:   @(#) $Id: HTEvent.html,v 2.2 1996/05/16 19:02:56 frystyk Exp $
2.1       eric       84: </ADDRESS>
2.3     ! frystyk    85: </BODY></HTML>

Webmaster