From 542b6374deed4bc008f4a057c04c36684b325604 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 19 Nov 2012 18:40:29 +0200 Subject: [PATCH] Add utils.h Collect all random utilities in one header file available to all users. Signed-off-by: Timo Kokkonen --- onewire_parser.c | 1 + parser.c | 1 + utils.h | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 utils.h 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 -- 2.44.0