{"id":24461474,"url":"https://github.com/wyattscarpenter/print.h","last_synced_at":"2025-10-12T05:09:00.389Z","repository":{"id":86840578,"uuid":"274355364","full_name":"wyattscarpenter/print.h","owner":"wyattscarpenter","description":"Finally, a print function! A compile-time-type-safe, variadic, free-form print() function, fully standard-compliant, C11 and later.","archived":false,"fork":false,"pushed_at":"2021-11-05T01:12:25.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T09:36:08.759Z","etag":null,"topics":["c","c11","cc0","print","public-domain"],"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/wyattscarpenter.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}},"created_at":"2020-06-23T08:45:22.000Z","updated_at":"2023-09-17T10:06:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc83c3ca-4b3d-4338-bbb9-b71d98b2f206","html_url":"https://github.com/wyattscarpenter/print.h","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wyattscarpenter/print.h","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyattscarpenter%2Fprint.h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyattscarpenter%2Fprint.h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyattscarpenter%2Fprint.h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyattscarpenter%2Fprint.h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyattscarpenter","download_url":"https://codeload.github.com/wyattscarpenter/print.h/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyattscarpenter%2Fprint.h/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010341,"owners_count":26084738,"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-10-12T02:00:06.719Z","response_time":53,"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":["c","c11","cc0","print","public-domain"],"created_at":"2025-01-21T04:19:49.030Z","updated_at":"2025-10-12T05:09:00.356Z","avatar_url":"https://github.com/wyattscarpenter.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# print.h\nFinally, a print function! A compile-time-type-safe, variadic, free-form print() function, fully standard-compliant, C11 and later.\n\nHave you ever wanted to write, eg, `print(\"here's some string\", some_other_variable)`? Well, now you can, and it will usually just work! print.h can print the same types of data as printf, and a few more! And you can add your own!\n\nAnd now, further information from the top comment of the print.h file:\n\nSimply #include \"print.h\" and call print on whatever you want, 1 to 32 arguments.\n\n32 is arbitrary, and the number of arguments print can take can be expanded straightforwardly.\n\nYou will receive a compile-time warning if you exceed the limit, don't worry.\n\nlabelled_print is like print, but will also print out the names of the variables being printed, convenient for debugging.\n\nWritten in and for pure C.\n\nIn fact, the implementation of the macro uses printf, so this is sort of just a safer and more convenient way of calling printf.\n\nCan print arrays of any size, unless they are the same size as a pointer.\n\nHowever, we can't print inline character literals, because those are by standard promoted to ints on creation, or something. Sorry, I don't make the rules. Use inline string literals instead.\n\nArguments are evaluated only once at run time in the expanded macro, so stuff like print(i++) is safe.\n\nOnly a handful of symbols are introduced into the namespace, most of them printing functions.\n\nprint cannot be used as an expression, only as a statement (it has no return value), and cannot take 0 arguments.\n\nThe \"header\" file currently includes implementations.\n\nThe header file currently #includes stdio.h, so don't bother double-including stdio.h.\n\nI release this code into the public domain under CC0.\n\nI have written blogposts about making this project on my blog:\n\nhttps://wyattscarpenter.github.io/blog/print.txt\n\nhttps://wyattscarpenter.github.io/blog/print_2_c_array_folly.txt\n\nhttps://wyattscarpenter.github.io/blog/print_3_structs.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyattscarpenter%2Fprint.h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyattscarpenter%2Fprint.h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyattscarpenter%2Fprint.h/lists"}