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);