2021-02-24 09:53:36 +03:00
|
|
|
## Overview
|
2021-02-04 11:17:43 +03:00
|
|
|
|
2021-02-24 09:53:36 +03:00
|
|
|
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
|
|
|
[![codecov](https://codecov.io/gh/tezc/sc/branch/master/graph/badge.svg?token=O8ZHQ0XZ30)](https://codecov.io/gh/tezc/sc)
|
|
|
|
[![Total alerts](https://img.shields.io/lgtm/alerts/g/tezc/sc.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/tezc/sc/alerts/)
|
|
|
|
|
2021-02-24 18:37:21 +03:00
|
|
|
Portable, stand-alone C libraries and data structures. (C99)
|
2021-03-01 14:50:18 +03:00
|
|
|
|
2021-02-27 20:29:43 +03:00
|
|
|
Most of them are optimized for performance. e.g array, hashmap, queue, timer.
|
2021-02-04 12:18:23 +03:00
|
|
|
|
2021-02-27 20:29:43 +03:00
|
|
|
Each folder is stand-alone with a single header/source pair in it.
|
|
|
|
There is no build for libraries, just copy files you want.
|
|
|
|
e.g If you want array, copy sc_array.h and sc_array.c to your project.
|
|
|
|
|
|
|
|
I use on Linux mostly but libraries are portable, CI runs on
|
2021-02-14 17:48:32 +03:00
|
|
|
|
2021-02-24 09:53:36 +03:00
|
|
|
<pre>
|
|
|
|
OS : Linux, MacOS, FreeBSD and Windows
|
|
|
|
Compilers : GCC, Clang, MSVC
|
2021-03-01 14:50:18 +03:00
|
|
|
Arch : x64, aarch64, armv6(32 bit), armv7(32 bit), ppc64le, s390x(big endian)
|
2021-02-24 09:53:36 +03:00
|
|
|
Sanitizers : valgrind and clang/gcc sanitizers(address, undefined, thread)
|
|
|
|
</pre>
|
2021-02-14 17:41:16 +03:00
|
|
|
|
2021-02-24 09:53:36 +03:00
|
|
|
## List
|
2021-02-04 11:17:43 +03:00
|
|
|
|
2021-02-05 16:35:10 +03:00
|
|
|
| Library | Description |
|
|
|
|
|--------------------------------|--------------------------------------------------------------------------------------------|
|
|
|
|
| **[array](array)** | Generic array/vector |
|
|
|
|
| **[buffer](buffer)** | Buffer for encoding/decoding variables, best fit for protocol/serialization implementations|
|
|
|
|
| **[condition](condition)** | Condition wrapper for Posix and Windows |
|
|
|
|
| **[crc32](crc32)** | Crc32c, uses crc32c CPU instruction if available |
|
|
|
|
| **[heap](heap)** | Min heap which can be used as max heap/priority queue as well |
|
|
|
|
| **[ini](ini)** | Ini parser |
|
|
|
|
| **[linked list](linked-list)** | Intrusive linked list |
|
|
|
|
| **[logger](logger)** | Logger |
|
2021-02-05 20:46:59 +03:00
|
|
|
| **[map](map)** | A high performance open addressing hashmap |
|
2021-02-05 16:35:10 +03:00
|
|
|
| **[memory map](memory-map)** | Mmap wrapper for Posix and Windows |
|
|
|
|
| **[mutex](mutex)** | Mutex wrapper for Posix and Windows |
|
|
|
|
| **[option](option)** | Cmdline argument parser. Very basic one |
|
|
|
|
| **[perf](perf)** | Benchmark utility to get performance counters info via perf_event_open() |
|
|
|
|
| **[queue](queue)** | Generic queue which can be used as dequeue/stack/list as well |
|
2021-02-06 16:58:50 +03:00
|
|
|
| **[sc](sc)** | Utility functions |
|
2021-02-15 00:10:57 +03:00
|
|
|
| **[signal](signal)** | Signal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc) |
|
2021-02-07 20:42:08 +03:00
|
|
|
| **[socket](socket)** | Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows |
|
2021-02-05 16:35:10 +03:00
|
|
|
| **[string](string)** | Length prefixed, null terminated C strings. |
|
|
|
|
| **[thread](thread)** | Thread wrapper for Posix and Windows. |
|
|
|
|
| **[time](time)** | Time and sleep functions for Posix and Windows |
|
2021-02-06 08:11:54 +03:00
|
|
|
| **[timer](timer)** | Hashed timing wheel implementation with fast poll / cancel ops |
|
2021-02-05 16:35:10 +03:00
|
|
|
| **[uri](uri)** | A basic uri parser |
|