All Projects β†’ nemequ β†’ Portable Snippets

nemequ / Portable Snippets

Licence: other
Collection of miscellaneous portable C snippets.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Portable Snippets

Tzupdate
Set the system timezone based on IP geolocation
Stars: ✭ 130 (-67.25%)
Mutual labels:  public-domain, time, clock
telltime
iOS application to tell the time in the British way πŸ‡¬πŸ‡§β°
Stars: ✭ 49 (-87.66%)
Mutual labels:  time, clock
TimeContinuum
No description or website provided.
Stars: ✭ 28 (-92.95%)
Mutual labels:  time, clock
mulle-thread
πŸ” Β Cross-platform thread/mutex/tss/atomic operations in C
Stars: ✭ 22 (-94.46%)
Mutual labels:  atomic, portable
ardusamber
Desamber time Arduino corporealization
Stars: ✭ 20 (-94.96%)
Mutual labels:  time, clock
time
The simplest but configurable online clock
Stars: ✭ 77 (-80.6%)
Mutual labels:  time, clock
ElevenClock
ElevenClock: Customize Windows 11 taskbar clock
Stars: ✭ 1,494 (+276.32%)
Mutual labels:  time, clock
Use Timer
A timer hook for React
Stars: ✭ 113 (-71.54%)
Mutual labels:  time, clock
simple-analog-clock
Simple clock view for displaying uh...time?
Stars: ✭ 24 (-93.95%)
Mutual labels:  time, clock
tm
timers and timeline
Stars: ✭ 31 (-92.19%)
Mutual labels:  time, clock
MD DS3231
DS3231 Real Time Clock Library
Stars: ✭ 29 (-92.7%)
Mutual labels:  time, clock
Md Date Time Picker
An implementation of Material Design Picker components in vanilla CSS, JS, and HTML
Stars: ✭ 272 (-31.49%)
Mutual labels:  time, clock
React Clock
An analog clock for your React app.
Stars: ✭ 149 (-62.47%)
Mutual labels:  time, clock
clocklet
An opinionated clock-style vanilla-js timepicker.
Stars: ✭ 31 (-92.19%)
Mutual labels:  time, clock
React Timer Hook
React timer hook
Stars: ✭ 118 (-70.28%)
Mutual labels:  time, clock
vue-analog-clock-range
Vue Analog Clock Range Component
Stars: ✭ 53 (-86.65%)
Mutual labels:  time, clock
Vue Clock2
vue clock component πŸ˜€
Stars: ✭ 67 (-83.12%)
Mutual labels:  time, clock
Hyperapp Fx
Effects for use with Hyperapp
Stars: ✭ 105 (-73.55%)
Mutual labels:  time, random
timestampy
πŸ•’ Bunch of utilities useful when working with UNIX timestamps
Stars: ✭ 21 (-94.71%)
Mutual labels:  time, clock
clock
High-resolution clock functions: monotonic, realtime, cputime.
Stars: ✭ 52 (-86.9%)
Mutual labels:  time, clock

Portable Snippets

This is a collection of public domain (CC0) code snippets written in C for performing various common tasks which are typically OS, architecture, and/or compiler-dependent. Basically, our goal is to move those annoying preprocessor conditionals from your code to ours.

Modules have no fixed target (such as C89) since that would preclude some functionality; instead, we simply try to provide the widest support we can for each module. If you have a platform which isn't supported for a particular feature but could be, please let us know; we'd be happy to try to work out a way to support it.

Everything is tested continuously with various versions of GCC, Clang, and PGI (on Travis CI), MSVC (on AppVeyor), and Emscripten (on Codefresh):

Travis CI status AppVeyor status Codefresh status

Currently ready-to-use modules include:

  • builtin β€” use compiler built-ins/intrinsics, or fall back on standard C
  • endian β€” endianness detection and swapping
  • atomic β€” common atomic synchronization operations
  • safe-math β€” overflow-safe integer functions
  • exact-int β€” exact-width integer types (think <stdint.h>)
  • clock β€” cross-platform wall clock, CPU time, and monotonic time

There are also modules which may not yet be ready for widespread use, but would benefit greatly from testing:

  • unaligned β€” fast unaligned loads & stores
  • once β€” one-time initialization
  • random β€” random number generation (3 flavors: cryptographic, reproducible, and fast)
  • debug-trap β€” debugging traps and assertions
  • check β€” assertion checking

Modules can be used in isolation, though some do work better together, so if you can keep the whole repository together instead of just copying a single file we recommend you do so.

Please don't be shy about filing issues about any of these; if you have problems it's likely others will, as well, so we would like to fix them.

If you have something you would like to contribute, please file an issue or pull request. If you'd like to help out by writing something new, take a look at the "enhancement" issues in our issue tracker for ideas.

Some things don't really fit this repository, so here are a few small-ish projects for doing things portably which you may be interested in:

  • Hedley β€” macros to enable compiler-specific features which make your code easier to use, harder to misuse, safer, faster, and more portable.
  • parg β€” Argument parsing similar to getopt/getopt_long. Public domain.
  • TinyCThread β€” Implements the C11 threads API on top of pthreads and the Windows API. zlib license.
  • win-iconv β€” Windows implementation of the iconv API (character set conversion).
  • mman-win32 β€” mman.h (mmap(), etc.) implementation for Windows.

If there is a project you'd like to see added to the list, please file an issue or pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].