Skip to content

Commit 39ec710

Browse files
authored
feat: add brotli compression (#4)
* feat: add brotli compression * chore: change compression level
1 parent 1a83e74 commit 39ec710

File tree

5 files changed

+195
-148
lines changed

5 files changed

+195
-148
lines changed

.github/workflows/sizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Deps
1717
run: |
1818
sudo apt update
19-
sudo apt install zlib*
19+
sudo apt install zlib* libbrotli-dev
2020
2121
- name: Checkout
2222
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- name: Deps
1515
run: |
1616
sudo apt update
17-
sudo apt install zlib*
17+
sudo apt install zlib* libbrotli-dev
1818
- name: make
1919
run: make

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
CC=gcc
2-
CFLAGS=-lz
2+
C_INCLUDES:=$(shell pkg-config --cflags libbrotlicommon libbrotlidec libbrotlienc)
3+
L_INCLUDES:=$(shell pkg-config --libs libbrotlicommon libbrotlidec libbrotlienc)
4+
CFLAGS=-lz ${C_INCLUDES} ${L_INCLUDES}
35
LIBSOURCES = $(wildcard lib/*.c)
46
SOURCES = $(LIBSOURCES) tools/filesize.c
57
OBJDIR = $(BINDIR)/obj
@@ -32,4 +34,8 @@ clean:
3234
.SECONDEXPANSION:
3335
$(OBJECTS): $$(patsubst %.o,%.c,$$(patsubst $$(OBJDIR)/%,%,$$@)) | $(DIRS)
3436
$(CC) $(CFLAGS) $(CPPFLAGS) -Ilib \
35-
-c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@
37+
-c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@
38+
39+
.PHONY:
40+
fmt:
41+
clang-format -i tools/filesize.c

readme.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ filesizemd "lib/*"
2626
**Output**
2727

2828
```
29-
|file|size|gzip|
30-
|---|---|---|
31-
|deflate.c|2.05KB|49B|
32-
|deflate.h|132B|92B|
29+
|file|size|gzip|brotli|
30+
|---|---|---|---|
31+
|deflate.c|2.05KB|893B|948B|
32+
|deflate.h|131B|91B|87B|
3333
```
3434

35-
## TODO
36-
37-
- Add compressed output from [brotli](https://gitub.com/google/brotli)
38-
3935
## License
4036

4137
[MIT](license)

0 commit comments

Comments
 (0)