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

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

Webmaster