{"id":15048991,"url":"https://github.com/johncoleman83/printf","last_synced_at":"2025-04-10T01:40:49.276Z","repository":{"id":42056128,"uuid":"85364879","full_name":"johncoleman83/printf","owner":"johncoleman83","description":"Custom version of printf() in C Language","archived":false,"fork":false,"pushed_at":"2020-07-24T04:20:24.000Z","size":1457,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T03:22:33.714Z","etag":null,"topics":["c","c-language","low-level-programming","printf"],"latest_commit_sha":null,"homepage":"https://johncoleman83.github.io/printf/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johncoleman83.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-18T00:17:02.000Z","updated_at":"2023-02-15T13:04:27.000Z","dependencies_parsed_at":"2022-09-15T15:22:13.489Z","dependency_job_id":null,"html_url":"https://github.com/johncoleman83/printf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncoleman83%2Fprintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncoleman83%2Fprintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncoleman83%2Fprintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncoleman83%2Fprintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johncoleman83","download_url":"https://codeload.github.com/johncoleman83/printf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142036,"owners_count":21054574,"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","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":["c","c-language","low-level-programming","printf"],"created_at":"2024-09-24T21:17:28.200Z","updated_at":"2025-04-10T01:40:49.256Z","avatar_url":"https://github.com/johncoleman83.png","language":"C","readme":"# _printf()\n\n\u003cimg src=\"https://raw.githubusercontent.com/johncoleman83/printf/master/screen-shot-printf.png\" alt=\"screen shot of custom printf function\"\u003e\n\n## Description\n\nThis Repo has has all the code necessary for our (David John Coleman II and\nJoann Vuong's) custom function called ``_printf()``.  It is a mini-version of C\nLanguage function ``printf()`` from ``stdio.h``, and our function ``_printf()``\nattempts to replicate the exact same process as the C function ``printf()``.\nThis project was completed as a part of the curriculum for a software development program.\n\n### C language standard functions used\n\n* ``write``, ``malloc``, ``free``, ``va_start``, ``va_end``, ``va_copy``,\n``va_arg``\n\n## Brief Synopsis\n\n``_printf()`` function takes 2 arguments: a character pointer to a string:\n``format``, and a 'variable arguments list': ``arg_list``.  ``_printf()`` loops\nthrough the format string searching for a conversion specifier, which is\nindicated with the '%' symbol.  If found, the ``match_specifier()`` function\nloops through an array of structs (contianing character and function pairs) to\nfind the specifier function that is matched with the given conversion specifier\nfrom the format string, and then returns a pointer to that paired function.\n``_printf()`` uses the pointer to that specifier function to call the specifier\nfunction on the next queued argument from the ``arg_list``.  Each specifier\nfunction writes a character one at a time as determined from the value in\n``arg_list``. In the buffer branch and in the 'release: v0.1', our code writes\nthe characters from the format string and the associated specifiers to the\nbuffer, and in the 'no-buffer' branch, our code is instead written to standard\noutput one at a time.\n\n## Usage\n\nThe directory contents should be compiled with the following command:\n\n```\n$ gcc -Wall -Werror -Wextra -pedantic *.c\n```\n\n`_printf()` function may be used, in any C language program.  This is the\nprototype:\n\n```\n_printf(const char *[FORMAT], ...)\n```\n\n__FORMAT__ refers to a string with any number of specifiers followed by a '`%`'\nsymbol.  i.e. `\"My name is %s and I am %d years old\"`.  __...__ refers to a\nlist of variadic (variable arguments in C Language), which can be any number of\nvariables of any type.  With the above example string, appropriate arguments\ncould be `\"Edwin Abbott Abbott\", 179`.  These examples together should be called\nlike so:\n\n```\n_printf(\"My name is %s and I am %d years old\", \"Edwin Abbott Abbott\", 179)\n```\n\n## File List\n\n* For a brief explanation of each file, please see the file `./FILELIST.md`\n\n## Tests\n\nTo run tests, to check the overall functionality of the program, compile\nwith `main.c` as the main file:\n\n```\n$ cp dev/main.c .\n$ gcc *.c\n```\n\nTo run tests to check that the code compiles correctly, run the following bash\nscript.  This script uses the `-Warning` flags from the usage section.\n\n```\n$ ./dev/init.sh\n```\n\n## Authors\n\nDavid John Coleman II - http://www.davidjohncoleman.com/  \nJoann Vuong - https://github.com/jvpupcat\n\n## License\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohncoleman83%2Fprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohncoleman83%2Fprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohncoleman83%2Fprintf/lists"}