From ac4bba7194a490f58f5dffb7c4d051b49bc1464d Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 5 Jan 2020 16:29:39 +0100 Subject: [PATCH] change: help useagen in seperated file --- Makefile | 8 +++++--- discspan.c | 25 ++++--------------------- help.c | 20 ++++++++++++++++++++ help.h | 6 ++++++ 4 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 help.c create mode 100644 help.h diff --git a/Makefile b/Makefile index f76823a..df711df 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,13 @@ BINPATH=/usr/bin all: discspan -discspan: discspan.o - $(CC) $(CFLAGS) -o discspan discspan.o +discspan: discspan.o help.o help.h + $(CC) $(CFLAGS) -o discspan discspan.o help.o -discspan.o: +discspan.o: discspan.c $(CC) $(CFLAGS) -c discspan.c +help.o: help.h help.c + $(CC) $(CFLAGS) -c help.c install: chmod 755 discspan diff --git a/discspan.c b/discspan.c index 5e60f81..342aef9 100644 --- a/discspan.c +++ b/discspan.c @@ -5,6 +5,10 @@ #include #include +#include "help.h" + +extern void useage(); + // Medien groessen const unsigned long long bluray = 25000000000; const unsigned long long dvd9 = 8500000000; @@ -121,27 +125,6 @@ unsigned long fill_array_from_file(FILE *in, struct file_size *fs, return lines; } -/** - * Gibt den Hilfetext aus - */ -void usage() -{ - printf("\nUsage: discspan