Title: [opsview] [11262] initial xs timeval
Revision
11262
Author
aburzynski
Date
2013-01-28 16:27:15 +0000 (Mon, 28 Jan 2013)

Log Message

initial xs timeval

Modified Paths


Modified: trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm	2013-01-28 16:16:19 UTC (rev 11261)
+++ trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm	2013-01-28 16:27:15 UTC (rev 11262)
@@ -24,6 +24,39 @@
 use DBI;
 use File::Slurp qw( read_file );
 
+=pod
+
+use Inline C => <<'END_C';
+
+void timeval(char * ts) {
+    char *sec = NULL;
+    char *mil = NULL;
+
+    char *del = ".";
+
+    sec = strtok(ts, del);
+    mil = strtok(NULL, del);
+
+    Inline_Stack_Vars;
+    Inline_Stack_Reset;
+
+    Inline_Stack_Push(sv_2mortal(newSViv(atoi(sec))));
+
+    if ( mil == NULL ) {
+        Inline_Stack_Push(sv_2mortal(newSViv(0)));
+    } else {
+        Inline_Stack_Push(sv_2mortal(newSViv(atoi(mil))));
+    }
+
+
+    Inline_Stack_Done;
+}
+
+
+END_C
+
+=cut
+
 sub timeval($) {
     my ( $s, $ms ) = split( /\./, $_[0], 2 );
 

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to