Mlib Versions Save

Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).

V0.7.2

4 months ago

The main new features of this release are:

  • Generic Interface providing way to have the exact same code working on any registered type (like C++). Once the user registers the oplist of its own type, the provided function macros will handle this type like any other (using _Generic & typeof). See example However, the interface is still a WIP.
  • Exception memory model with RAII support (using M_LET): The destructor of stack variables are called when the exception is triggered. Previously written code using M_LET is fully compatible. Add macro M_CHAIN_OBJ to handle partially initially object. In C++ mode, it uses C++ try/catch. Otherwise it uses setjmp/longjmp. Release Limitation: not all M*LIB functions are exception aware (some functions may leave the object in a partial state when an exception is triggered). See example
  • Provide way of avoiding code duplication for multiple source C files (Using compiler extension) - either globally or per container instance. See M_USE_EXTERN_DECL & M_USE_DECL & M_USE_EXTERN_FINE_GRAINED and example and this

Other new features are:

  • Make Function Object interface trivially copyable
  • INIT_WITH support for shared pointer
  • Add more Emplace support for other containers (Tuple, ...)
  • Add string_it_set_ref & string_pop_u & string_cat_vprintf (by Kitterion)
  • Change M_BY_NARGS semantics
  • Add threads backend for FreeRTOS tasks.
  • Add M_WORKER_SPAWN_DEF2 for providing specialization and type-safe variant of m_worker_spawn.

And the usual update:

  • Add examples
  • Improve coverage of test suite (>99%)
  • Fix build issue with FreeBSD
  • Fix bugs (in particular in parsing incorrect data)
  • Remove new warnings by new version of compilers
  • Improve documentation

V0.7.0

1 year ago

New release includes:

  • Add m-tree header (generic tree API)
  • Support of Emplace functionnality to generate functions to push a new element in the container based on the provided types and constructors (Through new operator EMPLACE_TYPE)
  • Support of M_INIT_WITH_THROUGH_EMPLACE_TYPE as INIT_WITH method to use the provided constructors of EMPLACE_TYPE to init an object in C11.
  • Add M prefix for all exported methods. Previous names still work but will be deprecated on the next release (controlled through M_USE_SMALL_NAME). The plan is for next release to have the names deprecated but still enabled, next next release to have the old names disabled (but can be enabled). Afterwards the old names will be removed for final version.
  • Rename M_DEFAULT_OPLIST in M_BASIC_OPLIST (cleaner name)
  • Add generic API transformation in the framework responsible of expanding the call to a method from an operator.
  • Add more core macros: M_CROSS_MAP2, M_CROSS_MAP, M_AND3 & M_OR3 macros
  • Move m_once_t to the public interface
  • Remove constraint of calling string_end_p before string_next or string_get_cref
  • Add string_previous, string_it_get_pos, string_it_pos, string_set_si & string_set_ui
  • Add bitset_ctz, m_core_ctz32, m_core_ctz64
  • Move internal types/functions to internal namespace
  • Add more internal macros (M_C5_EMPTY, M_C3_EMPTY, M_KEYWORD_TO_VA_ARGS)
  • Fix warnings in release mode
  • Add more tests
  • Add support for Fuzzer testing
  • More check against C++ STL
  • Fix bugs
  • Fix/Update documentation
  • Remove deprecated features

V0.6.0

2 years ago

New release including:

  • Rename M_INVERT to M_REVERSE, M_HASH_SEED to M_USE_HASH_SEED, _clean methods to _reset, _get_at methods to _safe_get to be more coherent and explicit.
  • Remove of UPDATE operator. Use of SET for RBTREE or ADD for DICT instead.
  • M_LET: Enable user selection of setting or emplacing the argument given to initialize the variable. If there is only one argument without parenthesis around it, it will _init_set the variable with the argument. Otherwise it will _init_with the variables with the argument(s) (INIT_WITH). However, it may break existing code: in such case, you need to put your argument in parenthesis.
  • M_LET supports tupple now
  • M_LET supports now recursive use of INIT_WITH.
  • \it_from method of RBTree definition change: from the greatest element of 'rbtree' lower of equal than 'data' to the lowest element of the tree 'rbtree' greater or equal than 'data' (More natural behavior).
  • Add _remove method for B+Tree
  • Add string_set_char function
  • _back & _front methods return a modifiable pointer.
  • JSON serializing can target string_t instead of FILE.
  • Add bitset_popcount
  • Add ARRAY_INIT_VALUE & LIST_INIT_VALUE to initialize globally some arrays & lists.
  • Add M_MERGE_ARGLIST macro to merge two argument lists.
  • Add macros M_GREATER_OR_EQUAL_P, M_GREATER_THAN_P, M_LESS_THAN_P and M_LESS_OR_EQUAL_P to compare at processing time two numbers.
  • Add macros M_FILTER, M_FILTER_C, M_REPLICATE & M_REPLICATE_C macros to manipulate lists.
  • Add macros M_REDUCE3, M_MAP3_C which provides an additional number argument over M_REDUCE2 and M_MAP2_C.
  • M_PRINT supports natively string_t variables and add support of custom print by providing oplist to the given variable.
  • Remove obsolete features of the previous version.
  • Rename internal functions to avoid polluting the prefix used by the user.
  • Augment test suite by comparing the behavior of M*LIB to the C++ STL
  • Increase coverage of test suite.
  • Factorization / Simplification.
  • Several bug fixs

V0.5.0

3 years ago

New release including:

  • Even fewer warnings reported by compilers even in hostile environments,
  • New functions & constructions to improve user efficiency (M_STR, M_LET_IF, ...)
  • Support of fully user defined types (with the DEF_*_AS macros)
  • Support for MSVC
  • Bug fixes

NOTE: The version is taggued as 0.4.1 in the header. It is an error, it should be 0.5.0.

V0.4.0

3 years ago

New release including:

  • better error checking of the library of incorrect argument (the library won't expand everything and stop on the first error)
  • Function object support
  • More algorithms are available
  • micro optimization
  • bug fixes

V0.3.0

4 years ago

New release, with notably multimap & multiset.

V0.2.2

5 years ago

New release, including notably using SSO (Small / Short Optimization) for string_t .

V0.2.1

5 years ago
  • Fix some issues including #43 #41 #40
  • Add CONCURRENT_RP_DEF #39

V0.2.0

5 years ago

Maturation of the API

V0.1.1

6 years ago