From 705c9b768db7539205992906aed2911425d43caa Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 18 Nov 2025 16:13:04 +0800
Subject: [PATCH] update iniparser to remove warnning
---
project/booster/utils.h | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/project/booster/utils.h b/project/booster/utils.h
new file mode 100644
index 0000000..65bbc07
--- /dev/null
+++ b/project/booster/utils.h
@@ -0,0 +1,61 @@
+/********************************************************************************
+ * Copyright: (C) 2020 LingYun IoT System Studio
+ * All rights reserved.
+ *
+ * Filename: util.h
+ * Description: This file is common utility functions
+ *
+ * Version: 1.0.0(7/06/2012~)
+ * Author: Guo Wenxue <guowenxue@gmail.com>
+ * ChangeLog: 1, Release initial version on "7/06/2012 09:21:33 PM"
+ *
+ ********************************************************************************/
+
+#ifndef __UTIL_H_
+#define __UTIL_H_
+
+#include <time.h>
+#include <stddef.h>
+
+#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
+
+/* +------------------------+
+ * | time functions API |
+ * +------------------------+*/
+static inline void msleep(unsigned long ms)
+{
+ struct timespec cSleep;
+ unsigned long ulTmp;
+
+ cSleep.tv_sec = ms / 1000;
+ if (cSleep.tv_sec == 0)
+ {
+ ulTmp = ms * 10000;
+ cSleep.tv_nsec = ulTmp * 100;
+ }
+ else
+ {
+ cSleep.tv_nsec = 0;
+ }
+
+ nanosleep(&cSleep, 0);
+ return ;
+}
+
+static inline int check_timeout(time_t *last_time, int interval)
+{
+ int timeout = 0;
+ time_t now;
+
+ time(&now);
+
+ if( difftime(now, *last_time)>interval )
+ {
+ timeout = 1;
+ *last_time = now;
+ }
+
+ return timeout;
+}
+
+#endif
--
Gitblit v1.9.1