Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5504)
+++ ChangeLog	(revision 5505)
@@ -2,4 +2,5 @@
 	* ROAR_DL_PLUGIN_START() now checks para structure (Closes: #236)
 	* Added support for AutoAppSched to the plugin container.
+	* Added simple UUID interface (Closes: #230)
 
 v. 1.0beta1 - Sat May 12 2012 11:49 CEST
Index: include/libroar/libroar.h
===================================================================
--- include/libroar/libroar.h	(revision 5443)
+++ include/libroar/libroar.h	(revision 5505)
@@ -121,4 +121,5 @@
 #include "base64.h"
 #include "keyval.h"
+#include "uuid.h"
 #include "env.h"
 #include "roardl.h"
Index: include/libroar/uuid.h
===================================================================
--- include/libroar/uuid.h	(revision 5505)
+++ include/libroar/uuid.h	(revision 5505)
@@ -0,0 +1,63 @@
+//uuid.h:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2012
+ *
+ *  This file is part of libroar a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  libroar is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ *  NOTE for everyone want's to change something and send patches:
+ *  read README and HACKING! There a addition information on
+ *  the license of this document you need to read before you send
+ *  any patches.
+ *
+ *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
+ *  or libpulse*:
+ *  The libs libroaresd, libroararts and libroarpulse link this lib
+ *  and are therefore GPL. Because of this it may be illigal to use
+ *  them with any software that uses libesd, libartsc or libpulse*.
+ */
+
+#ifndef _LIBROARUUID_H_
+#define _LIBROARUUID_H_
+
+#include "libroar.h"
+
+typedef unsigned char roar_uuid_t[16];
+
+enum roar_uuid_type {
+ ROAR_UUID_TYPE_NULL         = 0,
+ ROAR_UUID_TYPE_TIME         = 1,
+ ROAR_UUID_TYPE_DCE_SECURITY = 2,
+ ROAR_UUID_TYPE_MD5          = 3,
+ ROAR_UUID_TYPE_RANDOM       = 4,
+ ROAR_UUID_TYPE_SHA1         = 5
+};
+
+int roar_uuid_eq(roar_uuid_t a, roar_uuid_t b);
+int roar_uuid2str(char * str, roar_uuid_t uuid, ssize_t len);
+int roar_str2uuid(roar_uuid_t uuid, const char * str);
+int roar_uuid_gen(roar_uuid_t uuid, enum roar_uuid_type type, roar_uuid_t ns, void * argp, ssize_t arglen);
+#define roar_uuid_gen_null(uuid) roar_uuid_gen(uuid, ROAR_UUID_TYPE_NULL, NULL, NULL, -1)
+#define roar_uuid_gen_time(uuid) roar_uuid_gen(uuid, ROAR_UUID_TYPE_TIME, NULL, NULL, -1)
+#define roar_uuid_gen_random(uuid) roar_uuid_gen(uuid, ROAR_UUID_TYPE_RANDOM, NULL, NULL, -1)
+#define roar_uuid_clear(uuid) roar_uuid_gen_null(uuid)
+
+#endif
+
+//ll
Index: libroar/Makefile
===================================================================
--- libroar/Makefile	(revision 5443)
+++ libroar/Makefile	(revision 5505)
@@ -11,5 +11,5 @@
 PASSWORD=passwordapi.o pinentry.o sshaskpass.o
 CRYPTO=crypto.o random.o $(HASHES) crc.o
-OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o plugincontainer.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o time.o kstore.o
+OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o plugincontainer.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o time.o kstore.o uuid.o
 
 #DEFINES        = -DDEBUG
Index: libroar/uuid.c
===================================================================
--- libroar/uuid.c	(revision 5505)
+++ libroar/uuid.c	(revision 5505)
@@ -0,0 +1,115 @@
+//uuid.c:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2012
+ *
+ *  This file is part of libroar a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  libroar is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ *  NOTE for everyone want's to change something and send patches:
+ *  read README and HACKING! There a addition information on
+ *  the license of this document you need to read before you send
+ *  any patches.
+ *
+ *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
+ *  or libpulse*:
+ *  The libs libroaresd, libroararts and libroarpulse link this lib
+ *  and are therefore GPL. Because of this it may be illigal to use
+ *  them with any software that uses libesd, libartsc or libpulse*.
+ */
+
+#include "libroar.h"
+
+int roar_uuid_eq(roar_uuid_t a, roar_uuid_t b) {
+ if ( a == NULL || b == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
+
+ if ( memcpy(a, b, sizeof(roar_uuid_t)) == 0 )
+  return 1;
+
+ return 0;
+}
+
+int roar_uuid2str(char * str, roar_uuid_t uuid, ssize_t len) {
+ if ( str == NULL || uuid == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
+
+ if ( len < 1 ) {
+  roar_err_set(ROAR_ERROR_NOSPC);
+  return -1;
+ }
+
+ snprintf(str, len, "%.2x%.2x%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x",
+          uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
+          uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]
+         );
+
+ return 0;
+}
+
+int roar_str2uuid(roar_uuid_t uuid, const char * str) {
+ unsigned int inbuf[16];
+ int i;
+
+ if ( sscanf(str, "%2x%2x%2x%2x-%2x%2x-%2x%2x-%2x%2x-%2x%2x%2x%2x%2x%2x",
+             &(inbuf[0]), &(inbuf[1]), &(inbuf[2]), &(inbuf[3]), &(inbuf[4]), &(inbuf[5]),
+             &(inbuf[6]), &(inbuf[7]), &(inbuf[8]), &(inbuf[9]), &(inbuf[10]), &(inbuf[11]),
+             &(inbuf[12]), &(inbuf[13]), &(inbuf[14]), &(inbuf[15])) != 16 ) {
+  roar_err_set(ROAR_ERROR_ILLSEQ);
+  return -1;
+ }
+
+ for (i = 0; i < 16; i++)
+  uuid[i] = inbuf[i];
+
+ return 0;
+}
+int roar_uuid_gen(roar_uuid_t uuid, enum roar_uuid_type type, roar_uuid_t ns, void * argp, ssize_t arglen) {
+ if ( uuid == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
+
+ switch (type) {
+  case ROAR_UUID_TYPE_NULL:
+    memset(uuid, 0, sizeof(roar_uuid_t));
+    return 0;
+   break;
+  case ROAR_UUID_TYPE_RANDOM:
+     roar_random_gen_nonce(uuid, sizeof(roar_uuid_t));
+     uuid[6] = (uuid[8] & 0x0F) | 0x40; // Version
+     uuid[8] = (uuid[8] & 0x3F) | 0x80; // Variant
+    return 0;
+   break;
+  case ROAR_UUID_TYPE_DCE_SECURITY:
+  case ROAR_UUID_TYPE_MD5:
+  case ROAR_UUID_TYPE_SHA1:
+    roar_err_set(ROAR_ERROR_NOTSUP);
+    return -1;
+   break;
+ }
+
+ roar_err_set(ROAR_ERROR_BADRQC);
+ return -1;
+}
+
+//ll
