2
* Copyright 2004 Apache Software Foundation
4
* Licensed under the Apache License, Version 2.0 (the "License"); you
5
* may not use this file except in compliance with the License. You
6
* 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
13
* implied. See the License for the specific language governing
14
* permissions and limitations under the License.
16
* Originally developed by Gregory Trubetskoy.
21
* $Id: hlist.c,v 1.5 2004/02/16 19:47:27 grisha Exp $
23
* See accompanying documentation and source code comments
28
#include "mod_python.h"
36
hl_entry *hlist_new(apr_pool_t *p, const char *h, const char *d,
41
hle = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
43
hle->handler = apr_pstrdup(p, h);
44
hle->directory = apr_pstrdup(p, d);
53
* Appends an hl_entry to a list identified by hle,
54
* and returns the new tail. This func will skip
55
* to the tail of the list.
56
* If hle is NULL, a new list is created.
59
hl_entry *hlist_append(apr_pool_t *p, hl_entry *hle, const char * h,
60
const char *d, const int s)
65
while (hle && hle->next)
68
nhle = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
70
nhle->handler = apr_pstrdup(p, h);
71
nhle->directory = apr_pstrdup(p, d);
85
hl_entry *hlist_copy(apr_pool_t *p, const hl_entry *hle)
90
head = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
91
head->handler = apr_pstrdup(p, hle->handler);
92
head->directory = apr_pstrdup(p, hle->directory);
93
head->silent = hle->silent;
98
nhle->next = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
100
nhle->handler = apr_pstrdup(p, hle->handler);
101
nhle->directory = apr_pstrdup(p, hle->directory);
102
nhle->silent = hle->silent;