Split time functions into rs_time.rsh header.
Change-Id: I598b0031d15749c91d11fbd37b075d0564a94dbf
diff --git a/scriptc/rs_math.rsh b/scriptc/rs_math.rsh
index d059997..a74c0e0 100644
--- a/scriptc/rs_math.rsh
+++ b/scriptc/rs_math.rsh
@@ -118,32 +118,6 @@
extern float __attribute__((overloadable))
rsFrac(float);
-// time
-extern int32_t __attribute__((overloadable))
- rsSecond(void);
-extern int32_t __attribute__((overloadable))
- rsMinute(void);
-extern int32_t __attribute__((overloadable))
- rsHour(void);
-extern int32_t __attribute__((overloadable))
- rsDay(void);
-extern int32_t __attribute__((overloadable))
- rsMonth(void);
-extern int32_t __attribute__((overloadable))
- rsYear(void);
-
-// Return the current system clock in milliseconds
-extern int64_t __attribute__((overloadable))
- rsUptimeMillis(void);
-
-// Return the current system clock in nanoseconds
-extern int64_t __attribute__((overloadable))
- rsUptimeNanos(void);
-
-// Return the time in seconds since function was last called in this script.
-extern float __attribute__((overloadable))
- rsGetDt(void);
-
// Send a message back to the client. Will not block and returns true
// if the message was sendable and false if the fifo was full.
// A message ID is required. Data payload is optional.
diff --git a/scriptc/rs_time.rsh b/scriptc/rs_time.rsh
new file mode 100644
index 0000000..f1abed6
--- /dev/null
+++ b/scriptc/rs_time.rsh
@@ -0,0 +1,36 @@
+#ifndef __RS_TIME_RSH__
+#define __RS_TIME_RSH__
+
+typedef int rs_time_t;
+
+typedef struct {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+} rs_tm;
+
+extern rs_time_t __attribute__((overloadable))
+ rsTime(rs_time_t *timer);
+
+extern rs_tm * __attribute__((overloadable))
+ rsLocaltime(rs_tm *local, const rs_time_t *timer);
+
+// Return the current system clock in milliseconds
+extern int64_t __attribute__((overloadable))
+ rsUptimeMillis(void);
+
+// Return the current system clock in nanoseconds
+extern int64_t __attribute__((overloadable))
+ rsUptimeNanos(void);
+
+// Return the time in seconds since function was last called in this script.
+extern float __attribute__((overloadable))
+ rsGetDt(void);
+
+#endif