CFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
-all: clean v1 v2
-v1: $(ZSTD_FILES) v1.c
+all: clean single multi
+single: $(ZSTD_FILES) single.c
$(CC) $(FLAGS) $^ -o $@
-v2: $(ZSTD_FILES) v2.c
+multi: $(ZSTD_FILES) multi.c
$(CC) $(FLAGS) $^ -o $@
clean:
- @$(RM) -f v1 v2
+ @$(RM) -f single multi
@$(RM) -rf *.dSYM
@$(RM) -f tmp*
@echo "finished cleaning"
size_t const compressedSize = job->compressedSize;
if (ZSTD_isError(compressedSize)) {
DISPLAY("Error: an error occurred during compression\n");
- return arg;
+ return arg;
}
{
size_t const writeSize = fwrite(ctx->jobs[currJob].dst.start, 1, compressedSize, ctx->dstFile);
/* return 0 if successful, else return error */
int main(int argCount, const char* argv[])
{
- if (argCount < 2) {
+ if (argCount < 3) {
DISPLAY("Error: not enough arguments\n");
return 1;
}
-make clean v2
-./v2 tests/test2048.pdf tmp.zst
+make clean multi
+./multi tests/test2048.pdf tmp.zst
+zstd -d tmp.zst
+diff tmp tests/test2048.pdf
+echo "diff test complete"
+make clean