Skip to content
Wilhelm-LeePublic

About

C99-Compliant System Framework for High Level Abstractions Run in Native C. Features Consistant, Elegant OOP API, Dynamic Collections, Advanced String Manipulations plus Regex, Heapless Memory Pool. Suitable for Desktop Applications and Micro Controller Units.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

105 Commits

Folders and files

Repository files navigation

COMPOUND

The Compound library is a macro-driven, C99-compliant framework designed to bring high-level object-oriented patterns and automated memory management to the C programming language. It provides a robust foundation for building complex systems by abstracting common tasks such as generic container management, string manipulation, and programmatically generated C code.

To know more about generative source code licensing notices, see Important Notice Regarding Generated Code

Compound addresses the fragility of manual memory management in C through a built-in memory pool and recycler system, while maintaining performance and portability across multiple compilers and platforms.

Building

Codacy Badge

Compound supports multiple platforms, and is built using CMake.

This section delivers minimum steps for building Compound on your machine, as it covers the following platforms:

The output is managed. See Filesystem.

Microsoft Windows

Please make sure to have sufficient prerequisites installed on your Windows machine before starting the building process.


It is recommended to have the following software downloaded, and, installed on your computer, every one of them:

click the item to go to the download page

PowerShell / CMD

If you have not downloaded the project from GitHub.com , use the following command to do so:

  git clone 'https://github.com/Wilhelm-Lee/Compound.git'
  cd Compound

Next, build the project using CMake:

  cmake .
  make

GNU/Linux & Apple MacOS

Since you are using Unix-like systems, and you are trying to build a highly technical library on your own, it is considered that you have already acquired enough knowledge to operate without holding hands.

So here it is.

  git clone 'https://github.com/Wilhelm-Lee/Compound.git' && cd Compound
  cmake . && make

Other Platforms

If your platform wasn't listed, it's probably untested for the time being.

However, if your Operating System has more people talking about to add a support for it, the develop team is here to consider the suggestion.

Licensing and Compilation Acknowledgment

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, see https://www.gnu.org/licenses/.

Important Notice Regarding Generated Code

This library is designed to be fully usable as a standard, plain library. However, it also features an optional self-generating architecture.

If you choose to enable this feature, the library will generate additional source code that must be compiled and executed for those specific extended capabilities to function.

By opting to configure, compile, or execute the generated outcome of this library, you explicitly acknowledge and agree to the following:

  • Optional Code Generation: You understand that compiling and executing the library's own programmatic output is entirely optional and only required if you choose to utilize the self-generating features.
  • Derivatives and Linking: Any resulting binaries or modifications that dynamically or statically link to this library-including the optionally generated source code-remain subject to the terms of the LGPL 2.0.

Filesystem

This section lists the content changes in directories after both the building and the source code generation.

  • The building changes are highlighted using bold.
  • The source code generation changes are highlighted using italic.

Before building + source code generation:

  • inc
    • *.h
  • src
    • *.c
  • test
    • test.c

After building + source code generation:

  • inc
  • src
  • test
    • test.c
  • out
    • bin
      • CompoundTest/~.exe
    • lib
      • libcompound.so/~.dylib/~.dll
  • CMakeFiles
    • compound.dir
    • CompoundTest.dir
      • test
        • test.c.o
        • test.c.o.d
    • Foundation.dir
      • src
        • *.c.o
        • *.c.o.d
  • user
    • header.h

Language Compatibility

Compound is written compliantly to C99 standard.

But instead of relying on non-standard compiler extensions, recently obsoleted features or platform-specific APIs, Compound achieves wide compatibility through strict adherence to standard C paradigms:

Compound adopts

  • Strict compliance with the C99 standard; successfully compiled with -Wpedantic and -std=iso9899:1999.
  • Fixed-width integer definitions exclusively via <stdint.h> for unified memory layouts.
  • Standard variadic macros (__VA_ARGS__) to drive generic data structures and Metaprogramming.
  • A wrapped Main macro entry point to standardize environment and argument parsing across platforms.
  • Optional, isolated boolean type definitions (unsigned char) to avoid <stdbool.h> namespace collisions.

Compound forbids

  • Variable Length Arrays (VLA).
  • The #pragma directive.
  • The goto statement, explicitly undefining it to prevent control flow intrusion.
  • Proprietary compiler extensions for core structural logic.

About

C99-Compliant System Framework for High Level Abstractions Run in Native C. Features Consistant, Elegant OOP API, Dynamic Collections, Advanced String Manipulations plus Regex, Heapless Memory Pool. Suitable for Desktop Applications and Micro Controller Units.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages