upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / uri / gen_uri_delims.c
1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
2  * applicable.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <stdio.h>
18
19 /* generate a apr_table_t of 256 values, where certain characters are
20  * marked "interesting"... for the uri parsing process.
21  */
22
23 int main(int argc, char *argv[])
24 {
25     int i;
26     char *value;
27
28     printf("/* this file is automatically generated by "
29             "gen_uri_delims, do not edit */\n");
30     printf("static const unsigned char uri_delims[256] = {");
31     for (i = 0; i < 256; ++i) {
32         if (i % 20 == 0)
33             printf("\n    ");
34         switch (i) {
35         case ':':       value = "T_COLON";      break;
36         case '/':       value = "T_SLASH";      break;
37         case '?':       value = "T_QUESTION";   break;
38         case '#':       value = "T_HASH";       break;
39         case '\0':      value = "T_NUL";        break;
40         default:        value = "0";            break;
41         }
42         printf("%s%c", value, (i < 255) ? ',' : ' ');
43     }
44     printf("\n};\n");
45
46     return 0;
47 }