Skip to content

almayor/ft_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_printf

This project is part of the official curriculum at School 42.

Disclaimer

In School 42, almost every project must be written to comply with. coding standard (also known as the "Norm"). As a result, the implementation of certain parts may appear strange.

Overview

  • Official instructions
  • Module documentation
  • The goal of this project is to practice the following concepts
    • variadic functions
    • dispatch tables – loose coupling and performance
    • void pointers – generic programming
    • optimization patterns – buffering
  • Only the following functions are allowed
    • write
    • malloc
    • free
    • exit
    • functions of stdarg
  • The project (with the exception of tests) is consistent with the Norme, the code standard accepted at School 42. In particular, this means that
    • no comments inline or inside functions
    • for loops and switch statements are forbidden
    • each function must be maximum 25 lines
    • no functional macros
  • As per instructions, the project is realised using libft written in a previous project.

Checklist

Standard

  • csp% conversions
  • diouxX conversions with hh, h, l, ll flags
  • f conversion with flags L, l
  • #0-+ flag management (when applicable)
  • minimum field-width
  • precision
  • * flag management

Extra

  • b conversion to print in binary
  • variants of printf
    • ft_dprintf
    • ft_vprintf
    • ft_vdprintf
    • ft_sprintf
    • ft_snprintf
    • ft_vsprintf
    • ft_vsnprintf
    • ft_asprintf
    • ft_vasprintf
  • colors
    • ft_printf("{red} Color-print.{eoc} Normal print.")
    • red, blue, yellow, green, cyan, magenta

Tests

Run tests with make test

  • Behaviour is tested with Unity
  • Performance is benchmarked against printf(3)

Acknowledgements

Many of the included tests are borrowed from pft by gavinfielder and other contributors and Moulitest by yyang42 and other contributors. My thanks go to them.


If you have any questions, please contact me on Github.