liberasurecode 1.8.0
Erasure Code API library
Loading...
Searching...
No Matches
isa_l_rs_cauchy.c
Go to the documentation of this file.
1/*
2 * Copyright 2014 Kevin M Greenan
3 * Copyright 2014 Tushar Gohad
4 * Copyright 2016 Kota Tsuyuzaki
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *
9 * Redistributions of source code must retain the above copyright notice, this
10 * list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright notice, this
13 * list of conditions and the following disclaimer in the documentation and/or
14 * other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY
15 * THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 * EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * isa_l_rs_cauchy backend implementation
27 *
28 * vi: set noai tw=79 ts=4 sw=4:
29 */
30
31#include <stdlib.h>
32#include "erasurecode_backend.h"
33#include "isa_l_common.h"
34
35#define ISA_L_RS_CAUCHY_LIB_MAJOR 2
36#define ISA_L_RS_CAUCHY_LIB_MINOR 14
37#define ISA_L_RS_CAUCHY_LIB_REV 1
38#define ISA_L_RS_CAUCHY_LIB_VER_STR "2.14"
39#define ISA_L_RS_CAUCHY_LIB_NAME "isa_l_rs_cauchy"
40#if defined(__MACOS__) || defined(__MACOSX__) || defined(__OSX__) || defined(__APPLE__)
41#define ISA_L_RS_CAUCHY_SO_NAME "libisal" LIBERASURECODE_SO_SUFFIX ".dylib"
42#else
43#define ISA_L_RS_CAUCHY_SO_NAME "libisal" LIBERASURECODE_SO_SUFFIX ".so.2"
44#endif
45
46/* Forward declarations */
47struct ec_backend_common backend_isa_l_rs_cauchy;
48
49static void * isa_l_rs_cauchy_init(struct ec_backend_args *args,
50 void *backend_sohandle)
51{
52 return isa_l_common_init(args, backend_sohandle, "gf_gen_cauchy1_matrix");
53}
54
55/*
56 * For the time being, we only claim compatibility with versions that
57 * match exactly
58 */
59static bool isa_l_rs_cauchy_is_compatible_with(uint32_t version) {
60 return version == backend_isa_l_rs_cauchy.ec_backend_version;
61}
62
63static struct ec_backend_op_stubs isa_l_rs_cauchy_op_stubs = {
65 .EXIT = isa_l_exit,
66 .ISSYSTEMATIC = 1,
67 .ENCODE = isa_l_encode,
68 .DECODE = isa_l_decode,
69 .FRAGSNEEDED = isa_l_min_fragments,
70 .RECONSTRUCT = isa_l_reconstruct,
71 .ELEMENTSIZE = isa_l_element_size,
72 .ISCOMPATIBLEWITH = isa_l_rs_cauchy_is_compatible_with,
73 .GETMETADATASIZE = get_backend_metadata_size_zero,
74 .GETENCODEOFFSET = get_encode_offset_zero,
75};
76
77__attribute__ ((visibility ("internal")))
78struct ec_backend_common backend_isa_l_rs_cauchy = {
79 .id = EC_BACKEND_ISA_L_RS_CAUCHY,
82 .soversion = ISA_L_RS_CAUCHY_LIB_VER_STR,
84 .ec_backend_version = _VERSION(ISA_L_RS_CAUCHY_LIB_MAJOR,
87};
static void * isa_l_rs_cauchy_init(struct ec_backend_args *args, void *backend_sohandle)
#define ISA_L_RS_CAUCHY_SO_NAME
static bool isa_l_rs_cauchy_is_compatible_with(uint32_t version)
#define ISA_L_RS_CAUCHY_LIB_REV
struct ec_backend_common backend_isa_l_rs_cauchy
static struct ec_backend_op_stubs isa_l_rs_cauchy_op_stubs
#define ISA_L_RS_CAUCHY_LIB_NAME
__attribute__((visibility("internal")))
#define ISA_L_RS_CAUCHY_LIB_VER_STR
#define ISA_L_RS_CAUCHY_LIB_MINOR
#define ISA_L_RS_CAUCHY_LIB_MAJOR