Annotation of libwww/Library/src/HTProt.html, revision 2.6
2.1 frystyk 1: <HTML>
2: <HEAD>
3: <TITLE>Access Scheme Manager</TITLE>
2.6 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 20-Sep-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
23: is a part of the <A NAME="z10"
2.4 frystyk 24: HREF="http://www.w3.org/pub/WWW/Library/">
2.2 frystyk 25: W3C Reference Library</A>. <P>
2.1 frystyk 26:
27: <PRE>
28: #ifndef HTPROT_H
29: #define HTPROT_H
30:
2.5 frystyk 31: #include "HTReq.h"
2.1 frystyk 32: #include "HTAnchor.h"
2.5 frystyk 33: #include "HTEvntrg.h"
2.1 frystyk 34: </PRE>
35:
2.5 frystyk 36: After the new architecture based on call back functions managed by an
37: eventloop and protocol state machines, the protocol structure has been
38: modified to reflect this call back structure. The
39: <CODE>HTEventCallBack</CODE> is defined in <A
40: HREF="HTEvntrg.html">HTEvntrg module</A>. <P>
41:
42: By default, all the access schemes supported in the Library are
43: initiated automaticly using the function <CODE>HTAccessInit()</CODE>
44: in <A HREF="HTInit.html">HTInit module</A>. However, this can be
45: changed if defined <CODE>HT_NO_INIT</CODE> <P>
46:
47: An access scheme module takes as a parameter a socket (which is an
48: invalid socket the first time the function is called), a <A
2.6 ! frystyk 49: HREF="HTReqMan.html">request structure</A> containing details of the
2.5 frystyk 50: request, and the action by which the (valid) socket was selected in
51: the event loop. When the protocol class routine is called, the anchor
2.1 frystyk 52: element in the request is already valid (made valid by HTAccess).
53:
54: <PRE>
2.5 frystyk 55: typedef struct _HTProtocol HTProtocol;
2.1 frystyk 56: </PRE>
57:
58: <H3>Add an Access Scheme</H3>
59:
60: This functions registers a protocol module and binds it to a specific
2.5 frystyk 61: access acheme. For example HTTP.c is bound to http URLs. The call back
62: function is the function to be called for loading. The reason why it
63: is of type HTEventCallback is that it then can be used directly in the
64: event loop when used in non-preemtive mode.
2.1 frystyk 65:
66: <PRE>
2.5 frystyk 67: extern BOOL HTProtocol_add (CONST char * name,
68: BOOL preemtive,
69: HTEventCallBack * callback);
2.1 frystyk 70: </PRE>
71:
2.5 frystyk 72: <H3>Delete an Access Scheme</H3>
73:
74: This functions deletes a registered protocol module so that it can not
75: be used for accessing a resource anymore.
76:
77: <PRE>
78: extern BOOL HTProtocol_delete (CONST char * name);
79: </PRE>
80:
81: <H3>Remove ALL Registered Schemes</H3>
82:
83: This is the garbage collection function. It is called by <A
84: HREF="HTReq.html#Library">HTLibTerminate</A>
85:
86: <PRE>
87: extern BOOL HTProtocol_deleteAll (void);
88: </PRE>
89:
90: <H3>Bind an Access Scheme to an Anchor</H3>
2.1 frystyk 91:
92: This function finds the access scheme that is bound to the anchor's
93: type of URL. Returns YES if found, else NO
94:
95: <PRE>
2.5 frystyk 96: extern BOOL HTProtocol_bind PARAMS((HTParentAnchor * anchor));
2.1 frystyk 97: </PRE>
98:
2.5 frystyk 99: <H3Finds the Callback Function</H3>
2.1 frystyk 100:
2.5 frystyk 101: Returns the callback function registered with this access scheme if any.
2.1 frystyk 102:
103: <PRE>
2.5 frystyk 104: extern HTEventCallBack *HTProtocol_callback (HTProtocol * protocol);
2.1 frystyk 105: </PRE>
106:
2.5 frystyk 107: <H3>Is Access Scheme Preemtive</H3>
2.1 frystyk 108:
2.5 frystyk 109: Returns YES if the implementation of the access scheme supports
110: preemtive access only.
2.1 frystyk 111:
112: <PRE>
2.5 frystyk 113: extern BOOL HTProtocol_preemtive (HTProtocol * protocol);
2.1 frystyk 114: </PRE>
115:
116: <PRE>
117: #endif /* HTPROT_H */
118: </PRE>
119:
120: End of Declaration
121:
122: </BODY>
123: </HTML>
Webmaster