summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-10-24 12:23:30 +0200
committerTyge Løvset <[email protected]>2022-10-24 12:23:30 +0200
commitcf2ff10878153588b69e7e34523773e2bc42d79e (patch)
tree8980db94a0c79f5b02489510159821c0b8f22a39
parent60611de13ad64442287c5a57c7aa874ad45273ab (diff)
downloadSTC-modified-cf2ff10878153588b69e7e34523773e2bc42d79e.tar.gz
STC-modified-cf2ff10878153588b69e7e34523773e2bc42d79e.zip
API CHANGE: Renamed input params for naming consisteny and usage:
i_key_class TYPE => i_keyclass TYPE i_val_class TYPE => i_valclass TYPE i_key_arcbox TYPE => i_keyboxed TYPE i_val_arcbox TYPE => i_valboxed TYPE i_key_bind, i_val_bind are removed.
-rw-r--r--README.md16
-rw-r--r--docs/carc_api.md4
-rw-r--r--docs/cbox_api.md6
-rw-r--r--docs/cmap_api.md8
-rw-r--r--docs/cvec_api.md2
-rw-r--r--examples/arc_containers.c4
-rw-r--r--examples/arc_demo.c4
-rw-r--r--examples/arcvec_erase.c2
-rw-r--r--examples/box.c4
-rw-r--r--examples/box2.c2
-rw-r--r--examples/city.c6
-rw-r--r--examples/complex.c6
-rw-r--r--examples/forfilter.c2
-rw-r--r--examples/mapmap.c2
-rw-r--r--examples/mmap.c2
-rw-r--r--examples/multimap.c4
-rw-r--r--examples/music_arc.c4
-rw-r--r--examples/new_sptr.c6
-rw-r--r--examples/person_arc.c4
-rw-r--r--examples/rawptr_elements.c2
-rw-r--r--examples/vikings.c4
-rw-r--r--include/stc/carc.h4
-rw-r--r--include/stc/cbox.h6
-rw-r--r--include/stc/template.h61
24 files changed, 78 insertions, 87 deletions
diff --git a/README.md b/README.md
index d5a22db4..4548ea55 100644
--- a/README.md
+++ b/README.md
@@ -329,14 +329,14 @@ Val:
Specials:
- `i_key_str` - Define key type *cstr* and container i_tag = *str*. It binds type convertion from/to *const char*\*, and the ***cmp***, ***eq***, ***hash***, and ***keydrop*** functions.
- `i_key_ssv` - Define key type *cstr* and container i_tag = *ssv*. It binds type convertion from/to *csview*, and its ***cmp***, ***eq***, ***hash***, and ***keydrop*** functions.
-- `i_key_arcbox TYPE` - Define container key type where TYPE is a smart pointer **carc** or **cbox**. NB: not to be used when defining carc/cbox types themselves.
-- `i_key_class TYPE` - General version of the three above - will auto-bind to standard named functions: *TYPE_clone*, *TYPE_drop*, *TYPE_cmp*, *TYPE_eq*, *TYPE_hash*. If `i_keyraw` is defined, *TYPE_toraw* function is bound to `i_keyto`. Only functions required by the particular container need to be defined. E.g., only **cmap** and **cset** and smart pointers uses *TYPE_hash* and *TYPE_eq*. **cstack** does not use *TYPE_cmp*. *TYPE_clone* is not used if *#define i_opt c_no_clone* is specified. Likewise, *TYPE_cmp* is not used if *#define i_opt c_no_cmp* is specified.
-- `i_val_str`, `i_val_ssv`, `i_val_arcbox`, `i_val_class` - Similar rules as for ***key***.
+- `i_keyboxed TYPE` - Define container key type where TYPE is a smart pointer **carc** or **cbox**. NB: not to be used when defining carc/cbox types themselves.
+- `i_keyclass TYPE` - General version of the three above - will auto-bind to standard named functions: *TYPE_clone*, *TYPE_drop*, *TYPE_cmp*, *TYPE_eq*, *TYPE_hash*. If `i_keyraw` is defined, *TYPE_toraw* function is bound to `i_keyto`. Only functions required by the particular container need to be defined. E.g., only **cmap** and **cset** and smart pointers uses *TYPE_hash* and *TYPE_eq*. **cstack** does not use *TYPE_cmp*. *TYPE_clone* is not used if *#define i_opt c_no_clone* is specified. Likewise, *TYPE_cmp* is not used if *#define i_opt c_no_cmp* is specified.
+- `i_val_str`, `i_val_ssv`, `i_valboxed`, `i_valclass` - Similar rules as for ***key***.
**Notes**:
- Instead of defining `i_cmp`, you may define *i_opt c_no_cmp* to disable *searching and sorting* functions.
- Instead of defining `i_*clone`, you may define *i_opt c_no_clone* to disable *clone* functionality.
-- For `i_key_class`, if *i_keyraw RAWTYPE* is defined along with it, *i_keyfrom* may also be defined to enable the *emplace*-functions. Note: the signature for ***cmp***, ***eq***, and ***hash*** uses *RAWTYPE* as input.
+- For `i_keyclass`, if *i_keyraw RAWTYPE* is defined along with it, *i_keyfrom* may also be defined to enable the *emplace*-functions. Note: the signature for ***cmp***, ***eq***, and ***hash*** uses *RAWTYPE* as input.
The *emplace* versus non-emplace container methods
--------------------------------------------------
@@ -519,14 +519,14 @@ Memory efficiency
- Renamed: ***i_equ*** to `i_eq`, and ***_equalto*** to `_eq`.
- Renamed: ***i_cnt*** to `i_type` for defining the complete container type name.
- Renamed: type **csptr** to [**carc**](docs/carc_api.md) (atomic reference counted) smart pointer.
-- Renamed: ***i_key_csptr*** / ***i_val_csptr*** to `i_key_arcbox` / `i_val_arcbox` for specifying **carc** and **cbox** values in containers.
+- Renamed: ***i_key_csptr*** / ***i_val_csptr*** to `i_keyboxed` / `i_valboxed` for specifying **carc** and **cbox** values in containers.
- Renamed: *csptr_X_make()* to `carc_X_from()`.
- Renamed: *cstr_lit()* to `cstr_new(literal)`, and *cstr_assign_fmt()* to `cstr_printf()`.
- Renamed: *c_default_fromraw()* to `c_default_from()`.
- Changed: the [**c_apply**](docs/ccommon_api.md) macros API.
- Replaced: *csview_first_token()* and *csview_next_token()* with one function: `csview_token()`.
- Added: **checkauto** tool for checking that c-source files uses `c_auto*` macros correctly.
-- Added: general `i_key_class` / `i_val_class` template parameters which auto-binds template functions.
+- Added: general `i_keyclass` / `i_valclass` template parameters which auto-binds template functions.
- Added: `i_opt` template parameter: compile-time options: `c_no_cmp`, `c_no_clone`, `c_no_atomic`, `c_is_fwd`; may be combined with `|`
- Added: [**cbox**](docs/cbox_api.md) type: smart pointer, similar to [Rust Box](https://doc.rust-lang.org/rust-by-example/std/box.html) and [std::unique_ptr](https://en.cppreference.com/w/cpp/memory/unique_ptr).
- Added: [**c_forpair**](docs/ccommon_api.md) macro: for-loop with "structured binding"
@@ -543,8 +543,8 @@ Replace (whole word + match case):
- `i_valdel` ⟶ `i_valdrop`
- `i_cnt` ⟶ `i_type`
- `cstr_lit` ⟶ `cstr_new`
-- `i_key_sptr` ⟶ `i_key_arcbox`
-- `i_val_sptr` ⟶ `i_val_arcbox`
+- `i_key_sptr` ⟶ `i_keyboxed`
+- `i_val_sptr` ⟶ `i_valboxed`
Non-regex, global match case replace:
- `csptr` ⟶ `carc`
diff --git a/docs/carc_api.md b/docs/carc_api.md
index 4dea2b2c..04856622 100644
--- a/docs/carc_api.md
+++ b/docs/carc_api.md
@@ -13,7 +13,7 @@ All **carc** functions can be called by multiple threads on different instances
additional synchronization even if these instances are copies and share ownership of the same object.
**carc** uses thread-safe atomic reference counting, through the *carc_X_clone()* and *carc_X_drop()* methods.
-When declaring a container with shared pointers, define `i_val_arcbox` with the carc type, see example.
+When declaring a container with shared pointers, define `i_valboxed` with the carc type, see example.
See similar c++ class [std::shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) for a functional reference, or Rust [std::sync::Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html) / [std::rc::Rc](https://doc.rust-lang.org/std/rc/struct.Rc.html).
@@ -89,7 +89,7 @@ bool carc_X_value_eq(const i_val* x, const i_val* y);
#include <stc/carc.h>
#define i_type Stack
-#define i_val_arcbox Arc // Note: use i_val_arcbox for carc or cbox value types
+#define i_valboxed Arc // Note: use i_valboxed for carc or cbox value types
#include <stc/cstack.h>
int main()
diff --git a/docs/cbox_api.md b/docs/cbox_api.md
index 43fa46b0..79911876 100644
--- a/docs/cbox_api.md
+++ b/docs/cbox_api.md
@@ -5,7 +5,7 @@ be empty. The *cbox_X_cmp()*, *cbox_X_drop()* methods are defined based on the `
and `i_valdrop` macros specified. Use *cbox_X_clone(p)* to make a deep copy, which uses the
`i_valclone` macro if defined.
-When declaring a container of **cbox** values, define `i_val_arcbox` with the
+When declaring a container of **cbox** values, define `i_valboxed` with the
cbox type instead of defining `i_val`. This will auto-set `i_valdrop`, `i_valclone`, and `i_cmp` using
functions defined by the specified **cbox**.
@@ -79,11 +79,11 @@ void int_drop(int* x) {
#include <stc/cbox.h>
#define i_type ISet
-#define i_key_arcbox IBox // NB: use i_key_arcbox instead of i_key
+#define i_keyboxed IBox // NB: use i_keyboxed instead of i_key
#include <stc/csset.h> // ISet : std::set<std::unique_ptr<int>>
#define i_type IVec
-#define i_val_arcbox IBox // NB: use i_val_arcbox instead of i_val
+#define i_valboxed IBox // NB: use i_valboxed instead of i_val
#include <stc/cvec.h> // IVec : std::vector<std::unique_ptr<int>>
int main()
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 119b72f2..bf56fcab 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -298,10 +298,10 @@ static inline void Viking_drop(Viking* vk) {
}
#define i_type Vikings
-#define i_key_class Viking
+#define i_keyclass Viking
#define i_val int
/*
- i_key_class implies these defines, unless they are already defined:
+ i_keyclass implies these defines, unless they are already defined:
#define i_cmp Viking_cmp
#define i_hash Viking_hash
#define i_keyclone Viking_clone
@@ -377,7 +377,7 @@ static inline RViking Viking_toraw(const Viking* vp) {
// With this in place, we define the Viking => int hash map type:
#define i_type Vikings
-#define i_key_class Viking
+#define i_keyclass Viking
#define i_keyraw RViking
#define i_keyfrom Viking_from
#define i_opt c_no_clone // disable map cloning
@@ -385,7 +385,7 @@ static inline RViking Viking_toraw(const Viking* vp) {
#define i_val int
#include <stc/cmap.h>
/*
- i_key_class implies these defines, unless they are already defined:
+ i_keyclass implies these defines, unless they are already defined:
#define i_cmp RViking_cmp
//#define i_hash RViking_hash // already defined above.
//#define i_keyclone Viking_clone // not used because c_no_clone
diff --git a/docs/cvec_api.md b/docs/cvec_api.md
index 50fb4448..f4cedb75 100644
--- a/docs/cvec_api.md
+++ b/docs/cvec_api.md
@@ -206,7 +206,7 @@ User User_clone(User user) {
// Declare a managed, clonable vector of users.
#define i_type UVec
-#define i_val_class User // User is a "class" as it has _cmp, _clone and _drop functions.
+#define i_valclass User // User is a "class" as it has _cmp, _clone and _drop functions.
#include <stc/cvec.h>
int main(void) {
diff --git a/examples/arc_containers.c b/examples/arc_containers.c
index 6e6f748f..5a8b3653 100644
--- a/examples/arc_containers.c
+++ b/examples/arc_containers.c
@@ -16,11 +16,11 @@
#include <stc/carc.h>
#define i_type Stack
-#define i_val_arcbox Arc // define i_val_arcbox for carc/cbox value (not i_val)
+#define i_valboxed Arc // define i_valboxed for carc/cbox value (not i_val)
#include <stc/cstack.h>
#define i_type List
-#define i_val_arcbox Arc // as above
+#define i_valboxed Arc // as above
#include <stc/clist.h>
int main()
diff --git a/examples/arc_demo.c b/examples/arc_demo.c
index c282bdbd..087f90ac 100644
--- a/examples/arc_demo.c
+++ b/examples/arc_demo.c
@@ -13,10 +13,10 @@ void int_drop(int* x) {
#define i_valdrop int_drop // optional, just to display the elements destroyed
#include <stc/carc.h> // Arc
-#define i_key_arcbox Arc // note: use i_key_arcbox instead of i_key for carc/cbox elements
+#define i_keyboxed Arc // note: use i_keyboxed instead of i_key for carc/cbox elements
#include <stc/csset.h> // csset_Arc (like: std::set<std::shared_ptr<int>>)
-#define i_val_arcbox Arc // note: as above.
+#define i_valboxed Arc // note: as above.
#include <stc/cvec.h> // cvec_Arc (like: std::vector<std::shared_ptr<int>>)
int main()
diff --git a/examples/arcvec_erase.c b/examples/arcvec_erase.c
index 6990c94a..c70d59d9 100644
--- a/examples/arcvec_erase.c
+++ b/examples/arcvec_erase.c
@@ -9,7 +9,7 @@ void show_drop(int* x) { printf("drop: %d\n", *x); }
#include <stc/carc.h> // Shared pointer to int
#define i_type Vec
-#define i_val_arcbox Arc
+#define i_valboxed Arc
#include <stc/cvec.h> // Vec: cvec<Arc>
diff --git a/examples/box.c b/examples/box.c
index c95b2cb7..da13501f 100644
--- a/examples/box.c
+++ b/examples/box.c
@@ -28,11 +28,11 @@ void Person_drop(Person* p) {
}
#define i_type PBox
-#define i_val_class Person // "class" binds _cmp, _clone, _drop functions.
+#define i_valclass Person // "class" binds _cmp, _clone, _drop functions.
#include <stc/cbox.h>
#define i_type Persons
-#define i_val_arcbox PBox // "arcbox" informs that PBox is a smart pointer.
+#define i_valboxed PBox // "arcbox" informs that PBox is a smart pointer.
#include <stc/csset.h>
int main()
diff --git a/examples/box2.c b/examples/box2.c
index 2413e3fe..f64eb239 100644
--- a/examples/box2.c
+++ b/examples/box2.c
@@ -24,7 +24,7 @@ struct {
#include <stc/cbox.h> // cbox_Rectangle
// Box in box:
-#define i_val_arcbox cbox_Point // NB: use i_val_arcbox when value is a cbox or carc!
+#define i_valboxed cbox_Point // NB: use i_valboxed when value is a cbox or carc!
// it will auto define i_valdrop, i_valfrom, and i_cmp.
#define i_tag BoxPoint
#include <stc/cbox.h> // cbox_BoxPoint
diff --git a/examples/city.c b/examples/city.c
index 891e08f8..0996fe9b 100644
--- a/examples/city.c
+++ b/examples/city.c
@@ -13,17 +13,17 @@ City City_clone(City c);
void City_drop(City* c);
#define i_type CityArc
-#define i_val_class City
+#define i_valclass City
#include <stc/cbox.h>
//#include <stc/carc.h> // try instead of cbox.h
#define i_type Cities
-#define i_key_arcbox CityArc
+#define i_keyboxed CityArc
#include <stc/cvec.h>
#define i_type CityMap
#define i_key int
-#define i_val_arcbox CityArc
+#define i_valboxed CityArc
#include <stc/csmap.h>
diff --git a/examples/complex.c b/examples/complex.c
index c91f95d5..dd2f951a 100644
--- a/examples/complex.c
+++ b/examples/complex.c
@@ -14,18 +14,18 @@
#include <stc/cstack.h>
#define i_type StackList
-#define i_val_class FloatStack // "class" picks up _clone, _drop
+#define i_valclass FloatStack // "class" picks up _clone, _drop
#define i_opt c_no_cmp // no FloatStack_cmp()
#include <stc/clist.h>
#define i_type ListMap
#define i_key int
-#define i_val_class StackList // "class" picks up _clone, _drop
+#define i_valclass StackList // "class" picks up _clone, _drop
#include <stc/cmap.h>
#define i_type MapMap
#define i_key_str
-#define i_val_class ListMap
+#define i_valclass ListMap
#include <stc/cmap.h>
diff --git a/examples/forfilter.c b/examples/forfilter.c
index e1a3f1e5..cc7c3478 100644
--- a/examples/forfilter.c
+++ b/examples/forfilter.c
@@ -9,7 +9,7 @@
#include <stc/cstack.h>
#define i_type SVec
-#define i_val_class csview
+#define i_valclass csview
#include <stc/cstack.h>
// filters and transforms:
diff --git a/examples/mapmap.c b/examples/mapmap.c
index 99f5e58d..488cc539 100644
--- a/examples/mapmap.c
+++ b/examples/mapmap.c
@@ -12,7 +12,7 @@
// Departments: std::map<std::string, People>
#define i_type Departments
#define i_key_str
-#define i_val_class People
+#define i_valclass People
// Shorthand for:
// #define i_val People
// #define i_cmp People_cmp
diff --git a/examples/mmap.c b/examples/mmap.c
index 6fe041e4..3934cf26 100644
--- a/examples/mmap.c
+++ b/examples/mmap.c
@@ -11,7 +11,7 @@
// Map of int => clist_str.
#define i_type Multimap
#define i_key int
-#define i_val_class clist_str // uses clist_str as i_val and binds clist_str_clone, clist_str_drop
+#define i_valclass clist_str // uses clist_str as i_val and binds clist_str_clone, clist_str_drop
#define i_cmp -c_default_cmp // like std::greater<int>
#include <stc/csmap.h>
diff --git a/examples/multimap.c b/examples/multimap.c
index f8c5b6c2..e72bdce3 100644
--- a/examples/multimap.c
+++ b/examples/multimap.c
@@ -39,14 +39,14 @@ OlympicLocation OlympicLocation_clone(OlympicLocation loc);
void OlympicLocation_drop(OlympicLocation* self);
// Create a clist<OlympicLocation>, can be sorted by year.
-#define i_val_class OlympicLocation // binds _cmp, _clone and _drop.
+#define i_valclass OlympicLocation // binds _cmp, _clone and _drop.
#define i_tag OL
#define i_extern // define _clist_mergesort()
#include <stc/clist.h>
// Create a csmap<cstr, clist_OL> where key is country name
#define i_key_str // binds cstr_equ, cstr_hash, cstr_clone, ++
-#define i_val_class clist_OL // binds clist_OL_clone, clist_OL_drop
+#define i_valclass clist_OL // binds clist_OL_clone, clist_OL_drop
#define i_tag OL
#include <stc/csmap.h>
diff --git a/examples/music_arc.c b/examples/music_arc.c
index 0fb0dd70..162c4c2f 100644
--- a/examples/music_arc.c
+++ b/examples/music_arc.c
@@ -21,13 +21,13 @@ void Song_drop(Song* s) {
// Define the reference counted type
#define i_type SongArc
-#define i_val_class Song
+#define i_valclass Song
#define i_opt c_no_hash
#include <stc/carc.h>
// ... and a vector of it
#define i_type SongVec
-#define i_val_arcbox SongArc
+#define i_valboxed SongArc
#include <stc/cstack.h>
void example3()
diff --git a/examples/new_sptr.c b/examples/new_sptr.c
index c4c9f7f5..2c6b28d6 100644
--- a/examples/new_sptr.c
+++ b/examples/new_sptr.c
@@ -8,7 +8,7 @@ int Person_cmp(const Person* a, const Person* b);
uint64_t Person_hash(const Person* p);
#define i_type PersonArc
-#define i_val_class Person // "class" ensure Person_drop will be called
+#define i_valclass Person // "class" ensure Person_drop will be called
#define i_cmp Person_cmp // enable carc object comparisons (not ptr to obj)
#define i_hash Person_hash // enable carc object hash (not ptr to obj)
#include <stc/carc.h>
@@ -19,11 +19,11 @@ uint64_t Person_hash(const Person* p);
#include <stc/carc.h>
#define i_type IPStack
-#define i_val_arcbox IPtr
+#define i_valboxed IPtr
#include <stc/cstack.h>
#define i_type PASet
-#define i_val_arcbox PersonArc
+#define i_valboxed PersonArc
#include <stc/cset.h>
diff --git a/examples/person_arc.c b/examples/person_arc.c
index 26bdd44d..a7bf2a6f 100644
--- a/examples/person_arc.c
+++ b/examples/person_arc.c
@@ -28,12 +28,12 @@ void Person_drop(Person* p) {
}
#define i_type PSPtr
-#define i_val_class Person // ensure Person_drop
+#define i_valclass Person // ensure Person_drop
#define i_cmp Person_cmp // specify object cmp, instead of ptr cmp for arc.
#include <stc/carc.h>
#define i_type Persons
-#define i_val_arcbox PSPtr // binds PSPtr_cmp, PSPtr_drop...
+#define i_valboxed PSPtr // binds PSPtr_cmp, PSPtr_drop...
#include <stc/cvec.h>
diff --git a/examples/rawptr_elements.c b/examples/rawptr_elements.c
index bae314fd..095357ca 100644
--- a/examples/rawptr_elements.c
+++ b/examples/rawptr_elements.c
@@ -23,7 +23,7 @@ typedef int64_t inttype;
#define i_type SIBoxMap
#define i_key_str
-#define i_val_arcbox IBox
+#define i_valboxed IBox
#include <stc/cmap.h>
int main()
diff --git a/examples/vikings.c b/examples/vikings.c
index 1cfcf72e..fc73f438 100644
--- a/examples/vikings.c
+++ b/examples/vikings.c
@@ -32,7 +32,7 @@ static inline RViking Viking_toraw(const Viking* vp) {
// With this in place, we define the Viking => int hash map type:
#define i_type Vikings
-#define i_key_class Viking // key type
+#define i_keyclass Viking // key type
#define i_keyraw RViking // lookup type
#define i_keyfrom Viking_from
#define i_opt c_no_clone
@@ -40,7 +40,7 @@ static inline RViking Viking_toraw(const Viking* vp) {
#define i_val int // mapped type
#include <stc/cmap.h>
/*
- i_key_class implies these defines, unless they are already defined:
+ i_keyclass implies these defines, unless they are already defined:
i_cmp => RViking_cmp
//i_hash => RViking_hash // already defined.
//i_keyclone => Viking_clone // not used, because of c_no_clone
diff --git a/include/stc/carc.h b/include/stc/carc.h
index 882acb6b..e061aa2c 100644
--- a/include/stc/carc.h
+++ b/include/stc/carc.h
@@ -78,10 +78,10 @@ int main() {
#ifndef _i_prefix
#define _i_prefix carc_
#endif
-#if !(defined i_cmp || defined i_less || defined i_key_class || defined i_val_class)
+#if !(defined i_cmp || defined i_less || defined i_keyclass || defined i_valclass)
#define _i_no_cmp
#endif
-#if !(defined i_eq || defined i_hash || defined i_key_class || defined i_val_class)
+#if !(defined i_eq || defined i_hash || defined i_keyclass || defined i_valclass)
#define _i_no_hash
#endif
#include "template.h"
diff --git a/include/stc/cbox.h b/include/stc/cbox.h
index dde0ed08..dc7b76ba 100644
--- a/include/stc/cbox.h
+++ b/include/stc/cbox.h
@@ -40,7 +40,7 @@ void Person_drop(Person* p) {
c_drop(cstr, &p->name, &p->email);
}
-#define i_key_class Person // bind Person clone+drop fn's
+#define i_keyclass Person // bind Person clone+drop fn's
#define i_type PBox
#include <stc/cbox.h>
@@ -70,10 +70,10 @@ int main() {
#ifndef _i_prefix
#define _i_prefix cbox_
#endif
-#if !(defined i_cmp || defined i_less || defined i_key_class || defined i_val_class)
+#if !(defined i_cmp || defined i_less || defined i_keyclass || defined i_valclass)
#define _i_no_cmp
#endif
-#if !(defined i_eq || defined i_hash || defined i_key_class || defined i_val_class)
+#if !(defined i_eq || defined i_hash || defined i_keyclass || defined i_valclass)
#define _i_no_hash
#endif
#include "template.h"
diff --git a/include/stc/template.h b/include/stc/template.h
index e7b6dfdc..eb114fe7 100644
--- a/include/stc/template.h
+++ b/include/stc/template.h
@@ -57,15 +57,8 @@
#error "i_valfrom defined without i_valraw"
#endif
-#ifdef i_key_bind // [deprecated]
- #define i_key_class i_key_bind
-#endif
-#ifdef i_val_bind // [deprecated]
- #define i_val_class i_val_bind
-#endif
-
#if !(defined i_key || defined i_key_str || defined i_key_ssv || \
- defined i_key_class || defined i_key_arcbox)
+ defined i_keyclass || defined i_keyboxed)
#if defined _i_ismap
#error "i_key* must be defined for maps."
#endif
@@ -76,11 +69,11 @@
#if defined i_val_ssv
#define i_key_ssv i_val_ssv
#endif
- #if defined i_val_arcbox
- #define i_key_arcbox i_val_arcbox
+ #if defined i_valboxed
+ #define i_keyboxed i_valboxed
#endif
- #if defined i_val_class
- #define i_key_class i_val_class
+ #if defined i_valclass
+ #define i_keyclass i_valclass
#endif
#if defined i_val
#define i_key i_val
@@ -110,14 +103,14 @@
#endif
#if defined i_key_str
- #define i_key_class cstr
+ #define i_keyclass cstr
#define i_keyraw crawstr
#define i_keyfrom cstr_from
#ifndef i_tag
#define i_tag str
#endif
#elif defined i_key_ssv
- #define i_key_class cstr
+ #define i_keyclass cstr
#define i_keyraw csview
#define i_keyfrom cstr_from_sv
#define i_keyto cstr_sv
@@ -125,17 +118,17 @@
#ifndef i_tag
#define i_tag ssv
#endif
-#elif defined i_key_arcbox
- #define i_key_class i_key_arcbox
- #define i_keyraw c_paste(i_key_arcbox, _raw)
- #define i_keyfrom c_paste(i_key_arcbox, _new)
+#elif defined i_keyboxed
+ #define i_keyclass i_keyboxed
+ #define i_keyraw c_paste(i_keyboxed, _raw)
+ #define i_keyfrom c_paste(i_keyboxed, _new)
#if !defined _i_no_hash
- #define i_eq c_paste(i_key_arcbox, _raw_eq)
+ #define i_eq c_paste(i_keyboxed, _raw_eq)
#endif
#endif
-#ifdef i_key_class
- #define i_key i_key_class
+#ifdef i_keyclass
+ #define i_key i_keyclass
#ifndef i_keyclone
#define i_keyclone c_paste(i_key, _clone)
#endif
@@ -211,22 +204,22 @@
#if defined _i_ismap // ---- process cmap/csmap value i_val, ... ----
#ifdef i_val_str
- #define i_val_class cstr
+ #define i_valclass cstr
#define i_valraw crawstr
#define i_valfrom cstr_from
#elif defined i_val_ssv
- #define i_val_class cstr
+ #define i_valclass cstr
#define i_valraw csview
#define i_valfrom cstr_from_sv
#define i_valto cstr_sv
-#elif defined i_val_arcbox
- #define i_val_class i_val_arcbox
- #define i_valraw c_paste(i_val_arcbox, _raw)
- #define i_valfrom c_paste(i_val_arcbox, _new)
+#elif defined i_valboxed
+ #define i_valclass i_valboxed
+ #define i_valraw c_paste(i_valboxed, _raw)
+ #define i_valfrom c_paste(i_valboxed, _new)
#endif
-#ifdef i_val_class
- #define i_val i_val_class
+#ifdef i_valclass
+ #define i_val i_valclass
#ifndef i_valclone
#define i_valclone c_paste(i_val, _clone)
#endif
@@ -291,9 +284,8 @@
#undef i_val
#undef i_val_str
#undef i_val_ssv
-#undef i_val_arcbox
-#undef i_val_class
-#undef i_val_bind // [deprecated]
+#undef i_valboxed
+#undef i_valclass
#undef i_valraw
#undef i_valclone
#undef i_valfrom
@@ -303,9 +295,8 @@
#undef i_key
#undef i_key_str
#undef i_key_ssv
-#undef i_key_arcbox
-#undef i_key_class
-#undef i_key_bind // [deprecated]
+#undef i_keyboxed
+#undef i_keyclass
#undef i_keyraw
#undef i_keyclone
#undef i_keyfrom