summaryrefslogtreecommitdiffhomepage
path: root/examples/splitstr.c
AgeCommit message (Collapse)Author
2022-12-20Restructured folders: examples, benchmarks, tests into misc folder.Tyge Lovset
2022-12-19Renames:Tyge Løvset
cstr_null => cstr_NULL csview_null => csview_NULL cstr_npos => c_NPOS csview_npos => c_NPOS c_ARGsv(sv) => c_ARGSV(sv) c_init(x) => c_INIT(x)
2022-12-14cregex: renamed enums to all uppercase and prefixed CREG_Tyge Løvset
2022-12-04Support for linking dependant UTF8 and cstr functions and/or cregex.c by ↵Tyge Løvset
defining i_extern before including <stc/cstr.h> and <stc/cregex.h>. I.e. #define i_extern #define i_implement // define cstr functions as shared symbols (static if not defined). #include <stc/cregex.h> // include cstr.h, utf8code.c, cregex.c, unless already included.
2022-10-21Swapped two last params in cregex_replace_pattern() and cregex_replace_sv() ↵Tyge Løvset
to always have flags at last (sorry for inconveniences). Fixed a small bug in cregex_find_sv(), and added cre_default flag for readability.
2022-09-21Recent macro renames:Tyge Løvset
c_foreach_token() => c_fortoken() c_foreach_match() => c_formatch() Added: c_forfiltered() c_forpred()
2022-09-06- Added c_foreach_token(it, ...) macro in csview.h.Tyge Løvset
- Changed c_foreach_match(it, ...): to access matches, use it.match[j] - splitstr.c now shows usages of both the above.
2022-08-13Experimental: Renamed c_autovar => c_with, c_autoscope => c_scope, ↵Tyge Løvset
c_autodefer => c_defer. May or may not be reverted before V4.0 release.
2022-07-31csview: csview_token(sv, sep, &start): now start > sv.size on last token. ↵Tyge Løvset
Removed usage of c_ARGsv() macro in examples => printf formatting ".*s". csview fully inlined.
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-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-04-18Converted all example to use cstr_str(&s) instead of s.str to allow SSO ↵Tyge Løvset
string. Fixed misc warnings.
2022-01-14Renamed *_v() methods to *_sv(). Note: this breaks API, hopefully not too ↵Tyge Løvset
intrusive. The change was needed to be consistent in using 'sv' as a shorthand for "string view" everywhere, and is easier to understand than _v().
2022-01-09Removed strings.h.Tyge Løvset
2022-01-08Moved utf8 from cregex.h to separate file. Splitted csview.h into another ↵Tyge Løvset
file strings.h.
2021-12-29Removed warnings for MS cl -W2 and clang -pedantic -std=c99. No functional ↵Tyge Løvset
changes.
2021-12-29Fixed and simplified csview tokensizer call.Tyge Løvset
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-13Renamed constructor *cstr_lit()* to `cstr_new(lit)`.Tyge Løvset
Renamed *cstr_assign_fmt()* to `cstr_printf()`. Renamed cbits_from_str() to cbits_from().
2021-12-12- Added **cbox** type: container of one element: similar to std::unique_ptr ↵Tyge Løvset
/ Rust Box. - Replaced example for **csptr** in docs. - Added [**c_forpair**](docs/ccommon_api.md) macro: for-loop with "structural binding" as in c++. - Deprecated *csptr_X_make()*. Renamed to *csptr_X_new()*. Corresponding **cbox** method is *cbox_X_new()*. - Deprecated *c_default_fromraw(raw)*. Renamed to *c_default_clone(raw)*. - Deprecated `i_key_csptr` / `i_val_csptr`. Use `i_key_ref` / `i_val_ref` when specifying containers with **csptr** or **cbox** elements. - Deprecated `i_cnt`. Use `i_type` instead to define the full container type name. - Bugfixes and docs updates.
2021-10-04Added c_autodefer() macro (again). Depressed warning with c_no_compare().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-08Updated rest of examples, except cqueue.cTyge Løvset
2021-06-11Improve naming of c_sv() and c_lit() in csview.h: Rename c_sv(cstr) => ↵Tyge Løvset
cstr_sv(cstr), and c_lit(string literal) => c_sv(string literal). Hopefully not too much used yet, as they are fairly new.
2021-05-27Made substr() and slice() only returning csview. Added Both cstr and csview ↵Tyge Løvset
input argument variants. Changed def of cstr_npos.
2021-05-25Small refactoring and improved docs.Tyge Løvset
2021-05-24Added splitstr.c example. Renamed macro csview_ARG() to csview_arg(): ↵Tyge Løvset
special for printing csviews with "%.*s" format.