Common Gateway Interface (CGI) utility procedures.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | public, | parameter | :: | CGI_ENV_TRANSFER_ID | = | 'HTTP_DMPACK_TRANSFER_ID' |
Generic interface to CGI get functions.
Returns (last) value associated with key in query
as 32-bit integer.
The return code is set to E_EMPTY
if the key does not exist and
required
has not been passed or is .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
integer(kind=i4), | intent(out) | :: | value |
Parameter value. |
||
integer(kind=i4), | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
Returns (last) value associated with key in query
as 64-bit
integer. The return code is set to E_EMPTY
if the key does not
exist and required
has not been passed or is .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query parameters. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
integer(kind=i8), | intent(out) | :: | value |
Parameter value. |
||
integer(kind=i8), | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
Returns (last) value associated with key in query
as logical. The
return code is set to E_EMPTY
if the key does not exist and
required
has not been passed or is .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
logical, | intent(out) | :: | value |
Parameter value. |
||
logical, | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
Returns (last) value associated with key in query
as 32-bit real.
The return code is set to E_EMPTY
if the key does not exist and
required
has not been passed or is .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
real(kind=r4), | intent(out) | :: | value |
Parameter value. |
||
real(kind=r4), | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
Returns (last) value associated with key in query
as 64-bit real.
The return code is set to E_EMPTY
if the key does not exist and
required
has not been passed or is .true.
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
real(kind=r8), | intent(out) | :: | value |
Parameter value. |
||
real(kind=r8), | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
Returns (last) value associated with key in query
. The return code
is set to E_EMPTY
if the key does not exist and required
has not
been passed or is .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
||
character(len=*), | intent(inout) | :: | value |
Parameter value. |
||
character(len=*), | intent(in), | optional | :: | default |
Default value. |
|
logical, | intent(in), | optional | :: | required |
Required flag. |
CGI environment variables type. Changes to this type have to be
regarded in subroutine dm_html_cgi_env()
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=16), | public | :: | auth_type | = | ' ' |
AUTH_TYPE |
|
integer(kind=i8), | public | :: | content_length | = | 0_i8 |
CONTENT_LENGTH |
|
character(len=128), | public | :: | content_type | = | ' ' |
CONTENT_TYPE |
|
character(len=512), | public | :: | document_root | = | ' ' |
DOCUMENT_ROOT |
|
character(len=8), | public | :: | gateway_interface | = | ' ' |
GATEWAY_INTERFACE |
|
character(len=512), | public | :: | http_accept | = | ' ' |
HTTP_ACCEPT |
|
character(len=16), | public | :: | http_content_encoding | = | ' ' |
HTTP_CONTENT_ENCODING |
|
character(len=512), | public | :: | http_cookie | = | ' ' |
HTTP_COOKIE |
|
character(len=128), | public | :: | http_from | = | ' ' |
HTTP_FROM |
|
character(len=512), | public | :: | http_referer | = | ' ' |
HTTP_REFERER |
|
character(len=512), | public | :: | http_user_agent | = | ' ' |
HTTP_USER_AGENT |
|
character(len=512), | public | :: | path_info | = | ' ' |
PATH_INFO |
|
character(len=512), | public | :: | path_translated | = | ' ' |
PATH_TRANSLATED |
|
character(len=512), | public | :: | query_string | = | ' ' |
QUERY_STRING |
|
character(len=32), | public | :: | remote_addr | = | ' ' |
REMOTE_ADDR |
|
character(len=512), | public | :: | remote_host | = | ' ' |
REMOTE_HOST |
|
character(len=128), | public | :: | remote_ident | = | ' ' |
REMOTE_IDENT |
|
character(len=128), | public | :: | remote_user | = | ' ' |
REMOTE_USER |
|
character(len=8), | public | :: | request_method | = | ' ' |
REQUEST_METHOD |
|
character(len=512), | public | :: | request_uri | = | ' ' |
REQUEST_URI |
|
character(len=512), | public | :: | script_name | = | ' ' |
SCRIPT_NAME |
|
character(len=128), | public | :: | server_name | = | ' ' |
SERVER_NAME |
|
integer, | public | :: | server_port | = | 0 |
SERVER_PORT |
|
character(len=32), | public | :: | server_protocol | = | ' ' |
SERVER_PROTOCOL |
|
character(len=32), | public | :: | server_software | = | ' ' |
SERVER_SOFTWARE |
Opaque CGI query type. Stores GET and POST parameters as key-value pairs.
Reads HTTP request body (POST method). We have to rely on read(2)
as Fortran cannot read unformatted content from standard input. On
error, the string content
is allocated but empty.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_env_type), | intent(inout) | :: | env |
CGI environment type. |
||
character(len=:), | intent(out), | allocatable, target | :: | content |
Returned request body. |
Unwinds percent-encoding in given input string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input |
Encoded input string. |
||
character(len=len), | intent(out) | :: | output |
Decoded output string. |
Returns .true.
if key exists in query
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
Returns .true.
if key exists in query
and has value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
character(len=*), | intent(in) | :: | key |
Parameter key. |
Returns .true.
if CGI environment variable AUTH
is set to
Basic
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_env_type), | intent(inout) | :: | env |
CGI environment type. |
Returns key at index loc
in keys array of query
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
integer, | intent(in) | :: | loc |
Array index. |
Key or empty.
Returns the current number of elements in the given (opaque) CGI parameter type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
Returns value at index loc
in values array of query
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_query_type), | intent(inout) | :: | query |
CGI query type. |
||
integer, | intent(in) | :: | loc |
Array index. |
Value or empty.
Reads CGI environment variables and writes values into env
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_env_type), | intent(out) | :: | env |
CGI environment type. |
Returns HTTP form data from standard input
(application/x-www-form-urlencoded
).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_env_type), | intent(inout) | :: | env |
CGI environment type. |
||
type(cgi_query_type), | intent(out) | :: | query |
CGI query type. |
Writes HTTP header. A sane HTTP server converts the status code passed in the header to a real HTTP status code, as we cannot return it in any other way with CGI. Default HTTP status is 200.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | content_type |
MIME type. |
||
integer, | intent(in), | optional | :: | http_status |
HTTP status code. |
|
character(len=*), | intent(in), | optional | :: | location |
Optional redirect. |
Decodes and parses given character string containing new-line
separated key-values pairs, and returns CGI query parameters in query
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input |
Input string. |
||
type(cgi_query_type), | intent(out) | :: | query |
CGI query type. |
Returns CGI GET parameters from environment variable QUERY_STRING
as key–value pairs in query
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cgi_env_type), | intent(inout) | :: | env |
CGI environment type. |
||
type(cgi_query_type), | intent(out) | :: | query |
CGI query type. |
Prints content to standard output, returning it to the web server.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | content |
Response content. |