1 /*
2 * Copyright (c) 2020
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <stdio.h>
24
26
31 };
32
37 };
38
40 {
45 }
46
48 {
50 if (!q)
52
55
61 }
62
68
69 return q;
70 }
71
73 {
75 if (!q)
76 return;
77
83 }
84
86 }
87
89 {
91 }
92
94 {
97
99 }
100
102 {
105
107 }
108
110 {
113 if (!q)
114 return 0;
115
117 if (!new_entry)
118 return -1;
120
122 original_next->
prev = new_entry;
124 new_entry->
next = original_next;
126
128 }
129
131 {
134 if (!q)
135 return 0;
136
138 if (!new_entry)
139 return -1;
141
143 original_prev->
next = new_entry;
145 new_entry->
prev = original_prev;
147
149 }
150
152 {
156
159
161 new_head_next = front->
next;
163
166
170 }
171
173 {
177
180
182 new_tail_prev = back->
prev;
184
187
191 }