{"id":20368394,"url":"https://github.com/depau/c2singlefile","last_synced_at":"2026-05-10T17:47:51.120Z","repository":{"id":72603490,"uuid":"100641050","full_name":"depau/c2singlefile","owner":"depau","description":"Turns a bunch of specially formatted c files into a single file","archived":false,"fork":false,"pushed_at":"2017-08-17T20:13:52.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T05:52:40.552Z","etag":null,"topics":["c","parser","singlefile"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/depau.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T20:07:26.000Z","updated_at":"2017-08-17T20:12:42.000Z","dependencies_parsed_at":"2023-03-17T17:45:32.717Z","dependency_job_id":null,"html_url":"https://github.com/depau/c2singlefile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depau%2Fc2singlefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depau%2Fc2singlefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depau%2Fc2singlefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depau%2Fc2singlefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/depau","download_url":"https://codeload.github.com/depau/c2singlefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241913793,"owners_count":20041459,"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","parser","singlefile"],"created_at":"2024-11-15T00:40:52.667Z","updated_at":"2026-05-10T17:47:51.071Z","avatar_url":"https://github.com/depau.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C to Single File\n\nSimple script to turn a C project into a single file for online tests submission.\n\n## Usage\n\nAll files need to be formatted properly.\n\nThere are 5 type of parts that this program reads:\n\n* includes\n* macros\n* datatypes\n* declarations\n* definitions\n\nEvery part in each file needs to be surrounded by\n\n```c\n// start:PARTNAME\n// end:PARTNAME\n```\n\nFor example:\n\n`my_lib.h`\n\n```c\n// start:includes\n#include \u003cstdlib.h\u003e\n// end:includes\n\n// start:macros\n#define true 0   // I'm funny\n#define false 1  // aren't I?\n// end:macros\n\n// start:datatypes\ntypedef enum _my_enum {\n    SINGLE_FILE,\n    SUBMISSIONS,\n    SUCK\n} singlefile_is_cancer_t;\n// end:datatypes\n\n// start:declarations\nsinglefile_is_cancer_t i_really_mean_it();\n// end:declarations\n```\n`my_lib.c`\n\n```c\n// start:includes\n#include \"my_lib.h\"\n// end:includes\n\n// start:definitions\nsinglefile_is_cancer_t i_really_mean_it() {\n    return SUCK;\n}\n// end:definitions\n\n```\n\nWill result in:\n\n`$ c2singlefile my_lib.h my_lib.c`\n```c\n// AUTOMATICALLY GENERATED, DO NOT EDIT\n// This file was generated by c2singlefile\n// https://github.com/Depaulicious/c2singlefile\n\n// Files included here:\n// - my_lib.h\n// - my_lib.c\n\n#include \u003cstdlib.h\u003e\n\n// Macros\n// From my_lib.h\n\n#define true 0   // I'm funny\n#define false 1  // aren't I?\n\n// Datatypes\n// From my_lib.h\n\ntypedef enum _my_enum {\n    SINGLE_FILE,\n    SUBMISSIONS,\n    SUCK\n} singlefile_is_cancer_t;\n\n// Declarations\n// From my_lib.h\n\nsinglefile_is_cancer_t i_really_mean_it();\n\n// Definitions\n// From my_lib.c\n\nsinglefile_is_cancer_t i_really_mean_it() {\n    return SUCK;\n}\n```\n\nEverything between `start` and `end` comments will be kept as it is, except for includes.\n\nOnly `#include \u003c*\u003e` will be kept, and multiple occurrences of the same include statement are only repeated once.\n\n## Syntax\n\nSimply pass the program a list of files, starting from the least important, dependency-wise. The output will follow the same order.\n\n## Installation\n\n```shell\npip install https://github.com/Depaulicious/c2singlefile/archive/master.zip\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepau%2Fc2singlefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepau%2Fc2singlefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepau%2Fc2singlefile/lists"}