{"id":18537406,"url":"https://github.com/a2flo/tccpp","last_synced_at":"2025-10-22T10:49:13.091Z","repository":{"id":7977887,"uuid":"9380471","full_name":"a2flo/tccpp","owner":"a2flo","description":"stripped-down Tiny C Compiler (tcc) for doing OpenCL C preprocessing","archived":false,"fork":false,"pushed_at":"2014-09-17T07:00:49.000Z","size":440,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T01:39:58.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a2flo.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-11T21:16:09.000Z","updated_at":"2024-06-06T01:09:47.000Z","dependencies_parsed_at":"2022-09-10T20:11:25.864Z","dependency_job_id":null,"html_url":"https://github.com/a2flo/tccpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/a2flo/tccpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2flo%2Ftccpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2flo%2Ftccpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2flo%2Ftccpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2flo%2Ftccpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a2flo","download_url":"https://codeload.github.com/a2flo/tccpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2flo%2Ftccpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280424213,"owners_count":26328462,"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-22T02:00:06.515Z","response_time":63,"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":[],"created_at":"2024-11-06T19:38:05.546Z","updated_at":"2025-10-22T10:49:13.064Z","avatar_url":"https://github.com/a2flo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"*TCCPP \u0026 TCC - Tiny C Compiler*\n\n\"_Copyright (c) 2001-2004 Fabrice Bellard_\":http://bellard.org/tcc/\n_Copyright (c) 2013 Florian Ziesche (stripped-down TCCPP version)_\n\np. This library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2 of the License, or (at your option) any later version.\n\np. This library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\np. You should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n\n\n*Purpose of this project:*\nAfter much thought (and attempts to the contrary), I finally decided that I needed a C preprocessor for the \"oclraster project\":https://github.com/a2flo/oclraster to preprocess user provided OpenCL/oclraster shaders/programs.\nNote: even though this project can still be compiled and used as a standalone binary/preprocessor, its use in that state is relatively limited, since I've removed most of the unnecessary command line and system specific functionality.\n\n*in-memory preprocessing sample (mixed C/C++)*\n\u003cpre\u003e\u003ccode\u003estring preprocess_code(const int argc, const char** argv, const string\u0026 raw_code) {\n    // init\n    string ret_code = \"\";\n    TCCState* state = tcc_new();\n    state-\u003eoutput_type = TCC_OUTPUT_PREPROCESS;\n    // let tcc parse the input arguments\n    tcc_parse_args(state, argc, argv);\n    // in-memory preprocessing\n    const uint8_t* code_input = (const uint8_t*)raw_code.c_str();\n    tcc_in_memory_preprocess(// the just created tcc state object - thanks to this, tccpp is\n                             // multi-threading capable, i.e. you can create a TCCState object for\n                             // each thread and then call tcc_in_memory_preprocess from each\n                             // thread with their resp. state object\n                             state,\n                             // code input string + length\n                             code_input, raw_code.length(),\n                             // whether to print/add the include stack or not\n                             true,\n                             // the filename that should be used for this in-memory code\n                             // - probably only useful when include stack printing is enabled\n                             \"in_memory_file.c\",\n                             // preprocessed output (manual string concat)\n                             \u0026ret_code,\n                             // user provided function that is called for each preprocessed token\n                             // here: just add the token to ret/ret_code\n                             [](const char* str, void* ret) -\u003e void {\n                                 *(string*)ret += str;\n                             });\n    // cleanup + return\n    tcc_delete(state);\n    return ret_code;\n}\u003c/code\u003e\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2flo%2Ftccpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa2flo%2Ftccpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2flo%2Ftccpp/lists"}