[Telepathy-commits] [telepathy-doc/master] Rename the example to what it is.
Murray Cumming
murrayc at murrayc.com
Fri Aug 22 08:52:43 PDT 2008
---
configure.ac | 2 +-
docs/book/C/telepathy.xml | 2 +-
docs/examples/Makefile.am | 2 +-
docs/examples/contacts_list_all/Makefile.am | 7 --
docs/examples/contacts_list_all/main.c | 109 --------------------------
docs/examples/list_all_protocols/Makefile.am | 7 ++
docs/examples/list_all_protocols/main.c | 109 ++++++++++++++++++++++++++
7 files changed, 119 insertions(+), 119 deletions(-)
delete mode 100644 docs/examples/contacts_list_all/Makefile.am
delete mode 100644 docs/examples/contacts_list_all/main.c
create mode 100644 docs/examples/list_all_protocols/Makefile.am
create mode 100644 docs/examples/list_all_protocols/main.c
diff --git a/configure.ac b/configure.ac
index 609f67b..ac7a0f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ AC_OUTPUT([
docs/Makefile
docs/examples/Makefile
- docs/examples/contacts_list_all/Makefile
+ docs/examples/list_all_protocols/Makefile
docs/book/Makefile
])
diff --git a/docs/book/C/telepathy.xml b/docs/book/C/telepathy.xml
index bae66fa..a74379c 100644
--- a/docs/book/C/telepathy.xml
+++ b/docs/book/C/telepathy.xml
@@ -49,7 +49,7 @@
<address> <email>murrayc at openismus.com</email> </address>
</affiliation>
</author>
-
+ </authorgroup>
<copyright>
diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index ce86d9a..5c419f7 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -1,6 +1,6 @@
include $(top_srcdir)/docs/Makefile_web.am_fragment
-example_dirs = contacts_list_all
+example_dirs = list_all_protocols
# container - Disabled until the new higher-level library exists.
diff --git a/docs/examples/contacts_list_all/Makefile.am b/docs/examples/contacts_list_all/Makefile.am
deleted file mode 100644
index d0a304f..0000000
--- a/docs/examples/contacts_list_all/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(top_srcdir)/docs/examples/Makefile.am_fragment
-
-#Build the executable, but don't install it.
-noinst_PROGRAMS = example
-
-example_SOURCES = main.c
-
diff --git a/docs/examples/contacts_list_all/main.c b/docs/examples/contacts_list_all/main.c
deleted file mode 100644
index a7780c2..0000000
--- a/docs/examples/contacts_list_all/main.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright 2008 Collabora Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program 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 program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <telepathy-glib/connection-manager.h>
-#include <glib/gprintf.h>
-
-GMainLoop *mainloop = NULL;
-
-static void
-on_list_connection_managers(TpConnectionManager * const *connection_manager,
- gsize n_cms,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
-{
- if (error != NULL)
- {
- g_warning ("%s", error->message);
-
- /* Stop the mainloop so the program finishes: */
- g_main_loop_quit (mainloop);
- return;
- }
-
- g_printf ("Found %" G_GSIZE_FORMAT " connection managers:\n", n_cms);
-
- if(!connection_manager)
- return;
-
- //TODO: See http://bugs.freedesktop.org/show_bug.cgi?id=17115
- //about the awkwardness of these pointers to pointers:
- TpConnectionManager * const *cm_iter = connection_manager;
- for (; *cm_iter != NULL; ++cm_iter)
- {
- const TpConnectionManager *cm = *cm_iter;
- if (!cm)
- continue;
-
- //TODO: The protocols really shouldn't be const.
- //const shouldn't be used for complex types in C because C doesn't have full const support.
- //For instance, g_object_get() takes a non-const, so this causes a warning:
- gchar *cm_name = NULL;
- g_object_get (G_OBJECT(cm),
- "connection-manager", &cm_name,
- NULL);
-
- g_printf (" Connection Manager name: %s\n", cm_name);
- g_free (cm_name);
- cm_name = NULL;
-
- //TODO: See http://bugs.freedesktop.org/show_bug.cgi?id=17112
- //about the lack of real API for this:
- if(cm->protocols)
- {
- const TpConnectionManagerProtocol * const *protocols_iter = cm->protocols;
- for (; *protocols_iter != NULL; ++protocols_iter)
- {
- const TpConnectionManagerProtocol *protocol = *protocols_iter;
- if (protocol)
- {
- if(protocol->name)
- g_printf (" Protocol name: %s\n", protocol->name);
- }
- }
- }
-
-
- }
-
- /* Stop the mainloop so the program finishes: */
- g_main_loop_quit (mainloop);
-}
-
-int
-main (int argc, char **argv)
-{
- g_type_init ();
-
- /* Create the main loop: */
- mainloop = g_main_loop_new (NULL, FALSE);
-
- TpDBusDaemon *bus_daemon = tp_dbus_daemon_new (tp_get_bus ());
-
- tp_list_connection_managers (bus_daemon, &on_list_connection_managers,
- NULL /* user_data */, NULL /* destroy callback */, NULL);
-
-
- /* tp_list_connection_names (bus_daemon, got_connections, &data, NULL, NULL); */
-
- /* Start the main loop, and clean up when it finishes. */
- g_main_loop_run (mainloop);
- g_main_loop_unref (mainloop);
- g_object_unref (bus_daemon);
-
- return 0;
-}
diff --git a/docs/examples/list_all_protocols/Makefile.am b/docs/examples/list_all_protocols/Makefile.am
new file mode 100644
index 0000000..d0a304f
--- /dev/null
+++ b/docs/examples/list_all_protocols/Makefile.am
@@ -0,0 +1,7 @@
+include $(top_srcdir)/docs/examples/Makefile.am_fragment
+
+#Build the executable, but don't install it.
+noinst_PROGRAMS = example
+
+example_SOURCES = main.c
+
diff --git a/docs/examples/list_all_protocols/main.c b/docs/examples/list_all_protocols/main.c
new file mode 100644
index 0000000..a7780c2
--- /dev/null
+++ b/docs/examples/list_all_protocols/main.c
@@ -0,0 +1,109 @@
+/* Copyright 2008 Collabora Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <telepathy-glib/connection-manager.h>
+#include <glib/gprintf.h>
+
+GMainLoop *mainloop = NULL;
+
+static void
+on_list_connection_managers(TpConnectionManager * const *connection_manager,
+ gsize n_cms,
+ const GError *error,
+ gpointer user_data,
+ GObject *weak_object)
+{
+ if (error != NULL)
+ {
+ g_warning ("%s", error->message);
+
+ /* Stop the mainloop so the program finishes: */
+ g_main_loop_quit (mainloop);
+ return;
+ }
+
+ g_printf ("Found %" G_GSIZE_FORMAT " connection managers:\n", n_cms);
+
+ if(!connection_manager)
+ return;
+
+ //TODO: See http://bugs.freedesktop.org/show_bug.cgi?id=17115
+ //about the awkwardness of these pointers to pointers:
+ TpConnectionManager * const *cm_iter = connection_manager;
+ for (; *cm_iter != NULL; ++cm_iter)
+ {
+ const TpConnectionManager *cm = *cm_iter;
+ if (!cm)
+ continue;
+
+ //TODO: The protocols really shouldn't be const.
+ //const shouldn't be used for complex types in C because C doesn't have full const support.
+ //For instance, g_object_get() takes a non-const, so this causes a warning:
+ gchar *cm_name = NULL;
+ g_object_get (G_OBJECT(cm),
+ "connection-manager", &cm_name,
+ NULL);
+
+ g_printf (" Connection Manager name: %s\n", cm_name);
+ g_free (cm_name);
+ cm_name = NULL;
+
+ //TODO: See http://bugs.freedesktop.org/show_bug.cgi?id=17112
+ //about the lack of real API for this:
+ if(cm->protocols)
+ {
+ const TpConnectionManagerProtocol * const *protocols_iter = cm->protocols;
+ for (; *protocols_iter != NULL; ++protocols_iter)
+ {
+ const TpConnectionManagerProtocol *protocol = *protocols_iter;
+ if (protocol)
+ {
+ if(protocol->name)
+ g_printf (" Protocol name: %s\n", protocol->name);
+ }
+ }
+ }
+
+
+ }
+
+ /* Stop the mainloop so the program finishes: */
+ g_main_loop_quit (mainloop);
+}
+
+int
+main (int argc, char **argv)
+{
+ g_type_init ();
+
+ /* Create the main loop: */
+ mainloop = g_main_loop_new (NULL, FALSE);
+
+ TpDBusDaemon *bus_daemon = tp_dbus_daemon_new (tp_get_bus ());
+
+ tp_list_connection_managers (bus_daemon, &on_list_connection_managers,
+ NULL /* user_data */, NULL /* destroy callback */, NULL);
+
+
+ /* tp_list_connection_names (bus_daemon, got_connections, &data, NULL, NULL); */
+
+ /* Start the main loop, and clean up when it finishes. */
+ g_main_loop_run (mainloop);
+ g_main_loop_unref (mainloop);
+ g_object_unref (bus_daemon);
+
+ return 0;
+}
--
1.5.6.3
More information about the Telepathy-commits
mailing list