From 8288a4f657809a95eee2b02c3193f56ac4db513b Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Tue, 1 Oct 2019 10:50:19 -0700 Subject: [PATCH] timelist: Move timelist to lib Timelist is a generic tool to measure time and it can be moved to lib/ Signed-off-by: Otavio Pontes --- Makefile.am | 4 ++-- src/globals.h | 2 +- src/{ => lib}/timelist.c | 4 +++- src/{ => lib}/timelist.h | 3 +++ src/swupd.h | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) rename src/{ => lib}/timelist.c (98%) rename src/{ => lib}/timelist.h (96%) diff --git a/Makefile.am b/Makefile.am index eb8a76a3..1eeaaa41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,6 +78,8 @@ swupd_SOURCES = \ src/lib/sys.h \ src/lib/thread_pool.c \ src/lib/thread_pool.h \ + src/lib/timelist.c \ + src/lib/timelist.h \ src/lock.c \ src/main.c \ src/manifest.c \ @@ -105,8 +107,6 @@ swupd_SOURCES = \ src/swupd_progress.c \ src/swupd_progress.h \ src/telemetry.c \ - src/timelist.c \ - src/timelist.h \ src/update.c \ src/verify.c \ src/verifytime.c \ diff --git a/src/globals.h b/src/globals.h index ebb62e9b..730ba5d1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -10,7 +10,7 @@ * swupd, as well as functions to handle them. */ -#include "timelist.h" +#include "lib/timelist.h" #ifdef __cplusplus extern "C" { diff --git a/src/timelist.c b/src/lib/timelist.c similarity index 98% rename from src/timelist.c rename to src/lib/timelist.c index 685f4a67..2e481257 100644 --- a/src/timelist.c +++ b/src/lib/timelist.c @@ -23,8 +23,10 @@ #include #include +#include "log.h" +#include "macros.h" #include "memory.h" -#include "swupd.h" +#include "strings.h" #include "timelist.h" struct time { diff --git a/src/timelist.h b/src/lib/timelist.h similarity index 96% rename from src/timelist.h rename to src/lib/timelist.h index fed4105e..90410bf7 100644 --- a/src/timelist.h +++ b/src/lib/timelist.h @@ -12,6 +12,9 @@ extern "C" { #endif +/** + * @brief A timelist object + */ typedef TAILQ_HEAD(timelist, time) timelist; /** diff --git a/src/swupd.h b/src/swupd.h index 0ec291cd..4204f024 100644 --- a/src/swupd.h +++ b/src/swupd.h @@ -21,12 +21,12 @@ #include "lib/progress.h" #include "lib/strings.h" #include "lib/sys.h" +#include "lib/timelist.h" #include "manifest.h" #include "scripts.h" #include "swupd_curl.h" #include "swupd_exit_codes.h" #include "swupd_progress.h" -#include "timelist.h" #ifdef __cplusplus extern "C" {