Welcome to uLib’s documentation!
uLib is a modern library for C applications.
Getting started
API docs
- Numeric types
- Integer numbers
ulib_intulib_uintulib_uint16_floor2()ulib_uint32_floor2()ulib_uint64_floor2()ulib_uint16_ceil2()ulib_uint32_ceil2()ulib_uint64_ceil2()ulib_uint16_log2()ulib_uint32_log2()ulib_uint64_log2()ulib_uint16_ceil_log2()ulib_uint32_ceil_log2()ulib_uint64_ceil_log2()ulib_uint_floor2()ulib_uint_ceil2()ulib_uint_log2()ulib_uint_ceil_log2()ulib_uint_pow2()ulib_uint_is_pow2()ulib_uint_is_pow2_or_zero()ULIB_INT_MINULIB_INT_MAXULIB_INT_FMTULIB_UINT_MINULIB_UINT_MAXULIB_UINT_FMT
- Floating point numbers
- Utilities for numeric types
- Bitmasks
- Return codes
- Other types
- Integer numbers
- Strings
- Immutable string
UStringustring_nullustring_emptyustring_hash_func()ustring_size()ustring_length()ustring_data()ustring_assign()ustring_copy()ustring_wrap()ustring()ustring_assign_buf()ustring_copy_buf()ustring_wrap_buf()ustring_dup()ustring_with_format()ustring_with_format_list()ustring_range()ustring_concat()ustring_join()ustring_repeating()ustring_replacing_char()ustring_is_upper()ustring_is_lower()ustring_to_upper()ustring_to_lower()ustring_index_of()ustring_index_of_last()ustring_find()ustring_find_last()ustring_starts_with()ustring_ends_with()ustring_equals()ustring_precedes()ustring_compare()ustring_hash()ustring_to_int()ustring_to_uint()ustring_to_float()ustring_deinit()ustring_deinit_return_data()ustring_is_null()ustring_is_empty()ustring_init_nullustring_init_emptyustring_copy_literalustring_literal
- Mutable string buffer
- Raw C strings
ulib_char_is_upper()ulib_char_is_lower()ulib_char_to_upper()ulib_char_to_lower()ulib_str_equals()ulib_str_dup()ulib_str_flength()ulib_str_flength_list()ulib_str_is_upper()ulib_str_is_lower()ulib_str_to_upper()ulib_str_to_lower()ulib_str_to_int()ulib_str_to_uint()ulib_str_to_float()ulib_mem_chr_last()ulib_mem_mem()ulib_mem_mem_last()
- Immutable string
- Collections
- Vector
- Types
- Builtin types
- Constants
- Defining new vector types
- Common vector operations
uvec()uvec_assign()uvec_wrap()uvec_deinit()uvec_move()uvec_copy()uvec_copy_to_array()uvec_reserve()uvec_expand()uvec_shrink()uvec_data()uvec_get()uvec_set()uvec_first()uvec_last()uvec_count()uvec_size()uvec_index_is_valid()uvec_push()uvec_pop()uvec_remove_at()uvec_unordered_remove_at()uvec_insert_at()uvec_remove_range()uvec_unordered_remove_range()uvec_insert_range()uvec_clear()uvec_remove_all()uvec_append()uvec_append_array()uvec_view()uvec_view_from()uvec_view_to()uvec_set_range()uvec_reverse()uvec_shuffle()uvec_foreachuvec_foreach_reverse
- Equatable vectors
- Comparable vectors
uvec_index_of_min()uvec_index_of_max()uvec_sort()uvec_sort_range()uvec_sorted_insertion_index()uvec_sorted_index_of()uvec_sorted_contains()uvec_sorted_insert()uvec_sorted_unique_insert()uvec_sorted_remove()uvec_insertion_index_sorted()uvec_index_of_sorted()uvec_contains_sorted()uvec_insert_sorted()uvec_insert_sorted_unique()uvec_remove_sorted()
- Priority queues
- Hash table
- Types
- Builtin types
- Constants
- Hash functions
- Defining new hash table types
- Common hash table operations
uhash_identical()uhash_str_equals()uhash_int8_hash()uhash_int16_hash()uhash_int32_hash()uhash_int64_hash()uhash_ptr_hash()uhash_combine_hash()uhash_populate()uhash_deinit()uhash_move()uhash_copy()uhash_copy_as_set()uhash_resize()uhash_shrink()uhash_is_map()uhash_put()uhash_get()uhash_delete()uhash_contains()uhash_exists()uhash_key()uhash_value()uhash_size()uhash_count()uhash_clear()uhash_next()uhash_foreach
- Hash maps
- Hash sets
- Vector
- Streams
- Input stream
- Output stream
UOStreamuostream_std()uostream_stderr()uostream_null()uostream()uostream_deinit()uostream_flush()uostream_reset()uostream_write()uostream_writef()uostream_writef_list()uostream_write_buf()uostream_write_string()uostream_write_time()uostream_write_date()uostream_write_time_of_day()uostream_write_time_interval()uostream_write_version()uostream_to_path()uostream_to_file()uostream_to_buf()uostream_to_strbuf()uostream_to_multi()uostream_add_substream()uostream_buffered()uostream_write_literal
- Return codes
- Data compression
- Time
UTimeutime_unitutime_stamputime_nsutime_equals()utime_to_timestamp()utime_now()utime_local()utime_from_timestamp()utime_add()utime_to_utc()utime_to_timezone()utime_normalize_to_utc()utime_diff()utime_to_string()utime_from_string()utime_is_leap_year()utime_days_in_month()utime_get_timestamp()utime_get_ns()utime_interval_unit_auto()utime_interval_convert()utime_interval_to_string()UTIME_DATE_FMTutime_date_fmt_argsUTIME_TIME_FMTutime_time_fmt_argsUTIME_FMTutime_fmt_args
- Random generators
- Memory allocation
- Macros
- Logging
ULogulog_level_builtinulog_levelULOG_ALLULOG_DISABLEDULogMsgULogTagULogEventulog_mainulog_level_to_string()ulog_level_from_string()ulog_default()ulog_enabled()ulog_disable()ulog()ulog_trace()ulog_debug()ulog_info()ulog_warn()ulog_error()ulog_fatal()ulog_ns()ulog_write_event()ulog_write_header()ulog_write_footer()ulog_write_msg()ulog_write_date()ulog_write_level()ulog_write_tag()ulog_write_loc()ulog_write_elapsed()ulog_write_color()ulog_write_space()ulog_write_newline()ulog_elapsedulog_perf- Colors
- ANSI color codes
UCOLOR_BLKUCOLOR_REDUCOLOR_GRNUCOLOR_YELUCOLOR_BLUUCOLOR_MAGUCOLOR_CYNUCOLOR_WHTUCOLOR_BBLKUCOLOR_BREDUCOLOR_BGRNUCOLOR_BYELUCOLOR_BBLUUCOLOR_BMAGUCOLOR_BCYNUCOLOR_BWHTUCOLOR_UBLKUCOLOR_UREDUCOLOR_UGRNUCOLOR_UYELUCOLOR_UBLUUCOLOR_UMAGUCOLOR_UCYNUCOLOR_UWHTUCOLOR_BLKBUCOLOR_REDBUCOLOR_GRNBUCOLOR_YELBUCOLOR_BLUBUCOLOR_MAGBUCOLOR_CYNBUCOLOR_WHTBUCOLOR_BLKHBUCOLOR_REDHBUCOLOR_GRNHBUCOLOR_YELHBUCOLOR_BLUHBUCOLOR_MAGHBUCOLOR_CYNHBUCOLOR_WHTHBUCOLOR_HBLKUCOLOR_HREDUCOLOR_HGRNUCOLOR_HYELUCOLOR_HBLUUCOLOR_HMAGUCOLOR_HCYNUCOLOR_HWHTUCOLOR_BHBLKUCOLOR_BHREDUCOLOR_BHGRNUCOLOR_BHYELUCOLOR_BHBLUUCOLOR_BHMAGUCOLOR_BHCYNUCOLOR_BHWHTUCOLOR_RST
- Semantic colors
- ANSI color codes
- Tests
- Test framework
utest_run()utest_all_passed()utest_batch_all_passed()utest_passed()utest_log_failure_reason()utest_fail()utest_assert_msg()utest_assert()utest_assert_false()utest_assert_ret()utest_assert_ok()utest_assert_not_null()utest_assert_fatal()utest_assert_critical()utest_mainutest_subutest_assert_enumutest_assert_intutest_assert_uintutest_assert_floatutest_assert_ptrutest_assert_stringutest_assert_bufutest_assert_ustring
- Memory leak detection
- Test framework
- Version