Annotation of libwww/Library/src/HTProt.html, revision 2.16
2.1 frystyk 1: <HTML>
2: <HEAD>
2.16 ! eric 3: <!-- Changed by: Henrik Frystyk Nielsen, 26-Mar-1996 -->
! 4: <NEXTID N="z11">
! 5: <TITLE>W3C Reference Library libwww PROTOCOLS</TITLE>
2.1 frystyk 6: </HEAD>
7: <BODY>
2.16 ! eric 8: <H1>
! 9: Access Scheme Manager
! 10: </H1>
2.1 frystyk 11: <PRE>
12: /*
13: ** (c) COPYRIGHT MIT 1995.
14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
2.16 ! eric 17: <P>
! 18: This module keeps a list of valid protocol (naming scheme) specifiers with
! 19: associated access code. New access protocols may be registered at any time.
! 20: <P>
! 21: This module is implemented by <A HREF="HTProt.c">HTProt.c</A>, and it is
! 22: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
! 23: Library</A>.
! 24: <P>
2.1 frystyk 25: <PRE>
26: #ifndef HTPROT_H
27: #define HTPROT_H
28:
2.5 frystyk 29: #include "HTReq.h"
2.1 frystyk 30: #include "HTAnchor.h"
2.16 ! eric 31: #include "HTEvent.h"
2.15 frystyk 32: #include "HTTrans.h"
2.1 frystyk 33: </PRE>
2.16 ! eric 34: <P>
! 35: After the new architecture based on call back functions managed by an eventloop
! 36: and protocol state machines, the protocol structure has been modified to
! 37: reflect this call back structure. The <CODE>HTEventCallback</CODE> is defined
! 38: in <A HREF="HTEvntrg.html">HTEvntrg module</A>.
! 39: <P>
! 40: All the access schemes supported in the Library can be initiated using the
! 41: function <CODE>HTAccessInit()</CODE> in <A HREF="HTInit.html">HTInit module</A>
! 42: <P>
! 43: An access scheme module takes as a parameter a socket (which is an invalid
! 44: socket the first time the function is called), a
! 45: <A HREF="HTReqMan.html">request structure</A> containing details of the request,
! 46: and the action by which the (valid) socket was selected in the event loop.
! 47: When the protocol class routine is called, the anchor element in the request
! 48: is already valid (made valid by HTAccess).
2.1 frystyk 49: <PRE>
2.5 frystyk 50: typedef struct _HTProtocol HTProtocol;
2.1 frystyk 51: </PRE>
2.16 ! eric 52: <H3>
! 53: Add an Access Scheme
! 54: </H3>
! 55: <P>
! 56: This functions registers a protocol module and binds it to a specific access
! 57: acheme. For example HTTP.c is bound to http URLs. The call back function
! 58: is the function to be called for loading. The reason why it is of type
! 59: HTEventCallback is that it then can be used directly in the event loop when
! 60: used in non-preemptive mode.
2.1 frystyk 61: <PRE>
2.13 frystyk 62: extern BOOL HTProtocol_add (const char * name,
2.15 frystyk 63: const char * transport,
2.12 frystyk 64: BOOL preemptive,
2.11 frystyk 65: HTEventCallback * client,
66: HTEventCallback * server);
2.1 frystyk 67: </PRE>
2.16 ! eric 68: <H3>
! 69: Delete an Access Scheme
! 70: </H3>
! 71: <P>
! 72: This functions deletes a registered protocol module so that it can not be
! 73: used for accessing a resource anymore.
2.5 frystyk 74: <PRE>
2.13 frystyk 75: extern BOOL HTProtocol_delete (const char * name);
2.5 frystyk 76: </PRE>
2.16 ! eric 77: <H3>
! 78: Remove ALL Registered Schemes
! 79: </H3>
! 80: <P>
! 81: This is the garbage collection function. It is called by
! 82: <A HREF="HTAccess.html#Library">HTLibTerminate()</A>
2.5 frystyk 83: <PRE>
84: extern BOOL HTProtocol_deleteAll (void);
85: </PRE>
2.16 ! eric 86: <H3>
! 87: Find a Protocol Object
! 88: </H3>
! 89: <P>
! 90: You can search the list of registered protocol objects as a function of the
! 91: access acheme. If an access scheme is found then the protocol object is returned.
2.1 frystyk 92: <PRE>
2.13 frystyk 93: extern HTProtocol * HTProtocol_find (HTRequest * request, const char * access);
2.1 frystyk 94: </PRE>
2.16 ! eric 95: <H3>
! 96: Get the callback functions
! 97: </H3>
! 98: <P>
! 99: You can get the callback functions registered together with a protocol object
! 100: using the following methods.
2.1 frystyk 101: <PRE>
2.11 frystyk 102: extern HTEventCallback * HTProtocol_client (HTProtocol * protocol);
103: extern HTEventCallback * HTProtocol_server (HTProtocol * protocol);
2.1 frystyk 104: </PRE>
2.16 ! eric 105: <H3>
! 106: Is Access Scheme Preemptive
! 107: </H3>
! 108: <P>
! 109: Returns YES if the implementation of the access scheme supports preemptive
! 110: access only.
2.1 frystyk 111: <PRE>
2.12 frystyk 112: extern BOOL HTProtocol_preemptive (HTProtocol * protocol);
2.1 frystyk 113: </PRE>
2.16 ! eric 114: <H3>
! 115: Get and Set the Transport
! 116: </H3>
2.1 frystyk 117: <PRE>
2.15 frystyk 118: extern BOOL HTProtocol_setTransport (HTProtocol * protoccol,
119: const char * transport);
120: extern const char * HTProtocol_transport (HTProtocol * protocol);
121: </PRE>
122: <PRE>
2.1 frystyk 123: #endif /* HTPROT_H */
124: </PRE>
2.16 ! eric 125: <P>
! 126: <HR>
2.15 frystyk 127: <ADDRESS>
2.16 ! eric 128: @(#) $Id: HTProt.html,v 2.15 1996/04/12 17:48:31 frystyk Exp $
2.15 frystyk 129: </ADDRESS>
2.16 ! eric 130: </BODY></HTML>
Webmaster