Annotation of libwww/Library/src/HTProt.html, revision 2.7
2.1 frystyk 1: <HTML>
2: <HEAD>
3: <TITLE>Access Scheme Manager</TITLE>
2.7 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 24-Oct-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
38: <CODE>HTEventCallBack</CODE> is defined in <A
39: HREF="HTEvntrg.html">HTEvntrg module</A>. <P>
40:
41: By default, all the access schemes supported in the Library are
42: initiated automaticly using the function <CODE>HTAccessInit()</CODE>
43: in <A HREF="HTInit.html">HTInit module</A>. However, this can be
44: changed if defined <CODE>HT_NO_INIT</CODE> <P>
45:
46: An access scheme module takes as a parameter a socket (which is an
47: invalid socket the first time the function is called), a <A
2.6 frystyk 48: HREF="HTReqMan.html">request structure</A> containing details of the
2.5 frystyk 49: request, and the action by which the (valid) socket was selected in
50: the event loop. When the protocol class routine is called, the anchor
2.1 frystyk 51: element in the request is already valid (made valid by HTAccess).
52:
53: <PRE>
2.5 frystyk 54: typedef struct _HTProtocol HTProtocol;
2.1 frystyk 55: </PRE>
56:
57: <H3>Add an Access Scheme</H3>
58:
59: This functions registers a protocol module and binds it to a specific
2.5 frystyk 60: access acheme. For example HTTP.c is bound to http URLs. The call back
61: function is the function to be called for loading. The reason why it
62: is of type HTEventCallback is that it then can be used directly in the
63: event loop when used in non-preemtive mode.
2.1 frystyk 64:
65: <PRE>
2.5 frystyk 66: extern BOOL HTProtocol_add (CONST char * name,
67: BOOL preemtive,
68: HTEventCallBack * callback);
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:
89: <H3>Bind an Access Scheme to an Anchor</H3>
2.1 frystyk 90:
91: This function finds the access scheme that is bound to the anchor's
92: type of URL. Returns YES if found, else NO
93:
94: <PRE>
2.5 frystyk 95: extern BOOL HTProtocol_bind PARAMS((HTParentAnchor * anchor));
2.1 frystyk 96: </PRE>
97:
2.5 frystyk 98: <H3Finds the Callback Function</H3>
2.1 frystyk 99:
2.5 frystyk 100: Returns the callback function registered with this access scheme if any.
2.1 frystyk 101:
102: <PRE>
2.5 frystyk 103: extern HTEventCallBack *HTProtocol_callback (HTProtocol * protocol);
2.1 frystyk 104: </PRE>
105:
2.5 frystyk 106: <H3>Is Access Scheme Preemtive</H3>
2.1 frystyk 107:
2.5 frystyk 108: Returns YES if the implementation of the access scheme supports
109: preemtive access only.
2.1 frystyk 110:
111: <PRE>
2.5 frystyk 112: extern BOOL HTProtocol_preemtive (HTProtocol * protocol);
2.1 frystyk 113: </PRE>
114:
115: <PRE>
116: #endif /* HTPROT_H */
117: </PRE>
118:
119: End of Declaration
120:
121: </BODY>
122: </HTML>
Webmaster