summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-27 19:07:18 +0200
committerTyge Løvset <[email protected]>2022-04-27 19:07:18 +0200
commitedfcc712b48e2a582bcad1bc5a4102f18154e549 (patch)
tree70ed252f3bfd4e5841a25d802da630b73e58b800 /docs
parentdf73eddd7933df7c96269f11e37fc1a96916f747 (diff)
downloadSTC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.tar.gz
STC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.zip
Final fixes to carc and cbox; Reverted constructor name to make; (similarity to make_shared/make_unique in c++).
Diffstat (limited to 'docs')
-rw-r--r--docs/carc_api.md6
-rw-r--r--docs/cbox_api.md14
2 files changed, 10 insertions, 10 deletions
diff --git a/docs/carc_api.md b/docs/carc_api.md
index 301c25b1..ea5dea1f 100644
--- a/docs/carc_api.md
+++ b/docs/carc_api.md
@@ -32,8 +32,8 @@ See similar c++ class [std::shared_ptr](https://en.cppreference.com/w/cpp/memory
## Methods
```c
carc_X carc_X_init(); // empty shared pointer
-carc_X carc_X_make(i_valraw raw); // create owned value from raw type, if defined.
-carc_X carc_X_from(i_val val); // create new heap allocated object. Take ownership of val.
+carc_X carc_X_from(i_valraw raw); // construct a new value in an carc from raw type.
+carc_X carc_X_make(i_val val); // make a carc from constructed val object. Faster than from_ptr().
carc_X carc_X_from_ptr(i_val* p); // create a carc from raw pointer. Takes ownership of p.
carc_X carc_X_clone(carc_X other); // return other with increased use count
@@ -45,7 +45,7 @@ void carc_X_drop(carc_X* self); // destruct (decr
long carc_X_use_count(carc_X ptr);
void carc_X_reset(carc_X* self);
-void carc_X_reset_from(carc_X* self, i_val val); // assign new carc with value. Takes ownership of val.
+void carc_X_reset_to(carc_X* self, i_val* p); // assign new carc from ptr. Takes ownership of p.
uint64_t carc_X_value_hash(const i_val* x); // hash value
int carc_X_value_cmp(const i_val* x, const i_val* y); // compares pointer addresses if 'i_opt c_no_cmp'
diff --git a/docs/cbox_api.md b/docs/cbox_api.md
index 2e16815b..266539c6 100644
--- a/docs/cbox_api.md
+++ b/docs/cbox_api.md
@@ -31,23 +31,23 @@ compare the pointer addresses when used. Additionally, `c_no_clone` or `i_is_fwd
## Methods
```c
cbox_X cbox_X_init(); // return an empty cbox
-cbox_X cbox_X_make(i_valraw raw); // create owned value from raw type, if defined.
-cbox_X cbox_X_from(i_val val); // allocate new heap object with val. Take ownership of val.
+cbox_X cbox_X_from(i_valraw raw); // construct a new boxed object from raw type, if defined.
+cbox_X cbox_X_make(i_val val); // make a cbox from constructed val object.
cbox_X cbox_X_from_ptr(i_val* p); // create a cbox from a pointer. Takes ownership of p.
cbox_X cbox_X_clone(cbox_X other); // return deep copied clone
cbox_X cbox_X_move(cbox_X* self); // transfer ownership to another cbox.
void cbox_X_take(cbox_X* self, cbox_X other); // take ownership of other.
void cbox_X_copy(cbox_X* self, cbox_X other); // deep copy to self
-void cbox_X_drop(cbox_X* self); // destruct the contained object and free's it.
+void cbox_X_drop(cbox_X* self); // destruct the contained object and free's it.
void cbox_X_reset(cbox_X* self);
-void cbox_X_reset_from(cbox_X* self, i_val val); // assign new cbox with value. Takes ownership of val.
+void cbox_X_reset_to(cbox_X* self, i_val* p); // assign new cbox from ptr. Takes ownership of p.
-uint64_t cbox_X_value_hash(const i_val* x); // hash value
-int cbox_X_value_cmp(const i_val* x, const i_val* y); // compares pointer addresses if 'i_opt c_no_cmp'
+uint64_t cbox_X_value_hash(const i_val* p); // hash value
+int cbox_X_value_cmp(const i_val* p, const i_val* y); // compares pointer addresses if 'i_opt c_no_cmp'
// is defined. Otherwise uses 'i_cmp' or default compare.
-bool cbox_X_value_eq(const i_val* x, const i_val* y); // cbox_X_value_cmp == 0
+bool cbox_X_value_eq(const i_val* p, const i_val* y); // cbox_X_value_cmp == 0
```
## Types and constants