summaryrefslogtreecommitdiffhomepage
path: root/examples/mapmap.c
AgeCommit message (Collapse)Author
2022-12-20Restructured folders: examples, benchmarks, tests into misc folder.Tyge Lovset
2022-10-24API CHANGE: Renamed input params for naming consisteny and usage:Tyge Løvset
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.
2022-10-20Switch from #define i_val_bind to i_val_class and i_key_class.Tyge Løvset
i_val_bind/i_key_bind is deprecated but available for now.
2022-06-10Small simplifications in cmap.hTyge Løvset
2022-06-01Reverted to default static linkage of non-templated symbols (cstr, csview, ↵Tyge Løvset
..), as it gives smaller executables and is convenient for small applications. (no need to define i_implement when functions is used in one translaton unit only).
2022-06-01Converted all files with DOS line endings to LINUX.Tyge Løvset
2022-05-30Done refactoring:Tyge Løvset
- Non-templated types (cstr, csview, cbits, crandom) have no longer default static linking. Now i_header is defined, i.e. files are as headers only. ==> Define `i_implement` before file inclusion. Still possible to do static linkage by defining `i_static` before inclusion or global STC_STATIC. - Templated containers still have static linkage by default. - Renamed csview_substr(), csview_slice() to csview_substr_ex(), csview_slice_ex(). Added simpler inlined csview_substr(), csview_slice().
2022-05-30Added more utf8 features. Changed linking macros in ccommon.h.Tyge Lovset
2022-05-24Changed c_forpair(k, v, Map, map) so that k and v are pointers instead of ↵Tyge Løvset
values. This to make it consistent with c_foreach, c_apply, c_apply_arr.
2022-04-28Finalized template.h logic.Tyge Løvset
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-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-07More refactoring of cbits.h + minor changes in examples/benchmark.Tyge Løvset
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.
2021-12-29Removed warnings for MS cl -W2 and clang -pedantic -std=c99. No functional ↵Tyge Løvset
changes.
2021-12-19First commit for Version 3 of STC. Main changes are consistent rename of ↵Tyge Løvset
'_del' to '_drop' and '_compare' to '_cmp'. Also i_key_ref (earlier i_key_sptr) and i_val_ref replaced by more general i_key_bind/i_val_bind.
2021-12-02Breaking changes for i_fwd and i_cmp_none:Tyge Løvset
- Removed: i_cmp_none and i_fwd (replaced by c_no_compare and c_is_fwd args to i_opt). - Added compile-time disabling of clonable and comparable container elements, controlled by i_opt (c_no_clone | c_no_compare) - Added i_opt: can define multiple compile-time options: c_no_compare, c_no_clone, c_no_atomic, c_is_fwd: may be combined with | separator. - Except for csptr, when i_del / i_valdel / i_keydel is defined, also i_from / i_keyfrom / i_valfrom must be defined or i_opt c_no_clone. - For struct elements, either i_cmp must be defined (as before), or define i_opt c_no_compare for non-associative containers.
2021-11-03Changed container_X_get() and container_X_at() to return const value* (or ↵Tyge Løvset
const mapped*). Added container_X_getmut() for mutable version. Updated docs.
2021-10-29Renamed ..._value_t -> ..._value, etc. Deprecated, still works for cvec, ↵Tyge Løvset
cdeq, cmap, csmap, cslist
2021-10-16Changed c_hash_default() function. Was bad on long strings. Updated mapmap.c ↵Tyge Løvset
example.
2021-10-05Changed recommended order of defining template parameters.Tyge Løvset
2021-09-20Renamed macros: breaking changes for Version 2.0!Tyge Lovset
c_forvar => c_autovar c_forscope => c_autoscope c_forauto => c_auto Removed: c_fordefer(x); use c_forscope(0, x) instead. Added: c_exitauto; // continue
2021-09-13Removed most of the case-insensitive cstr methods, as they won't work with ↵Tyge Løvset
utf-8.
2021-09-08Updated rest of examples, except cqueue.cTyge Løvset
2021-05-24Split c_fordefer() into c_forvar() and c_fordefer() macros.Tyge Løvset
2021-05-24Renamed c_with => c_fordefer, and removed c_withvar. Macros were too ↵Tyge Løvset
deceiving and hid the fact that it was for-loops. Now it is more explicit.
2021-05-18Added the new c_defer(), c_with(), c_withvar() macros into the examples.Tyge Løvset
2021-03-13Fixed some doc errors in csmap and cmap. Added some inline funcs to cstr. ↵Tyge Løvset
Added read.c example.
2021-03-11Renamed public *_result_t struct member names in maps/sets for consistency ↵Tyge Løvset
with iterators.
2021-02-22Many internal renames. Reverted to specify both _del and _clone parameter ↵Tyge Løvset
when giving _del.
2021-02-21Renamed emplace_put() to emplace_or_assign(). May add put() as alias to ↵Tyge Løvset
insert_or_assign().
2021-02-20Rewamp of cmap/csmap API. More to come.Tyge Løvset
2021-01-30Internal changes: removed use of cmap_inits and set_inits. Use cmap_x_init() ↵Tyge Løvset
and cset_X_init(). Minor changes in cvec, csmap, cstr, crandom.
2021-01-03Force template argument *clone* to be specified when *del* is specified for ↵Tyge Løvset
containers. Can be *c_no_clone* if clonable is not required.
2020-12-17API change: Reverted back to original name used for .val in iterators to .refTyge Løvset
2020-11-26Removed stc/cfmt.h, as _Generic requires C11. I have made it a gist: ↵Tyge Løvset
https://gist.github.com/tylov/bcc956a4779f1d14204e66a14f17beb9 All examples are reverted to use printf() instead of c_print().
2020-11-03renamed __init to _initsTyge Løvset
2020-11-02Changed (half)-internal *_INIT to *__init macros. Minor reformatting.Tyge Løvset
2020-10-26Updates examples using cfmt.h c_print().Tyge Løvset
2020-09-24Changed iter.get to iter.val member. Internal, but used external. Will not ↵Tyge Løvset
change again.
2020-09-18Changed <container>_ini macro constant to <container>_INIT, and ↵Tyge Løvset
<container>_destroy() to <container>_del.
2020-09-17Fixed range methods in cvec, and renamed typename_<container>(..) to ↵Tyge Løvset
using_<container>(..).
2020-09-16Changed earlier declare_<container>(..) macro to typedef_<container>(..)Tyge Løvset
2020-09-16Changed API to conform with std:: containers. cmap now only use first, ↵Tyge Løvset
second. for result and value types.
2020-09-15Simplified declare_ statement e.g. c_cmap(...)Tyge Løvset
2020-09-15New API Change.Tyge Løvset
2020-09-14Renamed result_t type members to first, second (from item, inserted) for ↵Tyge Løvset
conformance with std::pair
2020-09-10Use cmap_emplace() rather than cmap_insert(). insert() is reduced to an ↵Tyge Løvset
alias of emplace() because it makes no sense using the std::unordered_map API.