Change the "ctx.prune" option to match the command-line client default.
[cvs2svn.git] / test-data / resync-misgroups-cvsrepos / httpp / test.c,v
blobbaeb6690f5b8fb37ff70409ac547edc5059ac3ef
1 head    1.2;
2 access;
3 symbols
4         libshout-2_0:1.2
5         libshout-2_0b3:1.2
6         libshout-2_0b2:1.2
7         libshout_2_0b1:1.2
8         libogg2-zerocopy:1.1.1.1.0.2
9         start:1.1.1.1
10         xiph:1.1.1;
11 locks; strict;
12 comment @ * @;
15 1.2
16 date    2003.03.15.02.10.18;    author msmith;  state Exp;
17 branches;
18 next    1.1;
20 1.1
21 date    2001.09.10.02.28.49;    author jack;    state Exp;
22 branches
23         1.1.1.1;
24 next    ;
26 1.1.1.1
27 date    2001.09.10.02.28.49;    author jack;    state Exp;
28 branches;
29 next    ;
32 desc
36 1.2
37 log
38 @Brendan was getting pissed off about inconsistent indentation styles.
39 Convert all tabs to 4 spaces. All code must now use 4 space indents.
41 text
42 @#include <stdio.h>
44 #include <avl/avl.h>
45 #include "httpp.h"
48 int main(int argc, char **argv)
50     char buff[8192];
51     int readed;
52     http_parser_t parser;
53     avl_node *node;
54     http_var_t *var;
56     httpp_initialize(&parser, NULL);
58     readed = fread(buff, 1, 8192, stdin);
59     if (httpp_parse(&parser, buff, readed)) {
60         printf("Parse succeeded...\n\n");
61         printf("Request was ");
62         switch (parser.req_type) {
63         case httpp_req_none:
64             printf(" none\n");
65             break;
66         case httpp_req_unknown:
67             printf(" unknown\n");
68             break;
69         case httpp_req_get:
70             printf(" get\n");
71             break;
72         case httpp_req_post:
73             printf(" post\n");
74             break;
75         case httpp_req_head:
76             printf(" head\n");
77             break;
78         }
79         printf("Version was 1.%d\n", parser.version);
80         
81         node = avl_get_first(parser.vars);
82         while (node) {
83             var = (http_var_t *)node->key;
84             
85             if (var)
86                 printf("Iterating variable(s): %s = %s\n", var->name, var->value);
87             
88             node = avl_get_next(node);
89         }
90     } else {
91         printf("Parse failed...\n");
92     }
94     printf("Destroying parser...\n");
95     httpp_destroy(&parser);
97     return 0;
106 @Initial revision
108 text
109 @d9 5
110 a13 5
111         char buff[8192];
112         int readed;
113         http_parser_t parser;
114         avl_node *node;
115         http_var_t *var;
116 d15 1
117 a15 1
118         httpp_initialize(&parser, NULL);
119 d17 35
120 a51 35
121         readed = fread(buff, 1, 8192, stdin);
122         if (httpp_parse(&parser, buff, readed)) {
123                 printf("Parse succeeded...\n\n");
124                 printf("Request was ");
125                 switch (parser.req_type) {
126                 case httpp_req_none:
127                         printf(" none\n");
128                         break;
129                 case httpp_req_unknown:
130                         printf(" unknown\n");
131                         break;
132                 case httpp_req_get:
133                         printf(" get\n");
134                         break;
135                 case httpp_req_post:
136                         printf(" post\n");
137                         break;
138                 case httpp_req_head:
139                         printf(" head\n");
140                         break;
141                 }
142                 printf("Version was 1.%d\n", parser.version);
143                 
144                 node = avl_get_first(parser.vars);
145                 while (node) {
146                         var = (http_var_t *)node->key;
147                         
148                         if (var)
149                                 printf("Iterating variable(s): %s = %s\n", var->name, var->value);
150                         
151                         node = avl_get_next(node);
152                 }
153         } else {
154                 printf("Parse failed...\n");
155         }
156 d53 2
157 a54 2
158         printf("Destroying parser...\n");
159         httpp_destroy(&parser);
160 d56 1
161 a56 1
162         return 0;
166 1.1.1.1
168 @move to cvs
170 text