Skip to content

0.4.6 - Add support for custom error handlers, drop ncurses, title features

Latest
Compare
Choose a tag to compare
@jgabaut jgabaut released this 02 Sep 12:16
ec00eda

What's Changed

Added

  • Add support for custom error handlers in push calls
    • Out-Of-Memory
    • PTRDIFF_MAX constraint violation
  • Add KLS_Err_Handlers to hold the handlers together
  • Add new err_handlers field to KLS_Conf
  • Add default handlers for all existing APIs:
    #ifndef KOLISEO_HAS_LOCATE
    void KLS_OOM_default_handler__(
        Koliseo* kls,
        ptrdiff_t available,
        ptrdiff_t padding,
        ptrdiff_t size,
        ptrdiff_t count
    );
    void KLS_PTRDIFF_MAX_default_handler__(
        Koliseo* kls,
        ptrdiff_t size,
        ptrdiff_t count
    );
    #else
    void KLS_OOM_default_handler_dbg__(
        Koliseo* kls,
        ptrdiff_t available,
        ptrdiff_t padding,
        ptrdiff_t size,
        ptrdiff_t count,
        Koliseo_Loc loc
    );
    void KLS_PTRDIFF_MAX_default_handler_dbg__(
        Koliseo* kls,
        ptrdiff_t size,
        ptrdiff_t count,
        Koliseo_Loc loc
    );
    #endif // KOLISEO_HAS_LOCATE
  • Add new constructors with custom OOM handler arguments
    • kls_new_traced_handled() // Macro
    • kls_new_dbg_handled() // Macro
    • kls_new_traced_AR_KLS_handled() // Function
    • kls_new_traced_alloc_handled() // Function
    • kls_new_dbg_alloc_handled() // Function
    • kls_new_traced_AR_KLS_alloc_handled() // Function
  • Add new kls_conf_init_handled() to pass handlers with a custom KLS_Conf
  • Add KLS_DEFAULT_ERR_HANDLERS macro

Changed

  • Drop ncurses, title features and all related symbols
  • The previous banner can be found in static/kls_banner.c

PR - feat: 0.4.6 Add support for custom error handlers by @jgabaut

Full Changelog: 0.4.5...0.4.6