Skip to content

Commit fc3ee53

Browse files
committed
Split "gztool.c" for usage as library
Splits "gztool.c" into components for use in external libraries. 1. gztool.h: Public API including structs and definitions that end-users of the library would need to us. Modifications to API cause major version number bump. 2. gztool.c: Implementation of the public functions that IDEALLY users of 'gztool.h' would not need to read 3. gztool_internal.h: Internal API, which can change between versions 4. gztool_internal.c: Implementation of the internal API 5. main.c: Existing CLI application Unfortunately some key functions (relating to creating index, decompressing and compressing) to the public API are far from ideal to be exposed in a public API (especially around the modal enum that modifies function behavior), but this minor change was concurred as acceptable by the author of gztool [1]. [1] #23 (comment)
1 parent a94390e commit fc3ee53

File tree

7 files changed

+6323
-5784
lines changed

7 files changed

+6323
-5784
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TESTS_ENVIRONMENT = \
44
gztool_abspath='$(abs_top_builddir)'/gztool; \
55
export gztool_abspath;
66
bin_PROGRAMS = gztool
7-
gztool_SOURCES = gztool.c
7+
gztool_SOURCES = gztool.c gztool_internal.c main.c
88
gztool_LDADD = -lm -lz
99
dist_doc_DATA = README.md
1010
dist_man_MANS = gztool.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Compilation
7171

7272
$ sudo apt-get install zlib1g-dev
7373

74-
$ gcc -O3 -o gztool gztool.c -lz -lm
74+
$ gcc -O3 -o gztool gztool.c gztool.h gztool_internal.c gztool_internal.h main.c -lz -lm
7575

7676
If you wish you can use autoconf to check the dependencies, build and
7777
test `gztool`:

0 commit comments

Comments
 (0)