Back to index

courier  0.68.2
Functions
cgiversion.c File Reference
#include "cgi.h"
#include <stdlib.h>
#include <ctype.h>

Go to the source code of this file.

Functions

void cgiversion (unsigned *major, unsigned *minor)

Function Documentation

void cgiversion ( unsigned *  major,
unsigned *  minor 
)

Definition at line 12 of file cgiversion.c.

{
const char *p=getenv("SERVER_PROTOCOL");

       *major=0;
       *minor=0;
       if (!p)       return;
       if ( toupper(*p++) != 'H' ||
              toupper(*p++) != 'T' ||
              toupper(*p++) != 'T' ||
              toupper(*p++) != 'P' ||
              *p++ != '/')  return;

       while (isdigit(*p))
              *major= *major * 10 + (*p++ - '0');
       if (*p++ == '.')
       {
              while (isdigit(*p))
                     *minor= *minor * 10 + (*p++ - '0');
       }
}

Here is the caller graph for this function: