Annotation of libwww/Library/src/HTProt.html, revision 2.12

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

Webmaster