switch to a 60 bit hash
[httpd-crcsyncproxy.git] / test / test_find.c
blob501933111ab87f9ac73093f9c54a107c6a666431
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 /* This program tests the ap_find_list_item routine in ../main/util.c.
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.
22 gcc -g -O2 -I../os/unix -I../include -o test_find \
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_find.c
27 * Roy Fielding, 1999
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include "httpd.h"
32 #include "apr_general.h"
35 * Dummy a bunch of stuff just to get a compile
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;
42 AP_DECLARE(void) ap_block_alarms(void)
47 AP_DECLARE(void) ap_unblock_alarms(void)
52 AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
53 const request_rec *r, const char *fmt, ...)
58 int main (void)
60 apr_pool_t *p;
61 char line[512];
62 char tok[512];
64 p = apr_pool_alloc_init();
66 printf("Enter field value to find items within:\n");
67 if (!gets(line))
68 exit(0);
70 printf("Enter search item:\n");
71 while (gets(tok)) {
72 printf(" [%s] == %s\n", tok, ap_find_list_item(p, line, tok)
73 ? "Yes" : "No");
74 printf("Enter search item:\n");
77 exit(0);