liberasurecode
1.6.2
Erasure Code API library
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "xor_code.h"
Go to the source code of this file.
Functions | |
int | is_data_in_parity (int data_idx, unsigned int parity_bm) |
int | does_parity_have_data (int parity_idx, unsigned int data_bm) |
int | parity_bit_lookup (xor_code_t *code_desc, int index) |
int | data_bit_lookup (xor_code_t *code_desc, int index) |
int | missing_elements_bm (xor_code_t *code_desc, int *missing_elements, int(*bit_lookup_func)(xor_code_t *code_desc, int index)) |
failure_pattern_t | get_failure_pattern (xor_code_t *code_desc, int *missing_idxs) |
void | fast_memcpy (char *dst, char *src, int size) |
void | xor_bufs_and_store (char *buf1, char *buf2, int blocksize) |
void | xor_code_encode (xor_code_t *code_desc, char **data, char **parity, int blocksize) |
void | selective_encode (xor_code_t *code_desc, char **data, char **parity, int *missing_parity, int blocksize) |
int * | get_missing_parity (xor_code_t *code_desc, int *missing_idxs) |
int * | get_missing_data (xor_code_t *code_desc, int *missing_idxs) |
void | xor_reconstruct_one (xor_code_t *code_desc, char **data, char **parity, int *missing_idxs, int index_to_reconstruct, int blocksize) |
int | num_missing_data_in_parity (xor_code_t *code_desc, int parity_idx, int *missing_data) |
int | index_of_connected_parity (xor_code_t *code_desc, int data_index, int *missing_parity, int *missing_data) |
void | remove_from_missing_list (int element, int *missing_list) |
Variables | |
const int | g_bit_lookup [] |
int data_bit_lookup | ( | xor_code_t * | code_desc, |
int | index | ||
) |
Definition at line 58 of file xor_code.c.
References g_bit_lookup.
Referenced by xor_hd_fragments_needed().
int does_parity_have_data | ( | int | parity_idx, |
unsigned int | data_bm | ||
) |
Definition at line 48 of file xor_code.c.
References g_bit_lookup.
Referenced by num_missing_data_in_parity().
void fast_memcpy | ( | char * | dst, |
char * | src, | ||
int | size | ||
) |
Definition at line 130 of file xor_code.c.
Referenced by decode_one_data(), decode_three_data(), decode_two_data(), and xor_reconstruct_one().
failure_pattern_t get_failure_pattern | ( | xor_code_t * | code_desc, |
int * | missing_idxs | ||
) |
Definition at line 76 of file xor_code.c.
Referenced by xor_hd_decode(), and xor_hd_fragments_needed().
int* get_missing_data | ( | xor_code_t * | code_desc, |
int * | missing_idxs | ||
) |
Definition at line 225 of file xor_code.c.
Referenced by fragments_needed_one_data_local(), xor_hd_decode(), xor_hd_fragments_needed(), and xor_reconstruct_one().
int* get_missing_parity | ( | xor_code_t * | code_desc, |
int * | missing_idxs | ||
) |
Definition at line 208 of file xor_code.c.
Referenced by fragments_needed_one_data_local(), xor_hd_decode(), xor_hd_fragments_needed(), and xor_reconstruct_one().
int index_of_connected_parity | ( | xor_code_t * | code_desc, |
int | data_index, | ||
int * | missing_parity, | ||
int * | missing_data | ||
) |
Definition at line 328 of file xor_code.c.
References is_data_in_parity(), is_missing(), and num_missing_data_in_parity().
Referenced by decode_one_data(), decode_three_data(), decode_two_data(), fragments_needed_one_data(), fragments_needed_one_data_local(), fragments_needed_three_data(), fragments_needed_two_data(), and xor_reconstruct_one().
int is_data_in_parity | ( | int | data_idx, |
unsigned int | parity_bm | ||
) |
Definition at line 43 of file xor_code.c.
References g_bit_lookup.
Referenced by decode_one_data(), decode_three_data(), decode_two_data(), fragments_needed_three_data(), index_of_connected_parity(), selective_encode(), and xor_code_encode().
int missing_elements_bm | ( | xor_code_t * | code_desc, |
int * | missing_elements, | ||
int(*)(xor_code_t *code_desc, int index) | bit_lookup_func | ||
) |
Definition at line 63 of file xor_code.c.
Referenced by xor_hd_fragments_needed().
int num_missing_data_in_parity | ( | xor_code_t * | code_desc, |
int | parity_idx, | ||
int * | missing_data | ||
) |
Definition at line 309 of file xor_code.c.
References does_parity_have_data().
Referenced by decode_three_data(), fragments_needed_three_data(), index_of_connected_parity(), and xor_reconstruct_one().
int parity_bit_lookup | ( | xor_code_t * | code_desc, |
int | index | ||
) |
Definition at line 53 of file xor_code.c.
References g_bit_lookup.
void remove_from_missing_list | ( | int | element, |
int * | missing_list | ||
) |
Definition at line 363 of file xor_code.c.
Referenced by decode_three_data(), and fragments_needed_three_data().
void selective_encode | ( | xor_code_t * | code_desc, |
char ** | data, | ||
char ** | parity, | ||
int * | missing_parity, | ||
int | blocksize | ||
) |
Definition at line 193 of file xor_code.c.
References is_data_in_parity(), and xor_bufs_and_store().
Referenced by xor_hd_decode().
void xor_bufs_and_store | ( | char * | buf1, |
char * | buf2, | ||
int | blocksize | ||
) |
Definition at line 141 of file xor_code.c.
Referenced by decode_one_data(), decode_three_data(), decode_two_data(), selective_encode(), xor_code_encode(), and xor_reconstruct_one().
void xor_code_encode | ( | xor_code_t * | code_desc, |
char ** | data, | ||
char ** | parity, | ||
int | blocksize | ||
) |
Definition at line 180 of file xor_code.c.
References is_data_in_parity(), and xor_bufs_and_store().
Referenced by init_xor_hd_code().
void xor_reconstruct_one | ( | xor_code_t * | code_desc, |
char ** | data, | ||
char ** | parity, | ||
int * | missing_idxs, | ||
int | index_to_reconstruct, | ||
int | blocksize | ||
) |
Definition at line 245 of file xor_code.c.
References fast_memcpy(), get_missing_data(), get_missing_parity(), index_of_connected_parity(), num_missing_data_in_parity(), and xor_bufs_and_store().
Referenced by flat_xor_hd_reconstruct().
const int g_bit_lookup[] |
Definition at line 34 of file xor_code.c.
Referenced by data_bit_lookup(), does_parity_have_data(), is_data_in_parity(), and parity_bit_lookup().