Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1712
Modified Files:
rhTray.h
Log Message:
Add utility func to add a time stamp to a log message.
Index: rhTray.h
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- rhTray.h 25 Oct 2006 03:59:03 -0000 1.3
+++ rhTray.h 24 Feb 2007 02:06:23 -0000 1.4
@@ -25,7 +25,24 @@
#include "nsCOMPtr.h"
#include "widget/nsIBaseWindow.h"
#include "widget/nsIWidget.h"
+#include <time.h>
+extern "C" {
+//Utility function to get Time Stamp
+ char *GetTStamp(char *aTime,int aSize)
+ {
+ if(!aTime)
+ return NULL;
+ int maxSize = 55;
+ if(aSize < maxSize)
+ return NULL;
+ char *tFormat = "[%c]";
+ time_t tm = time(NULL);
+ struct tm *ptr = localtime(&tm);
+ strftime(aTime ,maxSize ,tFormat,ptr);
+ return aTime;
+ }
+}
// Event Defines
#define MENU_EVT 1
Show replies by date