From d7f3b4e3092d0129c59aee9e2a3f3f94b7d470a1 Mon Sep 17 00:00:00 2001 From: gombasg Date: Fri, 7 Jul 2006 14:06:09 +0000 Subject: [PATCH] Add a header for definitions common to the master and client git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@806 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/examples/serialize-example/common.h | 12 ++++++++++++ dcapi/examples/serialize-example/master.c | 14 +++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 dcapi/examples/serialize-example/common.h diff --git a/dcapi/examples/serialize-example/common.h b/dcapi/examples/serialize-example/common.h new file mode 100644 index 0000000000..ee05c5dd5a --- /dev/null +++ b/dcapi/examples/serialize-example/common.h @@ -0,0 +1,12 @@ +/* + * Common definitions used by both the master and the client + */ + +#ifndef COMMON_H +#define COMMON_H + +/* Logical names of the input/output files */ +#define INPUT_LABEL "in.txt" +#define OUTPUT_LABEL "out.txt" + +#endif /* COMMON_H */ diff --git a/dcapi/examples/serialize-example/master.c b/dcapi/examples/serialize-example/master.c index 259d5737df..d9a2c110c3 100644 --- a/dcapi/examples/serialize-example/master.c +++ b/dcapi/examples/serialize-example/master.c @@ -19,6 +19,10 @@ * *****************************************************/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include @@ -29,11 +33,11 @@ #include #include -#define CHECKPOINT_LABEL "ckpt.txt" -#define INPUT_LABEL "in.txt" -#define OUTPUT_LABEL "out.txt" +#include "common.h" -static int finished_wus = 0; +#define CHECKPOINT_LABEL "ckpt.txt" + +static int finished_wus; static DC_Workunit *workunit; @@ -51,7 +55,7 @@ static void create_ckpt(void) char *ckpt; f = fopen(CHECKPOINT_LABEL, "w"); - if(!f) + if (!f) { DC_log(LOG_ERR, "Failed to open ckpt file (%s) for writing.", CHECKPOINT_LABEL); exit(1);