home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / HYPERMAI / HYPERMAI.ZIP / libcgi / get_cgi_info.c < prev    next >
C/C++ Source or Header  |  1994-07-28  |  1KB  |  38 lines

  1. /*
  2.  * This file is part of the LIBCGI library
  3.  *
  4.  * Copyright 1994 by Enterprise Integration Technologies Corporation
  5.  *
  6.  * This is freeware with commercialization rights reserved; see the
  7.  * LICENSE included in the distribution for specifics.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include "cgi.h"
  12.  
  13. int get_cgi_info(ci)
  14.      cgi_info *ci;
  15.  {
  16.   char *getenv(), *s;
  17.  
  18.   ci->content_length = (s = getenv("CONTENT_LENGTH")) ? atoi(s) : 0;
  19.   ci->content_type = getenv("CONTENT_TYPE");
  20.   ci->server_software = getenv("SERVER_SOFTWARE");
  21.   ci->gateway_interface = getenv("GATEWAY_INTERFACE");
  22.   ci->server_protocol = getenv("SERVER_PROTOCOL");
  23.   ci->server_port = getenv("SERVER_PORT");
  24.   ci->request_method = getenv("REQUEST_METHOD");
  25.   ci->http_accept = getenv("HTTP_ACCEPT");
  26.   ci->path_info = getenv("PATH_INFO");
  27.   ci->path_translated = getenv("PATH_TRANSLATED");
  28.   ci->script_name = getenv("SCRIPT_NAME");
  29.   ci->query_string = getenv("QUERY_STRING");
  30.   ci->remote_host = getenv("REMOTE_HOST");
  31.   ci->remote_addr = getenv("REMOTE_ADDR");
  32.   ci->remote_user = getenv("REMOTE_USER");
  33.   ci->auth_type = getenv("AUTH_TYPE");
  34.   ci->remote_user = getenv("REMOTE_USER");
  35.   ci->remote_ident = getenv("REMOTE_IDENT") ;
  36.   return (ci->server_name = getenv("SERVER_NAME")) != NULL;
  37. }
  38.