#include "SOGoAppointmentFolder.h"
#include "common.h"
+#include <unistd.h>
+#include <stdlib.h>
+
@implementation SOGoAppointmentFolder
++ (NSString *)globallyUniqueObjectId {
+/*
+4C08AE1A-A808-11D8-AC5A-000393BBAFF6
+ SOGo-Web-28273-18283-288182
+printf( "%x", *(int *) &f);
+ */
+ static int pid = 0;
+ static int sequence = 0;
+ static float rndm = 0;
+ float f;
+
+ if(pid == 0) {
+ pid = getpid();
+ rndm = random();
+ }
+ sequence++;
+ f = [[NSDate date] timeIntervalSince1970];
+ return [NSString stringWithFormat:@"%0X-%0X-%0X-%0X",
+ pid,
+ *(int *)&f,
+ sequence++,
+ random];
+}
+
- (void)dealloc {
[super dealloc];
}