Skip to content

Commit

Permalink
refactor: use plural instead as Slice-suffix as default for slice types
Browse files Browse the repository at this point in the history
  • Loading branch information
aiq committed Sep 1, 2024
1 parent ddc1091 commit 4f8946f
Show file tree
Hide file tree
Showing 51 changed files with 533 additions and 492 deletions.
8 changes: 4 additions & 4 deletions doc/clingo/container/CInt64Vec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ include::{docroot}/clingo/_tmpl/ValVec.adoc[]
----
#define add_many_to_int64_vec_c_( Vec, ... ) \
add_many_to_int64_vec_c( \
(Vec), (cInt64Slice)slice_c_( int64_t, __VA_ARGS__ ) \
(Vec), (cInt64s)slice_c_( int64_t, __VA_ARGS__ ) \
)
bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64Slice many );
bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64s many );
----
Adds all int64_t values from the slice to the int64_t vector.
==== slice_of_int64_vec_c
[source,c]
----
cInt64Slice slice_of_int64_vec_c( CInt64Vec const* vec );
cInt64s slice_of_int64_vec_c( CInt64Vec const* vec );
----
Via the macro link:vec.html#SLICE_OF_VEC_C_[SLICE_OF_VEC_C_] implemented function.
==== var_slice_of_int64_vec_c
[source,c]
----
cVarInt64Slice var_slice_of_int64_vec_c( CInt64Vec* vec );
cVarInt64s var_slice_of_int64_vec_c( CInt64Vec* vec );
----
Via the macro link:vec.html#VAR_SLICE_OF_VEC_C_[VAR_SLICE_OF_VEC_C_] implemented function.
2 changes: 1 addition & 1 deletion doc/clingo/container/map.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Fibonacci Hash function.
==== combine_hashes_c
[source,c]
----
uint64_t combine_hashes_c( cUint64Slice hashes );
uint64_t combine_hashes_c( cUint64s hashes );
----
Combines single hash values to one hash value.
Expand Down
8 changes: 4 additions & 4 deletions doc/clingo/lang/slice.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ to variable data.
| cVarChars

| int8_t
| cInt8Slice
| cVarInt8Slice
| cInt8s
| cVarInt8s
|====

This module defines code generation macros to generate typed slice structs.
Expand Down Expand Up @@ -64,8 +64,8 @@ The following call can be used in a .h or .c file.
----
SLICES_C_(
int8_t, // Type
cInt8Slice, // SliceType
cVarInt8Slice // VarSliceType
cInt8s, // SliceType
cVarInt8s // VarSliceType
)
----
Expand Down
22 changes: 11 additions & 11 deletions doc/clingo/type/double.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ cDoubleInfo represents the three sections of a double value.
//******************************************************************* Generated
=== Generated
[id='cDoubleSlice']
==== cDoubleSlice
[id='cDoubles']
==== cDoubles
:Slice-Type: double const
:Slice-Slice: cDoubleSlice
:Slice-Slice: cDoubles
include::{docroot}/clingo/_tmpl/Slice.adoc[]
[id='cVarDoubleSlice']
==== cVarDoubleSlice
[id='cVarDoubles']
==== cVarDoubles
:Slice-Type: double
:Slice-Slice: cVarDoubleSlice
:Slice-Slice: cVarDoubles
include::{docroot}/clingo/_tmpl/Slice.adoc[]
//******************************************************************************
Expand Down Expand Up @@ -207,39 +207,39 @@ include::{xmpldir}/unpack_double.c[]
==== find_double_c
[source,c]
----
double const* find_double_c( cDoubleSlice slice, double d );
double const* find_double_c( cDoubles slice, double d );
----
{FindVal}
==== max_double_c
[source,c]
----
double const* max_double_c( cDoubleSlice slice );
double const* max_double_c( cDoubles slice );
----
{FindMax}
==== min_double_c
[source,c]
----
double const* min_double_c( cDoubleSlice slice );
double const* min_double_c( cDoubles slice );
----
{FindMin}
==== prod_double_c
[source,c]
----
bool prod_double_c( cDoubleSlice slice, double res[static 1] );
bool prod_double_c( cDoubles slice, double res[static 1] );
----
{Prod}
==== sum_double_c
[source,c]
----
bool sum_double_c( cDoubleSlice slice, double res[static 1] );
bool sum_double_c( cDoubles slice, double res[static 1] );
----
{Sum}
22 changes: 11 additions & 11 deletions doc/clingo/type/float.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ cFloatInfo represents the three sections of a float value.
//******************************************************************* Generated
=== Generated
[id='cFloatSlice']
==== cFloatSlice
[id='cFloats']
==== cFloats
:Slice-Type: float const
:Slice-Slice: cFloatSlice
:Slice-Slice: cFloats
include::{docroot}/clingo/_tmpl/Slice.adoc[]
[id='cVarFloatSlice']
==== cVarFloatSlice
[id='cVarFloats']
==== cVarFloats
:Slice-Type: float
:Slice-Slice: cVarFloatSlice
:Slice-Slice: cVarFloats
include::{docroot}/clingo/_tmpl/Slice.adoc[]
//******************************************************************************
Expand Down Expand Up @@ -191,39 +191,39 @@ include::{xmpldir}/unpack_float.c[]
==== find_float_c
[source,c]
----
float const* find_float_c( cFloatSlice slice, float f );
float const* find_float_c( cFloats slice, float f );
----
{FindVal}
==== max_float_c
[source,c]
----
float const* max_float_c( cFloatSlice slice );
float const* max_float_c( cFloats slice );
----
{FindMax}
==== min_float_c
[source,c]
----
float const* min_float_c( cFloatSlice slice );
float const* min_float_c( cFloats slice );
----
{FindMin}
==== prod_float_c
[source,c]
----
bool prod_float_c( cFloatSlice slice, float res[static 1] );
bool prod_float_c( cFloats slice, float res[static 1] );
----
{Prod}
==== sum_float_c
[source,c]
----
bool sum_float_c( cFloatSlice slice, float res[static 1] );
bool sum_float_c( cFloats slice, float res[static 1] );
----
{Sum}
40 changes: 20 additions & 20 deletions doc/clingo/type/int16.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Module with functions and types to work with int16_t values.
//******************************************************************* Generated
=== Generated
[id='cInt16Slice']
==== cInt16Slice
[id='cInt16s']
==== cInt16s
:Slice-Type: int16_t const
:Slice-Slice: cInt16Slice
:Slice-Slice: cInt16s
include::{docroot}/clingo/_tmpl/Slice.adoc[]
[id='cVarInt16Slice']
==== cVarInt16Slice
[id='cVarInt16s']
==== cVarInt16s
:Slice-Type: int16_t
:Slice-Slice: cVarInt16Slice
:Slice-Slice: cVarInt16s
include::{docroot}/clingo/_tmpl/Slice.adoc[]
//******************************************************************************
Expand Down Expand Up @@ -148,82 +148,82 @@ include::{xmpldir}/swap_int16_to.c[]
//************************************************************************ algo
=== algo
==== cmp_int16_slice_c
==== cmp_int16s_c
[source,c]
----
int cmp_int16_slice_c( cInt16Slice a, cInt16Slice b );
int cmp_int16s_c( cInt16s a, cInt16s b );
----
{CmpSlice}
==== count_eq_int16_c
[source,c]
----
int64_t count_eq_int16_c( cInt16Slice slice, int16_t val );
int64_t count_eq_int16_c( cInt16s slice, int16_t val );
----
{CountEq}
==== find_int16_c
[source,c]
----
int16_t const* find_int16_c( cInt16Slice slice, int16_t val );
int16_t const* find_int16_c( cInt16s slice, int16_t val );
----
{FindVal}
==== max_int16_c
[source,c]
----
int16_t const* max_int16_c( cInt16Slice slice );
int16_t const* max_int16_c( cInt16s slice );
----
{FindMax}
==== min_int16_c
[source,c]
----
int16_t const* min_int16_c( cInt16Slice slice );
int16_t const* min_int16_c( cInt16s slice );
----
{FindMin}
==== prod_int16_c
[source,c]
----
bool prod_int16_c( cInt16Slice slice, int64_t res[static 1] );
bool prod_int16_c( cInt16s slice, int64_t res[static 1] );
----
{Prod}
==== qsort_int16_slice_c
==== qsort_int16s_c
[source,c]
----
void qsort_int16_slice_c( cVarInt16Slice slice );
void qsort_int16s_c( cVarInt16s slice );
----
{Qsort}
==== reverse_int16_slice_c
==== reverse_int16s_c
[source,c]
----
void reverse_int16_slice_c( cVarInt16Slice slice );
void reverse_int16s_c( cVarInt16s slice );
----
{Reverse}
==== rotate_int16_slice_c
==== rotate_int16s_c
[source,c]
----
void rotate_int16_slice_c( cVarInt16Slice slice, int64_t distance );
void rotate_int16s_c( cVarInt16s slice, int64_t distance );
----
{Rotate}
==== sum_int16_c
[source,c]
----
bool sum_int16_c( cInt16Slice slice, int64_t res[static 1] );
bool sum_int16_c( cInt16s slice, int64_t res[static 1] );
----
{Sum}
Loading

0 comments on commit 4f8946f

Please sign in to comment.