Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

cinfo_find

The cinfo_find() function uses the MIME types information to find the type, encoding, and/or language based on the extensions of the Universal Resource Identifier (URI) or local file name. Use this information to send headers (rq->srvhdrs) to the client indicating the content-type, content-encoding, and content-language of the data that the client will be receiving from the server.

The name used consists of all of the text after the last slash (/) or the whole string if no slash is found. File name extensions are not case-sensitive. The name may contain multiple extensions separated by period (.) to indicate type, encoding, or language. For example, the URI a/b/filename.jp.txt.zip could represent a Japanese language, text/plain type, .zip-encoded file.

Syntax

cinfo *cinfo_find(char *uri);

Returns

A pointer to a newly allocated cinfo structure if content info was found, or NULL if no content was found.

The cinfo structure that is allocated and returned contains pointers to the content-type, content-encoding, and content-language, if found. Each is a pointer into static data in the types database, or NULL if not found. Do not free these pointers. You should free the cinfo structure when you are done using it.

Parameters

char *uri is a Universal Resource Identifier (URI) or local file name. Multiple file name extensions should be separated by periods (.).