From 98adc04d5031ad1087f5885129d26fcf2677162d Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 26 Sep 2021 22:36:02 +0200 Subject: More docs work. --- README.md | 7 ++++--- docs/cpque_api.md | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b23808a5..f64eb515 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,9 @@ Others: Highlights ---------- -- **User friendly** - Just include the headers and you are good. The API and functionality is very close to c++ STL, and is fully listed in the docs. The ***#define i_xxx***-declarations configures the container type to use. You may define various names to customize element-*comparison*, *destruction*, *cloning*, *conversion types*, and more. -- **Unparalleled performance** - The containers are about equal and often much faster than the c++ STL containers. +- **User friendly** - Just include the headers and you are good. The API and functionality is very close to c++ STL, and is fully listed in the docs. +- **Templates** - Use `#define i_`**xxx** to specify container template arguments. There are templates for element-*type*, -*comparison*, -*destruction*, -*cloning*, -*conversion types*, and more. +- **Unparalleled performance** - Some containers are much faster than the c++ STL containers, the rest are about equal in speed. - **Fully memory managed** - All containers will destruct keys/values via destructor defined as macro parameters before including the container header. Also, shared pointers are supported and can be stored in containers, see ***csptr***. - **Fully type safe** - Because of templating, it avoids error-prone casting of container types and elements back and forth from the containers. - **Uniform, easy-to-learn API** - Methods to ***construct***, ***initialize***, ***iterate*** and ***destruct*** have uniform and intuitive usage across the various containers. @@ -332,7 +333,7 @@ typedef struct Dataset { User-defined container prefix ----------------------------- -Define either i_prefix or i_tag as empty: +Define either `i_prefix` or `i_tag` as empty: ```c #define i_prefix #define i_tag myvec diff --git a/docs/cpque_api.md b/docs/cpque_api.md index 63573082..4e58a323 100644 --- a/docs/cpque_api.md +++ b/docs/cpque_api.md @@ -22,27 +22,27 @@ See the c++ class [std::priority_queue](https://en.cppreference.com/w/cpp/contai ## Methods ```c -cpque_X cpque_X_init(void); -cpque_X cpque_X_clone(cpque_X pq); +cpque_X cpque_X_init(void); +cpque_X cpque_X_clone(cpque_X pq); -void cpque_X_clear(cpque_X* self); -void cpque_X_reserve(cpque_X* self, size_t n); -void cpque_X_copy(cpque_X* self, cpque_X other); -void cpque_X_del(cpque_X* self); // destructor +void cpque_X_clear(cpque_X* self); +void cpque_X_reserve(cpque_X* self, size_t n); +void cpque_X_copy(cpque_X* self, cpque_X other); +void cpque_X_del(cpque_X* self); // destructor -size_t cpque_X_size(cpque_X pq); -bool cpque_X_empty(cpque_X pq); -const cpque_X_value_t* cpque_X_top(const cpque_X* self); +size_t cpque_X_size(cpque_X pq); +bool cpque_X_empty(cpque_X pq); +cpque_X_value_t* cpque_X_top(const cpque_X* self); -void cpque_X_make_heap(cpque_X* self); // call after using push_back(). -void cpque_X_push(cpque_X* self, cpque_X_value_t value); -void cpque_X_emplace(cpque_X* self, cpque_X_rawvalue_t raw); +void cpque_X_make_heap(cpque_X* self); // call after using push_back(). +void cpque_X_push(cpque_X* self, cpque_X_value_t value); +void cpque_X_emplace(cpque_X* self, cpque_X_rawvalue_t raw); -void cpque_X_pop(cpque_X* self); -void cpque_X_erase_at(cpque_X* self, size_t idx); +void cpque_X_pop(cpque_X* self); +void cpque_X_erase_at(cpque_X* self, size_t idx); -void cpque_X_push_back(cpque_X* self, cpque_X_value_t value); // breaks heap-property -cpque_X_value_t cpque_X_value_clone(cpque_X_value_t val); +void cpque_X_push_back(cpque_X* self, cpque_X_value_t value); // breaks heap-property +cpque_X_value_t cpque_X_value_clone(cpque_X_value_t val); ``` ## Types -- cgit v1.2.3