How rustyrussell/ccan works
High-Level Components
a. CCAN Modules – The heart of the project is the “ccan” directory. Each subdirectory under “ccan” is an independent C module (for example, a_star, alignof, daemonize, io, json, tal, etc.). These modules are designed to be self-contained libraries with their own source, header, test, license, and information files.
c. Documentation & Web Content – Documentation is available in “doc” and “web” directories. “doc” contains manuals and formatted documentation while “web” houses the assets for the CCAN website (CSS, HTML, PHP scripts), which offer static content and search capabilities.
d. Licensing and Other Metadata – The “licenses” folder contains various open-source licenses (Apache, BSD, GPL, etc.), and there are also supporting configuration files (like .travis.yml, Makefiles, appveyor.yml) which highlight how CI and build processes are arranged.
e. Junkcode – A “junkcode” folder exists that gathers miscellaneous or experimental code from various contributors. This can be represented as an auxiliary component showcasing sample implementations or legacy code that is not part of the core libraries.
• Central “CCAN Modules” block enclosing many independent modules. Use a container or a logical grouping to indicate that each module is self-contained and follows a uniform structure (source, header, tests).
• That continuous integration (CI) files (.travis.yml, appveyor.yml, etc.) interact with both the modules and the tools for automated building, testing, and linting.
• “Documentation & Web” block to the “CCAN Modules” and “Tools” blocks to show that user documentation and online resources help consumers understand how to integrate and use the modules.
Architectural Patterns and Design Principles
• Modularity: Each CCAN module is independent and self-contained, which supports plug-and-play integration in third-party projects.
• Separation of concerns: The core library modules are separate from the tooling (build utilities, testers, code analysis) and from the documentation; this clear separation helps in managing and evolving the repository.
• Extensibility: The recommended approach is to add one module per subdirectory within “ccan” (as noted in the README), which encourages a tree-like expansion of functionalities.
• Uniform structure and testing: Nearly every module comes with its own “test” subdirectory, ensuring that each is verifiable and conforms to similar API standards.