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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
                      3: <TITLE>Access Scheme Manager</TITLE>
2.10    ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen, 11-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
                     62: event loop when used in non-preemtive mode.
2.1       frystyk    63: 
                     64: <PRE>
2.5       frystyk    65: extern BOOL HTProtocol_add (CONST char *               name,
                     66:                            BOOL                preemtive,
2.9       frystyk    67:                            HTEventCallback *   callback);
2.1       frystyk    68: </PRE>
                     69: 
2.5       frystyk    70: <H3>Delete an Access Scheme</H3>
                     71: 
                     72: This functions deletes a registered protocol module so that it can not
                     73: be used for accessing a resource anymore.
                     74: 
                     75: <PRE>
                     76: extern BOOL HTProtocol_delete (CONST char * name);
                     77: </PRE>
                     78: 
                     79: <H3>Remove ALL Registered Schemes</H3>
                     80: 
                     81: This is the garbage collection function. It is called by <A
2.7       frystyk    82: HREF="HTAccess.html#Library">HTLibTerminate()</A>
2.5       frystyk    83: 
                     84: <PRE>
                     85: extern BOOL HTProtocol_deleteAll (void);
                     86: </PRE>
                     87: 
                     88: <H3>Bind an Access Scheme to an Anchor</H3>
2.1       frystyk    89: 
                     90: This function finds the access scheme that is bound to the anchor's
                     91: type of URL. Returns YES if found, else NO
                     92: 
                     93: <PRE>
2.10    ! frystyk    94: extern BOOL HTProtocol_find (HTRequest * request, HTParentAnchor * anchor);
2.1       frystyk    95: </PRE>
                     96: 
2.5       frystyk    97: <H3Finds the Callback Function</H3>
2.1       frystyk    98: 
2.5       frystyk    99: Returns the callback function registered with this access scheme if any.
2.1       frystyk   100: 
                    101: <PRE>
2.9       frystyk   102: extern HTEventCallback *HTProtocol_callback (HTProtocol * protocol);
2.1       frystyk   103: </PRE>
                    104: 
2.5       frystyk   105: <H3>Is Access Scheme Preemtive</H3>
2.1       frystyk   106: 
2.5       frystyk   107: Returns YES if the implementation of the access scheme supports
                    108: preemtive access only.
2.1       frystyk   109: 
                    110: <PRE>
2.5       frystyk   111: extern BOOL HTProtocol_preemtive (HTProtocol * protocol);
2.1       frystyk   112: </PRE>
                    113: 
                    114: <PRE>
                    115: #endif /* HTPROT_H */
                    116: </PRE>
                    117: 
                    118: End of Declaration
                    119: 
                    120: </BODY>
                    121: </HTML>

Webmaster