https://github.com/basemax/c-minifier
CMinifier: A C program to remove comments and minimize the code (remove whitespace and summarize code)
https://github.com/basemax/c-minifier
c c-minifier minifier minifier-c minifiers minify minify-c minifying
Last synced: 15 days ago
JSON representation
CMinifier: A C program to remove comments and minimize the code (remove whitespace and summarize code)
- Host: GitHub
- URL: https://github.com/basemax/c-minifier
- Owner: BaseMax
- License: gpl-3.0
- Created: 2022-02-11T17:20:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-30T19:48:00.000Z (over 1 year ago)
- Last Synced: 2025-05-04T21:45:33.324Z (16 days ago)
- Topics: c, c-minifier, minifier, minifier-c, minifiers, minify, minify-c, minifying
- Language: C
- Homepage:
- Size: 53.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C Minifier
A **C program** to remove comments and **minimize** the code (remove whitespace and summarize code)
## Features
- Supporting most **C keywords** and automatically add space after these, such as: `if, else, int, long, float, bool, sizeof`
- Supporting **macro** statements #include and others
- Fast and Without any third-party library
- Without using **Regex**
- Remove inline C-style comments
- Remove multiline C-style comments
- Trim whitespaces
- Remove empty lines## Build
```
$ gcc Minifier.c -o minifier
```## Using
If you are going to minify A C program and get the results in stdout:
```
./minifier Minifier.c
```And maybe sometime you need to write the result in another or same file:
```
./minifier Minifier.c o.c
```### TODO
- Adding more C keywords if needed or missed
- Automatically rename and make short identifier names (A hash-map list to keep original name and new random name and a function to generate a short (and unique) name)Welcome to help and feel free to contribute and send Pull request.
Please open a issue if you find a bug and not have time to fix. Thanks in advance.
© Copyright Max Base, 2022