Thank you for your interest in contributing! This document outlines how to get started, the coding standards, and the process for submitting changes.
git clone https://github.com/Harsh7115/c-coroutine.git
cd c-coroutine
make # build library + tests + examples
make test # run the full test suiteRequirements: GCC or Clang, GNU Make, x86-64 Linux (or macOS for the ucontext fallback).
include/ public API header (coroutine.h)
src/ library implementation (coroutine.c, asm_ctx.S)
tests/ unit / stress tests
examples/ usage demos
benchmarks/ micro-benchmarks (optional, not built by default)
- C standard: C11 (
-std=c11) - Indentation: 4 spaces, no tabs
- Naming:
snake_casefor everything; public symbols prefixed withco_ - Comments: Doxygen-style
/** ... */on public API; inline//for implementation notes - Error handling: functions that can fail return
NULLor-1; always check return values in tests
Run make lint before submitting — it invokes cppcheck with the same flags used in CI.
- Create
tests/test_<feature>.c. - Include
<assert.h>and"coroutine.h". - Write a
main()that returns0on success and non-zero on failure. - Add an entry to the
TESTSvariable inMakefile.
- Fork the repo and create a feature branch:
git checkout -b feat/my-feature - Make your changes with clear, focused commits.
- Ensure
make testpasses andmake lintis clean. - Open a PR against
mainwith a concise description of what and why. - Respond to review comments — we aim for a first review within 48 hours.
Open a GitHub Issue with:
- OS and compiler version (
gcc --version) - Minimal reproducer
- Expected vs. actual behaviour
By contributing you agree that your changes will be released under the project's MIT License.