Commit 3aaf52b7 authored by Brice Videau's avatar Brice Videau

Define a const_excit_t type.

parent 2d727486
Pipeline #10094 failed with stages
in 4 seconds
......@@ -27,7 +27,7 @@ static void composition_it_free(excit_t data)
excit_free(it->indexer);
}
static int composition_it_copy(excit_t dst, const excit_t src)
static int composition_it_copy(excit_t dst, const_excit_t src)
{
const struct composition_it_s *it = (const struct composition_it_s *)src->data;
struct composition_it_s *result = (struct composition_it_s *)dst->data;
......@@ -54,7 +54,7 @@ static int composition_it_next(excit_t data, ssize_t *indexes)
return excit_nth(it->src, n, indexes);
}
static int composition_it_peek(const excit_t data, ssize_t *indexes)
static int composition_it_peek(const_excit_t data, ssize_t *indexes)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
ssize_t n;
......@@ -65,7 +65,7 @@ static int composition_it_peek(const excit_t data, ssize_t *indexes)
return excit_nth(it->src, n, indexes);
}
static int composition_it_size(const excit_t data, ssize_t *size)
static int composition_it_size(const_excit_t data, ssize_t *size)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
......@@ -79,7 +79,7 @@ static int composition_it_rewind(excit_t data)
return excit_rewind(it->indexer);
}
static int composition_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
static int composition_it_nth(const_excit_t data, ssize_t n, ssize_t *indexes)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
ssize_t p;
......@@ -90,7 +90,7 @@ static int composition_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
return excit_nth(it->src, p, indexes);
}
static int composition_it_rank(const excit_t data, const ssize_t *indexes,
static int composition_it_rank(const_excit_t data, const ssize_t *indexes,
ssize_t *n)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
......@@ -102,14 +102,14 @@ static int composition_it_rank(const excit_t data, const ssize_t *indexes,
return excit_rank(it->indexer, &inner_n, n);
}
static int composition_it_pos(const excit_t data, ssize_t *n)
static int composition_it_pos(const_excit_t data, ssize_t *n)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
return excit_pos(it->indexer, n);
}
static int composition_it_split(const excit_t data, ssize_t n, excit_t *results)
static int composition_it_split(const_excit_t data, ssize_t n, excit_t *results)
{
const struct composition_it_s *it = (const struct composition_it_s *)data->data;
int err = excit_split(it->indexer, n, results);
......
......@@ -56,7 +56,7 @@ static void cons_it_free(excit_t data)
free(it->fifo.buffer);
}
static int cons_it_copy(excit_t ddst, const excit_t dsrc)
static int cons_it_copy(excit_t ddst, const_excit_t dsrc)
{
struct cons_it_s *dst = (struct cons_it_s *)ddst->data;
const struct cons_it_s *src = (const struct cons_it_s *)dsrc->data;
......@@ -81,7 +81,7 @@ static int cons_it_copy(excit_t ddst, const excit_t dsrc)
return EXCIT_SUCCESS;
}
static int cons_it_size(const excit_t data, ssize_t *size)
static int cons_it_size(const_excit_t data, ssize_t *size)
{
const struct cons_it_s *it = (const struct cons_it_s *)data->data;
ssize_t tmp_size = 0;
......@@ -93,7 +93,7 @@ static int cons_it_size(const excit_t data, ssize_t *size)
return EXCIT_SUCCESS;
}
static int cons_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
static int cons_it_nth(const_excit_t data, ssize_t n, ssize_t *indexes)
{
ssize_t size;
int err = cons_it_size(data, &size);
......@@ -115,7 +115,7 @@ static int cons_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int cons_it_rank(const excit_t data, const ssize_t *indexes,
static int cons_it_rank(const_excit_t data, const ssize_t *indexes,
ssize_t *n)
{
const struct cons_it_s *it = (const struct cons_it_s *)data->data;
......@@ -139,7 +139,7 @@ static int cons_it_rank(const excit_t data, const ssize_t *indexes,
return EXCIT_SUCCESS;
}
static int cons_it_pos(const excit_t data, ssize_t *n)
static int cons_it_pos(const_excit_t data, ssize_t *n)
{
ssize_t inner_n;
const struct cons_it_s *it = (const struct cons_it_s *)data->data;
......@@ -152,7 +152,7 @@ static int cons_it_pos(const excit_t data, ssize_t *n)
return EXCIT_SUCCESS;
}
static int cons_it_peek(const excit_t data, ssize_t *indexes)
static int cons_it_peek(const_excit_t data, ssize_t *indexes)
{
const struct cons_it_s *it = (const struct cons_it_s *)data->data;
int err;
......
......@@ -83,7 +83,7 @@ int excit_set_func_table(excit_t it, const struct excit_func_table_s *func_table
return EXCIT_SUCCESS;
}
int excit_get_func_table(excit_t it, const struct excit_func_table_s **func_table)
int excit_get_func_table(const_excit_t it, const struct excit_func_table_s **func_table)
{
if (!it)
return -EXCIT_EINVAL;
......@@ -169,7 +169,7 @@ error:
return NULL;
}
excit_t excit_dup(excit_t it)
excit_t excit_dup(const_excit_t it)
{
excit_t result = NULL;
......@@ -199,7 +199,7 @@ error:
free(it);
}
int excit_dimension(excit_t it, ssize_t *dimension)
int excit_dimension(const_excit_t it, ssize_t *dimension)
{
if (!it || !dimension)
return -EXCIT_EINVAL;
......@@ -207,7 +207,7 @@ int excit_dimension(excit_t it, ssize_t *dimension)
return EXCIT_SUCCESS;
}
int excit_type(excit_t it, enum excit_type_e *type)
int excit_type(const_excit_t it, enum excit_type_e *type)
{
if (!it || !type)
return -EXCIT_EINVAL;
......@@ -224,7 +224,7 @@ int excit_next(excit_t it, ssize_t *indexes)
return it->func_table->next(it, indexes);
}
int excit_peek(const excit_t it, ssize_t *indexes)
int excit_peek(const_excit_t it, ssize_t *indexes)
{
if (!it || !it->func_table)
return -EXCIT_EINVAL;
......@@ -233,7 +233,7 @@ int excit_peek(const excit_t it, ssize_t *indexes)
return it->func_table->peek(it, indexes);
}
int excit_size(const excit_t it, ssize_t *size)
int excit_size(const_excit_t it, ssize_t *size)
{
if (!it || !it->func_table || !size)
return -EXCIT_EINVAL;
......@@ -251,7 +251,7 @@ int excit_rewind(excit_t it)
return it->func_table->rewind(it);
}
int excit_split(const excit_t it, ssize_t n, excit_t *results)
int excit_split(const_excit_t it, ssize_t n, excit_t *results)
{
if (!it || !it->func_table)
return -EXCIT_EINVAL;
......@@ -307,7 +307,7 @@ error1:
return it->func_table->split(it, n, results);
}
int excit_nth(const excit_t it, ssize_t n, ssize_t *indexes)
int excit_nth(const_excit_t it, ssize_t n, ssize_t *indexes)
{
if (!it || !it->func_table)
return -EXCIT_EINVAL;
......@@ -316,7 +316,7 @@ int excit_nth(const excit_t it, ssize_t n, ssize_t *indexes)
return it->func_table->nth(it, n, indexes);
}
int excit_rank(const excit_t it, const ssize_t *indexes, ssize_t *n)
int excit_rank(const_excit_t it, const ssize_t *indexes, ssize_t *n)
{
if (!it || !it->func_table || !indexes)
return -EXCIT_EINVAL;
......@@ -325,7 +325,7 @@ int excit_rank(const excit_t it, const ssize_t *indexes, ssize_t *n)
return it->func_table->rank(it, indexes, n);
}
int excit_pos(const excit_t it, ssize_t *n)
int excit_pos(const_excit_t it, ssize_t *n)
{
if (!it || !it->func_table)
return -EXCIT_EINVAL;
......
......@@ -128,6 +128,7 @@ const char *excit_error_name(enum excit_error_e err);
* Opaque structure of an iterator
*/
typedef struct excit_s *excit_t;
typedef const struct excit_s *const_excit_t;
/*******************************************************************************
* Programming interface for user-defined iterators:
......@@ -181,7 +182,7 @@ struct excit_func_table_s {
* calls to excit_next() must return the same results for both iterators.
* Returns EXCIT_SUCCESS or an error code.
*/
int (*copy)(excit_t dst_it, const excit_t src_it);
int (*copy)(excit_t dst_it, const_excit_t src_it);
/*
* This function is responsible for implementing the succession functionality
* of the iterator.
......@@ -193,13 +194,13 @@ struct excit_func_table_s {
* of the iterator.
* Returns EXCIT_SUCCESS, EXCIT_STOPIT or an error code.
*/
int (*peek)(const excit_t it, ssize_t *indexes);
int (*peek)(const_excit_t it, ssize_t *indexes);
/*
* This function is responsible for implementing the size functionality
* of the iterator.
* Returns EXCIT_SUCCESS or an error code.
*/
int (*size)(const excit_t it, ssize_t *size);
int (*size)(const_excit_t it, ssize_t *size);
/*
* This function is responsible for implementing the rewind
* functionality of the iterator.
......@@ -211,25 +212,25 @@ struct excit_func_table_s {
* functionality of the iterator.
* Returns EXCIT_SUCCESS or an error code.
*/
int (*split)(const excit_t it, ssize_t n, excit_t *results);
int (*split)(const_excit_t it, ssize_t n, excit_t *results);
/*
* This function is responsible for implementing the nth functionality
* of the iterator.
* Returns EXCIT_SUCCESS or an error code.
*/
int (*nth)(const excit_t it, ssize_t n, ssize_t *indexes);
int (*nth)(const_excit_t it, ssize_t n, ssize_t *indexes);
/*
* This function is responsible for implementing the rank functionality
* of the iterator.
* Returns EXCIT_SUCCESS or an error code.
*/
int (*rank)(const excit_t it, const ssize_t *indexes, ssize_t *n);
int (*rank)(const_excit_t it, const ssize_t *indexes, ssize_t *n);
/*
* This function is responsible for implementing the pos functionality
* of the iterator.
* Returns EXCIT_SUCCESS, EXCIT_STOPIT or an error code.
*/
int (*pos)(const excit_t it, ssize_t *n);
int (*pos)(const_excit_t it, ssize_t *n);
};
/*
......@@ -247,7 +248,7 @@ int excit_set_func_table(excit_t it, const struct excit_func_table_s *func_table
* stored.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_get_func_table(const excit_t it, const struct excit_func_table_s **func_table);
int excit_get_func_table(const_excit_t it, const struct excit_func_table_s **func_table);
/*
* Allocates a new iterator of the given type.
......@@ -273,7 +274,7 @@ excit_t excit_alloc_user(const struct excit_func_table_s *func_table,
* Returns an iterator (that will need to be freed unless ownership is
* transferred) or NULL if an error occurred.
*/
excit_t excit_dup(const excit_t it);
excit_t excit_dup(const_excit_t it);
/*
* Frees an iterator and all the iterators it acquired ownership to.
......@@ -287,7 +288,7 @@ void excit_free(excit_t it);
* "type": a pointer to the variable where the result will be stored.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_type(const excit_t it, enum excit_type_e *type);
int excit_type(const_excit_t it, enum excit_type_e *type);
/*
* Get the dimension of an iterator. This is the number of elements of the array
......@@ -296,7 +297,7 @@ int excit_type(const excit_t it, enum excit_type_e *type);
* "dimension": a pointer to the variable where the result will be stored.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_dimension(const excit_t it, ssize_t *dimension);
int excit_dimension(const_excit_t it, ssize_t *dimension);
/*
* Gets the current element of an iterator and increments it.
......@@ -318,7 +319,7 @@ int excit_next(excit_t it, ssize_t *indexes);
* Returns EXCIT_SUCCESS if a valid element was returned, EXCIT_STOPIT if the
* iterator is depleted, or an error code.
*/
int excit_peek(const excit_t it, ssize_t *indexes);
int excit_peek(const_excit_t it, ssize_t *indexes);
/*
* Rewinds an iterator to its initial state.
......@@ -333,7 +334,7 @@ int excit_rewind(excit_t it);
* "size": a pointer to the variable where the result will be stored.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_size(const excit_t it, ssize_t *size);
int excit_size(const_excit_t it, ssize_t *size);
/*
* Splits an iterator evenly into several subiterators.
......@@ -344,7 +345,7 @@ int excit_size(const excit_t it, ssize_t *size);
* Returns EXCIT_SUCCESS, -EXCIT_EDOM if the source iterator is too small to be
* subdivided into the desired number of subiterators, or an error code.
*/
int excit_split(const excit_t it, ssize_t n, excit_t *results);
int excit_split(const_excit_t it, ssize_t n, excit_t *results);
/*
* Gets the nth element of an iterator. If an iterator has k dimensions,
......@@ -357,7 +358,7 @@ int excit_split(const excit_t it, ssize_t n, excit_t *results);
* is returned if NULL.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_nth(const excit_t it, ssize_t rank, ssize_t *indexes);
int excit_nth(const_excit_t it, ssize_t rank, ssize_t *indexes);
/*
* Gets the rank of an element of an iterator. The rank of an element is its
......@@ -370,7 +371,7 @@ int excit_nth(const excit_t it, ssize_t rank, ssize_t *indexes);
* returned if NULL.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_rank(const excit_t it, const ssize_t *element, ssize_t *rank);
int excit_rank(const_excit_t it, const ssize_t *element, ssize_t *rank);
/*
* Gets the position of the iterator.
......@@ -380,7 +381,7 @@ int excit_rank(const excit_t it, const ssize_t *element, ssize_t *rank);
* Returns EXCIT_SUCCESS, EXCIT_STOPIT if the iterator is depleted, or an error
* code.
*/
int excit_pos(const excit_t it, ssize_t *rank);
int excit_pos(const_excit_t it, ssize_t *rank);
/*
* Increments the iterator.
......@@ -450,7 +451,7 @@ int excit_repeat_init(excit_t it, excit_t src, ssize_t n);
* Returns EXCIT_SUCCESS, -EXCIT_EDOM if the selected iterator is too small to
* be subdivided in the desired number of iterators, or an error code.
*/
int excit_repeat_split(const excit_t it, ssize_t n, excit_t *results);
int excit_repeat_split(const_excit_t it, ssize_t n, excit_t *results);
/*
* Creates a two-dimensional Hilbert space-filling curve iterator.
......@@ -483,7 +484,7 @@ int excit_product_add_copy(excit_t it, excit_t added_it);
* "count": a pointer to a variable where the result will be stored.
* Returns EXCIT_SUCCESS or an error code.
*/
int excit_product_count(const excit_t it, ssize_t *count);
int excit_product_count(const_excit_t it, ssize_t *count);
/*
* Splits a product iterator along the nth iterator.
......@@ -496,7 +497,7 @@ int excit_product_count(const excit_t it, ssize_t *count);
* Returns EXCIT_SUCCESS, -EXCIT_EDOM if the selected iterator is too small to
* be subdivided into the desired number of iterators, or an error code.
*/
int excit_product_split_dim(const excit_t it, ssize_t dim, ssize_t n,
int excit_product_split_dim(const_excit_t it, ssize_t dim, ssize_t n,
excit_t *results);
/*
......@@ -540,7 +541,7 @@ enum tleaf_it_policy_e {
int excit_tleaf_init(excit_t it,
ssize_t depth,
const ssize_t *arities,
const excit_t *index,
excit_t *index,
enum tleaf_it_policy_e policy,
const ssize_t *user_policy);
......@@ -554,6 +555,6 @@ int excit_tleaf_init(excit_t it,
* Returns EXCIT_SUCCESS, -EXCIT_EDOM if the arity of the selected level is too small to
* be subdivided into the desired number of iterators, or an error code.
*/
int tleaf_it_split(const excit_t it, ssize_t level, ssize_t n, excit_t *out);
int tleaf_it_split(const_excit_t it, ssize_t level, ssize_t n, excit_t *out);
#endif
......@@ -76,7 +76,7 @@ static void hilbert2d_it_free(excit_t data)
excit_free(it->range_it);
}
static int hilbert2d_it_copy(excit_t ddst, const excit_t dsrc)
static int hilbert2d_it_copy(excit_t ddst, const_excit_t dsrc)
{
struct hilbert2d_it_s *dst = (struct hilbert2d_it_s *)ddst->data;
const struct hilbert2d_it_s *src =
......@@ -97,7 +97,7 @@ static int hilbert2d_it_rewind(excit_t data)
return excit_rewind(it->range_it);
}
static int hilbert2d_it_peek(const excit_t data, ssize_t *val)
static int hilbert2d_it_peek(const_excit_t data, ssize_t *val)
{
struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
ssize_t d;
......@@ -124,13 +124,13 @@ static int hilbert2d_it_next(excit_t data, ssize_t *val)
return EXCIT_SUCCESS;
}
static int hilbert2d_it_size(const excit_t data, ssize_t *size)
static int hilbert2d_it_size(const_excit_t data, ssize_t *size)
{
const struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
return excit_size(it->range_it, size);
}
static int hilbert2d_it_nth(const excit_t data, ssize_t n, ssize_t *val)
static int hilbert2d_it_nth(const_excit_t data, ssize_t n, ssize_t *val)
{
ssize_t d;
struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
......@@ -143,7 +143,7 @@ static int hilbert2d_it_nth(const excit_t data, ssize_t n, ssize_t *val)
return EXCIT_SUCCESS;
}
static int hilbert2d_it_rank(const excit_t data, const ssize_t *indexes,
static int hilbert2d_it_rank(const_excit_t data, const ssize_t *indexes,
ssize_t *n)
{
struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
......@@ -156,14 +156,14 @@ static int hilbert2d_it_rank(const excit_t data, const ssize_t *indexes,
return excit_rank(it->range_it, &d, n);
}
static int hilbert2d_it_pos(const excit_t data, ssize_t *n)
static int hilbert2d_it_pos(const_excit_t data, ssize_t *n)
{
struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
return excit_pos(it->range_it, n);
}
static int hilbert2d_it_split(const excit_t data, ssize_t n, excit_t *results)
static int hilbert2d_it_split(const_excit_t data, ssize_t n, excit_t *results)
{
const struct hilbert2d_it_s *it = (struct hilbert2d_it_s *)data->data;
int err = excit_split(it->range_it, n, results);
......
......@@ -94,7 +94,7 @@ static void index_it_free(excit_t it)
free(data_it->index);
}
static int index_it_size(const excit_t it, ssize_t *size)
static int index_it_size(const_excit_t it, ssize_t *size)
{
struct index_it_s *data_it = it->data;
......@@ -110,7 +110,7 @@ static int index_it_rewind(excit_t it)
return EXCIT_SUCCESS;
}
static int index_it_copy(excit_t dst_it, const excit_t src_it)
static int index_it_copy(excit_t dst_it, const_excit_t src_it)
{
int err = EXCIT_SUCCESS;
struct index_it_s *dst = dst_it->data;
......@@ -137,7 +137,7 @@ exit_with_values:
return err;
}
static int index_it_pos(const excit_t it, ssize_t *value)
static int index_it_pos(const_excit_t it, ssize_t *value)
{
if (value == NULL)
return EXCIT_SUCCESS;
......@@ -149,7 +149,7 @@ static int index_it_pos(const excit_t it, ssize_t *value)
return EXCIT_SUCCESS;
}
static int index_it_nth(const excit_t it, ssize_t n, ssize_t *indexes)
static int index_it_nth(const_excit_t it, ssize_t n, ssize_t *indexes)
{
struct index_it_s *data_it = it->data;
......@@ -161,7 +161,7 @@ static int index_it_nth(const excit_t it, ssize_t n, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int index_it_peek(const excit_t it, ssize_t *value)
static int index_it_peek(const_excit_t it, ssize_t *value)
{
struct index_it_s *data_it = it->data;
......@@ -185,7 +185,7 @@ static int index_it_next(excit_t it, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int index_it_rank(const excit_t it, const ssize_t *indexes, ssize_t *n)
static int index_it_rank(const_excit_t it, const ssize_t *indexes, ssize_t *n)
{
struct index_it_s *data_it = it->data;
......
......@@ -33,7 +33,7 @@ static void prod_it_free(excit_t data)
}
}
static int prod_it_copy(excit_t dst, const excit_t src)
static int prod_it_copy(excit_t dst, const_excit_t src)
{
const struct prod_it_s *it = (const struct prod_it_s *)src->data;
struct prod_it_s *result = (struct prod_it_s *)dst->data;
......@@ -80,7 +80,7 @@ static int prod_it_rewind(excit_t data)
return EXCIT_SUCCESS;
}
static int prod_it_size(const excit_t data, ssize_t *size)
static int prod_it_size(const_excit_t data, ssize_t *size)
{
const struct prod_it_s *it = (const struct prod_it_s *)data->data;
ssize_t tmp_size = 0;
......@@ -104,7 +104,7 @@ static int prod_it_size(const excit_t data, ssize_t *size)
return EXCIT_SUCCESS;
}
static int prod_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
static int prod_it_nth(const_excit_t data, ssize_t n, ssize_t *indexes)
{
ssize_t size;
int err = prod_it_size(data, &size);
......@@ -134,7 +134,7 @@ static int prod_it_nth(const excit_t data, ssize_t n, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int prod_it_rank(const excit_t data, const ssize_t *indexes,
static int prod_it_rank(const_excit_t data, const ssize_t *indexes,
ssize_t *n)
{
const struct prod_it_s *it = (const struct prod_it_s *)data->data;
......@@ -162,7 +162,7 @@ static int prod_it_rank(const excit_t data, const ssize_t *indexes,
return EXCIT_SUCCESS;
}
static int prod_it_pos(const excit_t data, ssize_t *n)
static int prod_it_pos(const_excit_t data, ssize_t *n)
{
const struct prod_it_s *it = (const struct prod_it_s *)data->data;
......@@ -188,7 +188,7 @@ static int prod_it_pos(const excit_t data, ssize_t *n)
return EXCIT_SUCCESS;
}
static inline int prod_it_peeknext_helper(excit_t data, ssize_t *indexes,
static inline int prod_it_peeknext_helper(const_excit_t data, ssize_t *indexes,
int next)
{
struct prod_it_s *it = (struct prod_it_s *)data->data;
......@@ -226,7 +226,7 @@ static inline int prod_it_peeknext_helper(excit_t data, ssize_t *indexes,
return EXCIT_SUCCESS;
}
static int prod_it_peek(const excit_t data, ssize_t *indexes)
static int prod_it_peek(const_excit_t data, ssize_t *indexes)
{
return prod_it_peeknext_helper(data, indexes, 0);
}
......@@ -236,7 +236,7 @@ static int prod_it_next(excit_t data, ssize_t *indexes)
return prod_it_peeknext_helper(data, indexes, 1);
}
int excit_product_count(const excit_t it, ssize_t *count)
int excit_product_count(const_excit_t it, ssize_t *count)
{
if (!it || it->type != EXCIT_PRODUCT || !count)
return -EXCIT_EINVAL;
......@@ -244,7 +244,7 @@ int excit_product_count(const excit_t it, ssize_t *count)
return EXCIT_SUCCESS;
}
int excit_product_split_dim(const excit_t it, ssize_t dim, ssize_t n,
int excit_product_split_dim(const_excit_t it, ssize_t dim, ssize_t n,
excit_t *results)
{
if (!it || it->type != EXCIT_PRODUCT)
......
......@@ -25,7 +25,7 @@ static void range_it_free(excit_t data)
{
}
static int range_it_copy(excit_t ddst, const excit_t dsrc)
static int range_it_copy(excit_t ddst, const_excit_t dsrc)
{
struct range_it_s *dst = (struct range_it_s *)ddst->data;
const struct range_it_s *src = (const struct range_it_s *)dsrc->data;
......@@ -45,7 +45,7 @@ static int range_it_rewind(excit_t data)
return EXCIT_SUCCESS;
}
static int range_it_peek(const excit_t data, ssize_t *val)
static int range_it_peek(const_excit_t data, ssize_t *val)
{
struct range_it_s *it = (struct range_it_s *)data->data;
......@@ -73,7 +73,7 @@ static int range_it_next(excit_t data, ssize_t *val)
return EXCIT_SUCCESS;
}
static int range_it_size(const excit_t data, ssize_t *size)
static int range_it_size(const_excit_t data, ssize_t *size)
{
const struct range_it_s *it = (struct range_it_s *)data->data;
......@@ -92,7 +92,7 @@ static int range_it_size(const excit_t data, ssize_t *size)
return EXCIT_SUCCESS;
}
static int range_it_nth(const excit_t data, ssize_t n, ssize_t *val)
static int range_it_nth(const_excit_t data, ssize_t n, ssize_t *val)
{
ssize_t size;
int err = range_it_size(data, &size);
......@@ -108,7 +108,7 @@ static int range_it_nth(const excit_t data, ssize_t n, ssize_t *val)
return EXCIT_SUCCESS;
}
static int range_it_rank(const excit_t data, const ssize_t *val, ssize_t *n)
static int range_it_rank(const_excit_t data, const ssize_t *val, ssize_t *n)
{
ssize_t size;
int err = range_it_size(data, &size);
......@@ -125,7 +125,7 @@ static int range_it_rank(const excit_t data, const ssize_t *val, ssize_t *n)
return EXCIT_SUCCESS;
}
static int range_it_pos(const excit_t data, ssize_t *n)
static int range_it_pos(const_excit_t data, ssize_t *n)
{
ssize_t val;
int err = range_it_peek(data, &val);
......@@ -139,7 +139,7 @@ static int range_it_pos(const excit_t data, ssize_t *n)
return EXCIT_SUCCESS;
}
static int range_it_split(const excit_t data, ssize_t n, excit_t *results)
static int range_it_split(const_excit_t data, ssize_t n, excit_t *results)
{
const struct range_it_s *it = (struct range_it_s *)data->data;
ssize_t size;
......
......@@ -27,7 +27,7 @@ static void repeat_it_free(excit_t data)
excit_free(it->it);
}
static int repeat_it_copy(excit_t ddst, const excit_t dsrc)
static int repeat_it_copy(excit_t ddst, const_excit_t dsrc)
{
struct repeat_it_s *dst = (struct repeat_it_s *)ddst->data;
const struct repeat_it_s *src = (const struct repeat_it_s *)dsrc->data;
......@@ -41,7 +41,7 @@ static int repeat_it_copy(excit_t ddst, const excit_t dsrc)
return EXCIT_SUCCESS;
}
static int repeat_it_peek(const excit_t data, ssize_t *indexes)
static int repeat_it_peek(const_excit_t data, ssize_t *indexes)
{
const struct repeat_it_s *it = (const struct repeat_it_s *)data->data;
......@@ -59,7 +59,7 @@ static int repeat_it_next(excit_t data, ssize_t *indexes)
return excit_next(it->it, indexes);
}
static int repeat_it_size(const excit_t data, ssize_t *size)
static int repeat_it_size(const_excit_t data, ssize_t *size)
{
const struct repeat_it_s *it = (const struct repeat_it_s *)data->data;
int err = excit_size(it->it, size);
......@@ -78,7 +78,7 @@ static int repeat_it_rewind(excit_t data)
return excit_rewind(it->it);
}
static int repeat_it_nth(const excit_t data, ssize_t n, ssize_t *val)
static int repeat_it_nth(const_excit_t data, ssize_t n, ssize_t *val)
{
ssize_t size;
int err = repeat_it_size(data, &size);
......@@ -92,7 +92,7 @@ static int repeat_it_nth(const excit_t data, ssize_t n, ssize_t *val)
return excit_nth(it->it, n / it->n, val);
}
static int repeat_it_pos(const excit_t data, ssize_t *n)
static int repeat_it_pos(const_excit_t data, ssize_t *n)
{
ssize_t inner_n;
const struct repeat_it_s *it = (const struct repeat_it_s *)data->data;
......@@ -132,7 +132,7 @@ int excit_repeat_init(excit_t it, excit_t src, ssize_t n)
return EXCIT_SUCCESS;
}
int excit_repeat_split(const excit_t data, ssize_t n, excit_t *results)
int excit_repeat_split(const_excit_t data, ssize_t n, excit_t *results)
{
const struct repeat_it_s *it = (const struct repeat_it_s *)data->data;
int err = excit_split(it->it, n, results);
......
......@@ -13,10 +13,10 @@
#include "tleaf.h"
static int tleaf_init_with_it(excit_t it,
const ssize_t depth,
ssize_t depth,
const ssize_t *arities,
const excit_t *indexes,
const enum tleaf_it_policy_e policy,
excit_t *indexes,
enum tleaf_it_policy_e policy,
const ssize_t *user_policy,
excit_t levels, excit_t levels_inverse);
......@@ -47,7 +47,7 @@ static void tleaf_it_free(excit_t it)
excit_free(data_it->levels_inverse);
}
static int tleaf_it_size(const excit_t it, ssize_t *size)
static int tleaf_it_size(const_excit_t it, ssize_t *size)
{
struct tleaf_it_s *data_it = it->data;
int err = excit_size(data_it->levels, size);
......@@ -64,7 +64,7 @@ static int tleaf_it_rewind(excit_t it)
return excit_rewind(data_it->levels);
}
static int tleaf_it_copy(excit_t dst_it, const excit_t src_it)
static int tleaf_it_copy(excit_t dst_it, const_excit_t src_it)
{
int err = EXCIT_SUCCESS;
struct tleaf_it_s *dst = dst_it->data;
......@@ -111,7 +111,7 @@ error:
return err;
}
static int tleaf_it_pos(const excit_t it, ssize_t *value)
static int tleaf_it_pos(const_excit_t it, ssize_t *value)
{
struct tleaf_it_s *data_it = it->data;
......@@ -130,7 +130,7 @@ static ssize_t tleaf_it_value(struct tleaf_it_s *it)
return val;
}
static int tleaf_it_nth(const excit_t it, ssize_t n, ssize_t *indexes)
static int tleaf_it_nth(const_excit_t it, ssize_t n, ssize_t *indexes)
{
struct tleaf_it_s *data_it = it->data;
int err = excit_nth(data_it->levels, n, data_it->buf);
......@@ -142,7 +142,7 @@ static int tleaf_it_nth(const excit_t it, ssize_t n, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int tleaf_it_peek(const excit_t it, ssize_t *value)
static int tleaf_it_peek(const_excit_t it, ssize_t *value)
{
struct tleaf_it_s *data_it = it->data;
int err = excit_peek(data_it->levels, data_it->buf);
......@@ -167,7 +167,7 @@ static int tleaf_it_next(excit_t it, ssize_t *indexes)
return EXCIT_SUCCESS;
}
static int tleaf_it_rank(const excit_t it, const ssize_t *indexes, ssize_t *n)
static int tleaf_it_rank(const_excit_t it, const ssize_t *indexes, ssize_t *n)
{
ssize_t size;
int err;
......@@ -197,7 +197,7 @@ static int tleaf_it_rank(const excit_t it, const ssize_t *indexes, ssize_t *n)