libUPnP  1.8.0
sysdep.h
1 /*
2  * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
3  * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
4  * Digital Equipment Corporation, Maynard, Mass.
5  * Copyright (c) 1998 Microsoft.
6  * To anyone who acknowledges that this file is provided "AS IS"
7  * without any express or implied warranty: permission to use, copy,
8  * modify, and distribute this file for any purpose is hereby
9  * granted without fee, provided that the above copyright notices and
10  * this notice appears in all source code copies, and that none of
11  * the names of Open Software Foundation, Inc., Hewlett-Packard
12  * Company, or Digital Equipment Corporation be used in advertising
13  * or publicity pertaining to distribution of the software without
14  * specific, written prior permission. Neither Open Software
15  * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment
16  * Corporation makes any representations about the suitability of
17  * this software for any purpose.
18  */
19 
20 
21 #ifndef SYSDEP_H
22 #define SYSDEP_H
23 
24 
25 #include "ithread.h"
26 
27 
28 /* change to point to where MD5 .h's live */
29 /* get MD5 sample implementation from RFC 1321 */
30 #include "global.h"
31 #include "md5.h"
32 
33 
34 #include <sys/types.h>
35 
36 
37 #ifdef WIN32
38  /* Do not #include <sys/time.h> */
39 #else
40  #include <sys/time.h>
41 #endif
42 
43 
44 /* set the following to the number of 100ns ticks of the actual
45  resolution of
46  your system's clock */
47 #define UUIDS_PER_TICK 1024
48 
49 
50 /* Set the following to a call to acquire a system wide global lock
51  */
52 extern ithread_mutex_t gUUIDMutex;
53 
54 
55 #define UUIDLock() ithread_mutex_lock(&gUUIDMutex)
56 #define UUIDUnlock() ithread_mutex_unlock(&gUUIDMutex)
57 
58 
59 typedef unsigned long unsigned32;
60 typedef unsigned short unsigned16;
61 typedef unsigned char unsigned8;
62 typedef unsigned char byte;
63 
64 
65 /* Set this to what your compiler uses for 64 bit data type */
66 #ifdef WIN32
67  #define unsigned64_t __int64
68 #else
69  #define unsigned64_t unsigned long long
70 #endif
71 
72 
73 #define I64(C) C##LL
74 
75 
76 typedef unsigned64_t uuid_time_t;
77 
78 
79 typedef struct {
80  char nodeID[6];
81 } uuid_node_t;
82 
83 
84 void get_ieee_node_identifier(uuid_node_t *node);
85 void get_system_time(uuid_time_t *uuid_time);
86 void get_random_info(unsigned char seed[16]);
87 
88 
89 #endif /* SYSDEP_H */
90