Back to index

courier  0.68.2
http11.h
Go to the documentation of this file.
00001 #ifndef       http11_h
00002 #define       http11_h
00003 
00004 /*
00005 ** Copyright 1998 - 2003 Double Precision, Inc.
00006 ** See COPYING for distribution information.
00007 */
00008 
00009 #if HAVE_CONFIG_H
00010 #include      "config.h"
00011 #endif
00012 
00013 #ifdef  __cplusplus
00014 extern "C" {
00015 #endif
00016 
00017 #if HAVE_LIBFCGI
00018 #include <stdlib.h>
00019 #include "fcgi_stdio.h"
00020 #endif
00021 
00022 
00023 /* HTTP 1.1 library */
00024 
00025 /* Implement Accept-Language: and Content-Language: headers as follows.
00026 **
00027 ** libdir contains one subdirectory for each support content language.
00028 **
00029 ** softlinks are used to provide default variations of each content.
00030 ** (example: en -> en-us )
00031 **
00032 ** subdirectory/LANGUAGE is a file with one line, containing the name of
00033 ** the directory.  So, we can open en/LANGUAGE, read en-us, and send that
00034 ** back as the Content-Language:
00035 **
00036 ** subdirectory/LOCALE is a file with one line - the corresponding locale.
00037 ** en-us/LOCALE will contain en_US, for example.
00038 **
00039 */
00040 
00041 char *http11_best_content_language(const char *libdir, const char *acc_lang);
00042        /* acc_lang is our Accept-Language: header.  Figure out the best
00043        ** content language we can use.
00044        **
00045        ** Note - return pointer must be free()d.
00046        */
00047 
00048 const char *http11_content_language(const char *libdir, const char *cont_lang);
00049        /* Return the real content language by reading LANGUAGE */
00050 
00051 const char *http11_content_locale(const char *libdir, const char *cont_lang);
00052        /* Return the LOCALE */
00053 
00054 const char *http11_content_ispelldict(const char *libdir, const char *cont_lang);
00055        /* Return the ISPELL dictionary */
00056 
00057 const char *http11_content_charset(const char *libdir, const char *acc_lang);
00058        /* Return the CHARSET */
00059 
00060 FILE *http11_open_langfile(const char *libdir, const char *acc_lang,
00061               const char *file);
00062        /* Open arbitrary file */
00063 
00064 #define       HTTP11_DEFAULTLANG   "en"
00065 #ifdef  __cplusplus
00066 }
00067 #endif
00068 #endif