[gupnp] Add gupnp_get_uuid() helper function
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] Add gupnp_get_uuid() helper function
- Date: Sun, 10 May 2015 14:52:06 +0000 (UTC)
commit 5e72cec3a5b63195703fc452236ceedb3540bc69
Author: Jens Georg <mail jensge org>
Date: Sun May 10 16:37:34 2015 +0200
Add gupnp_get_uuid() helper function
Signed-off-by: Jens Georg <mail jensge org>
doc/gupnp-docs.xml | 1 +
doc/gupnp-sections.txt | 6 ++++++
libgupnp/Makefile.am | 1 +
libgupnp/gupnp-service.c | 13 +++++++++++++
libgupnp/gupnp-uuid.h | 32 ++++++++++++++++++++++++++++++++
libgupnp/gupnp.h | 1 +
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"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]