#include "nsd.h"Defines | |
| #define | ENC_LOCKED ((Tcl_Encoding) (-1)) |
Functions | |
| void | NsInitEncodings (void) |
| void | NsUpdateEncodings (void) |
| Tcl_Encoding | Ns_GetFileEncoding (char *file) |
| Tcl_Encoding | Ns_GetTypeEncoding (char *type) |
| Tcl_Encoding | Ns_GetCharsetEncoding (char *charset) |
| Tcl_Encoding | Ns_GetCharsetEncodingEx (char *charset, int len) |
| Tcl_Encoding | Ns_GetEncoding (char *name) |
| char * | Ns_FindCharset (char *type, int *lenPtr) |
| int | NsTclRegisterEncodingObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv) |
| int | NsTclCharsetsCmd (ClientData dummy, Tcl_Interp *interp, int argc, char *argv[]) |
| int | NsTclEncodingForCharsetCmd (ClientData dummy, Tcl_Interp *interp, int argc, char **argv) |
| Tcl_Encoding | NsGetInputEncoding (Conn *connPtr) |
| Tcl_Encoding | NsGetOutputEncoding (Conn *connPtr) |
| #define ENC_LOCKED ((Tcl_Encoding) (-1)) |
| char* Ns_FindCharset | ( | char * | type, | |
| int * | lenPtr | |||
| ) |
----------------------------------------------------------------------
Ns_FindCharset --
Find start end length of charset within a type string.
Results: Pointer to start of charset or NULL on no charset.
Side effects: Will update lenPtr with length of charset if found.
----------------------------------------------------------------------
| Tcl_Encoding Ns_GetCharsetEncoding | ( | char * | charset | ) |
----------------------------------------------------------------------
Ns_GetCharsetEncodingEx, Ns_GetCharsetEncoding --
Return the Tcl_Encoding for the given charset, e.g., "iso-8859-1" returns Tcl_Encoding for iso8859-1.
Results: Tcl_Encoding or NULL if not found.
Side effects: See LoadEncoding().
----------------------------------------------------------------------
| Tcl_Encoding Ns_GetCharsetEncodingEx | ( | char * | charset, | |
| int | len | |||
| ) |
| Tcl_Encoding Ns_GetEncoding | ( | char * | name | ) |
----------------------------------------------------------------------
Ns_GetEncoding --
Return the Tcl_Encoding for the given charset.
Results: Tcl_Encoding or NULL if not found.
Side effects: See GetEncoding().
----------------------------------------------------------------------
| Tcl_Encoding Ns_GetFileEncoding | ( | char * | file | ) |
----------------------------------------------------------------------
Ns_GetFileEncoding --
Return the Tcl_Encoding for the given file. Note this may not be the same as the encoding for the charset of the file's mimetype.
Results: Tcl_Encoding or NULL if not found.
Side effects: See LoadEncoding().
----------------------------------------------------------------------
| Tcl_Encoding Ns_GetTypeEncoding | ( | char * | type | ) |
----------------------------------------------------------------------
Ns_GetTypeEncoding --
Return the Tcl_Encoding for the given Content-type header, e.g., "text/html; charset=iso-8859-1" returns Tcl_Encoding for iso8859-1. This function will utilize the ns/parameters/OutputCharset config parameter if given a content-type "text/<anything>" with no charset. When no OutputCharset defined, the fall-back behavior is to return NULL.
Results: Tcl_Encoding or NULL if not found.
Side effects: See LoadEncoding().
----------------------------------------------------------------------
| Tcl_Encoding NsGetInputEncoding | ( | Conn * | connPtr | ) |
----------------------------------------------------------------------
NsGetInputEncoding --
Return the registered input encoding for the connection method/url, if any.
Results: Pointer to Tcl_Encoding or NULL if no encoding registered.
Side effects: None.
----------------------------------------------------------------------
| Tcl_Encoding NsGetOutputEncoding | ( | Conn * | connPtr | ) |
| void NsInitEncodings | ( | void | ) |
----------------------------------------------------------------------
NsInitEncodings --
Add compiled-in default encodings.
Results: None.
Side effects: None.
----------------------------------------------------------------------
Allocate URL space id for input encodings.
Initialize hash table of encodings and charsets.
Add default charset and file mappings.
| int NsTclCharsetsCmd | ( | ClientData | dummy, | |
| Tcl_Interp * | interp, | |||
| int | argc, | |||
| char * | argv[] | |||
| ) |
----------------------------------------------------------------------
NsTclCharsetsCmd --
Tcl command to get the list of charsets for which we have encodings.
Results: TCL_OK
Side effects: Sets Tcl interpreter result.
----------------------------------------------------------------------
| int NsTclEncodingForCharsetCmd | ( | ClientData | dummy, | |
| Tcl_Interp * | interp, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
----------------------------------------------------------------------
NsTclEncodingForCharsetCmd --
Return the name of the encoding for the specified charset.
Results: Tcl result contains an encoding name or "".
Side effects: None.
----------------------------------------------------------------------
| int NsTclRegisterEncodingObjCmd | ( | ClientData | data, | |
| Tcl_Interp * | interp, | |||
| int | objc, | |||
| Tcl_Obj ** | objv | |||
| ) |
----------------------------------------------------------------------
NsTclRegisterEncodingObjCmd --
Implements ns_register_encoding command to register an input encoding for a given method/URL.
Results: Standard Tcl result.
Side effects: May register a new encoding for given method/URL.
----------------------------------------------------------------------
| void NsUpdateEncodings | ( | void | ) |
----------------------------------------------------------------------
NsUpdateEncodings --
Add additional configured encodings.
Results: None.
Side effects: None.
----------------------------------------------------------------------
Add configured charsets and file mappings.
| char* charset |
| char* extension |
| char* name |
| char* name |
1.5.1