summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2015-05-10 16:37:34 +0200
committerJens Georg <mail@jensge.org>2015-05-10 16:50:55 +0200
commit5e72cec3a5b63195703fc452236ceedb3540bc69 (patch)
tree9ee4e0be2fead02f8a3cfbde11a5cc8a86301948
parent9eca22a207f09b9d481b96dcae840effd24a337e (diff)
downloadgupnp-5e72cec3a5b63195703fc452236ceedb3540bc69.tar.gz
Add gupnp_get_uuid() helper function
Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r--doc/gupnp-docs.xml1
-rw-r--r--doc/gupnp-sections.txt6
-rw-r--r--libgupnp/Makefile.am1
-rw-r--r--libgupnp/gupnp-service.c13
-rw-r--r--libgupnp/gupnp-uuid.h32
-rw-r--r--libgupnp/gupnp.h1
6 files changed, 54 insertions, 0 deletions
diff --git a/doc/gupnp-docs.xml b/doc/gupnp-docs.xml
index 17ce5f7..a621b68 100644
--- a/doc/gupnp-docs.xml
+++ b/doc/gupnp-docs.xml
@@ -86,6 +86,7 @@
<xi:include href="xml/gupnp-xml-doc.xml"/>
<xi:include href="xml/gupnp-error.xml"/>
<xi:include href="xml/gupnp-types.xml"/>
+ <xi:include href="xml/gupnp-misc.xml"/>
</chapter>
<chapter id="api-tools">
diff --git a/doc/gupnp-sections.txt b/doc/gupnp-sections.txt
index cb9b867..e3b0e79 100644
--- a/doc/gupnp-sections.txt
+++ b/doc/gupnp-sections.txt
@@ -497,3 +497,9 @@ GUPNP_ACL_GET_INTERFACE
GUPNP_IS_ACL
GUPNP_TYPE_ACL
</SECTION>
+
+<SECTION>
+<FILE>gupnp-misc</FILE>
+<TITLE>Utility functions</TITLE>
+gupnp_get_uuid
+</SECTION>
diff --git a/libgupnp/Makefile.am b/libgupnp/Makefile.am
index e1890a9..9c0b5a4 100644
--- a/libgupnp/Makefile.am
+++ b/libgupnp/Makefile.am
@@ -66,6 +66,7 @@ libgupnpinc_HEADERS = gupnp-acl.h \
gupnp-xml-doc.h \
gupnp-white-list.h \
gupnp-types.h \
+ gupnp-uuid.h \
gupnp.h
introspection_sources = $(libgupnpinc_HEADERS) \
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 989b43b..965cc68 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1084,6 +1084,19 @@ subscription_response (GUPnPService *service,
soup_message_set_status (msg, SOUP_STATUS_OK);
}
+/**
+ * gupnp_get_uuid:
+ *
+ * Generate and return a new UUID.
+ *
+ * Returns: (transfer full): A newly generated UUID in string representation.
+ */
+char *
+gupnp_get_uuid (void)
+{
+ return guul_get_uuid ();
+}
+
/* Generates a new SID */
static char *
generate_sid (void)
diff --git a/libgupnp/gupnp-uuid.h b/libgupnp/gupnp-uuid.h
new file mode 100644
index 0000000..857094a
--- /dev/null
+++ b/libgupnp/gupnp-uuid.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2015 Jens Georg
+ *
+ * Author: Jens Georg <mail@jensge.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GUPNP_UUID_H__
+#define __GUPNP_UUID_H__
+
+G_BEGIN_DECLS
+
+char *
+gupnp_get_uuid ();
+
+G_END_DECLS
+
+#endif /* __GUPNP_UUID_H__ */
diff --git a/libgupnp/gupnp.h b/libgupnp/gupnp.h
index 10a3fe7..2a10eab 100644
--- a/libgupnp/gupnp.h
+++ b/libgupnp/gupnp.h
@@ -36,3 +36,4 @@
#include "gupnp-white-list.h"
#include "gupnp-xml-doc.h"
#include "gupnp-types.h"
+#include "gupnp-uuid.h"