sysdep.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SYSDEP_H
00022 #define SYSDEP_H
00023
00024
00025 #include "ithread.h"
00026
00027
00028
00029
00030 #include "global.h"
00031 #include "md5.h"
00032
00033
00034 #include <sys/types.h>
00035
00036
00037 #ifdef WIN32
00038
00039 #else
00040 #include <sys/time.h>
00041 #endif
00042
00043
00044
00045
00046
00047 #define UUIDS_PER_TICK 1024
00048
00049
00050
00051
00052 extern ithread_mutex_t gUUIDMutex;
00053
00054
00055 #define UUIDLock() ithread_mutex_lock(&gUUIDMutex)
00056 #define UUIDUnlock() ithread_mutex_unlock(&gUUIDMutex)
00057
00058
00059 typedef unsigned long unsigned32;
00060 typedef unsigned short unsigned16;
00061 typedef unsigned char unsigned8;
00062 typedef unsigned char byte;
00063
00064
00065
00066 #ifdef WIN32
00067 #define unsigned64_t __int64
00068 #else
00069 #define unsigned64_t unsigned long long
00070 #endif
00071
00072
00073 #define I64(C) C##LL
00074
00075
00076 typedef unsigned64_t uuid_time_t;
00077
00078
00079 typedef struct {
00080 char nodeID[6];
00081 } uuid_node_t;
00082
00083
00084 void get_ieee_node_identifier(uuid_node_t *node);
00085 void get_system_time(uuid_time_t *uuid_time);
00086 void get_random_info(unsigned char seed[16]);
00087
00088
00089 #endif
00090