# Overview ## What cproof is - Terminal-based XMPP (chat) client written in C. - Fork of [Profanity](https://github.com/profanity-im/profanity); rename to cproof is **work in progress** — many internal symbols, copyright headers, and identifiers still say "Profanity". - Heavy GLib usage (strings, lists, hash tables, key files). - Optional integrations: OMEMO (libsignal-protocol), OTR (libotr), PGP/OX (gpgme), Python plugins, libnotify, libgcrypt, libreadline, ncurses. ## Build system - Autotools: `configure.ac` + a top-level `Makefile.am`. No CMake. - `autogen.sh` regenerates the configure script. - `configure-debug` is a thin helper that invokes `./configure` with debug-friendly flags. - Canonical build environment: Docker (`Dockerfile.debian` at repo root). See `build/docker.md`. ## Test framework - **Unit tests:** cmocka, run via `make check`. Live in `tests/unittests/`. - **Functional tests:** custom runner in `tests/functionaltests/` against a real running cproof instance. - **Benches:** custom runners in `tests/bench//` for database / flatfile / long-message workloads. - See `architecture/test-map.md` and the `testing/` directory for detail. ## High-level module split Source lives under `src/` in module directories — see `architecture/source-map.md` for the full table. Major chunks: - **Command layer** (`src/command/`) — `/foo`-style commands the user types. - **XMPP layer** (`src/xmpp/`) — protocol, sessions, stanza building. - **UI layer** (`src/ui/`) — windows, buffers, status bar, input. - **Event layer** (`src/event/`) — bridges between XMPP and UI / commands. - **Encryption** (`src/omemo/`, `src/otr/`, `src/pgp/`) — three independent encryption stacks. - **Plugins** (`src/plugins/`) — C and Python plugin APIs. - **Tools** (`src/tools/`) — generic utilities (parser, autocomplete, HTTP, clipboard, editor). Active feature branches (e.g. `feat/ai`, which adds `src/ai/`) are not described in the stable architecture files. See `wip/` for branch-specific notes. ## Entry points | File | Role | |---|---| | `src/main.c` | Process entry. | | `src/profanity.c` | Application init/shutdown lifecycle. | | `src/common.h` | Project-wide macros (`auto_*`, `FREE_SET_NULL`, `ARRAY_SIZE`). | | `src/database.c` / `src/database.h` | Database (SQLite + flatfile) abstraction. | | `src/chatlog.c` | Chat history persistence. | | `src/log.c` | Application log. |