/src/cairo/src/cairo-list-inline.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* cairo - a vector graphics library with display and print output |
2 | | * |
3 | | * Copyright © 2009 Chris Wilson |
4 | | * |
5 | | * This library is free software; you can redistribute it and/or |
6 | | * modify it either under the terms of the GNU Lesser General Public |
7 | | * License version 2.1 as published by the Free Software Foundation |
8 | | * (the "LGPL") or, at your option, under the terms of the Mozilla |
9 | | * Public License Version 1.1 (the "MPL"). If you do not alter this |
10 | | * notice, a recipient may use your version of this file under either |
11 | | * the MPL or the LGPL. |
12 | | * |
13 | | * You should have received a copy of the LGPL along with this library |
14 | | * in the file COPYING-LGPL-2.1; if not, write to the Free Software |
15 | | * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA |
16 | | * You should have received a copy of the MPL along with this library |
17 | | * in the file COPYING-MPL-1.1 |
18 | | * |
19 | | * The contents of this file are subject to the Mozilla Public License |
20 | | * Version 1.1 (the "License"); you may not use this file except in |
21 | | * compliance with the License. You may obtain a copy of the License at |
22 | | * http://www.mozilla.org/MPL/ |
23 | | * |
24 | | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY |
25 | | * OF ANY KIND, either express or implied. See the LGPL or the MPL for |
26 | | * the specific language governing rights and limitations. |
27 | | * |
28 | | * The Original Code is the cairo graphics library. |
29 | | * |
30 | | * The Initial Developer of the Original Code is Chris Wilson. |
31 | | * |
32 | | * Contributor(s): |
33 | | * Chris Wilson <chris@chris-wilson.co.uk> |
34 | | * |
35 | | */ |
36 | | |
37 | | #ifndef CAIRO_LIST_INLINE_H |
38 | | #define CAIRO_LIST_INLINE_H |
39 | | |
40 | | #include "cairo-list-private.h" |
41 | | |
42 | | /*< private > |
43 | | * cairo_list_entry: |
44 | | * @ptr: the pointer to the #cairo_list_t member. |
45 | | * @type: the type of the struct. |
46 | | * @member: the name of the list_head within the struct. |
47 | | * |
48 | | * Return value: the pointer the struct containing the @member that @ptr points to. |
49 | | **/ |
50 | | #define cairo_list_entry(ptr, type, member) \ |
51 | 2.71M | cairo_container_of(ptr, type, member) |
52 | | |
53 | | #define cairo_list_first_entry(ptr, type, member) \ |
54 | 35.0k | cairo_list_entry((ptr)->next, type, member) |
55 | | |
56 | | #define cairo_list_last_entry(ptr, type, member) \ |
57 | 34.4k | cairo_list_entry((ptr)->prev, type, member) |
58 | | |
59 | | /*< private > |
60 | | * cairo_list_foreach: |
61 | | * @pos: a #cairo_list_t* to use as a loop variable. |
62 | | * @head: the list. |
63 | | * |
64 | | * Iterate the list. @pos points to the #cairo_list_t member of the entry struct. |
65 | | **/ |
66 | | #define cairo_list_foreach(pos, head) \ |
67 | | for (pos = (head)->next; pos != (head); pos = pos->next) |
68 | | |
69 | | /*< private > |
70 | | * cairo_list_foreach_entry: |
71 | | * @pos: a variable of type T * to use as a loop variable. |
72 | | * @type: the type of the entry struct |
73 | | * @head: the list |
74 | | * @member: the name of the #cairo_list_t member of the entry |
75 | | * |
76 | | * Iterate the list of type T. |
77 | | **/ |
78 | | #define cairo_list_foreach_entry(pos, type, head, member) \ |
79 | 704k | for (pos = cairo_list_entry((head)->next, type, member);\ |
80 | 706k | &pos->member != (head); \ |
81 | 704k | pos = cairo_list_entry(pos->member.next, type, member)) |
82 | | |
83 | | /*< private > |
84 | | * cairo_list_foreach_entry_safe: |
85 | | * @pos: a variable of type T * to use as a loop variable. |
86 | | * @n: a variable of type T * that point to the next item after @pos. |
87 | | * @type: the type of the entry struct |
88 | | * @head: the list |
89 | | * @member: the name of the #cairo_list_t member of the entry |
90 | | * |
91 | | * Iterate the list of type T. It is safe to remove items while |
92 | | * iterating. @n is a temporary variable required to support safe |
93 | | * iterating. |
94 | | * |
95 | | * |[<!-- language="C" --> |
96 | | * struct foo { |
97 | | * int a; |
98 | | * cairo_list_t list; |
99 | | * } |
100 | | * |
101 | | * struct foo linked_list; |
102 | | * cairo_list_init (&linked_list); |
103 | | * ... calls to cairo_list_add (entry, &linked_list); |
104 | | * |
105 | | * struct foo *pos, *next; |
106 | | * cairo_list_foreach_entry_safe(pos, next, struct foo, &linked_list, list) { |
107 | | * printf("%d\n", pos->a); |
108 | | * cairo_list_del (pos); |
109 | | * } |
110 | | * ]| |
111 | | **/ |
112 | | #define cairo_list_foreach_entry_safe(pos, n, type, head, member) \ |
113 | 23.2k | for (pos = cairo_list_entry ((head)->next, type, member),\ |
114 | 23.2k | n = cairo_list_entry (pos->member.next, type, member);\ |
115 | 23.8k | &pos->member != (head); \ |
116 | 23.2k | pos = n, n = cairo_list_entry (n->member.next, type, member)) |
117 | | |
118 | | /*< private > |
119 | | * cairo_list_foreach_entry: |
120 | | * @pos: a variable of type T * to use as a loop variable. |
121 | | * @type: the type of the entry struct |
122 | | * @head: the list |
123 | | * @member: the name of the #cairo_list_t member of the entry |
124 | | * |
125 | | * Iterate the list of type T in reverse direction. |
126 | | **/ |
127 | | #define cairo_list_foreach_entry_reverse(pos, type, head, member) \ |
128 | | for (pos = cairo_list_entry((head)->prev, type, member);\ |
129 | | &pos->member != (head); \ |
130 | | pos = cairo_list_entry(pos->member.prev, type, member)) |
131 | | |
132 | | /*< private > |
133 | | * cairo_list_foreach_entry_safe: |
134 | | * @pos: a variable of type T * to use as a loop variable. |
135 | | * @n: a variable of type T * that point to the next item after @pos. |
136 | | * @type: the type of the entry struct |
137 | | * @head: the list |
138 | | * @member: the name of the #cairo_list_t member of the entry |
139 | | * |
140 | | * Iterate the list of type T in reverse direction. It is safe to |
141 | | * remove items while iterating. @n is a temporary variable required |
142 | | * to support safe iterating. |
143 | | **/ |
144 | | #define cairo_list_foreach_entry_reverse_safe(pos, n, type, head, member) \ |
145 | | for (pos = cairo_list_entry((head)->prev, type, member),\ |
146 | | n = cairo_list_entry (pos->member.prev, type, member);\ |
147 | | &pos->member != (head); \ |
148 | | pos = n, n = cairo_list_entry (n->member.prev, type, member)) |
149 | | |
150 | | #ifdef CAIRO_LIST_DEBUG |
151 | | static inline void |
152 | | _cairo_list_validate (const cairo_list_t *link) |
153 | | { |
154 | | assert (link->next->prev == link); |
155 | | assert (link->prev->next == link); |
156 | | } |
157 | | static inline void |
158 | | cairo_list_validate (const cairo_list_t *head) |
159 | | { |
160 | | cairo_list_t *link; |
161 | | |
162 | | cairo_list_foreach (link, head) |
163 | | _cairo_list_validate (link); |
164 | | } |
165 | | static inline cairo_bool_t |
166 | | cairo_list_is_empty (const cairo_list_t *head); |
167 | | static inline void |
168 | | cairo_list_validate_is_empty (const cairo_list_t *head) |
169 | | { |
170 | | assert (head->next == NULL || (cairo_list_is_empty (head) && head->next == head->prev)); |
171 | | } |
172 | | #else |
173 | | #define _cairo_list_validate(link) |
174 | | #define cairo_list_validate(head) |
175 | | #define cairo_list_validate_is_empty(head) |
176 | | #endif |
177 | | |
178 | | /*< private > |
179 | | * cairo_list_init: |
180 | | * @entry: list entry to initialize |
181 | | * |
182 | | * Initializes the list entry to point to itself. The result is an |
183 | | * empty list. |
184 | | **/ |
185 | | static inline void |
186 | | cairo_list_init (cairo_list_t *entry) |
187 | 2.80M | { |
188 | 2.80M | entry->next = entry; |
189 | 2.80M | entry->prev = entry; |
190 | 2.80M | } cairo-pattern.c:cairo_list_init Line | Count | Source | 187 | 2.52M | { | 188 | 2.52M | entry->next = entry; | 189 | 2.52M | entry->prev = entry; | 190 | 2.52M | } |
cairo-recording-surface.c:cairo_list_init Line | Count | Source | 187 | 9.74k | { | 188 | 9.74k | entry->next = entry; | 189 | 9.74k | entry->prev = entry; | 190 | 9.74k | } |
cairo-scaled-font.c:cairo_list_init Line | Count | Source | 187 | 43.0k | { | 188 | 43.0k | entry->next = entry; | 189 | 43.0k | entry->prev = entry; | 190 | 43.0k | } |
cairo-surface.c:cairo_list_init Line | Count | Source | 187 | 74.2k | { | 188 | 74.2k | entry->next = entry; | 189 | 74.2k | entry->prev = entry; | 190 | 74.2k | } |
cairo-ft-font.c:cairo_list_init Line | Count | Source | 187 | 30.0k | { | 188 | 30.0k | entry->next = entry; | 189 | 30.0k | entry->prev = entry; | 190 | 30.0k | } |
cairo-gstate.c:cairo_list_init Line | Count | Source | 187 | 40.2k | { | 188 | 40.2k | entry->next = entry; | 189 | 40.2k | entry->prev = entry; | 190 | 40.2k | } |
Unexecuted instantiation: cairo-image-source.c:cairo_list_init Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_init Unexecuted instantiation: cairo-observer.c:cairo_list_init cairo-path-fixed.c:cairo_list_init Line | Count | Source | 187 | 78.8k | { | 188 | 78.8k | entry->next = entry; | 189 | 78.8k | entry->prev = entry; | 190 | 78.8k | } |
Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_init Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_init Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_init cairo-pdf-interchange.c:cairo_list_init Line | Count | Source | 187 | 1.33k | { | 188 | 1.33k | entry->next = entry; | 189 | 1.33k | entry->prev = entry; | 190 | 1.33k | } |
Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_init cairo-tag-stack.c:cairo_list_init Line | Count | Source | 187 | 1.33k | { | 188 | 1.33k | entry->next = entry; | 189 | 1.33k | entry->prev = entry; | 190 | 1.33k | } |
|
191 | | |
192 | | static inline void |
193 | | __cairo_list_add (cairo_list_t *entry, |
194 | | cairo_list_t *prev, |
195 | | cairo_list_t *next) |
196 | 93.1k | { |
197 | 93.1k | next->prev = entry; |
198 | 93.1k | entry->next = next; |
199 | 93.1k | entry->prev = prev; |
200 | 93.1k | prev->next = entry; |
201 | 93.1k | } Unexecuted instantiation: cairo-pattern.c:__cairo_list_add cairo-recording-surface.c:__cairo_list_add Line | Count | Source | 196 | 2.54k | { | 197 | 2.54k | next->prev = entry; | 198 | 2.54k | entry->next = next; | 199 | 2.54k | entry->prev = prev; | 200 | 2.54k | prev->next = entry; | 201 | 2.54k | } |
cairo-scaled-font.c:__cairo_list_add Line | Count | Source | 196 | 38.3k | { | 197 | 38.3k | next->prev = entry; | 198 | 38.3k | entry->next = next; | 199 | 38.3k | entry->prev = prev; | 200 | 38.3k | prev->next = entry; | 201 | 38.3k | } |
cairo-surface.c:__cairo_list_add Line | Count | Source | 196 | 3.72k | { | 197 | 3.72k | next->prev = entry; | 198 | 3.72k | entry->next = next; | 199 | 3.72k | entry->prev = prev; | 200 | 3.72k | prev->next = entry; | 201 | 3.72k | } |
Unexecuted instantiation: cairo-ft-font.c:__cairo_list_add cairo-gstate.c:__cairo_list_add Line | Count | Source | 196 | 40.3k | { | 197 | 40.3k | next->prev = entry; | 198 | 40.3k | entry->next = next; | 199 | 40.3k | entry->prev = prev; | 200 | 40.3k | prev->next = entry; | 201 | 40.3k | } |
Unexecuted instantiation: cairo-image-source.c:__cairo_list_add Unexecuted instantiation: cairo-mask-compositor.c:__cairo_list_add Unexecuted instantiation: cairo-observer.c:__cairo_list_add cairo-path-fixed.c:__cairo_list_add Line | Count | Source | 196 | 8.18k | { | 197 | 8.18k | next->prev = entry; | 198 | 8.18k | entry->next = next; | 199 | 8.18k | entry->prev = prev; | 200 | 8.18k | prev->next = entry; | 201 | 8.18k | } |
Unexecuted instantiation: cairo-spans-compositor.c:__cairo_list_add Unexecuted instantiation: cairo-traps-compositor.c:__cairo_list_add Unexecuted instantiation: cairo-pdf-surface.c:__cairo_list_add Unexecuted instantiation: cairo-pdf-interchange.c:__cairo_list_add Unexecuted instantiation: cairo-tag-attributes.c:__cairo_list_add Unexecuted instantiation: cairo-tag-stack.c:__cairo_list_add |
202 | | |
203 | | /*< private > |
204 | | * cairo_list_add: |
205 | | * @entry: new entry |
206 | | * @head: linked list head |
207 | | * |
208 | | * Insert a @entry at the start of the list. |
209 | | **/ |
210 | | static inline void |
211 | | cairo_list_add (cairo_list_t *entry, cairo_list_t *head) |
212 | 82.7k | { |
213 | 82.7k | cairo_list_validate (head); |
214 | 82.7k | cairo_list_validate_is_empty (entry); |
215 | 82.7k | __cairo_list_add (entry, head, head->next); |
216 | 82.7k | cairo_list_validate (head); |
217 | 82.7k | } Unexecuted instantiation: cairo-pattern.c:cairo_list_add cairo-recording-surface.c:cairo_list_add Line | Count | Source | 212 | 2.54k | { | 213 | 2.54k | cairo_list_validate (head); | 214 | 2.54k | cairo_list_validate_is_empty (entry); | 215 | 2.54k | __cairo_list_add (entry, head, head->next); | 216 | 2.54k | cairo_list_validate (head); | 217 | 2.54k | } |
cairo-scaled-font.c:cairo_list_add Line | Count | Source | 212 | 36.1k | { | 213 | 36.1k | cairo_list_validate (head); | 214 | 36.1k | cairo_list_validate_is_empty (entry); | 215 | 36.1k | __cairo_list_add (entry, head, head->next); | 216 | 36.1k | cairo_list_validate (head); | 217 | 36.1k | } |
cairo-surface.c:cairo_list_add Line | Count | Source | 212 | 3.72k | { | 213 | 3.72k | cairo_list_validate (head); | 214 | 3.72k | cairo_list_validate_is_empty (entry); | 215 | 3.72k | __cairo_list_add (entry, head, head->next); | 216 | 3.72k | cairo_list_validate (head); | 217 | 3.72k | } |
Unexecuted instantiation: cairo-ft-font.c:cairo_list_add cairo-gstate.c:cairo_list_add Line | Count | Source | 212 | 40.2k | { | 213 | 40.2k | cairo_list_validate (head); | 214 | 40.2k | cairo_list_validate_is_empty (entry); | 215 | 40.2k | __cairo_list_add (entry, head, head->next); | 216 | 40.2k | cairo_list_validate (head); | 217 | 40.2k | } |
Unexecuted instantiation: cairo-image-source.c:cairo_list_add Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_add Unexecuted instantiation: cairo-observer.c:cairo_list_add Unexecuted instantiation: cairo-path-fixed.c:cairo_list_add Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_add Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_add Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_add Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_add Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_add Unexecuted instantiation: cairo-tag-stack.c:cairo_list_add |
218 | | |
219 | | /*< private > |
220 | | * cairo_list_add_tail: |
221 | | * @entry: new entry |
222 | | * @head: linked list head |
223 | | * |
224 | | * Append a @entry to the end of the list. |
225 | | **/ |
226 | | static inline void |
227 | | cairo_list_add_tail (cairo_list_t *entry, cairo_list_t *head) |
228 | 10.4k | { |
229 | 10.4k | cairo_list_validate (head); |
230 | 10.4k | cairo_list_validate_is_empty (entry); |
231 | 10.4k | __cairo_list_add (entry, head->prev, head); |
232 | 10.4k | cairo_list_validate (head); |
233 | 10.4k | } Unexecuted instantiation: cairo-pattern.c:cairo_list_add_tail Unexecuted instantiation: cairo-recording-surface.c:cairo_list_add_tail cairo-scaled-font.c:cairo_list_add_tail Line | Count | Source | 228 | 2.22k | { | 229 | 2.22k | cairo_list_validate (head); | 230 | 2.22k | cairo_list_validate_is_empty (entry); | 231 | 2.22k | __cairo_list_add (entry, head->prev, head); | 232 | 2.22k | cairo_list_validate (head); | 233 | 2.22k | } |
Unexecuted instantiation: cairo-surface.c:cairo_list_add_tail Unexecuted instantiation: cairo-ft-font.c:cairo_list_add_tail Unexecuted instantiation: cairo-gstate.c:cairo_list_add_tail Unexecuted instantiation: cairo-image-source.c:cairo_list_add_tail Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_add_tail Unexecuted instantiation: cairo-observer.c:cairo_list_add_tail cairo-path-fixed.c:cairo_list_add_tail Line | Count | Source | 228 | 8.18k | { | 229 | 8.18k | cairo_list_validate (head); | 230 | 8.18k | cairo_list_validate_is_empty (entry); | 231 | 8.18k | __cairo_list_add (entry, head->prev, head); | 232 | 8.18k | cairo_list_validate (head); | 233 | 8.18k | } |
Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_add_tail Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_add_tail Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_add_tail Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_add_tail Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_add_tail Unexecuted instantiation: cairo-tag-stack.c:cairo_list_add_tail |
234 | | |
235 | | static inline void |
236 | | __cairo_list_del (cairo_list_t *prev, cairo_list_t *next) |
237 | 78.4k | { |
238 | 78.4k | next->prev = prev; |
239 | 78.4k | prev->next = next; |
240 | 78.4k | } Unexecuted instantiation: cairo-pattern.c:__cairo_list_del cairo-recording-surface.c:__cairo_list_del Line | Count | Source | 237 | 2.54k | { | 238 | 2.54k | next->prev = prev; | 239 | 2.54k | prev->next = next; | 240 | 2.54k | } |
cairo-scaled-font.c:__cairo_list_del Line | Count | Source | 237 | 1.82k | { | 238 | 1.82k | next->prev = prev; | 239 | 1.82k | prev->next = next; | 240 | 1.82k | } |
cairo-surface.c:__cairo_list_del Line | Count | Source | 237 | 3.72k | { | 238 | 3.72k | next->prev = prev; | 239 | 3.72k | prev->next = next; | 240 | 3.72k | } |
cairo-ft-font.c:__cairo_list_del Line | Count | Source | 237 | 30.0k | { | 238 | 30.0k | next->prev = prev; | 239 | 30.0k | prev->next = next; | 240 | 30.0k | } |
cairo-gstate.c:__cairo_list_del Line | Count | Source | 237 | 40.3k | { | 238 | 40.3k | next->prev = prev; | 239 | 40.3k | prev->next = next; | 240 | 40.3k | } |
Unexecuted instantiation: cairo-image-source.c:__cairo_list_del Unexecuted instantiation: cairo-mask-compositor.c:__cairo_list_del Unexecuted instantiation: cairo-observer.c:__cairo_list_del Unexecuted instantiation: cairo-path-fixed.c:__cairo_list_del Unexecuted instantiation: cairo-spans-compositor.c:__cairo_list_del Unexecuted instantiation: cairo-traps-compositor.c:__cairo_list_del Unexecuted instantiation: cairo-pdf-surface.c:__cairo_list_del Unexecuted instantiation: cairo-pdf-interchange.c:__cairo_list_del Unexecuted instantiation: cairo-tag-attributes.c:__cairo_list_del Unexecuted instantiation: cairo-tag-stack.c:__cairo_list_del |
241 | | |
242 | | static inline void |
243 | | _cairo_list_del (cairo_list_t *entry) |
244 | 78.4k | { |
245 | 78.4k | __cairo_list_del (entry->prev, entry->next); |
246 | 78.4k | } Unexecuted instantiation: cairo-pattern.c:_cairo_list_del cairo-recording-surface.c:_cairo_list_del Line | Count | Source | 244 | 2.54k | { | 245 | 2.54k | __cairo_list_del (entry->prev, entry->next); | 246 | 2.54k | } |
cairo-scaled-font.c:_cairo_list_del Line | Count | Source | 244 | 1.82k | { | 245 | 1.82k | __cairo_list_del (entry->prev, entry->next); | 246 | 1.82k | } |
cairo-surface.c:_cairo_list_del Line | Count | Source | 244 | 3.72k | { | 245 | 3.72k | __cairo_list_del (entry->prev, entry->next); | 246 | 3.72k | } |
cairo-ft-font.c:_cairo_list_del Line | Count | Source | 244 | 30.0k | { | 245 | 30.0k | __cairo_list_del (entry->prev, entry->next); | 246 | 30.0k | } |
cairo-gstate.c:_cairo_list_del Line | Count | Source | 244 | 40.2k | { | 245 | 40.2k | __cairo_list_del (entry->prev, entry->next); | 246 | 40.2k | } |
Unexecuted instantiation: cairo-image-source.c:_cairo_list_del Unexecuted instantiation: cairo-mask-compositor.c:_cairo_list_del Unexecuted instantiation: cairo-observer.c:_cairo_list_del Unexecuted instantiation: cairo-path-fixed.c:_cairo_list_del Unexecuted instantiation: cairo-spans-compositor.c:_cairo_list_del Unexecuted instantiation: cairo-traps-compositor.c:_cairo_list_del Unexecuted instantiation: cairo-pdf-surface.c:_cairo_list_del Unexecuted instantiation: cairo-pdf-interchange.c:_cairo_list_del Unexecuted instantiation: cairo-tag-attributes.c:_cairo_list_del Unexecuted instantiation: cairo-tag-stack.c:_cairo_list_del |
247 | | |
248 | | /*< private > |
249 | | * cairo_list_del: |
250 | | * @entry: entry to remove |
251 | | * |
252 | | * Remove @entry from the list it is in. |
253 | | **/ |
254 | | static inline void |
255 | | cairo_list_del (cairo_list_t *entry) |
256 | 78.4k | { |
257 | 78.4k | _cairo_list_del (entry); |
258 | 78.4k | cairo_list_init (entry); |
259 | 78.4k | } Unexecuted instantiation: cairo-pattern.c:cairo_list_del cairo-recording-surface.c:cairo_list_del Line | Count | Source | 256 | 2.54k | { | 257 | 2.54k | _cairo_list_del (entry); | 258 | 2.54k | cairo_list_init (entry); | 259 | 2.54k | } |
cairo-scaled-font.c:cairo_list_del Line | Count | Source | 256 | 1.82k | { | 257 | 1.82k | _cairo_list_del (entry); | 258 | 1.82k | cairo_list_init (entry); | 259 | 1.82k | } |
cairo-surface.c:cairo_list_del Line | Count | Source | 256 | 3.72k | { | 257 | 3.72k | _cairo_list_del (entry); | 258 | 3.72k | cairo_list_init (entry); | 259 | 3.72k | } |
cairo-ft-font.c:cairo_list_del Line | Count | Source | 256 | 30.0k | { | 257 | 30.0k | _cairo_list_del (entry); | 258 | 30.0k | cairo_list_init (entry); | 259 | 30.0k | } |
cairo-gstate.c:cairo_list_del Line | Count | Source | 256 | 40.2k | { | 257 | 40.2k | _cairo_list_del (entry); | 258 | 40.2k | cairo_list_init (entry); | 259 | 40.2k | } |
Unexecuted instantiation: cairo-image-source.c:cairo_list_del Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_del Unexecuted instantiation: cairo-observer.c:cairo_list_del Unexecuted instantiation: cairo-path-fixed.c:cairo_list_del Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_del Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_del Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_del Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_del Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_del Unexecuted instantiation: cairo-tag-stack.c:cairo_list_del |
260 | | |
261 | | /*< private > |
262 | | * cairo_list_move: |
263 | | * @entry: entry to move |
264 | | * @head: linked list to move @entry to |
265 | | * |
266 | | * Remove @entry from the list it is in and insert it at the start of @head list. |
267 | | **/ |
268 | | static inline void |
269 | | cairo_list_move (cairo_list_t *entry, cairo_list_t *head) |
270 | 56 | { |
271 | 56 | cairo_list_validate (head); |
272 | 56 | __cairo_list_del (entry->prev, entry->next); |
273 | 56 | __cairo_list_add (entry, head, head->next); |
274 | 56 | cairo_list_validate (head); |
275 | 56 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_move Unexecuted instantiation: cairo-recording-surface.c:cairo_list_move Unexecuted instantiation: cairo-scaled-font.c:cairo_list_move Unexecuted instantiation: cairo-surface.c:cairo_list_move Unexecuted instantiation: cairo-ft-font.c:cairo_list_move cairo-gstate.c:cairo_list_move Line | Count | Source | 270 | 56 | { | 271 | 56 | cairo_list_validate (head); | 272 | 56 | __cairo_list_del (entry->prev, entry->next); | 273 | 56 | __cairo_list_add (entry, head, head->next); | 274 | 56 | cairo_list_validate (head); | 275 | 56 | } |
Unexecuted instantiation: cairo-image-source.c:cairo_list_move Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_move Unexecuted instantiation: cairo-observer.c:cairo_list_move Unexecuted instantiation: cairo-path-fixed.c:cairo_list_move Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_move Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_move Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_move Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_move Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_move Unexecuted instantiation: cairo-tag-stack.c:cairo_list_move |
276 | | |
277 | | /*< private > |
278 | | * cairo_list_move_tail: |
279 | | * @entry: entry tp move |
280 | | * @head: linked list to move @entry to |
281 | | * |
282 | | * Remove @entry from the list it is in and append it to the end of @head list. |
283 | | **/ |
284 | | static inline void |
285 | | cairo_list_move_tail (cairo_list_t *entry, cairo_list_t *head) |
286 | 0 | { |
287 | 0 | cairo_list_validate (head); |
288 | 0 | __cairo_list_del (entry->prev, entry->next); |
289 | 0 | __cairo_list_add (entry, head->prev, head); |
290 | 0 | cairo_list_validate (head); |
291 | 0 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_move_tail Unexecuted instantiation: cairo-recording-surface.c:cairo_list_move_tail Unexecuted instantiation: cairo-scaled-font.c:cairo_list_move_tail Unexecuted instantiation: cairo-surface.c:cairo_list_move_tail Unexecuted instantiation: cairo-ft-font.c:cairo_list_move_tail Unexecuted instantiation: cairo-gstate.c:cairo_list_move_tail Unexecuted instantiation: cairo-image-source.c:cairo_list_move_tail Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_move_tail Unexecuted instantiation: cairo-observer.c:cairo_list_move_tail Unexecuted instantiation: cairo-path-fixed.c:cairo_list_move_tail Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_move_tail Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_move_tail Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_move_tail Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_move_tail Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_move_tail Unexecuted instantiation: cairo-tag-stack.c:cairo_list_move_tail |
292 | | |
293 | | /*< private > |
294 | | * cairo_list_move_list: |
295 | | * @old: List to move |
296 | | * @new: List to move to. Should be empty, |
297 | | * |
298 | | * Move @old list to @new list, fixing up the references. |
299 | | **/ |
300 | | static inline void |
301 | | cairo_list_move_list (cairo_list_t *old, cairo_list_t *new) |
302 | 0 | { |
303 | 0 | __cairo_list_add (new, old->prev, old->next); |
304 | 0 | cairo_list_init (old); |
305 | 0 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_move_list Unexecuted instantiation: cairo-recording-surface.c:cairo_list_move_list Unexecuted instantiation: cairo-scaled-font.c:cairo_list_move_list Unexecuted instantiation: cairo-surface.c:cairo_list_move_list Unexecuted instantiation: cairo-ft-font.c:cairo_list_move_list Unexecuted instantiation: cairo-gstate.c:cairo_list_move_list Unexecuted instantiation: cairo-image-source.c:cairo_list_move_list Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_move_list Unexecuted instantiation: cairo-observer.c:cairo_list_move_list Unexecuted instantiation: cairo-path-fixed.c:cairo_list_move_list Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_move_list Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_move_list Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_move_list Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_move_list Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_move_list Unexecuted instantiation: cairo-tag-stack.c:cairo_list_move_list |
306 | | |
307 | | /*< private > |
308 | | * cairo_list_is_first: |
309 | | * @entry: entry to check |
310 | | * @head: linked list |
311 | | * |
312 | | * Return %TRUE if @entry is the first item in @head. |
313 | | **/ |
314 | | static inline cairo_bool_t |
315 | | cairo_list_is_first (const cairo_list_t *entry, |
316 | | const cairo_list_t *head) |
317 | 0 | { |
318 | 0 | cairo_list_validate (head); |
319 | 0 | return entry->prev == head; |
320 | 0 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_is_first Unexecuted instantiation: cairo-recording-surface.c:cairo_list_is_first Unexecuted instantiation: cairo-scaled-font.c:cairo_list_is_first Unexecuted instantiation: cairo-surface.c:cairo_list_is_first Unexecuted instantiation: cairo-ft-font.c:cairo_list_is_first Unexecuted instantiation: cairo-gstate.c:cairo_list_is_first Unexecuted instantiation: cairo-image-source.c:cairo_list_is_first Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_is_first Unexecuted instantiation: cairo-observer.c:cairo_list_is_first Unexecuted instantiation: cairo-path-fixed.c:cairo_list_is_first Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_is_first Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_is_first Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_is_first Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_is_first Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_is_first Unexecuted instantiation: cairo-tag-stack.c:cairo_list_is_first |
321 | | |
322 | | /*< private > |
323 | | * cairo_list_is_last: |
324 | | * @entry: entry to check |
325 | | * @head: linked list |
326 | | * |
327 | | * Return %TRUE if @entry is the last item in @head. |
328 | | **/ |
329 | | static inline cairo_bool_t |
330 | | cairo_list_is_last (const cairo_list_t *entry, |
331 | | const cairo_list_t *head) |
332 | 0 | { |
333 | 0 | cairo_list_validate (head); |
334 | 0 | return entry->next == head; |
335 | 0 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_is_last Unexecuted instantiation: cairo-recording-surface.c:cairo_list_is_last Unexecuted instantiation: cairo-scaled-font.c:cairo_list_is_last Unexecuted instantiation: cairo-surface.c:cairo_list_is_last Unexecuted instantiation: cairo-ft-font.c:cairo_list_is_last Unexecuted instantiation: cairo-gstate.c:cairo_list_is_last Unexecuted instantiation: cairo-image-source.c:cairo_list_is_last Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_is_last Unexecuted instantiation: cairo-observer.c:cairo_list_is_last Unexecuted instantiation: cairo-path-fixed.c:cairo_list_is_last Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_is_last Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_is_last Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_is_last Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_is_last Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_is_last Unexecuted instantiation: cairo-tag-stack.c:cairo_list_is_last |
336 | | |
337 | | /*< private > |
338 | | * cairo_list_is_empty: |
339 | | * @head: linked list |
340 | | * |
341 | | * Return %TRUE if @head is empty. |
342 | | **/ |
343 | | static inline cairo_bool_t |
344 | | cairo_list_is_empty (const cairo_list_t *head) |
345 | 2.72M | { |
346 | 2.72M | cairo_list_validate (head); |
347 | 2.72M | return head->next == head; |
348 | 2.72M | } Unexecuted instantiation: cairo-pattern.c:cairo_list_is_empty Unexecuted instantiation: cairo-recording-surface.c:cairo_list_is_empty cairo-scaled-font.c:cairo_list_is_empty Line | Count | Source | 345 | 100k | { | 346 | 100k | cairo_list_validate (head); | 347 | 100k | return head->next == head; | 348 | 100k | } |
cairo-surface.c:cairo_list_is_empty Line | Count | Source | 345 | 2.62M | { | 346 | 2.62M | cairo_list_validate (head); | 347 | 2.62M | return head->next == head; | 348 | 2.62M | } |
Unexecuted instantiation: cairo-ft-font.c:cairo_list_is_empty Unexecuted instantiation: cairo-gstate.c:cairo_list_is_empty Unexecuted instantiation: cairo-image-source.c:cairo_list_is_empty Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_is_empty Unexecuted instantiation: cairo-observer.c:cairo_list_is_empty Unexecuted instantiation: cairo-path-fixed.c:cairo_list_is_empty Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_is_empty Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_is_empty Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_is_empty Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_is_empty Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_is_empty cairo-tag-stack.c:cairo_list_is_empty Line | Count | Source | 345 | 1.33k | { | 346 | 1.33k | cairo_list_validate (head); | 347 | 1.33k | return head->next == head; | 348 | 1.33k | } |
|
349 | | |
350 | | /*< private > |
351 | | * cairo_list_is_singular: |
352 | | * @head: linked list |
353 | | * |
354 | | * Return %TRUE if @head has only one entry. |
355 | | **/ |
356 | | static inline cairo_bool_t |
357 | | cairo_list_is_singular (const cairo_list_t *head) |
358 | 0 | { |
359 | 0 | cairo_list_validate (head); |
360 | 0 | return head->next != head && head->next == head->prev; |
361 | 0 | } Unexecuted instantiation: cairo-pattern.c:cairo_list_is_singular Unexecuted instantiation: cairo-recording-surface.c:cairo_list_is_singular Unexecuted instantiation: cairo-scaled-font.c:cairo_list_is_singular Unexecuted instantiation: cairo-surface.c:cairo_list_is_singular Unexecuted instantiation: cairo-ft-font.c:cairo_list_is_singular Unexecuted instantiation: cairo-gstate.c:cairo_list_is_singular Unexecuted instantiation: cairo-image-source.c:cairo_list_is_singular Unexecuted instantiation: cairo-mask-compositor.c:cairo_list_is_singular Unexecuted instantiation: cairo-observer.c:cairo_list_is_singular Unexecuted instantiation: cairo-path-fixed.c:cairo_list_is_singular Unexecuted instantiation: cairo-spans-compositor.c:cairo_list_is_singular Unexecuted instantiation: cairo-traps-compositor.c:cairo_list_is_singular Unexecuted instantiation: cairo-pdf-surface.c:cairo_list_is_singular Unexecuted instantiation: cairo-pdf-interchange.c:cairo_list_is_singular Unexecuted instantiation: cairo-tag-attributes.c:cairo_list_is_singular Unexecuted instantiation: cairo-tag-stack.c:cairo_list_is_singular |
362 | | |
363 | | #endif /* CAIRO_LIST_INLINE_H */ |