… | |
… | |
26 | |
26 | |
27 | void **b_addr; |
27 | void **b_addr; |
28 | void **b_mmap; |
28 | void **b_mmap; |
29 | int *b_sz; |
29 | int *b_sz; |
30 | SV **b_sv; |
30 | SV **b_sv; |
31 | } *Convert__FEC; |
31 | } *Algorithm__FEC; |
32 | |
32 | |
33 | static void |
33 | static void |
34 | chk_array (SV *sv, int size, const char *func, const char *var) |
34 | chk_array (SV *sv, int size, const char *func, const char *var) |
35 | { |
35 | { |
36 | if (!SvROK (sv) |
36 | if (!SvROK (sv) |
… | |
… | |
140 | |
140 | |
141 | for (i = 0; i < self->dp; i++) |
141 | for (i = 0; i < self->dp; i++) |
142 | open_file (self, i, *av_fetch (av, i, 1), rw); |
142 | open_file (self, i, *av_fetch (av, i, 1), rw); |
143 | } |
143 | } |
144 | |
144 | |
145 | MODULE = Convert::FEC PACKAGE = Convert::FEC |
145 | MODULE = Algorithm::FEC PACKAGE = Algorithm::FEC |
146 | |
146 | |
147 | PROTOTYPES: ENABLE |
147 | PROTOTYPES: ENABLE |
148 | |
148 | |
149 | Convert::FEC |
149 | Algorithm::FEC |
150 | new(class, data_packets, encoded_packets, blocksize) |
150 | new(class, data_packets, encoded_packets, blocksize) |
151 | SV * class |
151 | SV * class |
152 | int data_packets |
152 | int data_packets |
153 | int encoded_packets |
153 | int encoded_packets |
154 | int blocksize |
154 | int blocksize |
… | |
… | |
180 | OUTPUT: |
180 | OUTPUT: |
181 | RETVAL |
181 | RETVAL |
182 | |
182 | |
183 | void |
183 | void |
184 | set_blocks (self, blocks) |
184 | set_blocks (self, blocks) |
185 | Convert::FEC self |
185 | Algorithm::FEC self |
186 | SV * blocks |
186 | SV * blocks |
187 | CODE: |
187 | CODE: |
188 | |
188 | |
189 | free_files (self); |
189 | free_files (self); |
190 | |
190 | |
… | |
… | |
194 | open_files (self, (AV *)SvRV (blocks), 0); |
194 | open_files (self, (AV *)SvRV (blocks), 0); |
195 | } |
195 | } |
196 | |
196 | |
197 | SV * |
197 | SV * |
198 | encode (self, block_index) |
198 | encode (self, block_index) |
199 | Convert::FEC self |
199 | Algorithm::FEC self |
200 | int block_index |
200 | int block_index |
201 | CODE: |
201 | CODE: |
202 | |
202 | |
203 | if (block_index < 0 || self->ep <= block_index) |
203 | if (block_index < 0 || self->ep <= block_index) |
204 | croak ("encode: block_index %d out of range, must be 0 <= block_index < %d", |
204 | croak ("encode: block_index %d out of range, must be 0 <= block_index < %d", |
… | |
… | |
221 | OUTPUT: |
221 | OUTPUT: |
222 | RETVAL |
222 | RETVAL |
223 | |
223 | |
224 | void |
224 | void |
225 | decode (self, blocks, indices) |
225 | decode (self, blocks, indices) |
226 | Convert::FEC self |
226 | Algorithm::FEC self |
227 | SV * blocks |
227 | SV * blocks |
228 | SV * indices |
228 | SV * indices |
229 | CODE: |
229 | CODE: |
230 | { |
230 | { |
231 | int i; |
231 | int i; |
… | |
… | |
288 | free_files (self); |
288 | free_files (self); |
289 | } |
289 | } |
290 | |
290 | |
291 | void |
291 | void |
292 | copy (self, srcblock, dstblock) |
292 | copy (self, srcblock, dstblock) |
293 | Convert::FEC self |
293 | Algorithm::FEC self |
294 | SV * srcblock |
294 | SV * srcblock |
295 | SV * dstblock |
295 | SV * dstblock |
296 | CODE: |
296 | CODE: |
297 | realloc_files (self); |
297 | realloc_files (self); |
298 | open_file (self, 0, srcblock, 0); |
298 | open_file (self, 0, srcblock, 0); |
… | |
… | |
301 | Copy (self->b_addr[0], self->b_addr[1], self->sz, char); |
301 | Copy (self->b_addr[0], self->b_addr[1], self->sz, char); |
302 | free_files (self); |
302 | free_files (self); |
303 | |
303 | |
304 | void |
304 | void |
305 | DESTROY(self) |
305 | DESTROY(self) |
306 | Convert::FEC self |
306 | Algorithm::FEC self |
307 | CODE: |
307 | CODE: |
308 | self->imp->fec_free (self->code); |
308 | self->imp->fec_free (self->code); |
309 | free_files (self); |
309 | free_files (self); |
310 | Safefree(self); |
310 | Safefree(self); |
311 | |
311 | |