Skip to content

Simple and yet powerful cross-platform C library providing data structures, algorithms and much more

License

Notifications You must be signed in to change notification settings

kala13x/libxutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8054128 · Mar 20, 2025
Mar 15, 2025
Mar 16, 2025
Mar 18, 2025
Mar 19, 2025
Mar 15, 2025
Mar 18, 2025
Jul 22, 2023
Mar 19, 2025
Mar 20, 2025
Mar 18, 2025
Mar 15, 2025

Repository files navigation

MIT License Linux MacOS Windows CodeQL Coverity Scan Build Status

libxutils - Cross-platform C library release 2.x

libxutils is a cross-platform C library that provides safer implementations of various functionality to make routine tasks easier for programs written in C and it's compatible languages like C++, Rust, and Objective C. The library offers a range of features including containers, data structures, network tools, cryptography algorithms, string manipulations, system utilities, HTTP/S & WS/WSS client/server, JSON parser/serializer, JWT tokens, and etc. A list of key features can be found below.

libxutils is available for Linux, Unix and Windows operating systems and is released under the MIT License. To check the version of the library you have, you can refer to the file src/xver.h. Please note that the list of features provided in the README is incomplete. For more information about the full range of features, you can refer to the individual header files linked below or browse the source code.

Containrers:

Network:

Cryptography:

System:

Miscellaneous:

Installation

There are several ways to build and install the project.

Using included script (recommended on Linux/Mac).

A relatively simple way to build and install the libary and tools is to use the included build script:

git clone https://github.com/kala13x/libxutils.git && ./libxutils/build.sh --install

List options that build script supports:

  • --tool=<tool> Specify Makefile generation tool or use included Makefile.
  • --install Install library and the tools after the build.
  • --examples Include examples in the build.
  • --tools Include tools in the build.
  • --clean Cleanup object files after build/installation.

You can either choose cmake, smake or make as the tool argument. If the tool will not be specified the script will use cmake as default.

Using CMake

If you have a CMake tool installed in your operating system, here is how project can be built and installed using cmake:

git clone https://github.com/kala13x/libxutils.git
cd libxutils
cmake . && make
sudo make install

Using SMake

SMake is a simple Makefile generator tool for the Linux/Unix operating systems:

git clone https://github.com/kala13x/libxutils.git
cd libxutils
smake && make
sudo make install

Using Makefile

The project can also be built with a pre-generated Makefile for the Linux.

export XUTILS_USE_SSL=y # In case you want to use SSL features
git clone https://github.com/kala13x/libxutils.git
cd libxutils
make
sudo make install

Dependencies

The only dependency that the library uses is the openssl-devel package for the SSL and RSA implementations.
If openssl package is not installed on the system, the lib will automatically be compiled without SSL support.

Install OpenSSL development package

Red-Hat family: sudo dnf install openssl-devel
Debian family: sudo apt-get install libssl-dev
Windows: choco install openssl
MacOS: brew install openssl

Usage

Just include the required <xutils/*.h> header files in your source code and use -lxutils
linker flag while compiling your project. See the example directory for more information.

Tools & Examples

Use the included script to build or install CLI apps from the tools directory.
The script can be used to build the sources from the examples directory as well.

./libxutils/build.sh --tools --examples

These sources can also be built by using the CMake tool or Makefile from that directory.
You may need to export the SSL flag accordingly if you are doing a build without the script:

export XUTILS_USE_SSL=y # In case you want to use SSL features
cd examples
cmake .
make

XTOP and more

alternate text

XTOP is HTOP like performance monitor that supports to monitor CPU, memory, and network traffic into a single window. In addition, it has powerful REST API client/server mode and much more.

After building the sources in tools directory, run sudo make install command to install following apps in the system:

  • xcrypt - File and text encrypt/decrypt tool for CLI
  • xpass - Secure password manager tool for CLI
  • xjson - JSON linter and minifier tool for CLI
  • xhttp - Powerful HTTP client tool for CLI
  • xhost - CLI tool to search and modify hosts
  • xtop - Advanced resource monithor for CLI
  • xsrc - Advanced file search tool for CLI

Run each of this tool with -h argument to check out the usage and version information.