summaryrefslogtreecommitdiffhomepage
path: root/examples
AgeCommit message (Collapse)Author
2022-05-19Some extra test on template params. Update shape.c example.Tyge Løvset
2022-05-19Small update of shape.cTyge Løvset
2022-05-19Added _toval() in carc and cbox. Added dynamic polymorphism example, shape.c.Tyge Løvset
2022-05-18Formatted carc.h cbox.h: also simplified; removed _get() -> was same as ↵Tyge Løvset
_toraw(), see template.h diff.
2022-05-16Changed contructor names in carr2/carr3 to be more consistent with other ↵Tyge Løvset
containers.
2022-05-13Changed csview c_PRIsv macro. Now must be prefixed with "%", to match with ↵Tyge Løvset
PRIxYYY macros from inttypes.h. E.g. printf("%40" c_PRIsv "\n", c_ARGsv(sv)); to specify 40 character right aligned output of sv. Check your usage.
2022-05-13constness and code formatting.Tyge Lovset
2022-05-12i_keyfrom/i_valfrom no longer used with i_key_bind/i_val_bind. Is considered ↵Tyge Løvset
optional for enabling emplace.
2022-05-07Updated alt/csmap.h to be synced with current csmap.h; alt-version allocates ↵Tyge Løvset
each node separately on the heap, regular uses an array. Now alt-version of csmap and cstr can be used by defining -DSTC_CSMAP_V1 and -DSTC_CSTR_V1 when compiling. Improved code readability by making line breaks after if and while (also cmap.h). Note, the alt-versions may be removed in the future, but the alt csmap.h may be made into an intrusive sorted map, where the creation and destruction of nodes must be done by the user.
2022-05-04Missing includes because of change in cregex.hTyge Løvset
2022-05-02More doc fixes on i_keyclone, i_keyfrom and i_valclone, i_valfromTyge Løvset
2022-04-28Finalized template.h logic.Tyge Løvset
2022-04-27Final fixes to carc and cbox; Reverted constructor name to make; (similarity ↵Tyge Løvset
to make_shared/make_unique in c++).
2022-04-27Updated examples.Tyge Løvset
2022-04-27Bugfix: cbox didn't use i_keyclone, and therefore did not deep clone properly.Tyge Løvset
2022-04-27Added cstr_expand_uninitialized().Tyge Løvset
2022-04-27Finally FIXED cloning/to/from scheme to work properly. When using ↵Tyge Løvset
i_key_bind/i_val_bind, a .._clone() function *must* always be defined. Functions .._from and .._toraw is only required when i_keyraw/i_valraw type is defined.
2022-04-25Removed size argument to `i_hash` template parameter and `c_default_hash`. ↵Tyge Løvset
This was a "design error", and is not worth keeping for backward compability. Please update your code where you use i_hash template parameter (simply remove second argument).
2022-04-25Added lower_bound() examples with both sorted cvec and sorted set (csset).Tyge Løvset
2022-04-23Integrated (and removed) c_hash32 and c_hash64 into c_default_hash, which is ↵Tyge Løvset
improved. Added i_key_ssv and i_val_ssv (cstr with csview as raw-type).
2022-04-22Readded push()/emplace() to all containers missing them. Made _hash function ↵Tyge Løvset
required for i_key_bind, _eq is derived from _cmp.
2022-04-21Switched to use i_key as primary template type parameter for all containers. ↵Tyge Løvset
Only maps will actually use i_val. Users can still specify i_val for non-maps, so there are no usability changes, other than the option to use i_key always, which makes the implementation and switching between container types simpler.
2022-04-20Some cleanup after carc / cbox updates.Tyge Løvset
2022-04-20Support for cloning containers with carc and cbox.Tyge Lovset
Disabled emplace methods for containers with carc and cbox.
2022-04-19Renamed cbox_new/carc_new to cbox_make/carc_make. Disabled container emplace ↵Tyge Lovset
on arcbox elements.
2022-04-19Added #error/warnings for likely missing definitions of i_hash/i_cmp.Tyge Løvset
2022-04-18crandom.h: Renamed *_init(..) functions to *_new(..). Old names are kept but ↵Tyge Løvset
deprecated.
2022-04-18Renamed newly added map function put_r() to put_raw() - alias for ↵Tyge Lovset
emplace_or_assign() for symetri with insert_or_assign()/put(). Experimental, may be removed.
2022-04-18Removed i_drop and i_from template specifiers to reduce redundancies and add ↵Tyge Lovset
clarity (error given if used): use i_valdrop/i_valfrom and i_keydrop/i_keyfrom instead. Added missing at_mut() function to cdeq.
2022-04-18Converted all example to use cstr_str(&s) instead of s.str to allow SSO ↵Tyge Løvset
string. Fixed misc warnings.
2022-04-11Fixed an potential issue with c_eq in template.h and missing usage in clist.hTyge Lovset
2022-04-10Fixed regression bug: cqueue_pop() did pop_back(), fixed to do pop_front().Tyge Løvset
Removed pop() functions in clist and cdeq as they are no standard. push() will push_back() for both.
2022-04-09- Switched from .._put() to .._push() as the "generic" method to add ↵Tyge Løvset
element to any container. - Changed clist_X_insert()/emplace() to clist_X_insert_at()/emplace_at() to make it consistent with cvec/cdeq. - Updated documentation.
2022-04-07More refactoring of cbits.h + minor changes in examples/benchmark.Tyge Løvset
2022-04-06Refactoring cbits.h and sso alt/cstr.hTyge Løvset
2022-03-30More enhancements on cstr / cstr_sso.Tyge Løvset
2022-03-26Fixed alt/cstr.h (short string optimized), so that it can be used in ↵Tyge Løvset
containers. Had to change some API in csview to make it play with that.
2022-03-25Modified (more) rarely used macros c_apply_cnt(v, ..) and c_apply_arr(v, ..) ↵Tyge Løvset
so that v is a reference that may modify the container items.
2022-03-24Misc. small internal API renaming/refactoring and additions.Tyge Løvset
2022-03-16Bugfix: carc and cbox cmp functions had bug.Tyge Løvset
Renamed: i_key_sptr / i_val_sptr to i_key_arcbox / i_val_arcbox. Other smaller updates.
2022-03-04Updated printf formatting to portable code. This was also to use ↵Tyge Løvset
http://winlibs.com gcc+clang with ucrt runtime-libs without warnings.
2022-02-18Some improvements and cleanup: CRegex, CMap.Tyge Løvset
2022-02-16Refactoring. Added size type param to forward_cmap/csmap . Reverted ↵Tyge Løvset
c_autovar macros. Added utf8_encode (not used yet).
2022-02-06Misc improvements.Tyge Løvset
2022-02-06Some build warnings/fixes.Tyge Løvset
2022-02-05Switched to heavily modified version of Rob Pike's plan9 regexp9. -> now ↵Tyge Løvset
renamed to cregex, with new API.
2022-01-30Replaced utf8_decode() and friends code.Tyge Løvset
2022-01-16Made private functions (not called by header inlines) always static. Added ↵Tyge Løvset
required param tp examples/regex1.c.
2022-01-16Added cregex_compile() to reuse a cregex object (using realloc)). Major ↵Tyge Løvset
optimizations when using ^ and $ (removed 3 strlen calls).
2022-01-15Added back cregex with examples. Found the bug in his code.Tyge Løvset