51 lines
2.5 KiB
Markdown
51 lines
2.5 KiB
Markdown
# Record Manager — starter template
|
|
|
|
Clean, best-practice starting point for the CS 2060 cumulative project.
|
|
Pick a flavor (contacts / gradebook / expense tracker) and extend it milestone
|
|
by milestone; do not delete the verification targets.
|
|
|
|
**Before your first commit:** read [`SETUP.md`](SETUP.md) (toolchain) and
|
|
[`AGENTS.md`](AGENTS.md) (the rules every coding agent reads), copy
|
|
[`MILESTONE.md`](MILESTONE.md) per milestone as your write-up.
|
|
|
|
## Layout
|
|
|
|
```text
|
|
include/record.h the record_t struct + record_new/record_free + status codes
|
|
src/record.c record implementation
|
|
src/main.c CLI menu (Milestone 1)
|
|
tests/smoke.sh dependency-free smoke tests for the CLI
|
|
Makefile build + test + sanitizer targets
|
|
.clang-format enforced formatting (clang-format -i src/*.c include/*.h)
|
|
```
|
|
|
|
## Targets
|
|
|
|
| Command | What it does |
|
|
| :--- | :--- |
|
|
| `make` | build `build/recman` (`-std=c17 -Wall -Wextra -Wpedantic -Werror -g`) |
|
|
| `make test` | run the smoke tests |
|
|
| `make sanitize` | rebuild with ASan+UBSan and run the smoke tests |
|
|
| `make valgrind` | run under Valgrind Memcheck (leaks → non-zero exit) |
|
|
| `make clean` | remove `build/` |
|
|
|
|
## Style & best-practice references
|
|
|
|
- **Formatting** — `.clang-format` (LLVM base, 4-space, 100 cols). Reference: <https://clang.llvm.org/docs/ClangFormatStyleOptions.html>
|
|
- **Readable C** — Linux kernel coding style: <https://www.kernel.org/doc/html/latest/process/coding-style.html>
|
|
- **Robust error handling** — return `status_t`, check it at the call site. Reference: SEI CERT C, API04-C / ERR33-C (<https://wiki.sei.cmu.edu/confluence/display/c/>)
|
|
- **Build hygiene** — automatic header deps via `-MMD -MP`. Reference: GNU Make, Automatic Prerequisites (<https://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.html>)
|
|
- **Memory safety** — sanitizers + Valgrind. Reference: GCC Instrumentation Options (<https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html>)
|
|
- **Course textbook** — Beej's Guide to C: <https://beej.us/guide/bgc/>
|
|
|
|
## Milestones
|
|
|
|
The five-milestone spec (M1 CLI → M2 buffer → M3 list → M4 file → M5 refactor)
|
|
lives in `../README.md` (the `assignments/projects/` folder).
|
|
|
|
## AI use (optional)
|
|
|
|
AI assistance is **not required**. If you use it, the standard `AGENTS.md` in
|
|
this repo tells the agent exactly what Tier 2 permits; state "AI used: none |
|
|
Tier 2" at the top of each milestone write-up and let the verification gates
|
|
(`make test` / `make sanitize` / `make valgrind` + the CI report) be the record.
|