00001 /***************************** License ********************************** 00002 00003 Copyright (C) 2008 by Communicative Machines 00004 http://www.cmlabs.com All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 ************************************************************************/ 00021 #include <sys/types.h> 00022 #include <sys/time.h> 00023 #include <sys/sysinfo.h> 00024 00025 typedef unsigned long unsigned32; 00026 typedef unsigned short unsigned16; 00027 typedef unsigned char unsigned8; 00028 typedef unsigned char byte; 00029 typedef struct _uuid__t { 00030 unsigned32 time_low; 00031 unsigned16 time_mid; 00032 unsigned16 time_hi_and_version; 00033 unsigned8 clock_seq_hi_and_reserved; 00034 unsigned8 clock_seq_low; 00035 byte node[6]; 00036 } uuid__t; 00037 00038 /* Set this to what your compiler uses for 64 bit data type */ 00039 #ifdef WININC 00040 #define unsigned64_t unsigned __int64 00041 #define I64(C) C 00042 #else 00043 #define unsigned64_t unsigned long long 00044 #define I64(C) C##LL 00045 #endif 00046 00047 00048 typedef unsigned64_t uuid_time_t; 00049 typedef struct { 00050 char nodeID[6]; 00051 } uuid_node_t; 00052 00053 00054 extern "C" { 00055 int uuid_create(uuid__t * uuid); 00056 }