# atemur/libft architecture

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

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

## Overview

Libft is a small C utility library that reimplements standard-library-style routines and adds string, conversion, output, and linked-list helpers. Consumers call its functions directly; there is no application-level orchestrator or multi-stage user workflow. The graph groups the library’s principal capabilities and shows only internal calls visible in the excerpts. Several leaf modules were not excerpted, so their behavior is represented by the documented API and source inventory without inferred call relationships.

Main entry points: [`ft_split.c`](https://github.com/atemur/libft/blob/main/ft_split.c) (Build and transform strings), [`ft_lstmap.c`](https://github.com/atemur/libft/blob/main/ft_lstmap.c) (Transform and clear lists), [`ft_strjoin.c`](https://github.com/atemur/libft/blob/main/ft_strjoin.c) (Copy and join strings), [`ft_strlen.c`](https://github.com/atemur/libft/blob/main/ft_strlen.c) (String length)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_text["String utilities"]
  node_text_build["Build and transform strings<br/>[ft_split.c]"]
  node_text_search["Search and compare strings<br/>[ft_strnstr.c]"]
  node_text_copy["Copy and join strings<br/>[ft_strjoin.c]"]
  node_text_length["String length<br/>[ft_strlen.c]"]
end

subgraph group_memory["Memory utilities"]
  node_memory_ops["Memory operations<br/>[ft_memmove.c]"]
  node_memory_alloc["Allocation and zeroing<br/>[ft_calloc.c]"]
end

subgraph group_chars["Character and conversion"]
  node_char_tests["Character classification<br/>[ft_isalnum.c]"]
  node_char_case["Case conversion<br/>[ft_tolower.c]"]
  node_number_parse["Parse integers<br/>[ft_atoi.c]"]
  node_number_format["Format integers<br/>[ft_itoa.c]"]
end

subgraph group_lists["Linked lists"]
  node_list_create["Create list nodes<br/>[ft_lstnew.c]"]
  node_list_manage["Manage list links<br/>[ft_lstadd_back.c]"]
  node_list_process["Transform and clear lists<br/>[ft_lstmap.c]"]
end

subgraph group_output["File descriptor output"]
  node_fd_output["Write values to descriptors<br/>[ft_putstr_fd.c]"]
end

subgraph group_api["Public API"]
  node_public_api["Function declarations and list type<br/>[libft.h]"]
end

node_text_build -->|"calls"| node_text_length
node_text_build -->|"calls"| node_text_search
node_text_build -->|"copies with"| node_text_copy
node_text_search -->|"calls"| node_text_length
node_text_copy -->|"calls"| node_text_length
node_text_copy -->|"copies and appends"| node_text_copy
node_number_format -->|"duplicates result"| node_text_build
node_memory_ops -->|"copies with"| node_memory_ops
node_list_process -->|"creates nodes"| node_list_create
node_list_process -->|"appends nodes"| node_list_manage
node_list_process -->|"clears on failure"| node_list_process

click node_text_build "https://github.com/atemur/libft/blob/main/ft_split.c"
click node_text_search "https://github.com/atemur/libft/blob/main/ft_strnstr.c"
click node_text_copy "https://github.com/atemur/libft/blob/main/ft_strjoin.c"
click node_text_length "https://github.com/atemur/libft/blob/main/ft_strlen.c"
click node_memory_ops "https://github.com/atemur/libft/blob/main/ft_memmove.c"
click node_memory_alloc "https://github.com/atemur/libft/blob/main/ft_calloc.c"
click node_char_tests "https://github.com/atemur/libft/blob/main/ft_isalnum.c"
click node_char_case "https://github.com/atemur/libft/blob/main/ft_tolower.c"
click node_number_parse "https://github.com/atemur/libft/blob/main/ft_atoi.c"
click node_number_format "https://github.com/atemur/libft/blob/main/ft_itoa.c"
click node_list_create "https://github.com/atemur/libft/blob/main/ft_lstnew.c"
click node_list_manage "https://github.com/atemur/libft/blob/main/ft_lstadd_back.c"
click node_list_process "https://github.com/atemur/libft/blob/main/ft_lstmap.c"
click node_fd_output "https://github.com/atemur/libft/blob/main/ft_putstr_fd.c"
click node_public_api "https://github.com/atemur/libft/blob/main/libft.h"

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_text_build,node_text_search,node_text_copy,node_text_length toneBlue
class node_memory_ops,node_memory_alloc toneAmber
class node_char_tests,node_char_case,node_number_parse,node_number_format toneMint
class node_list_create,node_list_manage,node_list_process toneRose
class node_fd_output toneIndigo
class node_public_api toneTeal
```

## Components

### String utilities

- [Build and transform strings](https://github.com/atemur/libft/blob/main/ft_split.c): `ft_split.c`
- [Search and compare strings](https://github.com/atemur/libft/blob/main/ft_strnstr.c): `ft_strnstr.c`
- [Copy and join strings](https://github.com/atemur/libft/blob/main/ft_strjoin.c): `ft_strjoin.c`
- [String length](https://github.com/atemur/libft/blob/main/ft_strlen.c): `ft_strlen.c`

### Memory utilities

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

### Character and conversion

- [Character classification](https://github.com/atemur/libft/blob/main/ft_isalnum.c): `ft_isalnum.c`
- [Case conversion](https://github.com/atemur/libft/blob/main/ft_tolower.c): `ft_tolower.c`
- [Parse integers](https://github.com/atemur/libft/blob/main/ft_atoi.c): `ft_atoi.c`
- [Format integers](https://github.com/atemur/libft/blob/main/ft_itoa.c): `ft_itoa.c`

### Linked lists

- [Create list nodes](https://github.com/atemur/libft/blob/main/ft_lstnew.c): `ft_lstnew.c`
- [Manage list links](https://github.com/atemur/libft/blob/main/ft_lstadd_back.c): `ft_lstadd_back.c`
- [Transform and clear lists](https://github.com/atemur/libft/blob/main/ft_lstmap.c): `ft_lstmap.c`

### File descriptor output

- [Write values to descriptors](https://github.com/atemur/libft/blob/main/ft_putstr_fd.c): `ft_putstr_fd.c`

### Public API

- [Function declarations and list type](https://github.com/atemur/libft/blob/main/libft.h): `libft.h`

## Connections

- Build and transform strings → String length: calls
- Build and transform strings → Search and compare strings: calls
- Build and transform strings → Copy and join strings: copies with
- Search and compare strings → String length: calls (evidence: `ft_strnstr.c`)
- Copy and join strings → String length: calls (evidence: `ft_strjoin.c`)
- Copy and join strings → Copy and join strings: copies and appends (evidence: `ft_strjoin.c`)
- Format integers → Build and transform strings: duplicates result (evidence: `ft_itoa.c`)
- Memory operations → Memory operations: copies with (evidence: `ft_memmove.c`)
- Transform and clear lists → Create list nodes: creates nodes (evidence: `ft_lstmap.c`)
- Transform and clear lists → Manage list links: appends nodes (evidence: `ft_lstmap.c`)
- Transform and clear lists → Transform and clear lists: clears on failure (evidence: `ft_lstmap.c`)
