Workshop o mikrokontrolérech na SKSP 2024.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

3 months ago
LibUCW Basics
=============
Every program using LibUCW should start with `#include <ucw/lib.h>` which
brings in the most frequently used library functions, macros and types.
This should be done before you include any of the system headers, since
`lib.h` defines the feature macros of the system C library.
Portability
-----------
LibUCW is written in C99 with a couple of GNU extensions mixed in where needed.
It currently requires the GNU C compiler version 4.0 or newer, but most modules
should be very easy to adapt to a different C99 compiler. (A notable exception
is `stkstring.h`, which is heavily tied to GNU extensions.)
The library has been developed on Linux with the GNU libc and it is known to run
on Darwin, too. The authors did not try using it on other systems, but most of
the code is written for a generic POSIX system, so porting to any UNIX-like system
should be a piece of cake.
Threads
-------
Generally, functions in the UCW library are reentrant as long as you call them
on different data. Accessing the same object from different threads is not supported,
unless otherwise told. This also applies to functions acting on any kind of global state.
ucw/lib.h
---------
!!ucw/lib.h
ucw/config.h
------------
This header contains the standard set of types used by LibUCW. It is automatically
included by `ucw/lib.h`.
!!ucw/config.h