Coder Social home page Coder Social logo

sc's Introduction

Overview

Common C libraries and data structures. (C99)

Each folder is stand-alone and contains a single .h .c pair.
There is no build, copy .h .c files you want.

List

Library Description
array Generic array/vector
buffer Buffer for encoding/decoding variables, best fit for protocol/serialization implementations
condition Condition wrapper for Posix and Windows
crc32 Crc32c, uses crc32c CPU instruction if available
heap Min heap which can be used as max heap/priority queue as well
ini Ini parser
linked list Intrusive linked list
logger Logger
map A high performance open addressing hashmap
memory map Mmap wrapper for Posix and Windows
mutex Mutex wrapper for Posix and Windows
option Cmdline argument parser. Very basic one
perf Benchmark utility to get performance counters info via perf_event_open()
queue Generic queue which can be used as dequeue/stack/list as well
sc Utility functions
signal Signal handler & signal safe snprintf (handling CTRL+C, printing backtrace on crash etc)
socket Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows
string Length prefixed, null terminated C strings.
thread Thread wrapper for Posix and Windows.
time Time and sleep functions for Posix and Windows
timer Hashed timing wheel implementation with fast poll / cancel ops
uri A basic uri parser

Test

codecov

Although I use on Linux mostly, CI runs with

OS         : Linux, MacOS, FreeBSD and Windows  
Compilers  : GCC, Clang, MSVC  
Arch       : x64, aarch64, armv6, armv7, ppc64le, s390x  
Sanitizers : valgrind and clang/gcc sanitizers(address, undefined, thread)

To run all tests :

#with valgrind
mkdir build; cd build;
cmake .. && make && make valgrind

#with address sanitizer
mkdir build; cd build;
cmake .. -DSANITIZER=address && make && make check

#with undefined sanitizer
mkdir build; cd build;
cmake .. -DSANITIZER=undefined && make && make check

#coverage, requires GCC.
mkdir build; cd build;
cmake .. -DCMAKE_BUILD_TYPE=Coverage; make; make coverage

sc's People

Contributors

tezc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.