upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / test / test_parser.c
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements.  See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License.  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 /* This program tests the ap_get_list_item routine in ../main/util.c.
18  *
19  * The defines in this sample compile line are specific to Roy's system.
20  * They should match whatever was used to compile Apache first.
21  *
22      gcc -g -O2 -I../os/unix -I../include -o test_parser \
23             -DSOLARIS2=250 -Wall -DALLOC_DEBUG -DPOOL_DEBUG \
24             ../main/alloc.o ../main/buff.o ../main/util.o \
25             ../ap/libap.a -lsocket -lnsl test_parser.c
26  * 
27  * Roy Fielding, 1999
28  */
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include "httpd.h"
32 #include "apr_general.h"
33
34 /*
35  * Dummy a bunch of stuff just to get a compile
36  */
37 uid_t ap_user_id;
38 gid_t ap_group_id;
39 void *ap_dummy_mutex = &ap_dummy_mutex;
40 char *ap_server_argv0;
41
42 AP_DECLARE(void) ap_block_alarms(void)
43 {
44     ;
45 }
46
47 AP_DECLARE(void) ap_unblock_alarms(void)
48 {
49     ;
50 }
51
52 AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
53                                const request_rec *r, const char *fmt, ...)
54 {
55     ;
56 }
57
58 int main (void)
59 {
60     apr_pool_t *p;
61     const char *field;
62     char *newstr;
63     char instr[512];
64
65     p = apr_pool_alloc_init();
66
67     while (gets(instr)) {
68         printf("  [%s] ==\n", instr);
69         field = instr;
70         while ((newstr = ap_get_list_item(p, &field)) != NULL)
71             printf("  <%s> ..\n", newstr);
72     }
73     
74     exit(0);
75 }