"Fossies" - the Fresh Open Source Software Archive

Member "asp2php-2008-08-13/src/jscript/request_j.c" (13 Aug 2008, 1834 Bytes) of package /linux/www/old/asp2php-2008-08-13.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "request_j.c" see the Fossies "Dox" file reference documentation.

    1 #include <stdio.h>
    2 #include <stdlib.h>
    3 #include <string.h>
    4 #include <ctype.h>
    5 
    6 #include "../globals.h"
    7 #include "../functions.h"
    8 
    9 /* parse_request() - Request.* object */
   10 
   11 int parse_request_j(char *newtoken)
   12 {
   13 int tokentype;
   14 char token[TOKENSIZE];
   15 char token_obj[TOKENSIZE];
   16 char molecule1[LINELENGTH];
   17 
   18   molecule1[0]=0;
   19 
   20   if ((tokentype=gettoken_j(token))!=14)
   21   {
   22     push(token,tokentype);
   23     convert_funct_j(molecule1,"1",1);
   24     sprintf(newtoken,"${%s}",molecule1);
   25 
   26     return 0;
   27   }
   28 
   29   tokentype=gettoken_j(token);
   30 
   31   if (strcasecmp(token,"servervariables")==0)
   32   { 
   33     convert_funct_j(molecule1,"1",1);
   34     sprintf(newtoken,"${%s}",molecule1);
   35     return 0;
   36   } 
   37     else
   38   if (strcasecmp(token,"form")==0)
   39   { 
   40     strcpy(token_obj,"HTTP_POST_VARS");
   41   }
   42     else
   43   if (strcasecmp(token,"querystring")==0)
   44   { 
   45     strcpy(token_obj,"HTTP_GET_VARS");
   46   }
   47     else
   48   if (strcasecmp(token,"cookies")==0)
   49   { 
   50     strcpy(token_obj,"HTTP_COOKIE_VARS");
   51   }
   52     else
   53   if (strcasecmp(token,"clientcertificate")==0)
   54   { 
   55     strcpy(token_obj,"HTTP_CERTIFICATE_VARS");
   56     printf("Warning: ClientCertificates are unsupported (line %d)\n",line);
   57   }
   58     else
   59   {
   60     printf("Warning: unsupported request method (line %d)\n",line);
   61     strcat(newtoken,"// unsupported: "); eval_expression(" "); 
   62   }
   63 
   64   tokentype=gettoken_j(token);
   65   if (strcmp(token,".")==0)
   66   {
   67     tokentype=gettoken_j(token);
   68     if (strcasecmp(token,"count")==0)
   69     { 
   70       sprintf(molecule1,"count($%s)",token_obj);
   71       strcat(newtoken,molecule1);
   72     }
   73   }
   74     else
   75   if (strcmp(token,"(")==0)
   76   {
   77     push(token,tokentype);
   78 
   79     convert_funct_j(molecule1,"1",1);
   80     sprintf(newtoken,"$%s[%s]",token_obj,molecule1);
   81   }
   82     else
   83   {
   84     push(token,tokentype);
   85     sprintf(molecule1,"$%s",token_obj);
   86     strcat(newtoken,molecule1);
   87   }
   88 
   89   return 0;
   90 }
   91