Welcome to uLib’s documentation!
uLib is a modern library for C applications.
Getting started
API docs
- Numeric types
- Integer numbers
ulib_int
ulib_uint
ulib_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_MIN
ULIB_INT_MAX
ULIB_INT_FMT
ULIB_UINT_MIN
ULIB_UINT_MAX
ULIB_UINT_FMT
- Floating point numbers
- Utilities for numeric types
- Bitmasks
- Return codes
- Other types
- Integer numbers
- Strings
- Immutable string
UString
ustring_null
ustring_empty
ustring_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_null
ustring_init_empty
ustring_copy_literal
ustring_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_foreach
uvec_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_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
UOStream
uostream_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
UTime
utime_unit
utime_stamp
utime_ns
utime_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_FMT
utime_date_fmt_args
UTIME_TIME_FMT
utime_time_fmt_args
UTIME_FMT
utime_fmt_args
- Random generators
- Memory allocation
- Macros
- Logging
ULog
ULogLevelBuiltin
ULogLevel
ULOG_ALL
ULOG_DISABLED
ULogMsg
ULogTag
ULogEvent
ulog_main
ulog_default()
ulog_enabled()
ulog_disable()
ulog()
ulog_trace()
ulog_debug()
ulog_info()
ulog_warn()
ulog_error()
ulog_fatal()
ulog_ns()
ulog_default_handler()
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_elapsed
ulog_perf
- Colors
- ANSI color codes
UCOLOR_BLK
UCOLOR_RED
UCOLOR_GRN
UCOLOR_YEL
UCOLOR_BLU
UCOLOR_MAG
UCOLOR_CYN
UCOLOR_WHT
UCOLOR_BBLK
UCOLOR_BRED
UCOLOR_BGRN
UCOLOR_BYEL
UCOLOR_BBLU
UCOLOR_BMAG
UCOLOR_BCYN
UCOLOR_BWHT
UCOLOR_UBLK
UCOLOR_URED
UCOLOR_UGRN
UCOLOR_UYEL
UCOLOR_UBLU
UCOLOR_UMAG
UCOLOR_UCYN
UCOLOR_UWHT
UCOLOR_BLKB
UCOLOR_REDB
UCOLOR_GRNB
UCOLOR_YELB
UCOLOR_BLUB
UCOLOR_MAGB
UCOLOR_CYNB
UCOLOR_WHTB
UCOLOR_BLKHB
UCOLOR_REDHB
UCOLOR_GRNHB
UCOLOR_YELHB
UCOLOR_BLUHB
UCOLOR_MAGHB
UCOLOR_CYNHB
UCOLOR_WHTHB
UCOLOR_HBLK
UCOLOR_HRED
UCOLOR_HGRN
UCOLOR_HYEL
UCOLOR_HBLU
UCOLOR_HMAG
UCOLOR_HCYN
UCOLOR_HWHT
UCOLOR_BHBLK
UCOLOR_BHRED
UCOLOR_BHGRN
UCOLOR_BHYEL
UCOLOR_BHBLU
UCOLOR_BHMAG
UCOLOR_BHCYN
UCOLOR_BHWHT
UCOLOR_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_not_null()
utest_assert_fatal()
utest_assert_critical()
utest_main
utest_sub
utest_assert_int
utest_assert_uint
utest_assert_float
utest_assert_ptr
utest_assert_string
utest_assert_buf
utest_assert_ustring
- Memory leak detection
- Test framework
- Version