f092eacupdate readme
1 file changed, +25, -12
author
mogiya <git@mogiya.dev> on 02-04-2026 21:09 UTC+2
committer
mogiya <git@mogiya.dev> on 02-04-2026 21:09 UTC+2
parent6b1cc64
README.md
+25, -12
+25, -12
      @@ -2,9 +2,19 @@
  2  2 
  3  3 <h1 id="description">Description</h1>
  4  4 
  5   -```ft_printf``` is a custom implementation of libc's ```printf``` function that formats and outputs data according to specified conversion rules.
     5+A custom implementation of the C standard library `printf` function, supporting formatted output with flags, width, precision, and multiple specifiers.
  6  6 
  7   -The library is compiled into a static library archive (```libftprintf.a```) and can be easily used in various C projects.
     7+Built as a static library (```libftprintf.a```) for easy integration into various C projects.
     8+
     9+<h3 id="prototype">Function Prototype</h3>
    10+
    11+This implementation follows the C standard implementation of `printf`.
    12+
    13+```c
    14+int	ft_printf(const char *fmt, ...);
    15+```
    16+
    17+Returns the number of characters written, or a negative value on error.
  8 18 
  9 19 <h1 id="instructions">Instructions</h1>
 10 20 
      @@ -29,17 +39,12 @@ Command | Description
 29 39    git clone ssh://git@codeberg.org/6times7/ft_printf.git
 30 40    ```
 31 41 
 32   -2. Compile the library:
    42+2. Build it:
 33 43    ```bash
 34 44    make -C ft_printf
 35 45    ```
 36 46 
 37   -   This will generate the static library:
 38   -   ```
 39   -   libftprintf.a
 40   -   ```
 41   -
 42   -3. Include the header in your C file:
    47+3. Include the header in your source file:
 43 48    ```c
 44 49    #include <ft_printf.h>
 45 50    ```
      @@ -57,7 +62,7 @@ Command | Description
 57 62 
 58 63 <h3 id="example-usage">Example Usage</h3>
 59 64 
 60   -Suppose you have a simple program `main.c`:
    65+Example program `main.c`:
 61 66 
 62 67 ```c
 63 68 #include <ft_printf.h>
      @@ -86,6 +91,7 @@ Expected output:
 86 91 ```
 87 92 hello world!
 88 93 ```
    94+
 89 95 <h1 id="format_specification">Format Specification</h1>
 90 96 
 91 97 The format specification is as follows:
      @@ -159,7 +165,7 @@ This function supports several format specifiers, described below.
159165         <td align="center">.number</td>
160166         <td>For integer specifiers (<b>d</b>, <b>i</b>, <b>u</b>, <b>x</b>, <b>X</b>), precision specifies the minimum number of digits to be written. If the value is shorter, the result is padded with leading zeros. The value is not truncated. A precision of 0 means that no character is written for the value 0.</br>
161167         For <b>s</b>, precision specifies the maximum number of characters to be printed.</br>
162   -        If no precision is specified, the default is 1. If the period is specified without a value, 0 is assumed.</td>
   168+        If the period is specified without a value, 0 is assumed.</td>
163169     </tr>
164170     <tr>
165171         <td align="center">.*</td>
      @@ -241,7 +247,7 @@ The following tree outlines the overall structure:
241247 
242248 <h3 id="parsing_strategy">Parsing Strategy</h3>
243249 
244   -The format string is written until the first occurrence of the character `%`. If it is encountered, the subsequent characters up to and including the specifier are parsed to extract:
   250+The format string is written until the first occurrence of the character `%`. If it is encountered, all subsequent characters up to the specifier are parsed to extract:
245251 
246252 - Flags
247253 - Field width
      @@ -339,6 +345,13 @@ Each specifier is handled by a dedicated function responsible for:
339345     O --> B
340346 ```
341347 
   348+<h1 id="limitations">Limitations</h1>
   349+
   350+- Does not support floating-point convertions (`f`, `e`, `g`)
   351+- Undefined behavior for invalid format specifiers
   352+- No locale handling
   353+- No length modifiers
   354+
342355 <h1 id="resources">Resources</h1>
343356 
344357 <h3 id="references">References</h3>