{"id":28477471,"url":"https://github.com/itaxbox/printf","last_synced_at":"2025-08-25T07:18:00.285Z","repository":{"id":295892299,"uuid":"991607445","full_name":"ITAXBOX/Printf","owner":"ITAXBOX","description":"Custom Printf Implementation in C","archived":false,"fork":false,"pushed_at":"2025-05-27T22:15:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-30T08:45:10.165Z","etag":null,"topics":["42school","c","makefile"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ITAXBOX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-27T22:13:09.000Z","updated_at":"2025-06-14T06:00:20.000Z","dependencies_parsed_at":"2025-05-27T23:25:44.703Z","dependency_job_id":"4eadef70-9f4d-4861-be1b-fcc0de3492cf","html_url":"https://github.com/ITAXBOX/Printf","commit_stats":null,"previous_names":["itaxbox/printf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ITAXBOX/Printf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITAXBOX%2FPrintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITAXBOX%2FPrintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITAXBOX%2FPrintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITAXBOX%2FPrintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ITAXBOX","download_url":"https://codeload.github.com/ITAXBOX/Printf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITAXBOX%2FPrintf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272022487,"owners_count":24860203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42school","c","makefile"],"created_at":"2025-06-07T16:36:17.753Z","updated_at":"2025-08-25T07:18:00.263Z","avatar_url":"https://github.com/ITAXBOX.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ft_printf - Custom Printf Implementation\n\n## Overview\n\nThis project is a custom implementation of the C standard library function `printf()`. The implementation supports various format specifiers and provides a similar functionality to the standard `printf()` function.\n\n## Features\n\nThis implementation of `printf()` supports the following format specifiers:\n\n| Specifier |                        Description                       |\n|-----------|----------------------------------------------------------|\n| `%c`      | Print a single character                                 |\n| `%s`      | Print a string                                           |\n| `%p`      | Print a pointer address in hexadecimal format            |\n| `%d`      | Print a decimal (base 10) number                         |\n| `%i`      | Print an integer in base 10                              |\n| `%u`      | Print an unsigned decimal (base 10) number               |\n| `%x`      | Print a number in hexadecimal (base 16) lowercase format |\n| `%X`      | Print a number in hexadecimal (base 16) uppercase format |\n| `%%`      | Print a percent sign                                     |\n\n## Project Structure\n\nThe project consists of several files:\n\n- **ft_printf.c**: Contains the main implementation of the `ft_printf` function and format specifier handling\n- **ft_printf.h**: Header file with function declarations and necessary includes\n- **ft_printer.c**: Contains functions to print various data types (integers, strings, pointers)\n- **ft_util.c**: Contains utility functions used by the main implementation\n- **Makefile**: Compiles the project and creates the library\n- **libft/**: Directory containing a custom C library with basic functions\n\n## Implementation Details\n\nThe implementation uses variadic functions from the `\u003cstdarg.h\u003e` library to handle a variable number of arguments. The main function `ft_printf` parses the format string and delegates printing to appropriate functions based on the encountered format specifiers.\n\nKey aspects of the implementation:\n\n- Uses a helper function `ft_print` to dispatch to the appropriate printer based on the format specifier\n- Returns the total number of characters printed, just like the original `printf`\n- Handles null pointers and strings with appropriate messages\n- Uses recursive approaches for printing numbers in different bases\n- Leverages the custom libft library functions for basic operations\n\n## How to Use\n\n### Compilation\n\nTo compile the library, run:\n\n```bash\nmake\n```\n\nThis will create a static library `libftprintf.a` that you can link with your programs.\n\n### Cleaning Up\n\nTo clean up the object files:\n\n```bash\nmake clean\n```\n\nTo remove all generated files (object files and the library):\n\n```bash\nmake fclean\n```\n\nTo rebuild the project:\n\n```bash\nmake re\n```\n\n### Using in Your Code\n\nInclude the header file in your code:\n\n```c\n#include \"ft_printf.h\"\n```\n\nCompile your program and link it with the library:\n\n```bash\ncc -Wall -Wextra -Werror your_program.c -L. -lftprintf -o your_program\n```\n\nExample usage:\n\n```c\n#include \"ft_printf.h\"\n\nint main(void)\n{\n    ft_printf(\"Character: %c\\n\", 'A');\n    ft_printf(\"String: %s\\n\", \"Hello, world!\");\n    ft_printf(\"Pointer: %p\\n\", \u0026main);\n    ft_printf(\"Integer: %d or %i\\n\", 42, 42);\n    ft_printf(\"Unsigned: %u\\n\", 4294967295);\n    ft_printf(\"Hexadecimal: %x or %X\\n\", 255, 255);\n    ft_printf(\"Percent sign: %%\\n\");\n    \n    return (0);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitaxbox%2Fprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitaxbox%2Fprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitaxbox%2Fprintf/lists"}