Annotation of libwww/Library/src/HTEvent.c, revision 2.1
2.1 ! eric 1: /* HTEvntrg.c
! 2: ** EVENT DISPATCHER
! 3: **
! 4: ** (c) COPYRIGHT MIT 1996.
! 5: ** Please first read the full copyright statement in the file COPYRIGH.
! 6: ** @(#) $Id: Date Author State $
! 7: **
! 8: ** The event dispatcher allows applications to register their own event
! 9: ** models. They may register the standard HTEventrg methods from
! 10: ** HTEventrg.c, of implement their functionality with their on methods.
! 11: **
! 12: ** Authors:
! 13: ** EGP Eric Gordon Prud'hommeuax
! 14: ** Bugs
! 15: **
! 16: */
! 17:
! 18: #include <assert.h> /* @@@ Should be in sysdep.h @@@ */
! 19:
! 20: /* Implementation dependent include files */
! 21: #include "sysdep.h"
! 22: #include "HTUtils.h"
! 23: #include "HTString.h"
! 24: #include "HTReqMan.h"
! 25: #include "HTError.h"
! 26: #include "HTDNS.h"
! 27: #include "HTEvent.h" /* Implemented here */
! 28:
! 29: PRIVATE HTEvent_registerCallback * RegisterCBF = 0;
! 30: PRIVATE HTEvent_unregisterCallback * UnregisterCBF = 0;
! 31:
! 32: PUBLIC void HTEvent_setRegisterCallback(HTEvent_registerCallback * registerCBF)
! 33: {
! 34: RegisterCBF = registerCBF;
! 35: }
! 36:
! 37: PUBLIC void HTEvent_setUnregisterCallback(HTEvent_unregisterCallback * unregisterCBF)
! 38: {
! 39: UnregisterCBF = unregisterCBF;
! 40: }
! 41:
! 42:
! 43: PUBLIC int HTEvent_register (SOCKET s, HTRequest * rq, SockOps ops,
! 44: HTEventCallback *cbf, HTPriority p)
! 45: {
! 46: if (!RegisterCBF)
! 47: return -1;
! 48: return (*RegisterCBF)(s, rq, ops, cbf, p);
! 49: }
! 50:
! 51: PUBLIC int HTEvent_unregister (SOCKET s, SockOps ops)
! 52: {
! 53: if (!UnregisterCBF)
! 54: return -1;
! 55: return (*UnregisterCBF)(s, ops);
! 56: }
! 57:
Webmaster