Compiler for C source code to both source and header file
- Install go
- Run
go install
- Set
go/bin
n to path
cscript <input> <output>
input
: Input filename with extensions- File can be either
.c
,.h
, or.cscript
.c
or.h
will be replaced with the compiled ones unless specified a differentoutput
.- Recommend using
.cscript
to perform transpiling if the code is frequently updated, as it is not replaced
- File can be either
output
: Output filename without extensions (optional, defaults toinput
)
auto-flag
, check based on the position of the first full non-static
function.
Currently, the CLI can only run in auto-flag
mode which judge declarations such as includes, defines, typedefs,
etc.
by checking the position of first function (with a executable block). This has limitation when declarations are
scattered
across the file.
It's is recommended to keep these declarations declared before any executable function.
Apparently, this tool has not existed yet in an accessible manner. In short, I am way too lazy to write a separate header file especially when it's clearly possible to automate the task.