Removed support for SFIO
[catagits/fcgi2.git] / examples / size.c
1 #include <stdlib.h>
2 #include "fcgiapp.h"
3
4 int main(void)
5 {
6   int i,scale;
7   char* pathInfo;
8   FCGX_Stream *in, *out, *err;
9   FCGX_ParamArray envp;
10
11   while (FCGX_Accept(&in, &out, &err, &envp) >= 0) 
12   {
13     FCGX_FPrintF(out,"Content-type: text/plain\r\n\r\n");      
14     
15     scale = 0;
16     
17     pathInfo = FCGX_GetParam("PATH_INFO",envp);
18     
19     if (pathInfo)
20       scale = atoi(pathInfo+1);
21
22     if (scale == 0)
23       scale = 500;
24  
25     FCGX_FPrintF(out,"Dumping %6d Bytes ...\n", scale);
26
27     scale = (scale-26)/80;
28
29     for (i=0;i<scale;i++)
30     {
31       /* each line has 80 character */
32       int rv = FCGX_FPrintF(out,"%4d:12345679890123456798901234567989012345679890123456798901234567989012345679890123\n",i);
33       if (rv <= 0)
34       {
35           FCGX_FPrintF(out, "FCGX_FPrintF() failed..");
36           break;
37       }
38     }
39   }
40   return 0;
41 }