# sanishpoudel/recover architecture

> Architecture diagram of the GitHub repository sanishpoudel/recover, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanishpoudel/recover
- Repository: https://github.com/sanishpoudel/recover

## Overview

recover is a small command-line utility that scans a raw image-card file in 512-byte blocks and extracts JPEG images. The workflow validates the argument, opens and scans the input, detects JPEG headers, and writes numbered output files. All runtime behavior is implemented in recover.c; the graph separates its meaningful stages for clarity.

Main entry points: [`recover.c`](https://github.com/sanishpoudel/recover/blob/main/recover.c) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["CLI entry<br/>[recover.c]"]
node_raw["Raw card file"]
node_scanner["Block scanner<br/>[recover.c]"]
node_detector["JPEG detector<br/>[recover.c]"]
node_outputs["Numbered JPEGs"]

node_user -->|"runs"| node_cli
node_cli -->|"opens"| node_raw
node_cli -->|"scans blocks"| node_scanner
node_scanner -->|"checks headers"| node_detector
node_detector -->|"writes images"| node_outputs

click node_cli "https://github.com/sanishpoudel/recover/blob/main/recover.c"
click node_scanner "https://github.com/sanishpoudel/recover/blob/main/recover.c"
click node_detector "https://github.com/sanishpoudel/recover/blob/main/recover.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_cli,node_scanner,node_detector toneTeal
class node_raw,node_outputs toneIndigo
```

## Components

### Other components

- **User**
- [CLI entry](https://github.com/sanishpoudel/recover/blob/main/recover.c): `recover.c`
- **Raw card file**
- [Block scanner](https://github.com/sanishpoudel/recover/blob/main/recover.c): `recover.c`
- [JPEG detector](https://github.com/sanishpoudel/recover/blob/main/recover.c): `recover.c`
- **Numbered JPEGs**

## Connections

- User → CLI entry: runs (evidence: `recover.c`)
- CLI entry → Raw card file: opens (evidence: `recover.c`)
- CLI entry → Block scanner: scans blocks (evidence: `recover.c`)
- Block scanner → JPEG detector: checks headers (evidence: `recover.c`)
- JPEG detector → Numbered JPEGs: writes images (evidence: `recover.c`)
