diff --git a/include/utils.h b/include/utils.h index 8bd5ecdd1..82429c88d 100644 --- a/include/utils.h +++ b/include/utils.h @@ -66,6 +66,9 @@ struct settings; struct timespec; +/** Print copyright message to screen. */ +void print_copyright(); + /** Normal random variate generator using the Box-Muller method * * @param m Mean diff --git a/lib/utils.c b/lib/utils.c index 56eb16241..64b24875f 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -19,6 +19,14 @@ #include "cfg.h" #include "utils.h" +void print_copyright() +{ + printf("Simulator2Simulator Server %s (built on %s %s)\n", + BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); + printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n"); + printf(" Steffen Vogel \n"); +} + int version_parse(const char *s, struct version *v) { return sscanf(s, "%u.%u", &v->major, &v->minor) != 2; diff --git a/src/pipe.c b/src/pipe.c index c0addd839..5191de01f 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -60,10 +60,7 @@ static void usage(char *name) printf(" NODE the name of the node to which samples are sent and received from\n"); printf(" -r swap read / write endpoints)\n\n"); - printf("Simulator2Simulator Server %s (built on %s %s)\n", - BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); - printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n"); - printf(" Steffen Vogel \n"); + print_copyright(); exit(EXIT_FAILURE); } diff --git a/src/server.c b/src/server.c index e1b0ee5a1..ed9fe87a8 100644 --- a/src/server.c +++ b/src/server.c @@ -113,10 +113,8 @@ static void usage(const char *name) list_foreach(struct node_type *vt, &node_types) printf(" - %s: %s\n", vt->name, vt->description); printf("\n"); - printf("Simulator2Simulator Server %s (built on %s %s)\n", - BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); - printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n"); - printf(" Steffen Vogel \n"); + + print_copyright(); exit(EXIT_FAILURE); } diff --git a/src/signal.c b/src/signal.c index 584f47275..76b2e8009 100644 --- a/src/signal.c +++ b/src/signal.c @@ -38,10 +38,7 @@ int main(int argc, char *argv[]) printf(" RATE how many messages per second\n"); printf(" LIMIT only send LIMIT messages\n\n"); - printf("Simulator2Simulator Server %s (built on %s %s)\n", - BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); - printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n"); - printf(" Steffen Vogel \n"); + print_copyright(); exit(EXIT_FAILURE); } diff --git a/src/test.c b/src/test.c index 156eac4df..771f3ac50 100644 --- a/src/test.c +++ b/src/test.c @@ -62,10 +62,7 @@ int main(int argc, char *argv[]) printf(" TEST the name of the test to execute: 'rtt'\n"); printf(" NODE name of the node which shoud be used\n\n"); - printf("Simulator2Simulator Server %s (built on %s %s)\n", - BLU(VERSION), MAG(__DATE__), MAG(__TIME__)); - printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n"); - printf(" Steffen Vogel \n"); + print_copyright(); exit(EXIT_FAILURE); }