From: Timo Kokkonen Date: Mon, 19 Nov 2012 16:40:29 +0000 (+0200) Subject: Add utils.h X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=542b6374deed4bc008f4a057c04c36684b325604 Add utils.h Collect all random utilities in one header file available to all users. Signed-off-by: Timo Kokkonen --- diff --git a/onewire_parser.c b/onewire_parser.c index e5d37ea..f878b09 100644 --- a/onewire_parser.c +++ b/onewire_parser.c @@ -4,6 +4,7 @@ #include "parser.h" #include "debug.h" #include "string.h" +#include "utils.h" int parse_opts(const char *str, char *ow_path, size_t pathlen, double *offset) { diff --git a/parser.c b/parser.c index bffe337..887b524 100644 --- a/parser.c +++ b/parser.c @@ -6,6 +6,7 @@ #include "process.h" #include "string.h" #include "debug.h" +#include "utils.h" #define STATFILE "/proc/stat" diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..c3d639a --- /dev/null +++ b/utils.h @@ -0,0 +1,6 @@ +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +#endif