842ae4bd224140319ae7feec1872b93dfd491143fielding/* Licensed to the Apache Software Foundation (ASF) under one or more
842ae4bd224140319ae7feec1872b93dfd491143fielding * contributor license agreements. See the NOTICE file distributed with
842ae4bd224140319ae7feec1872b93dfd491143fielding * this work for additional information regarding copyright ownership.
842ae4bd224140319ae7feec1872b93dfd491143fielding * The ASF licenses this file to You under the Apache License, Version 2.0
842ae4bd224140319ae7feec1872b93dfd491143fielding * (the "License"); you may not use this file except in compliance with
842ae4bd224140319ae7feec1872b93dfd491143fielding * the License. You may obtain a copy of the License at
b8d55029467b9f139d081cf38c6d06ff45e742a9nd *
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * http://www.apache.org/licenses/LICENSE-2.0
b8d55029467b9f139d081cf38c6d06ff45e742a9nd *
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * Unless required by applicable law or agreed to in writing, software
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * distributed under the License is distributed on an "AS IS" BASIS,
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * See the License for the specific language governing permissions and
b8d55029467b9f139d081cf38c6d06ff45e742a9nd * limitations under the License.
b8d55029467b9f139d081cf38c6d06ff45e742a9nd */
b8d55029467b9f139d081cf38c6d06ff45e742a9nd
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* This program tests the ap_get_list_item routine in ../main/util.c.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * The defines in this sample compile line are specific to Roy's system.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * They should match whatever was used to compile Apache first.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding gcc -g -O2 -I../os/unix -I../include -o test_parser \
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding -DSOLARIS2=250 -Wall -DALLOC_DEBUG -DPOOL_DEBUG \
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ../main/alloc.o ../main/buff.o ../main/util.o \
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ../ap/libap.a -lsocket -lnsl test_parser.c
e8f95a682820a599fe41b22977010636be5c2717jim *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Roy Fielding, 1999
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <stdio.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <stdlib.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include "httpd.h"
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb#include "apr_general.h"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/*
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Dummy a bunch of stuff just to get a compile
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinguid_t ap_user_id;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinggid_t ap_group_id;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvoid *ap_dummy_mutex = &ap_dummy_mutex;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingchar *ap_server_argv0;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
3d96ee83babeec32482c9082c9426340cee8c44dwroweAP_DECLARE(void) ap_block_alarms(void)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding{
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding}
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
3d96ee83babeec32482c9082c9426340cee8c44dwroweAP_DECLARE(void) ap_unblock_alarms(void)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding{
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding}
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
3d96ee83babeec32482c9082c9426340cee8c44dwroweAP_DECLARE(void) ap_log_error(const char *file, int line, int level,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding const request_rec *r, const char *fmt, ...)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding{
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding}
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint main (void)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding{
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm apr_pool_t *p;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding const char *field;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding char *newstr;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding char instr[512];
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
066877f1a045103acfdd376d48cdd473c33f409bdougm p = apr_pool_alloc_init();
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding while (gets(instr)) {
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding printf(" [%s] ==\n", instr);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding field = instr;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding while ((newstr = ap_get_list_item(p, &field)) != NULL)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding printf(" <%s> ..\n", newstr);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding }
e8f95a682820a599fe41b22977010636be5c2717jim
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding exit(0);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding}