# amine-negg/libft architecture

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

- Interactive diagram: https://gitdiagram.com/amine-negg/libft
- Repository: https://github.com/amine-negg/libft

## Overview

Libft is a reusable C utility library: a calling program invokes its exported functions and receives utility results or file-descriptor output. Its capabilities cover character handling, strings and conversion, memory and allocation, output, and linked lists. The graph groups these runtime responsibilities rather than treating the static archive build as a product workflow. Sampled excerpts support only a few internal call relationships; other capabilities are documented in the README, so their internal dependencies are not inferred.

Main entry points: [`libft.h`](https://github.com/amine-negg/libft/blob/main/libft.h) (Public API), [`ft_lstmap.c`](https://github.com/amine-negg/libft/blob/main/ft_lstmap.c) (List callbacks), [`ft_substr.c`](https://github.com/amine-negg/libft/blob/main/ft_substr.c) (String construction), [`ft_strlen.c`](https://github.com/amine-negg/libft/blob/main/ft_strlen.c) (String search and bounds)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chars["Character utilities"]
  node_character["Character checks<br/>[ft_isalpha.c]"]
  node_case["Case conversion<br/>[ft_toupper.c]"]
end

subgraph group_strings["String utilities"]
  node_stringbase["String search and bounds<br/>[ft_strlen.c]"]
  node_stringbuild["String construction<br/>[ft_substr.c]"]
  node_stringedit["String transforms<br/>[ft_strtrim.c]"]
  node_conversion["Number conversion<br/>[ft_atoi.c]"]
end

subgraph group_memory["Memory utilities"]
  node_memoryops["Memory operations<br/>[ft_memmove.c]"]
  node_allocation["Allocation<br/>[ft_calloc.c]"]
end

subgraph group_output["Descriptor output"]
  node_fdoutput["File descriptor output<br/>[ft_putendl_fd.c]"]
end

subgraph group_lists["Linked lists"]
  node_listcreate["List creation<br/>[ft_lstnew.c]"]
  node_listops["List operations<br/>[ft_lstadd_back.c]"]
  node_listcleanup["List cleanup<br/>[ft_lstclear.c]"]
  node_listcallbacks["List callbacks<br/>[ft_lstmap.c]"]
end

node_caller(("Calling program"))
node_api["Public API<br/>[libft.h]"]

node_caller -->|"includes and calls"| node_api
node_api -->|"declares"| node_character
node_api -->|"declares"| node_case
node_api -->|"declares"| node_stringbase
node_api -->|"declares"| node_stringbuild
node_api -->|"declares"| node_stringedit
node_api -->|"declares"| node_conversion
node_api -->|"declares"| node_memoryops
node_api -->|"declares"| node_allocation
node_api -->|"declares"| node_fdoutput
node_api -->|"declares"| node_listcreate
node_api -->|"declares"| node_listops
node_api -->|"declares"| node_listcleanup
node_api -->|"declares"| node_listcallbacks
node_allocation -->|"zeroes with"| node_memoryops
node_stringbuild -->|"measures with"| node_stringbase
node_stringbuild -->|"duplicates empty string with"| node_conversion
node_stringedit -->|"measures with"| node_stringbase
node_listcallbacks -->|"creates via"| node_listcreate
node_listcallbacks -->|"appends via"| node_listops
node_listcallbacks -->|"cleans via"| node_listcleanup

click node_api "https://github.com/amine-negg/libft/blob/main/libft.h"
click node_character "https://github.com/amine-negg/libft/blob/main/ft_isalpha.c"
click node_case "https://github.com/amine-negg/libft/blob/main/ft_toupper.c"
click node_stringbase "https://github.com/amine-negg/libft/blob/main/ft_strlen.c"
click node_stringbuild "https://github.com/amine-negg/libft/blob/main/ft_substr.c"
click node_stringedit "https://github.com/amine-negg/libft/blob/main/ft_strtrim.c"
click node_conversion "https://github.com/amine-negg/libft/blob/main/ft_atoi.c"
click node_memoryops "https://github.com/amine-negg/libft/blob/main/ft_memmove.c"
click node_allocation "https://github.com/amine-negg/libft/blob/main/ft_calloc.c"
click node_fdoutput "https://github.com/amine-negg/libft/blob/main/ft_putendl_fd.c"
click node_listcreate "https://github.com/amine-negg/libft/blob/main/ft_lstnew.c"
click node_listops "https://github.com/amine-negg/libft/blob/main/ft_lstadd_back.c"
click node_listcleanup "https://github.com/amine-negg/libft/blob/main/ft_lstclear.c"
click node_listcallbacks "https://github.com/amine-negg/libft/blob/main/ft_lstmap.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_character,node_case toneBlue
class node_stringbase,node_stringbuild,node_stringedit,node_conversion toneAmber
class node_memoryops,node_allocation,node_api toneMint
class node_fdoutput toneRose
class node_listcreate,node_listops,node_listcleanup,node_listcallbacks,node_caller toneIndigo
```

## Components

### Character utilities

- [Character checks](https://github.com/amine-negg/libft/blob/main/ft_isalpha.c): `ft_isalpha.c`
- [Case conversion](https://github.com/amine-negg/libft/blob/main/ft_toupper.c): `ft_toupper.c`

### String utilities

- [String search and bounds](https://github.com/amine-negg/libft/blob/main/ft_strlen.c): `ft_strlen.c`
- [String construction](https://github.com/amine-negg/libft/blob/main/ft_substr.c): `ft_substr.c`
- [String transforms](https://github.com/amine-negg/libft/blob/main/ft_strtrim.c): `ft_strtrim.c`
- [Number conversion](https://github.com/amine-negg/libft/blob/main/ft_atoi.c): `ft_atoi.c`

### Memory utilities

- [Memory operations](https://github.com/amine-negg/libft/blob/main/ft_memmove.c): `ft_memmove.c`
- [Allocation](https://github.com/amine-negg/libft/blob/main/ft_calloc.c): `ft_calloc.c`

### Descriptor output

- [File descriptor output](https://github.com/amine-negg/libft/blob/main/ft_putendl_fd.c): `ft_putendl_fd.c`

### Linked lists

- [List creation](https://github.com/amine-negg/libft/blob/main/ft_lstnew.c): `ft_lstnew.c`
- [List operations](https://github.com/amine-negg/libft/blob/main/ft_lstadd_back.c): `ft_lstadd_back.c`
- [List cleanup](https://github.com/amine-negg/libft/blob/main/ft_lstclear.c): `ft_lstclear.c`
- [List callbacks](https://github.com/amine-negg/libft/blob/main/ft_lstmap.c): `ft_lstmap.c`

### Other components

- **Calling program**
- [Public API](https://github.com/amine-negg/libft/blob/main/libft.h): `libft.h`

## Connections

- Calling program → Public API: includes and calls (evidence: `README.md`)
- Public API → Character checks: declares (evidence: `libft.h`)
- Public API → Case conversion: declares (evidence: `libft.h`)
- Public API → String search and bounds: declares (evidence: `libft.h`)
- Public API → String construction: declares (evidence: `libft.h`)
- Public API → String transforms: declares (evidence: `libft.h`)
- Public API → Number conversion: declares (evidence: `libft.h`)
- Public API → Memory operations: declares (evidence: `libft.h`)
- Public API → Allocation: declares (evidence: `libft.h`)
- Public API → File descriptor output: declares (evidence: `libft.h`)
- Public API → List creation: declares (evidence: `libft.h`)
- Public API → List operations: declares (evidence: `libft.h`)
- Public API → List cleanup: declares (evidence: `libft.h`)
- Public API → List callbacks: declares (evidence: `libft.h`)
- Allocation → Memory operations: zeroes with (evidence: `ft_calloc.c`)
- String construction → String search and bounds: measures with (evidence: `ft_substr.c`)
- String construction → Number conversion: duplicates empty string with (evidence: `ft_substr.c`)
- String transforms → String search and bounds: measures with (evidence: `ft_strtrim.c`)
- List callbacks → List creation: creates via (evidence: `ft_lstmap.c`)
- List callbacks → List operations: appends via (evidence: `ft_lstmap.c`)
- List callbacks → List cleanup: cleans via (evidence: `ft_lstmap.c`)
