/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This module keeps a list of valid protocol (naming scheme) specifiers with associated access code. New access protocols may be registered at any time.
This module is implemented by HTProt.c, and it is a part of the W3C Reference Library.
#ifndef HTPROT_H #define HTPROT_H #include "HTAccess.h" #include "HTAnchor.h"An access scheme is defined by an HTProtocol structure which point to the routines for performing the various logical operations on an object: in HTTP terms, GET, PUT, and POST. The access schemes supported in the Library are initiated automaticly using the function
HTAccessInit() if not defined
HT_NO_INIT Each of these routine takes as a parameter a request structure containing details of the request. When the protocol class routine is called, the anchor element in the request is already valid (made valid by HTAccess).
typedef enum _HTSocBlock {
SOC_BLOCK,
SOC_NON_BLOCK
} HTSocBlock;
typedef struct _HTProtocol {
char * name;
HTSocBlock block;
int (*load) PARAMS((HTRequest * request));
HTStream* (*saveStream) PARAMS((HTRequest * request));
HTStream* (*postStream) PARAMS((HTRequest * request,
HTParentAnchor* postTo));
} HTProtocol;
extern BOOL HTProtocol_add PARAMS((HTProtocol * protocol));
extern BOOL HTProtocol_get PARAMS((HTParentAnchor * anchor));
extern void HTProtocol_deleteAll NOPARAMS;
YES or
NO. If the Library is run in non-interactive mode then
the function always returns YES;
#define HTProtocol_isBlocking(me) \ ((me) && ((me)->BlockingIO || \ ((me)->anchor && (me)->anchor->protocol && \ ((HTProtocol*)((me)->anchor->protocol))->block==SOC_BLOCK)))
#endif /* HTPROT_H */End of Declaration