/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This module sets up the binding between a file Bind and a media type, language, encoding etc. In a client application the Binds are used in protocols that does not support media types etc., like FTP, and in server applications they are used to make the bindings between the server and the local file store that the server can serve to the rest of the world (well almost). The HTFormat module holds this information against the accept headers received in a request and uses if for format negotiation. All the binding management can all be replace by a database interface.
This module is implemented by HTBind.c, and it is a part of the W3C Reference Library.
#ifndef HTBIND_H #define HTBIND_H #include "HTFormat.h" #include "HTAnchor.h"
extern BOOL HTBind_init (void); extern BOOL HTBind_deleteAll (void);
extern void HTBind_caseSensitive (BOOL sensitive);
extern CONST char *HTBind_delimiters (void); extern void HTBind_setDelimiters (CONST char * new_suffixes);
extern BOOL HTBind_add (CONST char * suffix, CONST char * representation, CONST char * encoding, CONST char * language, double value); extern BOOL HTBind_addType (CONST char * suffix, CONST char * format, double value); extern BOOL HTBind_addEncoding (CONST char * suffix, CONST char * encoding, double value); extern BOOL HTBind_addLanguage (CONST char * suffix, CONST char * language, double value);The first method is a "super" method for binding information to a file suffic. Any of the string values can be
NULL
. If filename
suffix is already defined its previous definition is overridden or
modified. For example, a HTBind_setType
and
HTBind_setEncoding
can be called with the same suffix.Calling this with suffix set to "*" will set the default representation. Calling this with suffix set to "*.*" will set the default representation for unknown suffix files which contain a "."
NOTE: The suffixes can contain characters that must be
escaped in a URL. However, they should not be encoded when
parsed as the suffix
parameter.
extern char * HTBind_getSuffix (HTParentAnchor * anchor);
HTBind_getFormat
extern BOOL HTBind_getBindings (HTParentAnchor * anchor);
HTBind_getBindings
.
extern BOOL HTBind_getFormat (CONST char * filename, HTFormat * format, HTEncoding * encoding, HTLanguage * language, double * quality);
HTBind_getBindings
, and HTBind_getFormat
.
#define MULTI_SUFFIX ".multi" /* Extension for scanning formats */ #define MAX_SUFF 15 /* Maximum number of suffixes for a file */ extern HTContentDescription * HTBind_getDescription (char * file);End of declaration module
#endif /* HTBIND_H */