A set of common code used in AVSystem for projects written in C.
Currently the included components are:
avs_buffer
- simple data buffer with circular-like semanticsavs_list
- lightweight, generic and type-safe implementation of a singly linked list, with API optimized for ad-hoc usageavs_rbtree
- basic implementation of a red-black binary search treeavs_vector
- generic implementation of a C++-style vector (dynamic array)avs_http
- minimal implementation of a Hypertext Transfer Protocol (HTTP) clientavs_net
- abstraction layer for TCP, UDP, SSL/TLS and DTLS network sockets, as well as DNS resolution and URL parsingavs_commons
versions up to 4.0.x included an avs_coap
module. This has been removed in favor of the new CoAP implementation distributed as part of Anjayavs_algorithm
- currently contains a base64 encoder and decoderavs_log
- simple logging frameworkavs_stream
- generic framework for I/O streams; includes pre-implemented streams that can be used through its unified API:
md5.h
- calculating MD5 hashesnetbuf.h
- buffered network I/Ostream_file.h
- file I/Ostream_inbuf.h
- read-only wrapper for raw memory buffersstream_membuf.h
- in-memory stream optimized for a single-message write-then-read cyclestream_outbuf.h
- write-only wrapper for raw memory buffersavs_unit
- simple and easy to use unit testing frameworkavs_utils
- currently contains utility function for handling time values, psudorandom number generation and string tokenizationMost of the library is written in standard and portable C99. There are some dependencies on POSIX APIs, but there are provisions for replacing them when necessary (see the compat
directory for details).
avs_unit
relies on some GCC-isms and is unlikely to work with any compiler that is not based on either GCC or Clang.
The code is available under Apache 2.0 License.
The preferred way of building avs_commons
is to use CMake:
cmake . &&
make &&
make install
You may use cmake -LH
or tools such as cmake-gui
or ccmake
to examine the available configuration options.
Alternatively, you may use any other build system. You will need to:
avs_commons_config.h
file. See the comments in avs_commons_config.h.in
for details.*.c
and *.h
files from src
and include_public
directories are preserved, with the directory structure intact.*.c
files inside src
or any of its direct or indirect subdirectories are compiled.src
and include_public
directories are included in the header search path when compiling avs_commons
.include_public
directory or a copy of it is included in the header search path when compiling dependent application code.An example simplistic build process for a Unix-like shell could be:
# configuration
cp include_public/avsystem/commons/avs_commons_config.h.in include_public/avsystem/commons/avs_commons_config.h
vi include_public/avsystem/commons/avs_commons_config.h # manually configure the library here
# compilation
cc -Iinclude_public -Isrc -c $(find src -name '*.c')
ar rcs libavs_commons.a *.o
# installation
cp libavs_commons.a /usr/local/lib/
cp -r include_public/avsystem /usr/local/include/