Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.140
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
xampp /
apache /
include /
Delete
Unzip
Name
Size
Permission
Date
Action
ap_compat.h
1.08
KB
-rw-rw-rw-
2006-07-12 00:33
ap_config.h
6.65
KB
-rw-rw-rw-
2012-08-15 03:59
ap_config_layout.h
1.21
KB
-rw-rw-rw-
2022-01-02 15:34
ap_expr.h
14.09
KB
-rw-rw-rw-
2020-02-21 02:33
ap_hooks.h
6.01
KB
-rw-rw-rw-
2011-09-23 22:08
ap_listen.h
5.85
KB
-rw-rw-rw-
2016-05-30 23:26
ap_mmn.h
39.26
KB
-rw-rw-rw-
2023-08-29 11:23
ap_mpm.h
10.68
KB
-rw-rw-rw-
2020-04-23 16:32
ap_provider.h
3.55
KB
-rw-rw-rw-
2012-07-03 23:29
ap_regex.h
11.43
KB
-rw-rw-rw-
2022-02-28 13:56
ap_regkey.h
9.18
KB
-rw-rw-rw-
2011-09-23 17:38
ap_release.h
3.15
KB
-rw-rw-rw-
2023-10-16 17:28
ap_slotmem.h
7.26
KB
-rw-rw-rw-
2013-11-17 22:10
ap_socache.h
9.39
KB
-rw-rw-rw-
2012-02-11 00:47
apache_noprobes.h
15.93
KB
-rw-rw-rw-
2012-04-05 00:11
apr.h
18.28
KB
-rw-rw-rw-
2023-03-27 15:53
apr_allocator.h
6.25
KB
-rw-rw-rw-
2018-08-25 17:48
apr_anylock.h
5.06
KB
-rw-rw-rw-
2007-01-15 21:00
apr_atomic.h
6.25
KB
-rw-rw-rw-
2018-09-17 22:20
apr_base64.h
3.86
KB
-rw-rw-rw-
2012-12-23 00:24
apr_buckets.h
64.71
KB
-rw-rw-rw-
2021-09-18 17:25
apr_crypto.h
20.18
KB
-rw-rw-rw-
2017-06-14 00:28
apr_cstr.h
11.42
KB
-rw-rw-rw-
2016-12-03 22:49
apr_date.h
3.57
KB
-rw-rw-rw-
2007-01-15 21:00
apr_dbd.h
23.88
KB
-rw-rw-rw-
2017-04-02 21:57
apr_dbm.h
8.62
KB
-rw-rw-rw-
2008-11-21 08:20
apr_dso.h
2.73
KB
-rw-rw-rw-
2006-08-03 14:55
apr_encode.h
30.98
KB
-rw-rw-rw-
2022-10-18 11:38
apr_env.h
2.12
KB
-rw-rw-rw-
2009-09-26 00:07
apr_errno.h
55.08
KB
-rw-rw-rw-
2016-03-03 18:11
apr_escape.h
17.65
KB
-rw-rw-rw-
2018-08-26 14:24
apr_escape_test_char.h
1.4
KB
-rw-rw-rw-
2023-03-27 15:53
apr_file_info.h
17.59
KB
-rw-rw-rw-
2018-08-26 14:01
apr_file_io.h
43.11
KB
-rw-rw-rw-
2017-03-30 23:53
apr_fnmatch.h
6.23
KB
-rw-rw-rw-
2014-04-15 17:55
apr_general.h
7.36
KB
-rw-rw-rw-
2018-08-26 14:01
apr_getopt.h
6
KB
-rw-rw-rw-
2006-08-03 14:55
apr_global_mutex.h
7.38
KB
-rw-rw-rw-
2017-04-08 01:20
apr_hash.h
10.36
KB
-rw-rw-rw-
2020-11-08 10:13
apr_hooks.h
12.71
KB
-rw-rw-rw-
2013-10-03 17:32
apr_inherit.h
2.14
KB
-rw-rw-rw-
2013-10-03 17:29
apr_ldap.h
5.76
KB
-rw-rw-rw-
2023-01-24 11:36
apr_ldap_init.h
5.81
KB
-rw-rw-rw-
2009-02-19 10:04
apr_ldap_option.h
8.65
KB
-rw-rw-rw-
2009-02-19 10:04
apr_ldap_rebind.h
3.19
KB
-rw-rw-rw-
2009-02-19 10:04
apr_ldap_url.h
3.83
KB
-rw-rw-rw-
2009-02-19 10:04
apr_lib.h
8.47
KB
-rw-rw-rw-
2014-01-16 22:26
apr_md4.h
4.55
KB
-rw-rw-rw-
2007-01-15 21:00
apr_md5.h
6.37
KB
-rw-rw-rw-
2012-07-06 15:41
apr_memcache.h
17.25
KB
-rw-rw-rw-
2010-11-26 16:39
apr_mmap.h
5.18
KB
-rw-rw-rw-
2013-10-03 17:29
apr_network_io.h
36.95
KB
-rw-rw-rw-
2019-05-04 18:44
apr_optional.h
2.8
KB
-rw-rw-rw-
2007-01-15 21:00
apr_optional_hooks.h
3.9
KB
-rw-rw-rw-
2013-10-03 17:32
apr_perms_set.h
1.93
KB
-rw-rw-rw-
2014-04-28 16:08
apr_poll.h
21.04
KB
-rw-rw-rw-
2016-03-25 03:19
apr_pools.h
31.73
KB
-rw-rw-rw-
2022-06-18 00:09
apr_portable.h
20.56
KB
-rw-rw-rw-
2018-08-26 14:01
apr_proc_mutex.h
7.04
KB
-rw-rw-rw-
2017-04-08 01:20
apr_queue.h
4.12
KB
-rw-rw-rw-
2013-10-03 17:32
apr_random.h
5.07
KB
-rw-rw-rw-
2007-07-21 06:16
apr_redis.h
16.07
KB
-rw-rw-rw-
2017-09-27 20:02
apr_reslist.h
7.19
KB
-rw-rw-rw-
2013-10-03 17:32
apr_ring.h
19.28
KB
-rw-rw-rw-
2022-01-06 14:11
apr_rmm.h
4.8
KB
-rw-rw-rw-
2007-01-15 21:00
apr_sdbm.h
6.14
KB
-rw-rw-rw-
2007-10-23 13:59
apr_sha1.h
3.91
KB
-rw-rw-rw-
2007-01-15 21:00
apr_shm.h
9.48
KB
-rw-rw-rw-
2014-04-28 17:15
apr_signal.h
2.8
KB
-rw-rw-rw-
2007-08-05 19:48
apr_siphash.h
6.16
KB
-rw-rw-rw-
2017-06-15 00:00
apr_skiplist.h
14.56
KB
-rw-rw-rw-
2018-08-25 17:48
apr_strings.h
14.92
KB
-rw-rw-rw-
2018-08-26 14:01
apr_strmatch.h
2.69
KB
-rw-rw-rw-
2007-01-15 21:00
apr_support.h
1.65
KB
-rw-rw-rw-
2006-08-03 14:55
apr_tables.h
19.4
KB
-rw-rw-rw-
2020-11-08 09:24
apr_thread_cond.h
5.53
KB
-rw-rw-rw-
2007-06-29 21:20
apr_thread_mutex.h
4.51
KB
-rw-rw-rw-
2017-04-08 01:20
apr_thread_pool.h
11.14
KB
-rw-rw-rw-
2008-05-07 23:45
apr_thread_proc.h
36.11
KB
-rw-rw-rw-
2019-03-08 16:52
apr_thread_rwlock.h
4.78
KB
-rw-rw-rw-
2006-08-03 14:55
apr_time.h
7.62
KB
-rw-rw-rw-
2016-03-05 03:40
apr_uri.h
6.61
KB
-rw-rw-rw-
2009-01-07 22:39
apr_user.h
5.34
KB
-rw-rw-rw-
2013-10-03 17:29
apr_uuid.h
2.13
KB
-rw-rw-rw-
2007-01-15 21:00
apr_version.h
5.44
KB
-rw-rw-rw-
2023-04-13 11:38
apr_want.h
3.01
KB
-rw-rw-rw-
2012-08-15 00:48
apr_xlate.h
6.42
KB
-rw-rw-rw-
2007-01-15 21:00
apr_xml.h
12.54
KB
-rw-rw-rw-
2016-06-14 01:57
apu.h
4.76
KB
-rw-rw-rw-
2023-01-24 11:36
apu_errno.h
5.49
KB
-rw-rw-rw-
2009-01-07 22:35
apu_version.h
4.33
KB
-rw-rw-rw-
2023-02-01 09:56
apu_want.h
1.55
KB
-rw-rw-rw-
2023-01-24 11:36
cache_common.h
2.02
KB
-rw-rw-rw-
2013-05-29 00:30
expat.h
43.55
KB
-rw-rw-rw-
2022-10-25 19:09
heartbeat.h
1.62
KB
-rw-rw-rw-
2014-06-17 16:06
http_config.h
57.78
KB
-rw-rw-rw-
2022-02-23 16:39
http_connection.h
7.15
KB
-rw-rw-rw-
2021-09-26 18:11
http_core.h
37.25
KB
-rw-rw-rw-
2023-08-29 11:23
http_log.h
36.82
KB
-rw-rw-rw-
2016-08-25 16:48
http_main.h
3.25
KB
-rw-rw-rw-
2012-03-26 02:24
http_protocol.h
42.06
KB
-rw-rw-rw-
2022-06-01 16:34
http_request.h
26.34
KB
-rw-rw-rw-
2021-08-10 12:27
http_ssl.h
14.93
KB
-rw-rw-rw-
2022-08-22 00:26
http_vhost.h
4.61
KB
-rw-rw-rw-
2021-05-27 17:08
httpd.h
94.69
KB
-rw-rw-rw-
2022-03-09 16:04
mod_auth.h
4.55
KB
-rw-rw-rw-
2020-02-21 02:33
mod_cache.h
7.27
KB
-rw-rw-rw-
2011-12-03 20:02
mod_cgi.h
2.5
KB
-rw-rw-rw-
2011-09-23 17:38
mod_core.h
3.43
KB
-rw-rw-rw-
2012-09-24 13:49
mod_dav.h
100.22
KB
-rw-rw-rw-
2023-01-09 16:52
mod_dbd.h
4.18
KB
-rw-rw-rw-
2011-09-23 17:38
mod_http2.h
4.69
KB
-rw-rw-rw-
2023-08-29 11:23
mod_include.h
4.01
KB
-rw-rw-rw-
2011-09-23 17:38
mod_log_config.h
2.5
KB
-rw-rw-rw-
2011-09-23 17:38
mod_proxy.h
64.99
KB
-rw-rw-rw-
2023-03-31 18:33
mod_request.h
1.65
KB
-rw-rw-rw-
2011-02-18 20:40
mod_rewrite.h
1.41
KB
-rw-rw-rw-
2014-01-23 16:33
mod_so.h
1.23
KB
-rw-rw-rw-
2011-11-30 12:21
mod_ssl.h
4.99
KB
-rw-rw-rw-
2019-07-30 15:23
mod_ssl_openssl.h
4.79
KB
-rw-rw-rw-
2019-07-30 15:23
mod_status.h
2.45
KB
-rw-rw-rw-
2006-07-12 00:33
mod_watchdog.h
7.55
KB
-rw-rw-rw-
2014-09-05 18:19
mpm_common.h
17.39
KB
-rw-rw-rw-
2021-08-10 12:43
os.h
4.5
KB
-rw-rw-rw-
2021-04-21 05:10
scoreboard.h
9.98
KB
-rw-rw-rw-
2020-02-21 02:33
util_cfgtree.h
3.17
KB
-rw-rw-rw-
2011-09-23 17:38
util_charset.h
2.28
KB
-rw-rw-rw-
2014-11-01 11:19
util_cookies.h
4.99
KB
-rw-rw-rw-
2012-01-09 15:18
util_ebcdic.h
2.78
KB
-rw-rw-rw-
2014-11-01 11:19
util_fcgi.h
10.02
KB
-rw-rw-rw-
2020-02-21 02:33
util_filter.h
26.46
KB
-rw-rw-rw-
2013-04-15 16:37
util_ldap.h
18.33
KB
-rw-rw-rw-
2023-07-07 16:03
util_md5.h
2.19
KB
-rw-rw-rw-
2014-07-17 02:11
util_mutex.h
9.29
KB
-rw-rw-rw-
2011-10-09 22:35
util_script.h
9.8
KB
-rw-rw-rw-
2012-01-09 15:18
util_time.h
4.22
KB
-rw-rw-rw-
2023-07-18 01:16
util_varbuf.h
8.28
KB
-rw-rw-rw-
2014-07-19 21:22
util_xml.h
1.36
KB
-rw-rw-rw-
2014-07-19 21:22
zconf.h
16.83
KB
-rw-rw-rw-
2023-04-18 01:35
zlib.h
96.4
KB
-rw-rw-rw-
2023-08-18 12:45
Save
Rename
/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This code draws heavily from the 4.4BSD <sys/queue.h> macros * and Dean Gaudet's "splim/ring.h". * <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/queue.h> * <http://www.arctic.org/~dean/splim/> * * We'd use Dean's code directly if we could guarantee the * availability of inline functions. */ #ifndef APR_RING_H #define APR_RING_H /** * @file apr_ring.h * @brief APR Rings */ /* * for offsetof() */ #include "apr_general.h" /** * @defgroup apr_ring Ring Macro Implementations * @ingroup APR * A ring is a kind of doubly-linked list that can be manipulated * without knowing where its head is. * @{ */ /** * The Ring Element * * A ring element struct is linked to the other elements in the ring * through its ring entry field, e.g. * <pre> * struct my_element_t { * APR_RING_ENTRY(my_element_t) link; * int foo; * char *bar; * }; * </pre> * * An element struct may be put on more than one ring if it has more * than one APR_RING_ENTRY field. Each APR_RING_ENTRY has a corresponding * APR_RING_HEAD declaration. * * @warning For strict C standards compliance you should put the APR_RING_ENTRY * first in the element struct unless the head is always part of a larger * object with enough earlier fields to accommodate the offsetof() used * to compute the ring sentinel below. You can usually ignore this caveat. */ #define APR_RING_ENTRY(elem) \ struct { \ struct elem * volatile next; \ struct elem * volatile prev; \ } /** * The Ring Head * * Each ring is managed via its head, which is a struct declared like this: * <pre> * APR_RING_HEAD(my_ring_t, my_element_t); * struct my_ring_t ring, *ringp; * </pre> * * This struct looks just like the element link struct so that we can * be sure that the typecasting games will work as expected. * * The first element in the ring is next after the head, and the last * element is just before the head. */ #define APR_RING_HEAD(head, elem) \ struct head { \ struct elem * volatile next; \ struct elem * volatile prev; \ } /** * The Ring Sentinel * * This is the magic pointer value that occurs before the first and * after the last elements in the ring, computed from the address of * the ring's head. The head itself isn't an element, but in order to * get rid of all the special cases when dealing with the ends of the * ring, we play typecasting games to make it look like one. * * Here is a diagram to illustrate the arrangements of the next and * prev pointers of each element in a single ring. Note that they point * to the start of each element, not to the APR_RING_ENTRY structure. * * <pre> * +->+------+<-+ +->+------+<-+ +->+------+<-+ * | |struct| | | |struct| | | |struct| | * / | elem | \/ | elem | \/ | elem | \ * ... | | /\ | | /\ | | ... * +------+ | | +------+ | | +------+ * ...--|prev | | +--|ring | | +--|prev | * | next|--+ | entry|--+ | next|--... * +------+ +------+ +------+ * | etc. | | etc. | | etc. | * : : : : : : * </pre> * * The APR_RING_HEAD is nothing but a bare APR_RING_ENTRY. The prev * and next pointers in the first and last elements don't actually * point to the head, they point to a phantom place called the * sentinel. Its value is such that last->next->next == first because * the offset from the sentinel to the head's next pointer is the same * as the offset from the start of an element to its next pointer. * This also works in the opposite direction. * * <pre> * last first * +->+------+<-+ +->sentinel<-+ +->+------+<-+ * | |struct| | | | | |struct| | * / | elem | \/ \/ | elem | \ * ... | | /\ /\ | | ... * +------+ | | +------+ | | +------+ * ...--|prev | | +--|ring | | +--|prev | * | next|--+ | head|--+ | next|--... * +------+ +------+ +------+ * | etc. | | etc. | * : : : : * </pre> * * Note that the offset mentioned above is different for each kind of * ring that the element may be on, and each kind of ring has a unique * name for its APR_RING_ENTRY in each element, and has its own type * for its APR_RING_HEAD. * * Note also that if the offset is non-zero (which is required if an * element has more than one APR_RING_ENTRY), the unreality of the * sentinel may have bad implications on very perverse implementations * of C -- see the warning in APR_RING_ENTRY. * * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SENTINEL(hp, elem, link) \ (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link)) /** * The first element of the ring * @param hp The head of the ring */ #define APR_RING_FIRST(hp) (hp)->next /** * The last element of the ring * @param hp The head of the ring */ #define APR_RING_LAST(hp) (hp)->prev /** * The next element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_NEXT(ep, link) (ep)->link.next /** * The previous element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREV(ep, link) (ep)->link.prev /** * Initialize a ring * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INIT(hp, elem, link) do { \ APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ APR_RING_LAST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ } while (0) /** * Determine if a ring is empty * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @return true or false */ #define APR_RING_EMPTY(hp, elem, link) \ (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link)) /** * Initialize a singleton element * @param ep The element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_ELEM_INIT(ep, link) do { \ APR_RING_NEXT((ep), link) = (ep); \ APR_RING_PREV((ep), link) = (ep); \ } while (0) /** * Splice the sequence ep1..epN into the ring before element lep * (..lep.. becomes ..ep1..epN..lep..) * @warning This doesn't work for splicing before the first element or on * empty rings... see APR_RING_SPLICE_HEAD for one that does * @param lep Element in the ring to splice before * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_BEFORE(lep, ep1, epN, link) do { \ APR_RING_NEXT((epN), link) = (lep); \ APR_RING_PREV((ep1), link) = APR_RING_PREV((lep), link); \ APR_RING_NEXT(APR_RING_PREV((lep), link), link) = (ep1); \ APR_RING_PREV((lep), link) = (epN); \ } while (0) /** * Splice the sequence ep1..epN into the ring after element lep * (..lep.. becomes ..lep..ep1..epN..) * @warning This doesn't work for splicing after the last element or on * empty rings... see APR_RING_SPLICE_TAIL for one that does * @param lep Element in the ring to splice after * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do { \ APR_RING_PREV((ep1), link) = (lep); \ APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \ APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN); \ APR_RING_NEXT((lep), link) = (ep1); \ } while (0) /** * Insert the element nep into the ring before element lep * (..lep.. becomes ..nep..lep..) * @warning This doesn't work for inserting before the first element or on * empty rings... see APR_RING_INSERT_HEAD for one that does * @param lep Element in the ring to insert before * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_BEFORE(lep, nep, link) \ APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link) /** * Insert the element nep into the ring after element lep * (..lep.. becomes ..lep..nep..) * @warning This doesn't work for inserting after the last element or on * empty rings... see APR_RING_INSERT_TAIL for one that does * @param lep Element in the ring to insert after * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_AFTER(lep, nep, link) \ APR_RING_SPLICE_AFTER((lep), (nep), (nep), link) /** * Splice the sequence ep1..epN into the ring before the first element * (..hp.. becomes ..hp..ep1..epN..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) do { \ APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\ APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp)); \ APR_RING_PREV(APR_RING_FIRST((hp)), link) = (epN); \ APR_RING_FIRST((hp)) = (ep1); \ } while (0) /** * Splice the sequence ep1..epN into the ring after the last element * (..hp.. becomes ..ep1..epN..hp..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do { \ APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\ APR_RING_PREV((ep1), link) = APR_RING_LAST((hp)); \ APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1); \ APR_RING_LAST((hp)) = (epN); \ } while (0) /** * Insert the element nep into the ring before the first element * (..hp.. becomes ..hp..nep..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_HEAD(hp, nep, elem, link) \ APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link) /** * Insert the element nep into the ring after the last element * (..hp.. becomes ..nep..hp..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_TAIL(hp, nep, elem, link) \ APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link) /** * Concatenate ring h2 onto the end of ring h1, leaving h2 empty. * @param h1 Head of the ring to concatenate onto * @param h2 Head of the ring to concatenate * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CONCAT(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_TAIL((h1), APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), elem, link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Prepend ring h2 onto the beginning of ring h1, leaving h2 empty. * @param h1 Head of the ring to prepend onto * @param h2 Head of the ring to prepend * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREPEND(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_HEAD((h1), APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), elem, link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Unsplice a sequence of elements from a ring * @warning The unspliced sequence is left with dangling pointers at either end * @param ep1 First element in the sequence to unsplice * @param epN Last element in the sequence to unsplice * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_UNSPLICE(ep1, epN, link) do { \ APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \ APR_RING_NEXT((epN), link); \ APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \ APR_RING_PREV((ep1), link); \ } while (0) /** * Remove a single element from a ring * @warning The unspliced element is left with dangling pointers at either end * @param ep Element to remove * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_REMOVE(ep, link) \ APR_RING_UNSPLICE((ep), (ep), link) /** * Iterate over a ring * @param ep The current element * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH(ep, head, elem, link) \ for (ep = APR_RING_FIRST(head); \ ep != APR_RING_SENTINEL(head, elem, link); \ ep = APR_RING_NEXT(ep, link)) /** * Iterate over a ring safe against removal of the current element * @param ep1 The current element * @param ep2 Iteration cursor * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH_SAFE(ep1, ep2, head, elem, link) \ for (ep1 = APR_RING_FIRST(head), ep2 = APR_RING_NEXT(ep1, link); \ ep1 != APR_RING_SENTINEL(head, elem, link); \ ep1 = ep2, ep2 = APR_RING_NEXT(ep1, link)) /* Debugging tools: */ #ifdef APR_RING_DEBUG #include <stdio.h> #include <assert.h> #define APR_RING_CHECK_ONE(msg, ptr) \ fprintf(stderr, "*** %s %p\n", msg, ptr) #define APR_RING_CHECK(hp, elem, link, msg) \ APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg) #define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \ struct elem *start = (ep); \ struct elem *here = start; \ fprintf(stderr, "*** ring check start -- %s\n", msg); \ do { \ fprintf(stderr, "\telem %p\n", here); \ fprintf(stderr, "\telem->next %p\n", \ APR_RING_NEXT(here, link)); \ fprintf(stderr, "\telem->prev %p\n", \ APR_RING_PREV(here, link)); \ fprintf(stderr, "\telem->next->prev %p\n", \ APR_RING_PREV(APR_RING_NEXT(here, link), link)); \ fprintf(stderr, "\telem->prev->next %p\n", \ APR_RING_NEXT(APR_RING_PREV(here, link), link)); \ if (APR_RING_PREV(APR_RING_NEXT(here, link), link) != here) { \ fprintf(stderr, "\t*** elem->next->prev != elem\n"); \ break; \ } \ if (APR_RING_NEXT(APR_RING_PREV(here, link), link) != here) { \ fprintf(stderr, "\t*** elem->prev->next != elem\n"); \ break; \ } \ here = APR_RING_NEXT(here, link); \ } while (here != start); \ fprintf(stderr, "*** ring check end\n"); \ } while (0) #define APR_RING_CHECK_CONSISTENCY(hp, elem, link) \ APR_RING_CHECK_ELEM_CONSISTENCY(APR_RING_SENTINEL(hp, elem, link),\ elem, link) #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) do { \ struct elem *start = (ep); \ struct elem *here = start; \ do { \ assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \ assert(APR_RING_NEXT(APR_RING_PREV(here, link), link) == here); \ here = APR_RING_NEXT(here, link); \ } while (here != start); \ } while (0) #else /** * Print a single pointer value to STDERR * (This is a no-op unless APR_RING_DEBUG is defined.) * @param msg Descriptive message * @param ptr Pointer value to print */ #define APR_RING_CHECK_ONE(msg, ptr) /** * Dump all ring pointers to STDERR, starting with the head and looping all * the way around the ring back to the head. Aborts if an inconsistency * is found. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param hp Head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @param msg Descriptive message */ #define APR_RING_CHECK(hp, elem, link, msg) /** * Loops around a ring and checks all the pointers for consistency. Pops * an assertion if any inconsistency is found. Same idea as APR_RING_CHECK() * except that it's silent if all is well. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param hp Head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CHECK_CONSISTENCY(hp, elem, link) /** * Dump all ring pointers to STDERR, starting with the given element and * looping all the way around the ring back to that element. Aborts if * an inconsistency is found. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param ep The element * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @param msg Descriptive message */ #define APR_RING_CHECK_ELEM(ep, elem, link, msg) /** * Loops around a ring, starting with the given element, and checks all * the pointers for consistency. Pops an assertion if any inconsistency * is found. Same idea as APR_RING_CHECK_ELEM() except that it's silent * if all is well. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param ep The element * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) #endif /** @} */ #endif /* !APR_RING_H */