]> granicus.if.org Git - apache/blob - test/test_parser.c
fix copyright dates accorsding to the first check in
[apache] / test / test_parser.c
1 /* Copyright 1999-2004 Apache Software Foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /* This program tests the ap_get_list_item routine in ../main/util.c.
17  *
18  * The defines in this sample compile line are specific to Roy's system.
19  * They should match whatever was used to compile Apache first.
20  *
21      gcc -g -O2 -I../os/unix -I../include -o test_parser \
22             -DSOLARIS2=250 -Wall -DALLOC_DEBUG -DPOOL_DEBUG \
23             ../main/alloc.o ../main/buff.o ../main/util.o \
24             ../ap/libap.a -lsocket -lnsl test_parser.c
25  * 
26  * Roy Fielding, 1999
27  */
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include "httpd.h"
31 #include "apr_general.h"
32
33 /*
34  * Dummy a bunch of stuff just to get a compile
35  */
36 uid_t ap_user_id;
37 gid_t ap_group_id;
38 void *ap_dummy_mutex = &ap_dummy_mutex;
39 char *ap_server_argv0;
40
41 AP_DECLARE(void) ap_block_alarms(void)
42 {
43     ;
44 }
45
46 AP_DECLARE(void) ap_unblock_alarms(void)
47 {
48     ;
49 }
50
51 AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
52                                const request_rec *r, const char *fmt, ...)
53 {
54     ;
55 }
56
57 int main (void)
58 {
59     apr_pool_t *p;
60     const char *field;
61     char *newstr;
62     char instr[512];
63
64     p = apr_pool_alloc_init();
65
66     while (gets(instr)) {
67         printf("  [%s] ==\n", instr);
68         field = instr;
69         while ((newstr = ap_get_list_item(p, &field)) != NULL)
70             printf("  <%s> ..\n", newstr);
71     }
72     
73     exit(0);
74 }