telepathy-gabble-0.18.4/0000755000175000017500000000000013012562227016067 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/0000755000175000017500000000000013012562226016634 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/gibber/0000755000175000017500000000000013012562226020066 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/gibber/gibber-sockets-unix.h0000644000175000017500000000355212735675441024147 0ustar00gkiagiagkiagia00000000000000/* To be included by gibber-sockets.h only. * Do not include this header directly. */ /* * gibber-sockets-unix.h - meta-header for assorted semi-portable socket code * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include /* prerequisite for stdlib.h on Darwin etc., according to autoconf.info */ #include /* prerequisite for sys/socket.h on Darwin, according to autoconf.info */ #include /* prerequisite for all sorts of things */ #include #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ARPA_NAMESER_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_RESOLV_H /* autoconf.info recommends putting sys/types.h, netinet/in.h, * arpa/nameser.h, netdb.h before this one; if you re-order this header, * please keep that true */ # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif telepathy-gabble-0.18.4/lib/gibber/gibber-linklocal-transport.c0000644000175000017500000001274512735675441025514 0ustar00gkiagiagkiagia00000000000000/* * gibber-linklocal-transport.c - Source for GibberLLTransport * Copyright (C) 2006 Collabora Ltd. * @author: Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "gibber-sockets.h" #include "gibber-linklocal-transport.h" #include "gibber-util.h" #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" /* Buffer size used for reading input */ #define BUFSIZE 1024 G_DEFINE_TYPE(GibberLLTransport, gibber_ll_transport, GIBBER_TYPE_FD_TRANSPORT) GQuark gibber_ll_transport_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("gibber_linklocal_transport_error"); return quark; } /* private structure */ typedef struct _GibberLLTransportPrivate GibberLLTransportPrivate; struct _GibberLLTransportPrivate { gboolean incoming; gboolean dispose_has_run; }; #define GIBBER_LL_TRANSPORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIBBER_TYPE_LL_TRANSPORT, GibberLLTransportPrivate)) static void gibber_ll_transport_finalize (GObject *object); static void gibber_ll_transport_init (GibberLLTransport *self) { GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (self); priv->incoming = FALSE; } static void gibber_ll_transport_dispose (GObject *object); static void gibber_ll_transport_class_init (GibberLLTransportClass *gibber_ll_transport_class) { GObjectClass *object_class = G_OBJECT_CLASS (gibber_ll_transport_class); g_type_class_add_private (gibber_ll_transport_class, sizeof (GibberLLTransportPrivate)); object_class->dispose = gibber_ll_transport_dispose; object_class->finalize = gibber_ll_transport_finalize; } void gibber_ll_transport_dispose (GObject *object) { GibberLLTransport *self = GIBBER_LL_TRANSPORT (object); GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (self); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (G_OBJECT_CLASS (gibber_ll_transport_parent_class)->dispose) G_OBJECT_CLASS (gibber_ll_transport_parent_class)->dispose (object); } void gibber_ll_transport_finalize (GObject *object) { G_OBJECT_CLASS (gibber_ll_transport_parent_class)->finalize (object); } GibberLLTransport * gibber_ll_transport_new (void) { return g_object_new (GIBBER_TYPE_LL_TRANSPORT, NULL); } void gibber_ll_transport_open_fd (GibberLLTransport *transport, int fd) { GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (transport); priv->incoming = TRUE; gibber_transport_set_state (GIBBER_TRANSPORT (transport), GIBBER_TRANSPORT_CONNECTING); gibber_fd_transport_set_fd (GIBBER_FD_TRANSPORT (transport), fd, TRUE); } gboolean gibber_ll_transport_open_sockaddr (GibberLLTransport *transport, struct sockaddr_storage *addr, GError **error) { GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (transport); char host[NI_MAXHOST]; char port[NI_MAXSERV]; int fd; int ret; g_assert (!priv->incoming); gibber_transport_set_state (GIBBER_TRANSPORT(transport), GIBBER_TRANSPORT_CONNECTING); if (getnameinfo ((struct sockaddr *)addr, sizeof (struct sockaddr_storage), host, NI_MAXHOST, port, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV) == 0) { DEBUG("Trying to connect to %s port %s", host, port); } else { DEBUG("Connecting.."); } fd = socket (addr->ss_family, SOCK_STREAM, 0); if (fd < 0) { g_set_error (error, GIBBER_LL_TRANSPORT_ERROR, GIBBER_LL_TRANSPORT_ERROR_FAILED, "Getting socket failed: %s", g_strerror (errno)); DEBUG("Getting socket failed: %s", strerror(errno)); goto failed; } ret = connect (fd, (struct sockaddr *)addr, sizeof (struct sockaddr_storage)); if (ret < 0) { g_set_error (error, GIBBER_LL_TRANSPORT_ERROR, GIBBER_LL_TRANSPORT_ERROR_CONNECT_FAILED, "Connect failed: %s", g_strerror (errno)); DEBUG("Connecting failed: %s", strerror (errno)); goto failed; } gibber_fd_transport_set_fd (GIBBER_FD_TRANSPORT (transport), fd, TRUE); return TRUE; failed: gibber_transport_set_state (GIBBER_TRANSPORT (transport), GIBBER_TRANSPORT_DISCONNECTED); if (fd >= 0) { close (fd); } return FALSE; } gboolean gibber_ll_transport_is_incoming (GibberLLTransport *transport) { GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (transport); return priv->incoming; } void gibber_ll_transport_set_incoming (GibberLLTransport *transport, gboolean incoming) { GibberLLTransportPrivate *priv = GIBBER_LL_TRANSPORT_GET_PRIVATE (transport); g_assert ( GIBBER_TRANSPORT (transport)->state == GIBBER_TRANSPORT_DISCONNECTED); priv->incoming = incoming; } telepathy-gabble-0.18.4/lib/gibber/gibber-tcp-transport.c0000644000175000017500000001772713011303261024307 0ustar00gkiagiagkiagia00000000000000/* * gibber-tcp-transport.c - Source for GibberTCPTransport * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "gibber-sockets.h" #include "gibber-tcp-transport.h" #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" #include #include "errno.h" G_DEFINE_TYPE(GibberTCPTransport, gibber_tcp_transport, GIBBER_TYPE_FD_TRANSPORT) /* private structure */ typedef struct _GibberTCPTransportPrivate GibberTCPTransportPrivate; struct _GibberTCPTransportPrivate { GIOChannel *channel; GList *addresses; guint16 port; guint watch_in; gboolean dispose_has_run; }; #define GIBBER_TCP_TRANSPORT_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIBBER_TYPE_TCP_TRANSPORT, \ GibberTCPTransportPrivate)) static void gibber_tcp_transport_init (GibberTCPTransport *obj) { /* GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE (obj); */ /* allocate any data required by the object here */ } static void gibber_tcp_transport_dispose (GObject *object); static void gibber_tcp_transport_finalize (GObject *object); static void gibber_tcp_transport_class_init ( GibberTCPTransportClass *gibber_tcp_transport_class) { GObjectClass *object_class = G_OBJECT_CLASS (gibber_tcp_transport_class); g_type_class_add_private (gibber_tcp_transport_class, sizeof (GibberTCPTransportPrivate)); object_class->dispose = gibber_tcp_transport_dispose; object_class->finalize = gibber_tcp_transport_finalize; } static void clean_connect_attempt (GibberTCPTransport *self) { GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE ( self); if (priv->watch_in != 0) { g_source_remove (priv->watch_in); priv->watch_in = 0; } if (priv->channel != NULL) { g_io_channel_unref (priv->channel); priv->channel = NULL; } } static void clean_all_connect_attempts (GibberTCPTransport *self) { GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE ( self); clean_connect_attempt (self); g_resolver_free_addresses (priv->addresses); priv->addresses = NULL; } void gibber_tcp_transport_dispose (GObject *object) { GibberTCPTransport *self = GIBBER_TCP_TRANSPORT (object); GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE (self); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; clean_all_connect_attempts (self); /* release any references held by the object here */ if (G_OBJECT_CLASS (gibber_tcp_transport_parent_class)->dispose) G_OBJECT_CLASS (gibber_tcp_transport_parent_class)->dispose (object); } void gibber_tcp_transport_finalize (GObject *object) { /* GibberTCPTransport *self = GIBBER_TCP_TRANSPORT (object); GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE (self); */ /* free any data held directly by the object here */ G_OBJECT_CLASS (gibber_tcp_transport_parent_class)->finalize (object); } GibberTCPTransport * gibber_tcp_transport_new () { return g_object_new (GIBBER_TYPE_TCP_TRANSPORT, NULL); } static void new_connect_attempt (GibberTCPTransport *self); static gboolean try_to_connect (GibberTCPTransport *self) { GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE ( self); GSocketAddress *gaddr; struct sockaddr_storage addr; gssize native_size; gint fd; int ret; int err; gboolean connected = FALSE; g_assert (priv->channel != NULL); fd = g_io_channel_unix_get_fd (priv->channel); gaddr = g_inet_socket_address_new (G_INET_ADDRESS (priv->addresses->data), priv->port); native_size = g_socket_address_get_native_size (gaddr); /* _get_native_size() really shouldn't fail... */ g_return_val_if_fail (native_size > 0, FALSE); /* ...and if sockaddr_storage isn't big enough, we're basically screwed. */ g_return_val_if_fail ((gsize) native_size <= sizeof (addr), FALSE); g_socket_address_to_native (gaddr, &addr, sizeof (addr), NULL); ret = connect (fd, (struct sockaddr *)&addr, (gsize) native_size); #ifdef G_OS_WIN32 err = WSAGetLastError (); connected = (ret == 0 || err == WSAEISCONN); #else err = errno; connected = (ret == 0); #endif g_object_unref (gaddr); if (connected) { DEBUG ("connect succeeded"); clean_all_connect_attempts (self); gibber_fd_transport_set_fd (GIBBER_FD_TRANSPORT (self), fd, TRUE); return FALSE; } if (gibber_connect_errno_requires_retry (err)) { /* We have to wait longer */ return TRUE; } clean_connect_attempt (self); g_object_unref (priv->addresses->data); priv->addresses = g_list_remove_link (priv->addresses, priv->addresses); new_connect_attempt (self); return FALSE; } static gboolean _channel_io (GIOChannel *source, GIOCondition condition, gpointer data) { GibberTCPTransport *self = GIBBER_TCP_TRANSPORT (data); return try_to_connect (self); } static void new_connect_attempt (GibberTCPTransport *self) { GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE ( self); int fd; GSocketAddress *gaddr; gchar *tmpstr; if (priv->addresses == NULL) { /* no more candidate to try */ DEBUG ("connection failed"); goto failed; } tmpstr = g_inet_address_to_string (G_INET_ADDRESS (priv->addresses->data)); DEBUG ("Trying %s port %d...", tmpstr, priv->port); g_free (tmpstr); gaddr = g_inet_socket_address_new (G_INET_ADDRESS (priv->addresses->data), priv->port); fd = socket (g_socket_address_get_family (gaddr), SOCK_STREAM, IPPROTO_TCP); g_object_unref (gaddr); if (fd < 0) { DEBUG("socket failed: #%d %s", gibber_socket_errno (), gibber_socket_strerror ()); goto failed; } gibber_socket_set_nonblocking (fd); priv->channel = gibber_io_channel_new_from_socket (fd); g_io_channel_set_close_on_unref (priv->channel, FALSE); g_io_channel_set_encoding (priv->channel, NULL, NULL); g_io_channel_set_buffered (priv->channel, FALSE); priv->watch_in = g_io_add_watch (priv->channel, G_IO_IN | G_IO_PRI | G_IO_OUT, _channel_io, self); try_to_connect (self); return; failed: clean_all_connect_attempts (self); gibber_transport_set_state (GIBBER_TRANSPORT (self), GIBBER_TRANSPORT_DISCONNECTED); } void gibber_tcp_transport_connect (GibberTCPTransport *tcp_transport, const gchar *host, guint16 port) { GibberTCPTransportPrivate *priv = GIBBER_TCP_TRANSPORT_GET_PRIVATE ( tcp_transport); GResolver *resolver = g_resolver_get_default (); GError *error = NULL; gibber_transport_set_state (GIBBER_TRANSPORT (tcp_transport), GIBBER_TRANSPORT_CONNECTING); priv->port = port; g_assert (priv->addresses == NULL); g_assert (priv->channel == NULL); priv->addresses = g_resolver_lookup_by_name (resolver, host, NULL, &error); if (priv->addresses == NULL) { DEBUG("Address lookup failed: %s", error->message); gibber_transport_set_state (GIBBER_TRANSPORT (tcp_transport), GIBBER_TRANSPORT_DISCONNECTED); g_error_free (error); goto out; } new_connect_attempt (tcp_transport); out: g_object_unref (resolver); } telepathy-gabble-0.18.4/lib/gibber/gibber-util.h0000644000175000017500000000216112735675441022463 0ustar00gkiagiagkiagia00000000000000/* * gibber-util.h - Header for Gibber utility functions * Copyright (C) 2007 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_UTIL_H__ #define __GIBBER_UTIL_H__ #include "gibber-sockets.h" #include G_BEGIN_DECLS void gibber_normalize_address (struct sockaddr_storage *addr); gboolean gibber_strdiff (const gchar *left, const gchar *right); G_END_DECLS #endif /* #ifndef __GIBBER_UTIL_H__ */ telepathy-gabble-0.18.4/lib/gibber/gibber-transport.h0000644000175000017500000001065212735675441023546 0ustar00gkiagiagkiagia00000000000000/* * gibber-transport.h - Header for GibberTransport * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_TRANSPORT_H__ #define __GIBBER_TRANSPORT_H__ #include #include "gibber-sockets.h" G_BEGIN_DECLS typedef enum { GIBBER_TRANSPORT_DISCONNECTED = 0, GIBBER_TRANSPORT_CONNECTING, GIBBER_TRANSPORT_CONNECTED, GIBBER_TRANSPORT_DISCONNECTING, } GibberTransportState; typedef struct _GibberTransport GibberTransport; typedef struct _GibberTransportClass GibberTransportClass; typedef struct _GibberBuffer GibberBuffer; typedef void (*GibberHandlerFunc) (GibberTransport *transport, GibberBuffer *buffer, gpointer user_data); struct _GibberBuffer { const guint8 *data; gsize length; }; struct _GibberTransportClass { GObjectClass parent_class; gboolean (*send) (GibberTransport *transport, const guint8 *data, gsize length, GError **error); void (*disconnect) (GibberTransport *transport); gboolean (*get_peeraddr) (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); gboolean (*get_sockaddr) (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); gboolean (*buffer_is_empty) (GibberTransport *transport); void (*block_receiving) (GibberTransport *transport, gboolean block); }; struct _GibberTransport { GObject parent; GibberTransportState state; /* Maximum packet size for transports where it matters, 0 otherwise */ gsize max_packet_size; /* FIXME Should be private... */ GibberHandlerFunc handler; gpointer user_data; }; GType gibber_transport_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_TRANSPORT (gibber_transport_get_type ()) #define GIBBER_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_TRANSPORT, GibberTransport)) #define GIBBER_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_TRANSPORT, \ GibberTransportClass)) #define GIBBER_IS_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_TRANSPORT)) #define GIBBER_IS_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_TRANSPORT)) #define GIBBER_TRANSPORT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_TRANSPORT, \ GibberTransportClass)) /* Utility functions for the classes based on GibberTransport */ void gibber_transport_received_data (GibberTransport *transport, const guint8 *data, gsize length); void gibber_transport_received_data_custom (GibberTransport *transport, GibberBuffer *buffer); void gibber_transport_set_state (GibberTransport *transport, GibberTransportState state); void gibber_transport_emit_error (GibberTransport *transport, GError *error); /* Public api */ GibberTransportState gibber_transport_get_state (GibberTransport *transport); gboolean gibber_transport_send (GibberTransport *transport, const guint8 *data, gsize size, GError **error); void gibber_transport_disconnect (GibberTransport *transport); void gibber_transport_set_handler (GibberTransport *transport, GibberHandlerFunc func, gpointer user_data); gboolean gibber_transport_get_peeraddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); gboolean gibber_transport_get_sockaddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); gboolean gibber_transport_buffer_is_empty (GibberTransport *transport); void gibber_transport_emit_buffer_empty (GibberTransport *transport); void gibber_transport_block_receiving (GibberTransport *transport, gboolean block); G_END_DECLS #endif /* #ifndef __GIBBER_TRANSPORT_H__*/ telepathy-gabble-0.18.4/lib/gibber/gibber-debug.h0000644000175000017500000000324013012547534022561 0ustar00gkiagiagkiagia00000000000000 #ifndef __DEBUG_H__ #define __DEBUG_H__ #include "config.h" #include #if 0 #include "gibber-xmpp-stanza.h" #endif G_BEGIN_DECLS #ifdef ENABLE_DEBUG typedef enum { DEBUG_TRANSPORT = 1 << 0, DEBUG_NET = 1 << 1, DEBUG_XMPP_READER = 1 << 2, DEBUG_XMPP_WRITER = 1 << 3, DEBUG_SASL = 1 << 4, DEBUG_SSL = 1 << 5, DEBUG_RMULTICAST = 1 << 6, DEBUG_RMULTICAST_SENDER = 1 << 7, DEBUG_MUC_CONNECTION = 1 << 8, DEBUG_BYTESTREAM = 1 << 9, DEBUG_FILE_TRANSFER = 1 << 10, } DebugFlags; #define DEBUG_XMPP (DEBUG_XMPP_READER | DEBUG_XMPP_WRITER) void gibber_debug_set_flags_from_env (void); void gibber_debug_set_flags (DebugFlags flags); gboolean gibber_debug_flag_is_set (DebugFlags flag); void gibber_debug (DebugFlags flag, const gchar *format, ...) G_GNUC_PRINTF (2, 3); #if 0 void gibber_debug_stanza (DebugFlags flag, GibberXmppStanza *stanza, const gchar *format, ...) G_GNUC_PRINTF (3, 4); #endif #ifdef DEBUG_FLAG #define DEBUG(format, ...) \ G_STMT_START { \ gibber_debug (DEBUG_FLAG, "%s: " format, G_STRFUNC, ##__VA_ARGS__); \ } G_STMT_END #define DEBUG_STANZA(stanza, format, ...) \ G_STMT_START { \ gibber_debug_stanza (DEBUG_FLAG, stanza, "%s: " format, G_STRFUNC,\ ##__VA_ARGS__); \ } G_STMT_END #define DEBUGGING (debug_flag_is_set (DEBUG_FLAG)) #endif /* DEBUG_FLAG */ #else /* ENABLE_DEBUG */ #ifdef DEBUG_FLAG #define DEBUG(format, ...) G_STMT_START { } G_STMT_END #define DEBUG_STANZA(stanza, format, ...) G_STMT_START { } G_STMT_END #define DEBUGGING (0) #endif /* DEBUG_FLAG */ #endif /* ENABLE_DEBUG */ G_END_DECLS #endif telepathy-gabble-0.18.4/lib/gibber/gibber-listener.c0000644000175000017500000003226513006434402023314 0ustar00gkiagiagkiagia00000000000000/* * gibber-listener.c - Source for GibberListener * Copyright (C) 2007,2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include "gibber-sockets.h" #ifdef HAVE_UNISTD_H # include #endif #include #include "gibber-listener.h" #include "gibber-fd-transport.h" #include "gibber-unix-transport.h" #include "gibber-util.h" #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" #include "gibber-signals-marshal.h" G_DEFINE_TYPE (GibberListener, gibber_listener, \ G_TYPE_OBJECT); /* signals */ enum { NEW_CONNECTION, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; typedef struct { GIOChannel *listener; guint io_watch_in; } Listener; typedef struct _GibberListenerPrivate GibberListenerPrivate; struct _GibberListenerPrivate { GSList *listeners; /* Don't allow to listen again if it is already listening */ gboolean listening; int port; gboolean dispose_has_run; }; #define GIBBER_LISTENER_GET_PRIVATE(obj) \ ((GibberListenerPrivate *) obj->priv) GQuark gibber_listener_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ( "gibber_listener_error"); return quark; } static gboolean unimplemented (GError **error) { g_set_error (error, GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAILED, "Unimplemented"); return FALSE; } static void gibber_listener_init (GibberListener *self) { GibberListenerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GIBBER_TYPE_LISTENER, GibberListenerPrivate); self->priv = priv; priv->dispose_has_run = FALSE; } static void gibber_listeners_clean_listeners (GibberListener *self) { GibberListenerPrivate *priv = GIBBER_LISTENER_GET_PRIVATE (self); GSList *t; for (t = priv->listeners ; t != NULL ; t = g_slist_delete_link (t, t)) { Listener *l = (Listener *) t->data; g_io_channel_unref (l->listener); g_source_remove (l->io_watch_in); g_slice_free (Listener, l); } priv->listeners = NULL; priv->listening = FALSE; priv->port = 0; } static void gibber_listener_dispose (GObject *object) { GibberListener *self = GIBBER_LISTENER (object); gibber_listeners_clean_listeners (self); G_OBJECT_CLASS (gibber_listener_parent_class)->dispose ( object); } static void gibber_listener_class_init ( GibberListenerClass *gibber_listener_class) { GObjectClass *object_class = G_OBJECT_CLASS ( gibber_listener_class); g_type_class_add_private (gibber_listener_class, sizeof (GibberListenerPrivate)); object_class->dispose = gibber_listener_dispose; signals[NEW_CONNECTION] = g_signal_new ( "new-connection", G_OBJECT_CLASS_TYPE (gibber_listener_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, _gibber_signals_marshal_VOID__OBJECT_POINTER_UINT, G_TYPE_NONE, 3, GIBBER_TYPE_TRANSPORT, G_TYPE_POINTER, G_TYPE_UINT); } GibberListener * gibber_listener_new (void) { return g_object_new (GIBBER_TYPE_LISTENER, NULL); } static gboolean listener_io_in_cb (GIOChannel *source, GIOCondition condition, gpointer user_data) { GibberListener *self = GIBBER_LISTENER (user_data); GibberFdTransport *transport; int fd, nfd; int ret; char host[NI_MAXHOST]; char port[NI_MAXSERV]; struct sockaddr_storage addr; socklen_t addrlen = sizeof (struct sockaddr_storage); fd = g_io_channel_unix_get_fd (source); nfd = accept (fd, (struct sockaddr *) &addr, &addrlen); gibber_normalize_address (&addr); #ifdef GIBBER_TYPE_UNIX_TRANSPORT if (addr.ss_family == AF_UNIX) { transport = GIBBER_FD_TRANSPORT (gibber_unix_transport_new_from_fd (nfd)); /* UNIX sockets doesn't have port */ ret = getnameinfo ((struct sockaddr *) &addr, addrlen, host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); port[0] = '\0'; } else #endif { transport = g_object_new (GIBBER_TYPE_FD_TRANSPORT, NULL); gibber_fd_transport_set_fd (transport, nfd, TRUE); ret = getnameinfo ((struct sockaddr *) &addr, addrlen, host, NI_MAXHOST, port, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV); } if (ret == 0) { if (port[0] != '\0') DEBUG ("New connection from %s port %s", host, port); else DEBUG ("New connection from %s", host); } else { DEBUG("New connection..."); } g_signal_emit (self, signals[NEW_CONNECTION], 0, transport, &addr, (guint) addrlen); g_object_unref (transport); return TRUE; } static gboolean add_listener (GibberListener *self, int family, int type, int protocol, struct sockaddr *address, socklen_t addrlen, GError **error) { #define BACKLOG 5 int fd = -1, ret, yes = 1; Listener *l; GibberListenerPrivate *priv = GIBBER_LISTENER_GET_PRIVATE (self); char name [NI_MAXHOST], portname[NI_MAXSERV]; union { struct sockaddr addr; struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_storage storage; } baddress; socklen_t baddrlen = sizeof (baddress); fd = socket (family, type, protocol); if (fd == -1) { gibber_socket_set_error (error, "socket failed", GIBBER_LISTENER_ERROR, gibber_socket_errno_is_eafnosupport () ? GIBBER_LISTENER_ERROR_FAMILY_NOT_SUPPORTED : GIBBER_LISTENER_ERROR_FAILED); goto error; } ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (int)); if (ret == -1) { gibber_socket_set_error (error, "setsockopt failed", GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAILED); goto error; } #ifdef IPV6_V6ONLY if (family == AF_INET6) { ret = setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof (int)); if (ret == -1) { gibber_socket_set_error (error, "setsockopt failed", GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAILED); goto error; } } #endif ret = bind (fd, address, addrlen); if (ret < 0) { gibber_socket_set_error (error, "bind failed", GIBBER_LISTENER_ERROR, gibber_socket_errno_is_eaddrinuse () ? GIBBER_LISTENER_ERROR_ADDRESS_IN_USE : GIBBER_LISTENER_ERROR_FAILED); goto error; } ret = listen (fd, BACKLOG); if (ret == -1) { gibber_socket_set_error (error, "listen failed", GIBBER_LISTENER_ERROR, gibber_socket_errno_is_eaddrinuse () ? GIBBER_LISTENER_ERROR_ADDRESS_IN_USE : GIBBER_LISTENER_ERROR_FAILED); goto error; } ret = getsockname (fd, &baddress.addr, &baddrlen); if (ret == -1) { gibber_socket_set_error (error, "getsockname failed", GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAILED); goto error; } getnameinfo (&baddress.addr, baddrlen, name, sizeof (name), portname, sizeof (portname), NI_NUMERICHOST | NI_NUMERICSERV); DEBUG ( "Listening on %s port %s...", name, portname); switch (family) { case AF_INET: priv->port = g_ntohs (baddress.in.sin_port); break; case AF_INET6: priv->port = g_ntohs (baddress.in6.sin6_port); break; default: priv->port = 0; break; } l = g_slice_new (Listener); l->listener = gibber_io_channel_new_from_socket (fd); g_io_channel_set_close_on_unref (l->listener, TRUE); l->io_watch_in = g_io_add_watch (l->listener, G_IO_IN, listener_io_in_cb, self); priv->listeners = g_slist_append (priv->listeners, l); return TRUE; error: if (fd > 0) close (fd); return FALSE; } /* port: if 0, choose a random port */ static gboolean listen_tcp_af (GibberListener *listener, int port, GibberAddressFamily family, gboolean loopback, GError **error) { GibberListenerPrivate *priv = GIBBER_LISTENER_GET_PRIVATE (listener); struct addrinfo req, *ans = NULL, *a; int ret; gchar sport[6]; if (priv->listening) { g_set_error (error, GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_ALREADY_LISTENING, "GibberListener is already listening"); return FALSE; } memset (&req, 0, sizeof (req)); if (!loopback) req.ai_flags = AI_PASSIVE; switch (family) { case GIBBER_AF_IPV4: req.ai_family = AF_INET; break; case GIBBER_AF_IPV6: req.ai_family = AF_INET6; break; case GIBBER_AF_ANY: req.ai_family = AF_UNSPEC; break; } req.ai_socktype = SOCK_STREAM; req.ai_protocol = IPPROTO_TCP; g_snprintf (sport, 6, "%d", port); ret = getaddrinfo (NULL, sport, &req, &ans); if (ret != 0) { DEBUG ("getaddrinfo failed: %s", gai_strerror (ret)); g_set_error (error, GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAILED, "%s", gai_strerror (ret)); goto error; } priv->port = 0; for (a = ans ; a != NULL ; a = a->ai_next) { union { struct sockaddr *addr; struct sockaddr_storage *storage; struct sockaddr_in *in; struct sockaddr_in6 *in6; } addr; gboolean ret_; GError *terror = NULL; addr.addr = a->ai_addr; /* the caller let us choose a port and we are not in the first round */ if (port == 0 && priv->port != 0) { if (a->ai_family == AF_INET) addr.in->sin_port = g_htons (priv->port); else if (a->ai_family == AF_INET6) addr.in6->sin6_port = g_htons (priv->port); else g_assert_not_reached (); } ret_ = add_listener (listener, a->ai_family, a->ai_socktype, a->ai_protocol, a->ai_addr, a->ai_addrlen, &terror); if (ret_ == FALSE) { gboolean fatal = !g_error_matches (terror, GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_FAMILY_NOT_SUPPORTED); /* let error always point to the last error */ g_clear_error (error); g_propagate_error (error, terror); if (fatal) goto error; } else { /* add_listener succeeded: don't allow to listen again */ priv->listening = TRUE; } } /* If all listeners failed, report the last error */ if (priv->listeners == NULL) goto error; /* There was an error at some point, but it was not fatal. ignore it */ g_clear_error (error); freeaddrinfo (ans); return TRUE; error: gibber_listeners_clean_listeners (listener); if (ans != NULL) freeaddrinfo (ans); return FALSE; } gboolean gibber_listener_listen_tcp (GibberListener *listener, int port, GError **error) { return gibber_listener_listen_tcp_af (listener, port, GIBBER_AF_ANY, error); } gboolean gibber_listener_listen_tcp_af (GibberListener *listener, int port, GibberAddressFamily family, GError **error) { return listen_tcp_af (listener, port, family, FALSE, error); } gboolean gibber_listener_listen_tcp_loopback (GibberListener *listener, int port, GError **error) { return gibber_listener_listen_tcp_loopback_af (listener, port, GIBBER_AF_ANY, error); } gboolean gibber_listener_listen_tcp_loopback_af (GibberListener *listener, int port, GibberAddressFamily family, GError **error) { return listen_tcp_af (listener, port, family, TRUE, error); } gboolean gibber_listener_listen_socket (GibberListener *listener, gchar *path, gboolean abstract, GError **error) { GibberListenerPrivate *priv = GIBBER_LISTENER_GET_PRIVATE (listener); #ifdef GIBBER_TYPE_UNIX_TRANSPORT struct sockaddr_un addr; int ret; #endif if (priv->listening) { g_set_error (error, GIBBER_LISTENER_ERROR, GIBBER_LISTENER_ERROR_ALREADY_LISTENING, "GibberListener is already listening"); return FALSE; } #ifdef GIBBER_TYPE_UNIX_TRANSPORT if (abstract) return unimplemented (error); memset (&addr, 0, sizeof (addr)); addr.sun_family = PF_UNIX; snprintf (addr.sun_path, sizeof (addr.sun_path) - 1, "%s", path); ret = add_listener (listener, AF_UNIX, SOCK_STREAM, 0, (struct sockaddr *) &addr, sizeof (addr), error); if (ret == TRUE) { /* add_listener succeeded: don't allow to listen again */ priv->listening = TRUE; } return ret; #else /* Unix transport not supported */ return unimplemented (error); #endif /* Unix transport not supported */ } int gibber_listener_get_port (GibberListener *listener) { GibberListenerPrivate *priv = GIBBER_LISTENER_GET_PRIVATE (listener); return priv->port; } telepathy-gabble-0.18.4/lib/gibber/gibber-sockets-win32.h0000644000175000017500000000215412735675441024123 0ustar00gkiagiagkiagia00000000000000/* To be included by gibber-sockets.h only. * Do not include this header directly. */ /* * gibber-sockets-win32.h - meta-header for assorted semi-portable socket code * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include /* Winsock makes some inappropriately-namespaced definitions */ #undef ERROR #undef interface telepathy-gabble-0.18.4/lib/gibber/gibber-debug.c0000644000175000017500000000444013012547534022557 0ustar00gkiagiagkiagia00000000000000#include "config.h" #include #include #include "gibber-debug.h" #ifdef ENABLE_DEBUG static DebugFlags flags = 0; static gboolean initialized = FALSE; static GDebugKey keys[] = { { "transport", DEBUG_TRANSPORT }, { "net", DEBUG_NET }, { "xmpp", DEBUG_XMPP }, { "xmpp-reader", DEBUG_XMPP_READER }, { "xmpp-writer", DEBUG_XMPP_WRITER }, { "sasl", DEBUG_SASL }, { "ssl", DEBUG_SSL }, { "rmulticast", DEBUG_RMULTICAST }, { "rmulticast-sender", DEBUG_RMULTICAST_SENDER }, { "muc-connection", DEBUG_MUC_CONNECTION }, { "bytestream", DEBUG_BYTESTREAM }, { "ft", DEBUG_FILE_TRANSFER }, { "all", ~0 }, { 0, }, }; void gibber_debug_set_flags_from_env () { guint nkeys; const gchar *flags_string; for (nkeys = 0; keys[nkeys].value; nkeys++); flags_string = g_getenv ("GIBBER_DEBUG"); if (flags_string) gibber_debug_set_flags (g_parse_debug_string (flags_string, keys, nkeys)); initialized = TRUE; } void gibber_debug_set_flags (DebugFlags new_flags) { flags |= new_flags; initialized = TRUE; } gboolean gibber_debug_flag_is_set (DebugFlags flag) { return flag & flags; } void gibber_debug (DebugFlags flag, const gchar *format, ...) { if (G_UNLIKELY(!initialized)) gibber_debug_set_flags_from_env (); if (flag & flags) { va_list args; va_start (args, format); g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args); va_end (args); } } #if 0 void gibber_debug_stanza (DebugFlags flag, GibberXmppStanza *stanza, const gchar *format, ...) { if (G_UNLIKELY(!initialized)) gibber_debug_set_flags_from_env (); if (flag & flags) { va_list args; gchar *msg, *node_str; va_start (args, format); msg = g_strdup_vprintf (format, args); va_end (args); node_str = gibber_xmpp_node_to_string (stanza->node); g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s\n%s", msg, node_str); g_free (msg); g_free (node_str); } } #endif #endif telepathy-gabble-0.18.4/lib/gibber/gibber-listener.h0000644000175000017500000000575512735675441023347 0ustar00gkiagiagkiagia00000000000000/* * gibber-listener.h - Header for GibberListener * Copyright (C) 2007, 2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _GIBBER_LISTENER_H_ #define _GIBBER_LISTENER_H_ #include G_BEGIN_DECLS GQuark gibber_listener_error_quark (void); #define GIBBER_LISTENER_ERROR \ gibber_listener_error_quark () typedef enum { GIBBER_LISTENER_ERROR_ALREADY_LISTENING, GIBBER_LISTENER_ERROR_ADDRESS_IN_USE, GIBBER_LISTENER_ERROR_FAMILY_NOT_SUPPORTED, GIBBER_LISTENER_ERROR_FAILED, } GibberListenerError; typedef enum { GIBBER_AF_IPV4, GIBBER_AF_IPV6, GIBBER_AF_ANY } GibberAddressFamily; typedef struct _GibberListener GibberListener; typedef struct _GibberListenerClass GibberListenerClass; struct _GibberListenerClass { GObjectClass parent_class; }; struct _GibberListener { GObject parent; gpointer priv; }; GType gibber_listener_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_LISTENER \ (gibber_listener_get_type ()) #define GIBBER_LISTENER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_LISTENER,\ GibberListener)) #define GIBBER_LISTENER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_LISTENER,\ GibberListenerClass)) #define GIBBER_IS_LISTENER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_LISTENER)) #define GIBBER_IS_LISTENER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_LISTENER)) #define GIBBER_LISTENER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_LISTENER,\ GibberListenerClass)) GibberListener *gibber_listener_new (void); gboolean gibber_listener_listen_tcp (GibberListener *listener, int port, GError **error); gboolean gibber_listener_listen_tcp_af (GibberListener *listener, int port, GibberAddressFamily family, GError **error); gboolean gibber_listener_listen_tcp_loopback (GibberListener *listener, int port, GError **error); gboolean gibber_listener_listen_tcp_loopback_af (GibberListener *listener, int port, GibberAddressFamily family, GError **error); gboolean gibber_listener_listen_socket (GibberListener *listener, gchar *path, gboolean abstract, GError **error); int gibber_listener_get_port (GibberListener *listener); G_END_DECLS #endif /* #ifndef _GIBBER_LISTENER_H_ */ telepathy-gabble-0.18.4/lib/gibber/gibber-tcp-transport.h0000644000175000017500000000434312735675441024332 0ustar00gkiagiagkiagia00000000000000/* * gibber-tcp-transport.h - Header for GibberTCPTransport * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_TCP_TRANSPORT_H__ #define __GIBBER_TCP_TRANSPORT_H__ #include #include "gibber-fd-transport.h" G_BEGIN_DECLS typedef struct _GibberTCPTransport GibberTCPTransport; typedef struct _GibberTCPTransportClass GibberTCPTransportClass; struct _GibberTCPTransportClass { GibberFdTransportClass parent_class; }; struct _GibberTCPTransport { GibberFdTransport parent; }; GType gibber_tcp_transport_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_TCP_TRANSPORT \ (gibber_tcp_transport_get_type ()) #define GIBBER_TCP_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_TCP_TRANSPORT, \ GibberTCPTransport)) #define GIBBER_TCP_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_TCP_TRANSPORT, \ GibberTCPTransportClass)) #define GIBBER_IS_TCP_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_TCP_TRANSPORT)) #define GIBBER_IS_TCP_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_TCP_TRANSPORT)) #define GIBBER_TCP_TRANSPORT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_TCP_TRANSPORT, \ GibberTCPTransportClass)) GibberTCPTransport * gibber_tcp_transport_new (void); void gibber_tcp_transport_connect (GibberTCPTransport *tcp_transport, const gchar *host, guint16 port); G_END_DECLS #endif /* #ifndef __GIBBER_TCP_TRANSPORT_H__*/ telepathy-gabble-0.18.4/lib/gibber/gibber-sockets.h0000644000175000017500000000300312735675441023155 0ustar00gkiagiagkiagia00000000000000/* * gibber-sockets.h - meta-header for assorted semi-portable socket code * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #ifndef GIBBER_SOCKETS_H #define GIBBER_SOCKETS_H #include #ifdef G_OS_WIN32 # include "gibber-sockets-win32.h" #else # include "gibber-sockets-unix.h" #endif G_BEGIN_DECLS gboolean gibber_connect_errno_requires_retry (int err); gboolean gibber_socket_errno_is_eafnosupport (void); gboolean gibber_socket_errno_is_eaddrinuse (void); void gibber_socket_set_error (GError **error, const gchar *context, GQuark domain, gint code); gint gibber_socket_errno (void); const gchar *gibber_socket_strerror (void); GIOChannel *gibber_io_channel_new_from_socket (gint sockfd); void gibber_socket_set_nonblocking (gint sockfd); G_END_DECLS #endif telepathy-gabble-0.18.4/lib/gibber/gibber-linklocal-transport.h0000644000175000017500000000531012735675441025507 0ustar00gkiagiagkiagia00000000000000/* * gibber-linklocal-transport.h - Header for GibberLLTransport * Copyright (C) 2006 Collabora Ltd. * @author: Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_LL_TRANSPORT_H__ #define __GIBBER_LL_TRANSPORT_H__ #include #include "gibber-fd-transport.h" G_BEGIN_DECLS GQuark gibber_ll_transport_error_quark (void); #define GIBBER_LL_TRANSPORT_ERROR gibber_ll_transport_error_quark() typedef enum { GIBBER_LL_TRANSPORT_ERROR_CONNECT_FAILED, GIBBER_LL_TRANSPORT_ERROR_FAILED, } GibberLLTransportError; typedef struct _GibberLLTransport GibberLLTransport; typedef struct _GibberLLTransportClass GibberLLTransportClass; struct _GibberLLTransportClass { GibberFdTransportClass parent_class; }; struct _GibberLLTransport { GibberFdTransport parent; }; GType gibber_ll_transport_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_LL_TRANSPORT \ (gibber_ll_transport_get_type ()) #define GIBBER_LL_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_LL_TRANSPORT, \ GibberLLTransport)) #define GIBBER_LL_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_LL_TRANSPORT, \ GibberLLTransportClass)) #define GIBBER_IS_LL_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_LL_TRANSPORT)) #define GIBBER_IS_LL_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_LL_TRANSPORT)) #define GIBBER_LL_TRANSPORT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_LL_TRANSPORT, \ GibberLLTransportClass)) GibberLLTransport * gibber_ll_transport_new (void); void gibber_ll_transport_open_fd (GibberLLTransport *connection, int fd); gboolean gibber_ll_transport_open_sockaddr (GibberLLTransport *connection, struct sockaddr_storage *addr, GError **error); gboolean gibber_ll_transport_is_incoming (GibberLLTransport *connection); void gibber_ll_transport_set_incoming (GibberLLTransport *connetion, gboolean incoming); G_END_DECLS #endif /* #ifndef __GIBBER_LL_TRANSPORT_H__*/ telepathy-gabble-0.18.4/lib/gibber/Makefile.am0000644000175000017500000000465712735675441022155 0ustar00gkiagiagkiagia00000000000000noinst_LTLIBRARIES = libgibber.la BUILT_SOURCES = \ gibber-signals-marshal.list \ gibber-signals-marshal.h \ gibber-signals-marshal.c OUR_SOURCES = \ gibber-debug.c \ gibber-debug.h \ gibber-transport.c \ gibber-transport.h \ gibber-fd-transport.c \ gibber-fd-transport.h \ gibber-tcp-transport.c \ gibber-tcp-transport.h \ gibber-unix-transport.c \ gibber-unix-transport.h \ gibber-linklocal-transport.c \ gibber-linklocal-transport.h \ gibber-listener.c \ gibber-listener.h \ gibber-sockets.c \ gibber-sockets.h \ gibber-sockets-unix.h \ gibber-sockets-win32.h \ gibber-util.h \ gibber-util.c libgibber_la_SOURCES = $(OUR_SOURCES) $(BUILT_SOURCES) # Coding style checks check_c_sources = \ $(OUR_SOURCES) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style CLEANFILES=$(BUILT_SOURCES) dist-hook: $(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done) gibber-signals-marshal.list: $(OUR_SOURCES) Makefile.am @( cd $(srcdir) && \ sed -n -e 's/.*_gibber_signals_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \ $(OUR_SOURCES) ) \ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp @if cmp -s $@.tmp $@; then \ rm $@.tmp; \ touch $@; \ else \ mv $@.tmp $@; \ fi %-signals-marshal.h: %-signals-marshal.list Makefile.am $(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_signals_marshal $< > $@ %-signals-marshal.c: %-signals-marshal.list Makefile.am $(AM_V_GEN){ echo '#include "$*-signals-marshal.h"' && \ glib-genmarshal --body --prefix=_$(subst -,_,$*)_signals_marshal $< ; \ } > $@ AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ @GMODULE_CFLAGS@ -fno-strict-aliasing # following flag is requied to make getnameinfo work if WINDOWS AM_CFLAGS += -D_WIN32_WINNT=0x0501 endif AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ Android.mk: Makefile.am $(BUILT_SOURCES) androgenizer -:PROJECT telepathy-gabble -:STATIC gibber -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libgibber_la_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(AM_LDFLAGS) \ > $@ telepathy-gabble-0.18.4/lib/gibber/gibber-unix-transport.c0000644000175000017500000002467612735675441024535 0ustar00gkiagiagkiagia00000000000000/* * gibber-linklocal-transport.c - Source for GibberLLTransport * Copyright (C) 2006, 2008 Collabora Ltd. * @author: Sjoerd Simons * @author: Alban Crequy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #ifdef G_OS_UNIX /* If you claim to be Unix but you don't have these headers, you may have * already lost. */ #include #include #include #include #include #include #include #include #include #include "gibber-unix-transport.h" #include "gibber-util.h" #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" G_DEFINE_TYPE(GibberUnixTransport, gibber_unix_transport, \ GIBBER_TYPE_FD_TRANSPORT) GQuark gibber_unix_transport_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("gibber_unix_transport_error"); return quark; } /* private structure */ typedef struct _GibberUnixTransportPrivate GibberUnixTransportPrivate; struct _GibberUnixTransportPrivate { gboolean incoming; GibberUnixTransportRecvCredentialsCb recv_creds_cb; gpointer recv_creds_data; gboolean dispose_has_run; }; #define GIBBER_UNIX_TRANSPORT_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIBBER_TYPE_UNIX_TRANSPORT, \ GibberUnixTransportPrivate)) static void gibber_unix_transport_finalize (GObject *object); static void gibber_unix_transport_init (GibberUnixTransport *self) { GibberUnixTransportPrivate *priv = GIBBER_UNIX_TRANSPORT_GET_PRIVATE (self); priv->incoming = FALSE; } static void gibber_unix_transport_dispose (GObject *object); static GibberFdIOResult gibber_unix_transport_read ( GibberFdTransport *transport, GIOChannel *channel, GError **error); static void gibber_unix_transport_class_init ( GibberUnixTransportClass *gibber_unix_transport_class) { GObjectClass *object_class = G_OBJECT_CLASS (gibber_unix_transport_class); GibberFdTransportClass *fd_class = GIBBER_FD_TRANSPORT_CLASS ( gibber_unix_transport_class); g_type_class_add_private (gibber_unix_transport_class, sizeof (GibberUnixTransportPrivate)); object_class->dispose = gibber_unix_transport_dispose; object_class->finalize = gibber_unix_transport_finalize; /* override GibberFdTransport's read */ fd_class->read = gibber_unix_transport_read; } void gibber_unix_transport_dispose (GObject *object) { GibberUnixTransport *self = GIBBER_UNIX_TRANSPORT (object); GibberUnixTransportPrivate *priv = GIBBER_UNIX_TRANSPORT_GET_PRIVATE (self); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; priv->recv_creds_cb = NULL; priv->recv_creds_data = NULL; if (G_OBJECT_CLASS (gibber_unix_transport_parent_class)->dispose) G_OBJECT_CLASS (gibber_unix_transport_parent_class)->dispose (object); } void gibber_unix_transport_finalize (GObject *object) { G_OBJECT_CLASS (gibber_unix_transport_parent_class)->finalize (object); } GibberUnixTransport * gibber_unix_transport_new (void) { return g_object_new (GIBBER_TYPE_UNIX_TRANSPORT, NULL); } gboolean gibber_unix_transport_connect (GibberUnixTransport *transport, const gchar *path, GError **error) { union { struct sockaddr_un un; struct sockaddr addr; } addr; int fd; gibber_transport_set_state (GIBBER_TRANSPORT (transport), GIBBER_TRANSPORT_CONNECTING); memset (&addr, 0, sizeof (addr)); fd = socket (PF_UNIX, SOCK_STREAM, 0); if (fd == -1) { DEBUG ("Error creating socket: %s", g_strerror (errno)); g_set_error (error, GIBBER_UNIX_TRANSPORT_ERROR, GIBBER_UNIX_TRANSPORT_ERROR_CONNECT_FAILED, "Error creating socket: %s", g_strerror (errno)); goto failed; } addr.un.sun_family = PF_UNIX; g_strlcpy (addr.un.sun_path, path, sizeof (addr.un.sun_path)); if (connect (fd, &addr.addr, sizeof (addr.un)) == -1) { g_set_error (error, GIBBER_UNIX_TRANSPORT_ERROR, GIBBER_UNIX_TRANSPORT_ERROR_CONNECT_FAILED, "Error connecting socket: %s", g_strerror (errno)); DEBUG ("Error connecting socket: %s", g_strerror (errno)); goto failed; } DEBUG ("Connected to socket"); gibber_fd_transport_set_fd (GIBBER_FD_TRANSPORT (transport), fd, TRUE); return TRUE; failed: g_assert (error != NULL); gibber_transport_emit_error (GIBBER_TRANSPORT(transport), *error); gibber_transport_set_state (GIBBER_TRANSPORT (transport), GIBBER_TRANSPORT_DISCONNECTED); return FALSE; } GibberUnixTransport * gibber_unix_transport_new_from_fd (int fd) { GibberUnixTransport *transport; transport = gibber_unix_transport_new (); gibber_fd_transport_set_fd (GIBBER_FD_TRANSPORT (transport), fd, TRUE); return transport; } /* Patches that reimplement these functions for non-Linux would be welcome * (please file a bug) */ #if defined(__linux__) gboolean gibber_unix_transport_supports_credentials (void) { return TRUE; } gboolean gibber_unix_transport_send_credentials (GibberUnixTransport *transport, const guint8 *data, gsize size) { int fd, ret; struct ucred *cred; struct msghdr msg; struct cmsghdr *ch; struct iovec iov; char buffer[CMSG_SPACE (sizeof (struct ucred))]; DEBUG ("send credentials"); fd = GIBBER_FD_TRANSPORT (transport)->fd; /* Set the message payload */ memset (&iov, 0, sizeof (iov)); iov.iov_base = (void *) data; iov.iov_len = size; memset (&msg, 0, sizeof (msg)); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = buffer; msg.msg_controllen = sizeof (buffer); memset (buffer, 0, sizeof (buffer)); /* Set the credentials */ ch = CMSG_FIRSTHDR (&msg); ch->cmsg_len = CMSG_LEN (sizeof (struct ucred)); ch->cmsg_level = SOL_SOCKET; ch->cmsg_type = SCM_CREDENTIALS; cred = (struct ucred *) CMSG_DATA (ch); cred->pid = getpid (); cred->uid = getuid (); cred->gid = getgid (); ret = sendmsg (fd, &msg, 0); if (ret == -1) { DEBUG ("sendmsg failed: %s", g_strerror (errno)); return FALSE; } return TRUE; } #define BUFSIZE 1024 static GibberFdIOResult gibber_unix_transport_read (GibberFdTransport *transport, GIOChannel *channel, GError **error) { GibberUnixTransport *self = GIBBER_UNIX_TRANSPORT (transport); GibberUnixTransportPrivate *priv = GIBBER_UNIX_TRANSPORT_GET_PRIVATE (self); int fd; guint8 buffer[BUFSIZE]; ssize_t bytes_read; GibberBuffer buf; struct iovec iov; struct msghdr msg; char control[CMSG_SPACE (sizeof (struct ucred))]; struct cmsghdr *ch; struct ucred *cred; int opt; if (priv->recv_creds_cb == NULL) return gibber_fd_transport_read (transport, channel, error); /* We are waiting for credentials */ fd = transport->fd; /* set SO_PASSCRED flag */ opt = 1; setsockopt (fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof (opt)); memset (buffer, 0, sizeof (buffer)); memset (&iov, 0, sizeof (iov)); iov.iov_base = buffer; iov.iov_len = sizeof (buffer); memset (&msg, 0, sizeof (msg)); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = control; msg.msg_controllen = sizeof (control); bytes_read = recvmsg (fd, &msg, 0); if (bytes_read == -1) { GError *err = NULL; g_set_error_literal (&err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), "recvmsg failed"); priv->recv_creds_cb (self, NULL, NULL, err, priv->recv_creds_data); g_propagate_error (error, err); priv->recv_creds_cb = NULL; priv->recv_creds_data = NULL; return GIBBER_FD_IO_RESULT_ERROR; } /* unset SO_PASSCRED flag */ opt = 0; setsockopt (fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof (opt)); buf.data = buffer; buf.length = bytes_read; /* extract the credentials */ ch = CMSG_FIRSTHDR (&msg); if (ch == NULL) { GError *err = NULL; DEBUG ("Message doesn't contain credentials"); g_set_error_literal (&err, GIBBER_UNIX_TRANSPORT_ERROR, GIBBER_UNIX_TRANSPORT_ERROR_NO_CREDENTIALS, "no credentials received"); priv->recv_creds_cb (self, &buf, NULL, err, priv->recv_creds_data); g_error_free (err); } else { GibberCredentials credentials; cred = (struct ucred *) CMSG_DATA (ch); credentials.pid = cred->pid; credentials.uid = cred->uid; credentials.gid = cred->gid; priv->recv_creds_cb (self, &buf, &credentials, NULL, priv->recv_creds_data); } priv->recv_creds_cb = NULL; priv->recv_creds_data = NULL; return GIBBER_FD_IO_RESULT_SUCCESS; } gboolean gibber_unix_transport_recv_credentials (GibberUnixTransport *self, GibberUnixTransportRecvCredentialsCb callback, gpointer user_data) { GibberUnixTransportPrivate *priv = GIBBER_UNIX_TRANSPORT_GET_PRIVATE (self); if (priv->recv_creds_cb != NULL) { DEBUG ("already waiting for credentials"); return FALSE; } priv->recv_creds_cb = callback; priv->recv_creds_data = user_data; return TRUE; } #else /* OSs where we have no implementation */ gboolean gibber_unix_transport_supports_credentials (void) { return FALSE; } gboolean gibber_unix_transport_recv_credentials (GibberUnixTransport *self, GibberUnixTransportRecvCredentialsCb callback, gpointer user_data) { DEBUG ("stub implementation, failing"); return FALSE; } gboolean gibber_unix_transport_send_credentials (GibberUnixTransport *transport, const guint8 *data, gsize size) { DEBUG ("stub implementation, failing"); return FALSE; } static GibberFdIOResult gibber_unix_transport_read (GibberFdTransport *transport, GIOChannel *channel, GError **error) { return gibber_fd_transport_read (transport, channel, error); } #endif /* OSs where we have no implementation of credentials */ #endif /* G_OS_UNIX */ telepathy-gabble-0.18.4/lib/gibber/gibber-fd-transport.c0000644000175000017500000003726112735675441024135 0ustar00gkiagiagkiagia00000000000000/* * gibber-fd-transport.c - Source for GibberFdTransport * Copyright (C) 2006-2007 Collabora Ltd. * @author: Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "gibber-sockets.h" #include "gibber-fd-transport.h" #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" static gboolean _channel_io_out (GIOChannel *source, GIOCondition condition, gpointer data); static gboolean gibber_fd_transport_send (GibberTransport *transport, const guint8 *data, gsize size, GError **error); static void gibber_fd_transport_disconnect (GibberTransport *transport); static gboolean gibber_fd_transport_get_peeraddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); static gboolean gibber_fd_transport_get_sockaddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len); static void _do_disconnect (GibberFdTransport *self); static gboolean gibber_fd_transport_buffer_is_empty ( GibberTransport *transport); static void gibber_fd_transport_block_receiving (GibberTransport *transport, gboolean block); G_DEFINE_TYPE(GibberFdTransport, gibber_fd_transport, GIBBER_TYPE_TRANSPORT) GQuark gibber_fd_transport_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("gibber_fd_transport_error"); return quark; } /* private structure */ typedef struct _GibberFdTransportPrivate GibberFdTransportPrivate; struct _GibberFdTransportPrivate { GIOChannel *channel; gboolean dispose_has_run; guint watch_in; guint watch_out; guint watch_err; GString *output_buffer; gboolean receiving_blocked; }; #define GIBBER_FD_TRANSPORT_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIBBER_TYPE_FD_TRANSPORT, \ GibberFdTransportPrivate)) static void gibber_fd_transport_init (GibberFdTransport *self) { GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); self->fd = -1; priv->channel = NULL; priv->output_buffer = NULL; priv->watch_in = 0; priv->watch_out = 0; priv->watch_err = 0; } static void gibber_fd_transport_dispose (GObject *object); static void gibber_fd_transport_finalize (GObject *object); static GibberFdIOResult gibber_fd_transport_write ( GibberFdTransport *fd_transport, GIOChannel *channel, const guint8 *data, int len, gsize *written, GError **error); static void gibber_fd_transport_class_init ( GibberFdTransportClass *gibber_fd_transport_class) { GObjectClass *object_class = G_OBJECT_CLASS (gibber_fd_transport_class); GibberTransportClass *transport_class = GIBBER_TRANSPORT_CLASS (gibber_fd_transport_class); g_type_class_add_private (gibber_fd_transport_class, sizeof (GibberFdTransportPrivate)); object_class->dispose = gibber_fd_transport_dispose; object_class->finalize = gibber_fd_transport_finalize; transport_class->send = gibber_fd_transport_send; transport_class->disconnect = gibber_fd_transport_disconnect; transport_class->get_peeraddr = gibber_fd_transport_get_peeraddr; transport_class->get_sockaddr = gibber_fd_transport_get_sockaddr; transport_class->buffer_is_empty = gibber_fd_transport_buffer_is_empty; transport_class->block_receiving = gibber_fd_transport_block_receiving; gibber_fd_transport_class->read = gibber_fd_transport_read; gibber_fd_transport_class->write = gibber_fd_transport_write; } void gibber_fd_transport_dispose (GObject *object) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (object); GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; _do_disconnect (self); if (G_OBJECT_CLASS (gibber_fd_transport_parent_class)->dispose) G_OBJECT_CLASS (gibber_fd_transport_parent_class)->dispose (object); } void gibber_fd_transport_finalize (GObject *object) { G_OBJECT_CLASS (gibber_fd_transport_parent_class)->finalize (object); } static void _do_disconnect (GibberFdTransport *self) { GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); if (GIBBER_TRANSPORT(self)->state == GIBBER_TRANSPORT_DISCONNECTED) { return; } DEBUG ("Closing the fd transport"); if (priv->channel != NULL) { if (priv->watch_in != 0) g_source_remove (priv->watch_in); if (priv->watch_out) g_source_remove (priv->watch_out); if (priv->watch_err) g_source_remove (priv->watch_err); g_io_channel_shutdown (priv->channel, FALSE, NULL); g_io_channel_unref (priv->channel); priv->channel = NULL; } else { close (self->fd); } self->fd = -1; if (priv->output_buffer) { g_string_free (priv->output_buffer, TRUE); priv->output_buffer = NULL; } if (!priv->dispose_has_run) /* If we are disposing we don't care about the state anymore */ gibber_transport_set_state (GIBBER_TRANSPORT (self), GIBBER_TRANSPORT_DISCONNECTED); } static gboolean _try_write (GibberFdTransport *self, const guint8 *data, int len, gsize *written, GError **err) { GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); GibberFdTransportClass *cls = GIBBER_FD_TRANSPORT_GET_CLASS (self); GibberFdIOResult result; GError *error = NULL; result = cls->write (self, priv->channel, data, len, written, &error); switch (result) { case GIBBER_FD_IO_RESULT_SUCCESS: case GIBBER_FD_IO_RESULT_AGAIN: break; case GIBBER_FD_IO_RESULT_ERROR: gibber_transport_emit_error (GIBBER_TRANSPORT (self), error); /* fallthrough */ case GIBBER_FD_IO_RESULT_EOF: DEBUG ("Writing data failed, closing the transport"); _do_disconnect (self); g_propagate_error (err, error); return FALSE; break; } return TRUE; } static gboolean _writeout (GibberFdTransport *self, const guint8 *data, gsize len, GError **error) { GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); gsize written = 0; DEBUG ("Writing out %" G_GSIZE_FORMAT " bytes", len); if (priv->output_buffer == NULL || priv->output_buffer->len == 0) { /* We've got nothing buffer yet so try to write out directly */ if (!_try_write (self, data, len, &written, error)) { return FALSE; } } if (written == len) { gibber_transport_emit_buffer_empty (GIBBER_TRANSPORT (self)); return TRUE; } if (priv->output_buffer) { g_string_append_len (priv->output_buffer, (gchar *) data + written, len - written); } else { priv->output_buffer = g_string_new_len ((gchar *) data + written, len - written); } if (!priv->watch_out) { priv->watch_out = g_io_add_watch (priv->channel, G_IO_OUT, _channel_io_out, self); } return TRUE; } static gboolean _channel_io_in (GIOChannel *source, GIOCondition condition, gpointer data) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (data); GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); GibberFdIOResult result; GError *error = NULL; GibberFdTransportClass *cls = GIBBER_FD_TRANSPORT_GET_CLASS(self); result = cls->read (self, priv->channel, &error); switch (result) { case GIBBER_FD_IO_RESULT_SUCCESS: case GIBBER_FD_IO_RESULT_AGAIN: break; case GIBBER_FD_IO_RESULT_ERROR: gibber_transport_emit_error (GIBBER_TRANSPORT(self), error); /* Deliberately falling through */ case GIBBER_FD_IO_RESULT_EOF: DEBUG("Failed to read from the transport, closing.."); _do_disconnect (self); return FALSE; } return TRUE; } static gboolean _channel_io_out (GIOChannel *source, GIOCondition condition, gpointer data) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (data); GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); gsize written; g_assert (priv->output_buffer); if (!_try_write (self, (guint8 *) priv->output_buffer->str, priv->output_buffer->len, &written, NULL)) { return FALSE; } if (written > 0 ) { priv->output_buffer = g_string_erase (priv->output_buffer, 0, written); } if (priv->output_buffer->len == 0) { priv->watch_out = 0; gibber_transport_emit_buffer_empty (GIBBER_TRANSPORT (self)); return FALSE; } return TRUE; } static gboolean _channel_io_err (GIOChannel *source, GIOCondition condition, gpointer data) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (data); GError *error = NULL; gint code; const gchar *msg; if (condition & G_IO_ERR) { DEBUG ("Error on GIOChannel.Closing the transport"); /* We can't use g_io_channel_error_from_errno because it seems errno is * not always set when we got a G_IO_ERR. */ code = GIBBER_FD_TRANSPORT_ERROR_FAILED; msg = "Error on GIOChannel"; } else { g_assert_not_reached (); } error = g_error_new_literal (GIBBER_FD_TRANSPORT_ERROR, code, msg); gibber_transport_emit_error (GIBBER_TRANSPORT (self), error); g_error_free (error); _do_disconnect (self); return FALSE; } #ifdef G_OS_WIN32 /* workaround for GLib bug #338943 */ static gboolean _channel_io_in_dispatcher (GIOChannel *source, GIOCondition condition, gpointer data) { if (condition & G_IO_ERR) { return _channel_io_err (source, condition, data); } if (condition == G_IO_IN) { return _channel_io_in (source, condition, data); } g_assert_not_reached (); } #endif /* Default read and write implementations */ static GibberFdIOResult gibber_fd_transport_write (GibberFdTransport *fd_transport, GIOChannel *channel, const guint8 *data, int len, gsize *written, GError **error) { GIOStatus status; status = g_io_channel_write_chars (channel, (gchar *) data, len, written, error); switch (status) { case G_IO_STATUS_NORMAL: return GIBBER_FD_IO_RESULT_SUCCESS; case G_IO_STATUS_AGAIN: return GIBBER_FD_IO_RESULT_AGAIN; case G_IO_STATUS_ERROR: return GIBBER_FD_IO_RESULT_ERROR; case G_IO_STATUS_EOF: return GIBBER_FD_IO_RESULT_EOF; } g_assert_not_reached (); } #define BUFSIZE 1024 GibberFdIOResult gibber_fd_transport_read (GibberFdTransport *transport, GIOChannel *channel, GError **error) { guint8 buf[BUFSIZE + 1]; GIOStatus status; gsize bytes_read; status = g_io_channel_read_chars (channel, (gchar *) buf, BUFSIZE, &bytes_read, error); switch (status) { case G_IO_STATUS_NORMAL: buf[bytes_read] = '\0'; DEBUG ("Received %" G_GSIZE_FORMAT " bytes", bytes_read); gibber_transport_received_data (GIBBER_TRANSPORT (transport), buf, bytes_read); return GIBBER_FD_IO_RESULT_SUCCESS; case G_IO_STATUS_ERROR: return GIBBER_FD_IO_RESULT_ERROR; case G_IO_STATUS_EOF: return GIBBER_FD_IO_RESULT_EOF; case G_IO_STATUS_AGAIN: return GIBBER_FD_IO_RESULT_AGAIN; } g_assert_not_reached (); } void gibber_fd_transport_set_fd (GibberFdTransport *self, int fd, gboolean is_socket) { GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); g_assert (self->fd == -1 && fd >= 0); self->fd = fd; if (is_socket) { gibber_socket_set_nonblocking (fd); priv->channel = gibber_io_channel_new_from_socket (fd); } else { #ifndef G_OS_WIN32 fcntl (fd, F_SETFL, O_NONBLOCK); #endif priv->channel = g_io_channel_unix_new (fd); } g_io_channel_set_close_on_unref (priv->channel, TRUE); g_io_channel_set_encoding (priv->channel, NULL, NULL); g_io_channel_set_buffered (priv->channel, FALSE); #ifdef G_OS_WIN32 /* workaround for GLib bug #338943 */ if (!priv->receiving_blocked) { priv->watch_in = g_io_add_watch (priv->channel, G_IO_IN | G_IO_ERR, _channel_io_in_dispatcher, self); } else { priv->watch_err = g_io_add_watch (priv->channel, G_IO_ERR, _channel_io_err, self); } #else if (!priv->receiving_blocked) { priv->watch_in = g_io_add_watch (priv->channel, G_IO_IN, _channel_io_in, self); } priv->watch_err = g_io_add_watch (priv->channel, G_IO_ERR, _channel_io_err, self); #endif gibber_transport_set_state (GIBBER_TRANSPORT(self), GIBBER_TRANSPORT_CONNECTED); } gboolean gibber_fd_transport_send (GibberTransport *transport, const guint8 *data, gsize size, GError **error) { return _writeout (GIBBER_FD_TRANSPORT (transport), data, size, error); } void gibber_fd_transport_disconnect (GibberTransport *transport) { DEBUG("Connection close requested"); _do_disconnect (GIBBER_FD_TRANSPORT (transport)); } static gboolean gibber_fd_transport_get_peeraddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (transport); if (self->fd == -1) { DEBUG ("Someone requested the sockaddr while we're not connected"); return FALSE; } *len = sizeof (struct sockaddr_storage); return (getpeername (self->fd, (struct sockaddr *) addr, len) == 0); } static gboolean gibber_fd_transport_get_sockaddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (transport); if (self->fd == -1) { DEBUG ("Someone requested the sockaddr while we're not connected"); return FALSE; } *len = sizeof (struct sockaddr_storage); return (getsockname (self->fd, (struct sockaddr *) addr, len) == 0); } static gboolean gibber_fd_transport_buffer_is_empty (GibberTransport *transport) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (transport); GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); return (priv->output_buffer == NULL || priv->output_buffer->len == 0); } static void gibber_fd_transport_block_receiving (GibberTransport *transport, gboolean block) { GibberFdTransport *self = GIBBER_FD_TRANSPORT (transport); GibberFdTransportPrivate *priv = GIBBER_FD_TRANSPORT_GET_PRIVATE (self); if (block && priv->watch_in != 0) { DEBUG ("block receiving from the transport"); g_source_remove (priv->watch_in); priv->watch_in = 0; } else if (!block && priv->watch_in == 0) { DEBUG ("unblock receiving from the transport"); if (priv->channel != NULL) { #ifdef G_OS_WIN32 /* workaround for GLib bug #338943 */ if (priv->watch_err) { g_source_remove (priv->watch_err); priv->watch_err = 0; } priv->watch_in = g_io_add_watch (priv->channel, G_IO_IN | G_IO_ERR, _channel_io_in_dispatcher, self); #else priv->watch_in = g_io_add_watch (priv->channel, G_IO_IN, _channel_io_in, self); #endif } /* else the transport isn't connected yet */ } priv->receiving_blocked = block; } telepathy-gabble-0.18.4/lib/gibber/gibber-fd-transport.h0000644000175000017500000000602312735675441024132 0ustar00gkiagiagkiagia00000000000000/* * gibber-fd-transport.h - Header for GibberFdTransport * Copyright (C) 2006 Collabora Ltd. * @author: Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_FD_TRANSPORT_H__ #define __GIBBER_FD_TRANSPORT_H__ #include #include "gibber-sockets.h" #include "gibber-transport.h" typedef enum { GIBBER_FD_IO_RESULT_SUCCESS, GIBBER_FD_IO_RESULT_AGAIN, GIBBER_FD_IO_RESULT_ERROR, GIBBER_FD_IO_RESULT_EOF, } GibberFdIOResult; G_BEGIN_DECLS GQuark gibber_fd_transport_error_quark (void); #define GIBBER_FD_TRANSPORT_ERROR gibber_fd_transport_error_quark() typedef enum { GIBBER_FD_TRANSPORT_ERROR_PIPE, GIBBER_FD_TRANSPORT_ERROR_FAILED, } GibberFdTransportError; typedef struct _GibberFdTransport GibberFdTransport; typedef struct _GibberFdTransportClass GibberFdTransportClass; struct _GibberFdTransportClass { GibberTransportClass parent_class; /* Called when fd is ready for reading */ GibberFdIOResult (*read) (GibberFdTransport *fd_transport, GIOChannel *channel, GError **error); /* Called when something needs to be written*/ GibberFdIOResult (*write) (GibberFdTransport *fd_transport, GIOChannel *channel, const guint8 *data, int len, gsize *written, GError **error); }; struct _GibberFdTransport { GibberTransport parent; int fd; }; GType gibber_fd_transport_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_FD_TRANSPORT \ (gibber_fd_transport_get_type ()) #define GIBBER_FD_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_FD_TRANSPORT, \ GibberFdTransport)) #define GIBBER_FD_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_FD_TRANSPORT, \ GibberFdTransportClass)) #define GIBBER_IS_FD_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_FD_TRANSPORT)) #define GIBBER_IS_FD_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_FD_TRANSPORT)) #define GIBBER_FD_TRANSPORT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_FD_TRANSPORT, \ GibberFdTransportClass)) void gibber_fd_transport_set_fd (GibberFdTransport *fd_transport, int fd, gboolean is_socket); GibberFdIOResult gibber_fd_transport_read (GibberFdTransport *transport, GIOChannel *channel, GError **error); G_END_DECLS #endif /* #ifndef __GIBBER_FD_TRANSPORT_H__*/ telepathy-gabble-0.18.4/lib/gibber/gibber-util.c0000644000175000017500000000424012735675441022456 0ustar00gkiagiagkiagia00000000000000/* * gibber-util.c - Code for Gibber utility functions * Copyright (C) 2007 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "gibber-util.h" void gibber_normalize_address (struct sockaddr_storage *addr) { struct sockaddr_in *s4 = (struct sockaddr_in *) addr; struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) addr; if (s6->sin6_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED (&(s6->sin6_addr))) { /* Normalize to ipv4 address */ guint32 addr_big_endian; guint16 port; memcpy (&addr_big_endian, s6->sin6_addr.s6_addr + 12, 4); port = s6->sin6_port; s4->sin_family = AF_INET; s4->sin_addr.s_addr = addr_big_endian; s4->sin_port = port; } } /** * gibber_strdiff: * @left: The first string to compare (may be NULL) * @right: The second string to compare (may be NULL) * * Return %TRUE if the given strings are different. Unlike #strcmp this * function will handle null pointers, treating them as distinct from any * string. * * Returns: %FALSE if @left and @right are both %NULL, or if * neither is %NULL and both have the same contents; %TRUE otherwise */ gboolean gibber_strdiff (const gchar *left, const gchar *right) { if ((NULL == left) != (NULL == right)) return TRUE; else if (left == right) return FALSE; else return (0 != strcmp (left, right)); } telepathy-gabble-0.18.4/lib/gibber/Makefile.in0000644000175000017500000005156213012560744022147 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/tools/check-coding-style.mk # following flag is requied to make getnameinfo work @WINDOWS_TRUE@am__append_1 = -D_WIN32_WINNT=0x0501 subdir = lib/gibber ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_config_dir.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgibber_la_LIBADD = am__objects_1 = gibber-debug.lo gibber-transport.lo \ gibber-fd-transport.lo gibber-tcp-transport.lo \ gibber-unix-transport.lo gibber-linklocal-transport.lo \ gibber-listener.lo gibber-sockets.lo gibber-util.lo am__objects_2 = gibber-signals-marshal.lo am_libgibber_la_OBJECTS = $(am__objects_1) $(am__objects_2) libgibber_la_OBJECTS = $(am_libgibber_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libgibber_la_SOURCES) DIST_SOURCES = $(libgibber_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLIENT_TYPE = @CLIENT_TYPE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ENABLE_PLUGINS = @ENABLE_PLUGINS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NICE_CFLAGS = @NICE_CFLAGS@ NICE_LIBS = @NICE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ STRIP = @STRIP@ TEST_PYTHON = @TEST_PYTHON@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_GLIB_LIBS = @TP_GLIB_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ WOCKY_LIBS = @WOCKY_LIBS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gabbletestsdir = @gabbletestsdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginexecdir = @pluginexecdir@ pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libgibber.la BUILT_SOURCES = \ gibber-signals-marshal.list \ gibber-signals-marshal.h \ gibber-signals-marshal.c OUR_SOURCES = \ gibber-debug.c \ gibber-debug.h \ gibber-transport.c \ gibber-transport.h \ gibber-fd-transport.c \ gibber-fd-transport.h \ gibber-tcp-transport.c \ gibber-tcp-transport.h \ gibber-unix-transport.c \ gibber-unix-transport.h \ gibber-linklocal-transport.c \ gibber-linklocal-transport.h \ gibber-listener.c \ gibber-listener.h \ gibber-sockets.c \ gibber-sockets.h \ gibber-sockets-unix.h \ gibber-sockets-win32.h \ gibber-util.h \ gibber-util.c libgibber_la_SOURCES = $(OUR_SOURCES) $(BUILT_SOURCES) # Coding style checks check_c_sources = \ $(OUR_SOURCES) CLEANFILES = $(BUILT_SOURCES) AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ \ @GMODULE_CFLAGS@ -fno-strict-aliasing $(am__append_1) AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/check-coding-style.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/gibber/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/gibber/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/tools/check-coding-style.mk: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgibber.la: $(libgibber_la_OBJECTS) $(libgibber_la_DEPENDENCIES) $(EXTRA_libgibber_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libgibber_la_OBJECTS) $(libgibber_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-fd-transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-linklocal-transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-signals-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-sockets.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-tcp-transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-unix-transport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibber-util.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \ dist-hook distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style dist-hook: $(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done) gibber-signals-marshal.list: $(OUR_SOURCES) Makefile.am @( cd $(srcdir) && \ sed -n -e 's/.*_gibber_signals_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \ $(OUR_SOURCES) ) \ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp @if cmp -s $@.tmp $@; then \ rm $@.tmp; \ touch $@; \ else \ mv $@.tmp $@; \ fi %-signals-marshal.h: %-signals-marshal.list Makefile.am $(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_signals_marshal $< > $@ %-signals-marshal.c: %-signals-marshal.list Makefile.am $(AM_V_GEN){ echo '#include "$*-signals-marshal.h"' && \ glib-genmarshal --body --prefix=_$(subst -,_,$*)_signals_marshal $< ; \ } > $@ Android.mk: Makefile.am $(BUILT_SOURCES) androgenizer -:PROJECT telepathy-gabble -:STATIC gibber -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libgibber_la_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(AM_LDFLAGS) \ > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/gibber/gibber-unix-transport.h0000644000175000017500000000701012735675441024521 0ustar00gkiagiagkiagia00000000000000/* * gibber-unix-transport.h - Header for GibberUnixTransport * Copyright (C) 2006, 2008 Collabora Ltd. * @author: Sjoerd Simons * @author: Alban Crequy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GIBBER_UNIX_TRANSPORT_H__ #define __GIBBER_UNIX_TRANSPORT_H__ #include #ifdef G_OS_UNIX #include #include #include #include #include #include #include #include #include #include "gibber-fd-transport.h" G_BEGIN_DECLS GQuark gibber_unix_transport_error_quark (void); #define GIBBER_UNIX_TRANSPORT_ERROR gibber_unix_transport_error_quark() typedef enum { GIBBER_UNIX_TRANSPORT_ERROR_CONNECT_FAILED, GIBBER_UNIX_TRANSPORT_ERROR_FAILED, GIBBER_UNIX_TRANSPORT_ERROR_NO_CREDENTIALS, } GibberUnixTransportError; typedef struct _GibberUnixTransport GibberUnixTransport; typedef struct _GibberUnixTransportClass GibberUnixTransportClass; struct _GibberUnixTransportClass { GibberFdTransportClass parent_class; }; struct _GibberUnixTransport { GibberFdTransport parent; }; GType gibber_unix_transport_get_type (void); /* TYPE MACROS */ #define GIBBER_TYPE_UNIX_TRANSPORT \ (gibber_unix_transport_get_type ()) #define GIBBER_UNIX_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GIBBER_TYPE_UNIX_TRANSPORT, \ GibberUnixTransport)) #define GIBBER_UNIX_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GIBBER_TYPE_UNIX_TRANSPORT, \ GibberUnixTransportClass)) #define GIBBER_IS_UNIX_TRANSPORT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIBBER_TYPE_UNIX_TRANSPORT)) #define GIBBER_IS_UNIX_TRANSPORT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GIBBER_TYPE_UNIX_TRANSPORT)) #define GIBBER_UNIX_TRANSPORT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_UNIX_TRANSPORT, \ GibberUnixTransportClass)) gboolean gibber_unix_transport_supports_credentials (void); GibberUnixTransport * gibber_unix_transport_new (void); GibberUnixTransport * gibber_unix_transport_new_from_fd (int fd); gboolean gibber_unix_transport_connect (GibberUnixTransport *transport, const gchar *path, GError **error); gboolean gibber_unix_transport_send_credentials (GibberUnixTransport *transport, const guint8 *data, gsize size); typedef struct { pid_t pid; uid_t uid; gid_t gid; } GibberCredentials; typedef void (*GibberUnixTransportRecvCredentialsCb) ( GibberUnixTransport *transport, GibberBuffer *buffer, GibberCredentials *credentials, GError *error, gpointer user_data); gboolean gibber_unix_transport_recv_credentials (GibberUnixTransport *transport, GibberUnixTransportRecvCredentialsCb callback, gpointer user_data); G_END_DECLS #endif /* G_OS_UNIX */ #endif /* #ifndef __GIBBER_UNIX_TRANSPORT_H__*/ telepathy-gabble-0.18.4/lib/gibber/gibber-sockets.c0000644000175000017500000000475112735675441023163 0ustar00gkiagiagkiagia00000000000000/* * gibber-sockets.c - basic portability wrappers for BSD/Winsock differences * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "gibber-sockets.h" #include #define DEBUG_FLAG DEBUG_NET #include "gibber-debug.h" gboolean gibber_connect_errno_requires_retry (int err) { #ifdef G_OS_WIN32 return (err == WSAEINPROGRESS || err == WSAEALREADY || err == WSAEWOULDBLOCK || err == WSAEINVAL); #else return (err == EINPROGRESS || err == EALREADY); #endif } gint gibber_socket_errno (void) { #ifdef G_OS_WIN32 return WSAGetLastError (); #else return errno; #endif } const gchar * gibber_socket_strerror (void) { #ifdef G_OS_WIN32 return "[no strerror() in winsock :-(]"; #else return g_strerror (errno); #endif } gboolean gibber_socket_errno_is_eafnosupport (void) { #ifdef G_OS_WIN32 return (WSAGetLastError () == WSAEAFNOSUPPORT); #else return (errno == EAFNOSUPPORT); #endif } gboolean gibber_socket_errno_is_eaddrinuse (void) { #ifdef G_OS_WIN32 return (WSAGetLastError () == WSAEADDRINUSE); #else return (errno == EADDRINUSE); #endif } void gibber_socket_set_error (GError **error, const gchar *context, GQuark domain, gint code) { gint err = gibber_socket_errno (); const gchar *str = gibber_socket_strerror (); DEBUG ("%s: #%d %s", context, err, str); g_set_error (error, domain, code, "%s: #%d %s", context, err, str); } GIOChannel * gibber_io_channel_new_from_socket (gint sockfd) { #ifdef G_OS_WIN32 return g_io_channel_win32_new_socket (sockfd); #else return g_io_channel_unix_new (sockfd); #endif } void gibber_socket_set_nonblocking (gint sockfd) { #ifdef G_OS_WIN32 u_long please_dont_block = 1; ioctlsocket (sockfd, FIONBIO, &please_dont_block); #else fcntl (sockfd, F_SETFL, O_NONBLOCK); #endif } telepathy-gabble-0.18.4/lib/gibber/gibber-transport.c0000644000175000017500000002007313011057407023517 0ustar00gkiagiagkiagia00000000000000/* * gibber-transport.c - Source for GibberTransport * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include "gibber-transport.h" #include "gibber-signals-marshal.h" #define DEBUG_FLAG DEBUG_TRANSPORT #include "gibber-debug.h" G_DEFINE_TYPE(GibberTransport, gibber_transport, G_TYPE_OBJECT) /* signal enum */ enum { CONNECTED, CONNECTING, DISCONNECTED, DISCONNECTING, ERROR, BUFFER_EMPTY, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; /* private structure */ typedef struct _GibberTransportPrivate GibberTransportPrivate; struct _GibberTransportPrivate { gboolean dispose_has_run; }; #define GIBBER_TRANSPORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GIBBER_TYPE_TRANSPORT, GibberTransportPrivate)) static void gibber_transport_init (GibberTransport *obj) { obj->state = GIBBER_TRANSPORT_DISCONNECTED; obj->handler = NULL; } static void gibber_transport_dispose (GObject *object); static void gibber_transport_finalize (GObject *object); static void gibber_transport_class_init (GibberTransportClass *gibber_transport_class) { GObjectClass *object_class = G_OBJECT_CLASS (gibber_transport_class); g_type_class_add_private (gibber_transport_class, sizeof (GibberTransportPrivate)); object_class->dispose = gibber_transport_dispose; object_class->finalize = gibber_transport_finalize; signals[BUFFER_EMPTY] = g_signal_new ("buffer-empty", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[CONNECTED] = g_signal_new ("connected", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[CONNECTING] = g_signal_new ("connecting", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[DISCONNECTING] = g_signal_new ("disconnecting", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[DISCONNECTED] = g_signal_new ("disconnected", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[ERROR] = g_signal_new ("error", G_OBJECT_CLASS_TYPE (gibber_transport_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, _gibber_signals_marshal_VOID__UINT_INT_STRING, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); } void gibber_transport_dispose (GObject *object) { GibberTransport *self = GIBBER_TRANSPORT (object); GibberTransportPrivate *priv = GIBBER_TRANSPORT_GET_PRIVATE (self); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (G_OBJECT_CLASS (gibber_transport_parent_class)->dispose) G_OBJECT_CLASS (gibber_transport_parent_class)->dispose (object); } void gibber_transport_finalize (GObject *object) { G_OBJECT_CLASS (gibber_transport_parent_class)->finalize (object); } void gibber_transport_received_data (GibberTransport *transport, const guint8 *data, gsize length) { GibberBuffer buffer; buffer.length = length; buffer.data = data; gibber_transport_received_data_custom (transport, &buffer); } void gibber_transport_received_data_custom (GibberTransport *transport, GibberBuffer *buffer) { if (G_UNLIKELY (transport->handler == NULL)) { DEBUG("No handler for transport, dropping data!"); } else { transport->handler (transport, buffer, transport->user_data); } } void gibber_transport_set_state (GibberTransport *transport, GibberTransportState state) { if (state != transport->state) { transport->state = state; switch (state) { case GIBBER_TRANSPORT_DISCONNECTED: g_signal_emit (transport, signals[DISCONNECTED], 0); break; case GIBBER_TRANSPORT_CONNECTING: g_signal_emit (transport, signals[CONNECTING], 0); break; case GIBBER_TRANSPORT_CONNECTED: g_signal_emit (transport, signals[CONNECTED], 0); break; case GIBBER_TRANSPORT_DISCONNECTING: g_signal_emit (transport, signals[DISCONNECTING], 0); break; } } } GibberTransportState gibber_transport_get_state (GibberTransport *transport) { return transport->state; } void gibber_transport_emit_error (GibberTransport *transport, GError *error) { DEBUG ("Transport error: %s", error->message); g_signal_emit (transport, signals[ERROR], 0, error->domain, error->code, error->message); } gboolean gibber_transport_send (GibberTransport *transport, const guint8 *data, gsize size, GError **error) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); g_assert (transport->state == GIBBER_TRANSPORT_CONNECTED); return cls->send (transport, data, size, error); } void gibber_transport_disconnect (GibberTransport *transport) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); return cls->disconnect (transport); } void gibber_transport_set_handler (GibberTransport *transport, GibberHandlerFunc func, gpointer user_data) { g_assert (transport->handler == NULL || func == NULL); transport->handler = func; transport->user_data = user_data; } gboolean gibber_transport_get_peeraddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); if (cls->get_peeraddr != NULL) return cls->get_peeraddr (transport, addr, len); return FALSE; } gboolean gibber_transport_get_sockaddr (GibberTransport *transport, struct sockaddr_storage *addr, socklen_t *len) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); if (cls->get_sockaddr != NULL) return cls->get_sockaddr (transport, addr, len); return FALSE; } gboolean gibber_transport_buffer_is_empty (GibberTransport *transport) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); g_assert (cls->buffer_is_empty != NULL); return cls->buffer_is_empty (transport); } void gibber_transport_emit_buffer_empty (GibberTransport *transport) { g_signal_emit (transport, signals[BUFFER_EMPTY], 0); } void gibber_transport_block_receiving (GibberTransport *transport, gboolean block) { GibberTransportClass *cls = GIBBER_TRANSPORT_GET_CLASS (transport); g_assert (cls->block_receiving != NULL); cls->block_receiving (transport, block); } telepathy-gabble-0.18.4/lib/Makefile.am0000644000175000017500000000002312735675441020702 0ustar00gkiagiagkiagia00000000000000SUBDIRS=ext gibber telepathy-gabble-0.18.4/lib/Makefile.in0000644000175000017500000004503313012560744020711 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_config_dir.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLIENT_TYPE = @CLIENT_TYPE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ENABLE_PLUGINS = @ENABLE_PLUGINS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NICE_CFLAGS = @NICE_CFLAGS@ NICE_LIBS = @NICE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ STRIP = @STRIP@ TEST_PYTHON = @TEST_PYTHON@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_GLIB_LIBS = @TP_GLIB_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ WOCKY_LIBS = @WOCKY_LIBS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gabbletestsdir = @gabbletestsdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginexecdir = @pluginexecdir@ pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = ext gibber all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/ext/0000755000175000017500000000000013012562225017433 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/0000755000175000017500000000000013012562226020570 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/tools/0000755000175000017500000000000013012562225021727 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/tools/check-whitespace.sh0000644000175000017500000000032312735676345025514 0ustar00gkiagiagkiagia00000000000000#!/bin/sh fail=0 if grep -n ' $' "$@" then echo "^^^ The above files contain unwanted trailing spaces" fail=1 fi if grep -n ' ' "$@" then echo "^^^ The above files contain tabs" fail=1 fi exit $fail telepathy-gabble-0.18.4/lib/ext/wocky/tools/flymake.mk0000644000175000017500000000014412735676345023733 0ustar00gkiagiagkiagia00000000000000check-syntax: $(CC) $(AM_CPPFLAGS) $(AM_CFLAGS) -fsyntax-only $(CHK_SOURCES) .PHONY: check-syntax telepathy-gabble-0.18.4/lib/ext/wocky/tools/check-misc.sh0000644000175000017500000000036012735676345024314 0ustar00gkiagiagkiagia00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-whitespace.sh ) || fail=$? if egrep '(Free\s*Software\s*Foundation.*02139|02111-1307)' "$@" then echo "^^^ The above files contain the FSF's old address in GPL headers" fail=1 fi exit $fail telepathy-gabble-0.18.4/lib/ext/wocky/tools/Makefile.am0000644000175000017500000000017712735676345024014 0ustar00gkiagiagkiagia00000000000000EXTRA_DIST = \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ flymake.mk telepathy-gabble-0.18.4/lib/ext/wocky/tools/check-c-style.sh0000644000175000017500000000376412735676345024754 0ustar00gkiagiagkiagia00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-misc.sh ) || fail=$? if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@" then echo "^^^ The above files contain uninitialized GError*s - they should be" echo " initialized to NULL" fail=1 fi # The first regex finds function calls like foo() (as opposed to foo ()). # It attempts to ignore string constants (may cause false negatives). # The second and third ignore block comments (gtkdoc uses foo() as markup). # The fourth ignores cpp so you can # #define foo(bar) (_real_foo (__FUNC__, bar)) (cpp insists on foo() style). if grep -n '^[^"]*[[:lower:]](' "$@" \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: */\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *#' then echo "^^^ Our coding style is to use function calls like foo (), not foo()" fail=1 fi if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then echo "^^^ Our coding style is to have a space between a cast and the " echo " thing being cast" fail=1 fi # this only spots casts if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 1)" fail=1 fi # ... and this only spots variable declarations and function return types if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \ "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 2)" fail=1 fi if grep -n 'g_hash_table_destroy' "$@"; then echo "^^^ Our coding style is to use g_hash_table_unref" fail=1 fi for p in "" "ptr_" "byte_"; do if grep -En "g_${p}array_free \(([^ ,]+), TRUE\)" "$@"; then echo "^^^ Our coding style is to use g_${p}array_unref in the case " echo " the underlying C array is not used" fail=1 fi done if test -n "$CHECK_FOR_LONG_LINES" then if egrep -n '.{80,}' "$@" then echo "^^^ The above files contain long lines" fail=1 fi fi exit $fail telepathy-gabble-0.18.4/lib/ext/wocky/tools/Makefile.in0000644000175000017500000002777713012560753024024 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ flymake.mk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/ext/wocky/tools/check-coding-style.mk0000644000175000017500000000076412735676345025767 0ustar00gkiagiagkiagia00000000000000check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi telepathy-gabble-0.18.4/lib/ext/wocky/config.sub0000755000175000017500000010705513012560753022566 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-03-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-gabble-0.18.4/lib/ext/wocky/ChangeLog0000644000175000017500000000000012735676345022353 0ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/docs/0000755000175000017500000000000013012562226021520 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/0000755000175000017500000000000013012562226023456 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/wocky-docs.sgml0000644000175000017500000000735213012550005026423 0ustar00gkiagiagkiagia00000000000000 ]> Wocky Reference Manual API Reference Object Hierarchy API Index telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/wocky-overrides.txt0000644000175000017500000000000012735676345027364 0ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/Makefile.am0000644000175000017500000000733512735676345025545 0ustar00gkiagiagkiagia00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE= wocky # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR=$(abs_top_srcdir)/wocky $(abs_top_builddir)/wocky # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types --rebuild-sections # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # If we're building out of tree, we need to scan wocky/ under the builddir as # well as under the sourcedir (which is specified above with DOC_SOURCE_DIR) to # pick up the enumtypes. # # If we're building in-tree, well, we'd just better hope gtkdoc doesn't mind # scanning stuff twice. SCAN_OPTIONS += --source-dir=$(abs_top_builddir)/wocky MKDB_OPTIONS += --source-dir=$(abs_top_builddir)/wocky # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/wocky/*.h $(top_builddir)/wocky/*.h CFILE_GLOB=$(top_srcdir)/wocky/*.c $(top_builddir)/wocky/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) @GLIB_CFLAGS@ @SQLITE_CFLAGS@ GTKDOC_LIBS= @GLIB_LIBS@ @SQLITE_LIBS@ $(top_builddir)/wocky/libwocky.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = wocky-sections.txt wocky.types # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/Makefile.in0000644000175000017500000006420513012560753025535 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = docs/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = wocky # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR = $(abs_top_srcdir)/wocky $(abs_top_builddir)/wocky # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" # If we're building out of tree, we need to scan wocky/ under the builddir as # well as under the sourcedir (which is specified above with DOC_SOURCE_DIR) to # pick up the enumtypes. # # If we're building in-tree, well, we'd just better hope gtkdoc doesn't mind # scanning stuff twice. SCAN_OPTIONS = --rebuild-types --rebuild-sections \ --source-dir=$(abs_top_builddir)/wocky # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml \ --source-dir=$(abs_top_builddir)/wocky # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/wocky/*.h $(top_builddir)/wocky/*.h CFILE_GLOB = $(top_srcdir)/wocky/*.c $(top_builddir)/wocky/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) @GLIB_CFLAGS@ @SQLITE_CFLAGS@ GTKDOC_LIBS = @GLIB_LIBS@ @SQLITE_LIBS@ $(top_builddir)/wocky/libwocky.la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test @GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = wocky-sections.txt wocky.types all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am @ENABLE_GTK_DOC_FALSE@all-local: all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc @ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" @HAVE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/0000755000175000017500000000000013012562226024422 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyContactFactory.html0000644000175000017500000007361113012562226031260 0ustar00gkiagiagkiagia00000000000000 WockyContactFactory: Wocky Reference Manual

WockyContactFactory

WockyContactFactory — creates and looks up WockyContact objects

Types and Values

Object Hierarchy

    GObject
    ╰── WockyContactFactory

Includes

#include <wocky/wocky-contact-factory.h>

Description

Provides a way to create WockyContact objects. The objects created this way are cached by the factory and you can eventually look them up without creating them again.

Functions

wocky_contact_factory_new ()

WockyContactFactory *
wocky_contact_factory_new (void);

Convenience function to create a new WockyContactFactory object.

Returns

a newly created instance of WockyContactFactory


wocky_contact_factory_ensure_bare_contact ()

WockyBareContact *
wocky_contact_factory_ensure_bare_contact
                               (WockyContactFactory *factory,
                                const gchar *bare_jid);

Returns an instance of WockyBareContact for bare_jid . The factory cache is used, but if the contact is not found in the cache, a new WockyBareContact is created and cached for future use.

Parameters

factory

a WockyContactFactory instance

 

bare_jid

the JID of a bare contact

 

Returns

a new reference to a WockyBareContact instance, which the caller is expected to release with g_object_unref() after use.


wocky_contact_factory_lookup_bare_contact ()

WockyBareContact *
wocky_contact_factory_lookup_bare_contact
                               (WockyContactFactory *factory,
                                const gchar *bare_jid);

Looks up if there's a WockyBareContact for bare_jid in the cache, and returns it if it's found.

Parameters

factory

a WockyContactFactory instance

 

bare_jid

the JID of a bare contact

 

Returns

a borrowed WockyBareContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.


wocky_contact_factory_ensure_resource_contact ()

WockyResourceContact *
wocky_contact_factory_ensure_resource_contact
                               (WockyContactFactory *factory,
                                const gchar *full_jid);

Returns an instance of WockyResourceContact for full_jid . The factory cache is used, but if the resource is not found in the cache, a new WockyResourceContact is created and cached for future use.

Parameters

factory

a WockyContactFactory instance

 

full_jid

the full JID of a resource

 

Returns

a new reference to a WockyResourceContact instance, which the caller is expected to release with g_object_unref() after use.


wocky_contact_factory_lookup_resource_contact ()

WockyResourceContact *
wocky_contact_factory_lookup_resource_contact
                               (WockyContactFactory *factory,
                                const gchar *full_jid);

Looks up if there's a WockyResourceContact for full_jid in the cache, and returns it if it's found.

Parameters

factory

a WockyContactFactory instance

 

full_jid

the full JID of a resource

 

Returns

a borrowed WockyResourceContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.


wocky_contact_factory_ensure_ll_contact ()

WockyLLContact *
wocky_contact_factory_ensure_ll_contact
                               (WockyContactFactory *factory,
                                const gchar *jid);

Returns an instance of WockyLLContact for jid . The factory cache is used, but if the contact is not found in the cache, a new WockyLLContact is created and cached for future use.

Parameters

factory

a WockyContactFactory instance

 

jid

the JID of a contact

 

Returns

a new reference to a WockyLLContact instance, which the caller is expected to release with g_object_unref() after use.


wocky_contact_factory_lookup_ll_contact ()

WockyLLContact *
wocky_contact_factory_lookup_ll_contact
                               (WockyContactFactory *factory,
                                const gchar *jid);

Looks up if there's a WockyLLContact for jid in the cache, and returns it if it's found.

Parameters

factory

a WockyContactFactory instance

 

jid

the JID of a contact

 

Returns

a borrowed WockyLLContact instance (which the caller should reference with g_object_ref() if it will be kept), or NULL if the contact is not found.


wocky_contact_factory_add_ll_contact ()

void
wocky_contact_factory_add_ll_contact (WockyContactFactory *factory,
                                      WockyLLContact *contact);

Adds contact to the contact factory.

Parameters

factory

a WockyContactFactory instance

 

contact

a WockyLLContact

 

wocky_contact_factory_get_ll_contacts ()

GList *
wocky_contact_factory_get_ll_contacts (WockyContactFactory *factory);

Parameters

factory

a WockyContactFactory instance

 

Returns

a newly allocated GList of WockyLLContacts which should be freed using g_list_free().

Types and Values

struct WockyContactFactoryClass

struct WockyContactFactoryClass {
};

The class of a WockyContactFactory.

Signal Details

The “bare-contact-added” signal

void
user_function (WockyContactFactory *wockycontactfactory,
               GObject             *arg1,
               gpointer             user_data)

Flags: Run Last


The “ll-contact-added” signal

void
user_function (WockyContactFactory *wockycontactfactory,
               GObject             *arg1,
               gpointer             user_data)

Flags: Run Last


The “resource-contact-added” signal

void
user_function (WockyContactFactory *wockycontactfactory,
               GObject             *arg1,
               gpointer             user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/api-index-full.html0000644000175000017500000076402113012562226030140 0ustar00gkiagiagkiagia00000000000000 API Index: Wocky Reference Manual

API Index

A

wocky_absolutize_path, function in wocky-utils
WockyAuthAuthDataFunc, user_function in WockyAuthHandler
WockyAuthError, enum in WockyAuthRegistry
WockyAuthHandlerIface, struct in WockyAuthHandler
WockyAuthInitialResponseFunc, user_function in WockyAuthHandler
WockyAuthRegistryChallengeAsyncFunc, user_function in WockyAuthRegistry
WockyAuthRegistryChallengeFinishFunc, user_function in WockyAuthRegistry
WockyAuthRegistryClass, struct in WockyAuthRegistry
WockyAuthRegistryFailureFunc, user_function in WockyAuthRegistry
WockyAuthRegistryStartAuthAsyncFunc, user_function in WockyAuthRegistry
WockyAuthRegistryStartAuthFinishFunc, user_function in WockyAuthRegistry
WockyAuthRegistryStartData, struct in WockyAuthRegistry
WockyAuthRegistrySuccessAsyncFunc, user_function in WockyAuthRegistry
WockyAuthRegistrySuccessFinishFunc, user_function in WockyAuthRegistry
WockyAuthSuccessFunc, user_function in WockyAuthHandler
WOCKY_AUTH_ERROR, macro in WockyAuthRegistry
wocky_auth_error_quark, function in WockyAuthRegistry
wocky_auth_handler_get_initial_response, function in WockyAuthHandler
wocky_auth_handler_get_mechanism, function in WockyAuthHandler
wocky_auth_handler_handle_auth_data, function in WockyAuthHandler
wocky_auth_handler_handle_success, function in WockyAuthHandler
wocky_auth_handler_is_plain, function in WockyAuthHandler
WOCKY_AUTH_MECH_JABBER_DIGEST, macro in WockyAuthRegistry
WOCKY_AUTH_MECH_JABBER_PASSWORD, macro in WockyAuthRegistry
WOCKY_AUTH_MECH_SASL_DIGEST_MD5, macro in WockyAuthRegistry
WOCKY_AUTH_MECH_SASL_PLAIN, macro in WockyAuthRegistry
WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1, macro in WockyAuthRegistry
wocky_auth_registry_add_handler, function in WockyAuthRegistry
wocky_auth_registry_challenge_async, function in WockyAuthRegistry
wocky_auth_registry_challenge_finish, function in WockyAuthRegistry
wocky_auth_registry_failure, function in WockyAuthRegistry
wocky_auth_registry_new, function in WockyAuthRegistry
wocky_auth_registry_start_auth_async, function in WockyAuthRegistry
wocky_auth_registry_start_auth_finish, function in WockyAuthRegistry
wocky_auth_registry_start_data_dup, function in WockyAuthRegistry
wocky_auth_registry_start_data_free, function in WockyAuthRegistry
wocky_auth_registry_start_data_new, function in WockyAuthRegistry
wocky_auth_registry_success_async, function in WockyAuthRegistry
wocky_auth_registry_success_finish, function in WockyAuthRegistry
wocky_auth_registry_supports_one_of, function in WockyAuthRegistry

B

WockyBareContact, struct in wocky-types
WockyBareContact:groups, object property in wocky-types
WockyBareContact:jid, object property in wocky-types
WockyBareContact:name, object property in wocky-types
WockyBareContact:subscription, object property in wocky-types
WockyBareContactClass, struct in WockyBareContact
wocky_bare_contact_add_group, function in WockyBareContact
wocky_bare_contact_add_resource, function in WockyBareContact
wocky_bare_contact_copy, function in WockyBareContact
wocky_bare_contact_debug_print, function in WockyBareContact
wocky_bare_contact_equal, function in WockyBareContact
wocky_bare_contact_get_groups, function in WockyBareContact
wocky_bare_contact_get_jid, function in WockyBareContact
wocky_bare_contact_get_name, function in WockyBareContact
wocky_bare_contact_get_resources, function in WockyBareContact
wocky_bare_contact_get_subscription, function in WockyBareContact
wocky_bare_contact_in_group, function in WockyBareContact
wocky_bare_contact_new, function in WockyBareContact
wocky_bare_contact_remove_group, function in WockyBareContact
wocky_bare_contact_set_groups, function in WockyBareContact
wocky_bare_contact_set_name, function in WockyBareContact
wocky_bare_contact_set_subscription, function in WockyBareContact

C

WockyC2SPorter, struct in WockyC2SPorter
WockyC2SPorterClass, struct in WockyC2SPorter
wocky_c2s_porter_enable_power_saving_mode, function in WockyC2SPorter
wocky_c2s_porter_new, function in WockyC2SPorter
wocky_c2s_porter_register_handler_from_server, function in WockyC2SPorter
wocky_c2s_porter_register_handler_from_server_by_stanza, function in WockyC2SPorter
wocky_c2s_porter_register_handler_from_server_va, function in WockyC2SPorter
wocky_c2s_porter_send_whitespace_ping_async, function in WockyC2SPorter
wocky_c2s_porter_send_whitespace_ping_finish, function in WockyC2SPorter
WockyCapsCache, struct in WockyCapsCache
WockyCapsCache:path, object property in WockyCapsCache
WockyCapsCacheClass, struct in WockyCapsCache
wocky_caps_cache_dup_shared, function in WockyCapsCache
wocky_caps_cache_free_shared, function in WockyCapsCache
wocky_caps_cache_insert, function in WockyCapsCache
wocky_caps_cache_lookup, function in WockyCapsCache
wocky_caps_cache_new, function in WockyCapsCache
wocky_caps_hash_compute_from_lists, function in WockyCapsHash
wocky_caps_hash_compute_from_node, function in WockyCapsHash
wocky_compose_jid, function in wocky-utils
WockyConnector::connection-established, object signal in WockyConnector
WockyConnector:auth-registry, object property in WockyConnector
WockyConnector:email, object property in WockyConnector
WockyConnector:encrypted-plain-auth-ok, object property in WockyConnector
WockyConnector:features, object property in WockyConnector
WockyConnector:identity, object property in WockyConnector
WockyConnector:jid, object property in WockyConnector
WockyConnector:legacy, object property in WockyConnector
WockyConnector:old-ssl, object property in WockyConnector
WockyConnector:password, object property in WockyConnector
WockyConnector:plaintext-auth-allowed, object property in WockyConnector
WockyConnector:resource, object property in WockyConnector
WockyConnector:session-id, object property in WockyConnector
WockyConnector:tls-handler, object property in WockyConnector
WockyConnector:tls-required, object property in WockyConnector
WockyConnector:xmpp-port, object property in WockyConnector
WockyConnector:xmpp-server, object property in WockyConnector
WockyConnectorClass, struct in WockyConnector
WockyConnectorError, enum in WockyConnector
wocky_connector_connect_async, function in WockyConnector
wocky_connector_connect_finish, function in WockyConnector
WOCKY_CONNECTOR_ERROR, macro in WockyConnector
wocky_connector_error_quark, function in WockyConnector
wocky_connector_new, function in WockyConnector
wocky_connector_register_async, function in WockyConnector
wocky_connector_register_finish, function in WockyConnector
wocky_connector_set_auth_registry, function in WockyConnector
wocky_connector_unregister_async, function in WockyConnector
wocky_connector_unregister_finish, function in WockyConnector
WockyContactClass, struct in WockyContact
WockyContactDupJidImpl, user_function in WockyContact
WockyContactFactory::bare-contact-added, object signal in WockyContactFactory
WockyContactFactory::ll-contact-added, object signal in WockyContactFactory
WockyContactFactory::resource-contact-added, object signal in WockyContactFactory
WockyContactFactoryClass, struct in WockyContactFactory
wocky_contact_dup_jid, function in WockyContact
wocky_contact_factory_add_ll_contact, function in WockyContactFactory
wocky_contact_factory_ensure_bare_contact, function in WockyContactFactory
wocky_contact_factory_ensure_ll_contact, function in WockyContactFactory
wocky_contact_factory_ensure_resource_contact, function in WockyContactFactory
wocky_contact_factory_get_ll_contacts, function in WockyContactFactory
wocky_contact_factory_lookup_bare_contact, function in WockyContactFactory
wocky_contact_factory_lookup_ll_contact, function in WockyContactFactory
wocky_contact_factory_lookup_resource_contact, function in WockyContactFactory
wocky_contact_factory_new, function in WockyContactFactory

D

WockyDataForm, struct in WockyDataForm
WockyDataForm:instructions, object property in WockyDataForm
WockyDataForm:title, object property in WockyDataForm
WockyDataFormClass, struct in WockyDataForm
WockyDataFormError, enum in WockyDataForm
WockyDataFormField, struct in WockyDataForm
WockyDataFormFieldOption, struct in WockyDataForm
WockyDataFormFieldType, enum in WockyDataForm
wocky_data_form_add_to_node, function in WockyDataForm
WOCKY_DATA_FORM_ERROR, macro in WockyDataForm
wocky_data_form_error_quark, function in WockyDataForm
wocky_data_form_field_cmp, function in WockyDataForm
wocky_data_form_get_instructions, function in WockyDataForm
wocky_data_form_get_title, function in WockyDataForm
wocky_data_form_new_from_form, function in WockyDataForm
wocky_data_form_new_from_node, function in WockyDataForm
wocky_data_form_parse_result, function in WockyDataForm
wocky_data_form_set_boolean, function in WockyDataForm
wocky_data_form_set_string, function in WockyDataForm
wocky_data_form_set_strv, function in WockyDataForm
wocky_data_form_set_type, function in WockyDataForm
wocky_data_form_submit, function in WockyDataForm
DEBUG, macro in wocky-debug-internal
wocky_debug, function in wocky-debug-internal
WockyDebugFlags, enum in wocky-debug
DEBUGGING, macro in wocky-debug-internal
wocky_debug_flag_is_set, function in wocky-debug-internal
DEBUG_NODE, macro in wocky-debug-internal
wocky_debug_node, function in wocky-debug-internal
DEBUG_NODE_TREE, macro in wocky-debug-internal
wocky_debug_node_tree, function in wocky-debug-internal
wocky_debug_set_flags, function in wocky-debug
wocky_debug_set_flags_from_env, function in wocky-debug-internal
DEBUG_STANZA, macro in wocky-debug-internal
wocky_debug_stanza, function in wocky-debug-internal
wocky_debug_valist, function in wocky-debug-internal
WOCKY_DEBUG_XMPP, macro in wocky-debug
wocky_decode_jid, function in wocky-utils
wocky_deinit, function in wocky
WockyDiscoIdentity, struct in WockyDiscoIdentity
wocky_disco_identity_array_copy, function in WockyDiscoIdentity
wocky_disco_identity_array_free, function in WockyDiscoIdentity
wocky_disco_identity_array_new, function in WockyDiscoIdentity
wocky_disco_identity_cmp, function in WockyDiscoIdentity
wocky_disco_identity_copy, function in WockyDiscoIdentity
wocky_disco_identity_free, function in WockyDiscoIdentity
wocky_disco_identity_new, function in WockyDiscoIdentity

E

wocky_enum_from_nick, function in wocky-utils
wocky_enum_to_nick, function in wocky-utils

G

WockyGoogleRelayResolver, struct in wocky-google-relay
WOCKY_GOOGLE_NS_AUTH, macro in wocky-namespaces
wocky_google_relay_resolver_destroy, function in wocky-google-relay
wocky_google_relay_resolver_new, function in wocky-google-relay
wocky_google_relay_resolver_resolve, function in wocky-google-relay
wocky_g_string_dup, function in wocky-utils
wocky_g_string_free, function in wocky-utils
wocky_g_value_slice_dup, function in wocky-utils
wocky_g_value_slice_free, function in wocky-utils
wocky_g_value_slice_new, function in wocky-utils
wocky_g_value_slice_new_boolean, function in wocky-utils
wocky_g_value_slice_new_boxed, function in wocky-utils
wocky_g_value_slice_new_double, function in wocky-utils
wocky_g_value_slice_new_int, function in wocky-utils
wocky_g_value_slice_new_int64, function in wocky-utils
wocky_g_value_slice_new_static_boxed, function in wocky-utils
wocky_g_value_slice_new_static_string, function in wocky-utils
wocky_g_value_slice_new_string, function in wocky-utils
wocky_g_value_slice_new_take_boxed, function in wocky-utils
wocky_g_value_slice_new_take_string, function in wocky-utils
wocky_g_value_slice_new_uint, function in wocky-utils
wocky_g_value_slice_new_uint64, function in wocky-utils

H

WockyHeartbeatCallback, user_function in wocky-heartbeat-source
wocky_heartbeat_source_new, function in wocky-heartbeat-source
wocky_heartbeat_source_update_interval, function in wocky-heartbeat-source
WOCKY_H_INSIDE, macro in wocky

I

wocky_implement_finish_copy_pointer, macro in wocky-utils
wocky_implement_finish_return_copy_pointer, macro in wocky-utils
wocky_implement_finish_return_pointer, macro in wocky-utils
wocky_implement_finish_void, macro in wocky-utils
wocky_init, function in wocky

J

WockyJabberAuth:auth-registry, object property in WockyJabberAuth
WockyJabberAuth:connection, object property in WockyJabberAuth
WockyJabberAuth:password, object property in WockyJabberAuth
WockyJabberAuth:resource, object property in WockyJabberAuth
WockyJabberAuth:session-id, object property in WockyJabberAuth
WockyJabberAuth:username, object property in WockyJabberAuth
WockyJabberAuthClass, struct in WockyJabberAuth
wocky_jabber_auth_add_handler, function in WockyJabberAuth
wocky_jabber_auth_authenticate_async, function in WockyJabberAuth
wocky_jabber_auth_authenticate_finish, function in WockyJabberAuth
wocky_jabber_auth_digest_new, function in wocky-jabber-auth-digest
wocky_jabber_auth_new, function in WockyJabberAuth
wocky_jabber_auth_password_new, function in wocky-jabber-auth-password
WOCKY_JABBER_NS_AUTH, macro in wocky-namespaces
WOCKY_JABBER_NS_AUTH_FEATURE, macro in wocky-namespaces
WockyJingleAction, enum in wocky-jingle-types
WockyJingleCandidate, struct in wocky-jingle-types
WockyJingleCandidateType, enum in wocky-jingle-types
WockyJingleCodec, struct in WockyJingleMediaRtp
WockyJingleContent, struct in wocky-jingle-types
WockyJingleContent::completed, object signal in wocky-jingle-types
WockyJingleContent::new-candidates, object signal in wocky-jingle-types
WockyJingleContent::new-share-channel, object signal in wocky-jingle-types
WockyJingleContent::ready, object signal in wocky-jingle-types
WockyJingleContent::removed, object signal in wocky-jingle-types
WockyJingleContent:content-ns, object property in wocky-jingle-types
WockyJingleContent:disposition, object property in wocky-jingle-types
WockyJingleContent:locally-created, object property in wocky-jingle-types
WockyJingleContent:name, object property in wocky-jingle-types
WockyJingleContent:senders, object property in wocky-jingle-types
WockyJingleContent:session, object property in wocky-jingle-types
WockyJingleContent:state, object property in wocky-jingle-types
WockyJingleContent:transport-ns, object property in wocky-jingle-types
WockyJingleContentSenders, enum in wocky-jingle-types
WockyJingleContentState, enum in WockyJingleContent
WockyJingleDialect, enum in wocky-jingle-types
WockyJingleError, enum in wocky-xmpp-error
WockyJingleFactory, struct in wocky-jingle-types
WockyJingleFactory::new-session, object signal in wocky-jingle-types
WockyJingleFactory::query-cap, object signal in wocky-jingle-types
WockyJingleFactory:session, object property in wocky-jingle-types
WockyJingleFeedbackMessage, struct in WockyJingleMediaRtp
WockyJingleInfo::stun-server-changed, object signal in WockyJingleInfo
WockyJingleInfo:porter, object property in WockyJingleInfo
WockyJingleInfoRelaySessionCb, user_function in WockyJingleInfo
WockyJingleMediaDescription, struct in WockyJingleMediaRtp
WockyJingleMediaRtp, struct in wocky-jingle-types
WockyJingleMediaRtp::remote-media-description, object signal in wocky-jingle-types
WockyJingleMediaRtp:media-type, object property in wocky-jingle-types
WockyJingleMediaRtp:remote-mute, object property in wocky-jingle-types
WockyJingleMediaType, enum in WockyJingleContent
WockyJingleReason, enum in wocky-jingle-types
WockyJingleRelay, struct in WockyJingleInfo
WockyJingleRelayType, enum in WockyJingleInfo
WockyJingleRtpHeaderExtension, struct in WockyJingleMediaRtp
WockyJingleSession, struct in wocky-jingle-types
WockyJingleSession::about-to-initiate, object signal in wocky-jingle-types
WockyJingleSession::content-rejected, object signal in wocky-jingle-types
WockyJingleSession::new-content, object signal in wocky-jingle-types
WockyJingleSession::query-cap, object signal in wocky-jingle-types
WockyJingleSession::remote-state-changed, object signal in wocky-jingle-types
WockyJingleSession::terminated, object signal in wocky-jingle-types
WockyJingleSession:dialect, object property in wocky-jingle-types
WockyJingleSession:jingle-factory, object property in wocky-jingle-types
WockyJingleSession:local-hold, object property in wocky-jingle-types
WockyJingleSession:local-initiator, object property in wocky-jingle-types
WockyJingleSession:peer-contact, object property in wocky-jingle-types
WockyJingleSession:porter, object property in wocky-jingle-types
WockyJingleSession:remote-hold, object property in wocky-jingle-types
WockyJingleSession:remote-ringing, object property in wocky-jingle-types
WockyJingleSession:session-id, object property in wocky-jingle-types
WockyJingleSession:state, object property in wocky-jingle-types
WockyJingleState, enum in wocky-jingle-types
WockyJingleTransportGoogle, struct in wocky-jingle-types
WockyJingleTransportGoogle::new-candidates, object signal in wocky-jingle-types
WockyJingleTransportGoogle:content, object property in wocky-jingle-types
WockyJingleTransportGoogle:state, object property in wocky-jingle-types
WockyJingleTransportGoogle:transport-ns, object property in wocky-jingle-types
WockyJingleTransportIceUdp, struct in wocky-jingle-types
WockyJingleTransportIceUdp::new-candidates, object signal in wocky-jingle-types
WockyJingleTransportIceUdp:content, object property in wocky-jingle-types
WockyJingleTransportIceUdp:state, object property in wocky-jingle-types
WockyJingleTransportIceUdp:transport-ns, object property in wocky-jingle-types
WockyJingleTransportIface:content, object property in WockyJingleTransportIface
WockyJingleTransportIface:state, object property in WockyJingleTransportIface
WockyJingleTransportIface:transport-ns, object property in WockyJingleTransportIface
WockyJingleTransportProtocol, enum in wocky-jingle-types
WockyJingleTransportRawUdp, struct in wocky-jingle-types
WockyJingleTransportRawUdp::new-candidates, object signal in wocky-jingle-types
WockyJingleTransportRawUdp:content, object property in wocky-jingle-types
WockyJingleTransportRawUdp:state, object property in wocky-jingle-types
WockyJingleTransportRawUdp:transport-ns, object property in wocky-jingle-types
WockyJingleTransportState, enum in WockyJingleTransportIface
WockyJingleTransportType, enum in wocky-jingle-types
wocky_jingle_candidate_free, function in WockyJingleTransportIface
wocky_jingle_candidate_new, function in WockyJingleTransportIface
wocky_jingle_content_add_candidates, function in WockyJingleContent
wocky_jingle_content_change_direction, function in WockyJingleContent
wocky_jingle_content_create_share_channel, function in WockyJingleContent
wocky_jingle_content_creator_is_initiator, function in WockyJingleContent
wocky_jingle_content_get_credentials, function in WockyJingleContent
wocky_jingle_content_get_disposition, function in WockyJingleContent
wocky_jingle_content_get_local_candidates, function in WockyJingleContent
wocky_jingle_content_get_name, function in WockyJingleContent
wocky_jingle_content_get_ns, function in WockyJingleContent
wocky_jingle_content_get_remote_candidates, function in WockyJingleContent
wocky_jingle_content_get_transport_ns, function in WockyJingleContent
wocky_jingle_content_get_transport_type, function in WockyJingleContent
wocky_jingle_content_inject_candidates, function in WockyJingleContent
wocky_jingle_content_is_created_by_us, function in WockyJingleContent
wocky_jingle_content_is_ready, function in WockyJingleContent
wocky_jingle_content_maybe_send_description, function in WockyJingleContent
wocky_jingle_content_parse_accept, function in WockyJingleContent
wocky_jingle_content_parse_add, function in WockyJingleContent
wocky_jingle_content_parse_description_info, function in WockyJingleContent
wocky_jingle_content_parse_info, function in WockyJingleContent
wocky_jingle_content_parse_transport_info, function in WockyJingleContent
wocky_jingle_content_produce_node, function in WockyJingleContent
wocky_jingle_content_receiving, function in WockyJingleContent
wocky_jingle_content_reject, function in WockyJingleContent
wocky_jingle_content_remove, function in WockyJingleContent
wocky_jingle_content_request_receiving, function in WockyJingleContent
wocky_jingle_content_retransmit_candidates, function in WockyJingleContent
wocky_jingle_content_sending, function in WockyJingleContent
wocky_jingle_content_send_complete, function in WockyJingleContent
wocky_jingle_content_set_sending, function in WockyJingleContent
wocky_jingle_content_set_transport_state, function in WockyJingleContent
wocky_jingle_content_update_senders, function in WockyJingleContent
WOCKY_JINGLE_ERROR, macro in wocky-xmpp-error
wocky_jingle_error_quark, function in wocky-xmpp-error
wocky_jingle_factory_create_session, function in WockyJingleFactory
wocky_jingle_factory_get_jingle_info, function in WockyJingleFactory
wocky_jingle_factory_lookup_content_type, function in WockyJingleFactory
wocky_jingle_factory_lookup_transport, function in WockyJingleFactory
wocky_jingle_factory_new, function in WockyJingleFactory
wocky_jingle_factory_register_content_type, function in WockyJingleFactory
wocky_jingle_factory_register_transport, function in WockyJingleFactory
wocky_jingle_factory_stop, function in WockyJingleFactory
wocky_jingle_feedback_message_free, function in WockyJingleMediaRtp
wocky_jingle_feedback_message_new, function in WockyJingleMediaRtp
wocky_jingle_info_create_google_relay_session, function in WockyJingleInfo
wocky_jingle_info_get_google_relay_token, function in WockyJingleInfo
wocky_jingle_info_get_stun_servers, function in WockyJingleInfo
wocky_jingle_info_new, function in WockyJingleInfo
wocky_jingle_info_send_request, function in WockyJingleInfo
wocky_jingle_info_set_test_mode, function in WockyJingleInfo
wocky_jingle_info_take_stun_server, function in WockyJingleInfo
wocky_jingle_media_description_copy, function in WockyJingleMediaRtp
wocky_jingle_media_description_free, function in WockyJingleMediaRtp
wocky_jingle_media_description_new, function in WockyJingleMediaRtp
wocky_jingle_media_description_simplify, function in WockyJingleMediaRtp
jingle_media_rtp_codec_free, function in WockyJingleMediaRtp
jingle_media_rtp_codec_new, function in WockyJingleMediaRtp
jingle_media_rtp_compare_codecs, function in WockyJingleMediaRtp
jingle_media_rtp_copy_codecs, function in WockyJingleMediaRtp
jingle_media_rtp_free_codecs, function in WockyJingleMediaRtp
wocky_jingle_media_rtp_get_remote_media_description, function in WockyJingleMediaRtp
jingle_media_rtp_register, function in WockyJingleMediaRtp
jingle_media_rtp_set_local_media_description, function in WockyJingleMediaRtp
wocky_jingle_relay_free, function in WockyJingleInfo
wocky_jingle_relay_new, function in WockyJingleInfo
wocky_jingle_rtp_header_extension_free, function in WockyJingleMediaRtp
wocky_jingle_rtp_header_extension_new, function in WockyJingleMediaRtp
wocky_jingle_session_accept, function in WockyJingleSession
wocky_jingle_session_acknowledge_iq, function in WockyJingleSession
wocky_jingle_session_add_content, function in WockyJingleSession
wocky_jingle_session_can_modify_contents, function in WockyJingleSession
wocky_jingle_session_defines_action, function in WockyJingleSession
wocky_jingle_session_detect, function in WockyJingleSession
wocky_jingle_session_get_contents, function in WockyJingleSession
wocky_jingle_session_get_content_type, function in WockyJingleSession
wocky_jingle_session_get_dialect, function in WockyJingleSession
wocky_jingle_session_get_factory, function in WockyJingleSession
wocky_jingle_session_get_initiator, function in WockyJingleSession
wocky_jingle_session_get_peer_contact, function in WockyJingleSession
wocky_jingle_session_get_peer_jid, function in WockyJingleSession
wocky_jingle_session_get_peer_resource, function in WockyJingleSession
wocky_jingle_session_get_porter, function in WockyJingleSession
wocky_jingle_session_get_reason_name, function in WockyJingleSession
wocky_jingle_session_get_remote_hold, function in WockyJingleSession
wocky_jingle_session_get_remote_ringing, function in WockyJingleSession
wocky_jingle_session_get_sid, function in WockyJingleSession
wocky_jingle_session_new, function in WockyJingleSession
wocky_jingle_session_new_message, function in WockyJingleSession
wocky_jingle_session_parse, function in WockyJingleSession
wocky_jingle_session_peer_has_cap, function in WockyJingleSession
wocky_jingle_session_remove_content, function in WockyJingleSession
wocky_jingle_session_send, function in WockyJingleSession
wocky_jingle_session_set_local_hold, function in WockyJingleSession
wocky_jingle_session_terminate, function in WockyJingleSession
jingle_transport_free_candidates, function in WockyJingleTransportIface
jingle_transport_get_credentials, function in WockyJingleTransportIface
jingle_transport_google_register, function in WockyJingleTransportGoogle
jingle_transport_google_set_component_name, function in WockyJingleTransportGoogle
jingle_transport_iceudp_register, function in WockyJingleTransportIceUdp
wocky_jingle_transport_iface_can_accept, function in WockyJingleTransportIface
wocky_jingle_transport_iface_get_local_candidates, function in WockyJingleTransportIface
wocky_jingle_transport_iface_get_remote_candidates, function in WockyJingleTransportIface
wocky_jingle_transport_iface_get_transport_type, function in WockyJingleTransportIface
wocky_jingle_transport_iface_inject_candidates, function in WockyJingleTransportIface
wocky_jingle_transport_iface_new, function in WockyJingleTransportIface
wocky_jingle_transport_iface_new_local_candidates, function in WockyJingleTransportIface
wocky_jingle_transport_iface_parse_candidates, function in WockyJingleTransportIface
wocky_jingle_transport_iface_send_candidates, function in WockyJingleTransportIface
jingle_transport_rawudp_register, function in WockyJingleTransportRawUdp

L

wocky_list_deep_copy, function in wocky-utils
WockyLLConnectionFactoryError, enum in WockyLLConnectionFactory
WockyLLConnector:connection, object property in WockyLLConnector
WockyLLConnector:incoming, object property in WockyLLConnector
WockyLLConnector:local-jid, object property in WockyLLConnector
WockyLLConnector:remote-jid, object property in WockyLLConnector
WockyLLConnector:stream, object property in WockyLLConnector
WockyLLConnectorError, enum in WockyLLConnector
WockyLLContact, struct in wocky-types
WockyLLContact:jid, object property in wocky-types
WockyLLContactGetAddressesImpl, user_function in WockyLLContact
WOCKY_LL_CONNECTION_FACTORY_ERROR, macro in WockyLLConnectionFactory
wocky_ll_connection_factory_error_quark, function in WockyLLConnectionFactory
wocky_ll_connection_factory_make_connection_async, function in WockyLLConnectionFactory
wocky_ll_connection_factory_make_connection_finish, function in WockyLLConnectionFactory
wocky_ll_connection_factory_new, function in WockyLLConnectionFactory
WOCKY_LL_CONNECTOR_ERROR, macro in WockyLLConnector
wocky_ll_connector_error_quark, function in WockyLLConnector
wocky_ll_connector_finish, function in WockyLLConnector
wocky_ll_connector_incoming_async, function in WockyLLConnector
wocky_ll_connector_outgoing_async, function in WockyLLConnector
wocky_ll_contact_equal, function in WockyLLContact
wocky_ll_contact_get_addresses, function in WockyLLContact
wocky_ll_contact_get_jid, function in WockyLLContact
wocky_ll_contact_has_address, function in WockyLLContact
wocky_ll_contact_new, function in WockyLLContact
WockyLoopbackStream:input-stream, object property in WockyLoopbackStream
WockyLoopbackStream:output-stream, object property in WockyLoopbackStream
wocky_loopback_stream_new, function in WockyLoopbackStream

M

WockyMetaPorter:contact-factory, object property in WockyMetaPorter
WockyMetaPorterError, enum in WockyMetaPorter
wocky_meta_porter_borrow_connection, function in WockyMetaPorter
WOCKY_META_PORTER_ERROR, macro in WockyMetaPorter
wocky_meta_porter_error_quark, function in WockyMetaPorter
wocky_meta_porter_get_port, function in WockyMetaPorter
wocky_meta_porter_hold, function in WockyMetaPorter
wocky_meta_porter_new, function in WockyMetaPorter
wocky_meta_porter_open_async, function in WockyMetaPorter
wocky_meta_porter_open_finish, function in WockyMetaPorter
wocky_meta_porter_set_jid, function in WockyMetaPorter
wocky_meta_porter_unhold, function in WockyMetaPorter
WockyMuc::error, object signal in WockyMuc
WockyMuc::fill-presence, object signal in WockyMuc
WockyMuc::joined, object signal in WockyMuc
WockyMuc::left, object signal in WockyMuc
WockyMuc::message, object signal in WockyMuc
WockyMuc::message-error, object signal in WockyMuc
WockyMuc::nick-change, object signal in WockyMuc
WockyMuc::own-presence, object signal in WockyMuc
WockyMuc::parted, object signal in WockyMuc
WockyMuc::permissions, object signal in WockyMuc
WockyMuc::presence, object signal in WockyMuc
WockyMuc:affiliation, object property in WockyMuc
WockyMuc:category, object property in WockyMuc
WockyMuc:description, object property in WockyMuc
WockyMuc:jid, object property in WockyMuc
WockyMuc:muc-flags, object property in WockyMuc
WockyMuc:name, object property in WockyMuc
WockyMuc:nickname, object property in WockyMuc
WockyMuc:password, object property in WockyMuc
WockyMuc:porter, object property in WockyMuc
WockyMuc:reserved-nick, object property in WockyMuc
WockyMuc:role, object property in WockyMuc
WockyMuc:room, object property in WockyMuc
WockyMuc:service, object property in WockyMuc
WockyMuc:status-message, object property in WockyMuc
WockyMuc:type, object property in WockyMuc
WockyMuc:user, object property in WockyMuc
WockyMucAffiliation, enum in WockyMuc
WockyMucClass, struct in WockyMuc
WockyMucFeature, enum in WockyMuc
WockyMucMember, struct in WockyMuc
WockyMucMsgState, enum in WockyMuc
WockyMucMsgType, enum in WockyMuc
WockyMucRole, enum in WockyMuc
WockyMucState, enum in WockyMuc
WockyMucStatusCode, enum in WockyMuc
wocky_muc_affiliation, function in WockyMuc
wocky_muc_create_presence, function in WockyMuc
wocky_muc_disco_info_async, function in WockyMuc
wocky_muc_disco_info_finish, function in WockyMuc
wocky_muc_get_state, function in WockyMuc
wocky_muc_jid, function in WockyMuc
wocky_muc_join, function in WockyMuc
wocky_muc_members, function in WockyMuc
wocky_muc_role, function in WockyMuc
wocky_muc_user, function in WockyMuc

N

WockyNode, struct in WockyNode
WockyNodeBuildTag, enum in WockyNode
WockyNodeIter, struct in WockyNode
WockyNodeTree, struct in wocky-types
WockyNodeTree:top-node, object property in wocky-types
WockyNodeTreeClass, struct in WockyNodeTree
wocky_node_add_build, function in WockyNode
wocky_node_add_build_va, function in WockyNode
wocky_node_add_child, function in WockyNode
wocky_node_add_child_ns, function in WockyNode
wocky_node_add_child_ns_q, function in WockyNode
wocky_node_add_child_with_content, function in WockyNode
wocky_node_add_child_with_content_ns, function in WockyNode
wocky_node_add_child_with_content_ns_q, function in WockyNode
wocky_node_add_node_tree, function in WockyNode
wocky_node_append_content, function in WockyNode
wocky_node_append_content_n, function in WockyNode
wocky_node_attribute_ns_get_prefix_from_quark, function in WockyNode
wocky_node_attribute_ns_get_prefix_from_urn, function in WockyNode
wocky_node_attribute_ns_set_prefix, function in WockyNode
wocky_node_deinit, function in WockyNode
wocky_node_each_attribute, function in WockyNode
wocky_node_each_attr_func, user_function in WockyNode
wocky_node_each_child, function in WockyNode
wocky_node_each_child_func, user_function in WockyNode
wocky_node_equal, function in WockyNode
wocky_node_free, function in WockyNode
wocky_node_get_attribute, function in WockyNode
wocky_node_get_attribute_ns, function in WockyNode
wocky_node_get_child, function in WockyNode
wocky_node_get_child_ns, function in WockyNode
wocky_node_get_content_from_child, function in WockyNode
wocky_node_get_content_from_child_ns, function in WockyNode
wocky_node_get_first_child, function in WockyNode
wocky_node_get_first_child_ns, function in WockyNode
wocky_node_get_language, function in WockyNode
wocky_node_get_ns, function in WockyNode
wocky_node_has_ns, function in WockyNode
wocky_node_has_ns_q, function in WockyNode
wocky_node_init, function in WockyNode
wocky_node_is_superset, function in WockyNode
wocky_node_iter_init, function in WockyNode
wocky_node_iter_next, function in WockyNode
wocky_node_iter_remove, function in WockyNode
wocky_node_matches, function in WockyNode
wocky_node_matches_q, function in WockyNode
wocky_node_new, function in WockyNode
wocky_node_prepend_node_tree, function in WockyNode
wocky_node_set_attribute, function in WockyNode
wocky_node_set_attributes, function in WockyNode
wocky_node_set_attribute_n, function in WockyNode
wocky_node_set_attribute_ns, function in WockyNode
wocky_node_set_attribute_n_ns, function in WockyNode
wocky_node_set_content, function in WockyNode
wocky_node_set_language, function in WockyNode
wocky_node_set_language_n, function in WockyNode
wocky_node_to_string, function in WockyNode
wocky_node_tree_get_top_node, function in WockyNodeTree
wocky_node_tree_new, function in WockyNodeTree
wocky_node_tree_new_from_node, function in WockyNodeTree
wocky_node_tree_new_va, function in WockyNodeTree
wocky_normalise_jid, function in wocky-utils
WOCKY_NS_CHATSTATE, macro in wocky-namespaces
WOCKY_NS_DISCO_INFO, macro in wocky-namespaces
WOCKY_NS_DISCO_ITEMS, macro in wocky-namespaces
WOCKY_NS_GOOGLE_SESSION_PHONE, macro in wocky-namespaces
WOCKY_NS_GOOGLE_SESSION_VIDEO, macro in wocky-namespaces
WOCKY_NS_MUC, macro in wocky-namespaces
WOCKY_NS_MUC_ADMIN, macro in wocky-namespaces
WOCKY_NS_MUC_OWNER, macro in wocky-namespaces
WOCKY_NS_MUC_UNIQUE, macro in wocky-namespaces
WOCKY_NS_MUC_USER, macro in wocky-namespaces
WOCKY_NS_VCARD_TEMP, macro in wocky-namespaces
WOCKY_NS_VCARD_TEMP_UPDATE, macro in wocky-namespaces
WOCKY_N_JINGLE_RELAY_TYPES, macro in WockyJingleInfo

P

WockyPepService, struct in WockyPepService
WockyPepService::changed, object signal in WockyPepService
WockyPepService:node, object property in WockyPepService
WockyPepService:subscribe, object property in WockyPepService
WockyPepServiceClass, struct in WockyPepService
wocky_pep_service_get_async, function in WockyPepService
wocky_pep_service_get_finish, function in WockyPepService
wocky_pep_service_make_publish_stanza, function in WockyPepService
wocky_pep_service_new, function in WockyPepService
wocky_pep_service_start, function in WockyPepService
WockyPing:ping-interval, object property in WockyPing
WockyPing:porter, object property in WockyPing
WockyPingClass, struct in WockyPing
wocky_ping_error_quark, function in WockyPing
wocky_ping_new, function in WockyPing
WockyPorter::closing, object signal in WockyPorter
WockyPorter::remote-closed, object signal in WockyPorter
WockyPorter::remote-error, object signal in WockyPorter
WockyPorter::sending, object signal in WockyPorter
WockyPorter:bare-jid, object property in WockyPorter
WockyPorter:connection, object property in WockyPorter
WockyPorter:full-jid, object property in WockyPorter
WockyPorter:resource, object property in WockyPorter
WockyPorterError, enum in WockyPorter
WockyPorterHandlerFunc, user_function in WockyPorter
WockyPorterInterface, struct in WockyPorter
wocky_porter_acknowledge_iq, function in WockyPorter
wocky_porter_close_async, function in WockyPorter
wocky_porter_close_finish, function in WockyPorter
WOCKY_PORTER_ERROR, macro in WockyPorter
wocky_porter_error_quark, function in WockyPorter
wocky_porter_force_close_async, function in WockyPorter
wocky_porter_force_close_finish, function in WockyPorter
wocky_porter_get_bare_jid, function in WockyPorter
wocky_porter_get_full_jid, function in WockyPorter
wocky_porter_get_resource, function in WockyPorter
WOCKY_PORTER_HANDLER_PRIORITY_MAX, macro in WockyPorter
WOCKY_PORTER_HANDLER_PRIORITY_MIN, macro in WockyPorter
WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, macro in WockyPorter
wocky_porter_register_handler_from, function in WockyPorter
wocky_porter_register_handler_from_anyone, function in WockyPorter
wocky_porter_register_handler_from_anyone_by_stanza, function in WockyPorter
wocky_porter_register_handler_from_anyone_va, function in WockyPorter
wocky_porter_register_handler_from_by_stanza, function in WockyPorter
wocky_porter_register_handler_from_va, function in WockyPorter
wocky_porter_send, function in WockyPorter
wocky_porter_send_async, function in WockyPorter
wocky_porter_send_finish, function in WockyPorter
wocky_porter_send_iq_async, function in WockyPorter
wocky_porter_send_iq_error, function in WockyPorter
wocky_porter_send_iq_finish, function in WockyPorter
wocky_porter_send_iq_gerror, function in WockyPorter
wocky_porter_start, function in WockyPorter
wocky_porter_unregister_handler, function in WockyPorter
WockyPubsubAffiliationState, enum in WockyPubsubNode
WockyPubsubNode, struct in wocky-types
WockyPubsubNode::deleted, object signal in wocky-types
WockyPubsubNode::event-received, object signal in wocky-types
WockyPubsubNode::subscription-state-changed, object signal in wocky-types
WockyPubsubNode:name, object property in wocky-types
WockyPubsubNode:service, object property in wocky-types
WockyPubsubNodeClass, struct in WockyPubsubNode
WockyPubsubNodeEventHandler, user_function in wocky-pubsub-node-internal
WockyPubsubNodeEventMapping, struct in wocky-pubsub-node-internal
WockyPubsubService::event-received, object signal in WockyPubsubService
WockyPubsubService::node-deleted, object signal in WockyPubsubService
WockyPubsubService::subscription-state-changed, object signal in WockyPubsubService
WockyPubsubService:jid, object property in WockyPubsubService
WockyPubsubService:session, object property in WockyPubsubService
WockyPubsubServiceError, enum in WockyPubsubService
WockyPubsubSubscriptionState, enum in WockyPubsubService
wocky_pubsub_affiliation_copy, function in WockyPubsubNode
wocky_pubsub_affiliation_free, function in WockyPubsubNode
wocky_pubsub_affiliation_list_copy, function in WockyPubsubNode
wocky_pubsub_affiliation_list_free, function in WockyPubsubNode
wocky_pubsub_affiliation_new, function in WockyPubsubNode
wocky_pubsub_distill_ambivalent_iq_reply, function in wocky-pubsub-helpers
wocky_pubsub_distill_iq_reply, function in wocky-pubsub-helpers
wocky_pubsub_distill_stanza, function in wocky-pubsub-helpers
wocky_pubsub_distill_void_iq_reply, function in wocky-pubsub-helpers
wocky_pubsub_make_event_stanza, function in wocky-pubsub-helpers
wocky_pubsub_make_publish_stanza, function in wocky-pubsub-helpers
wocky_pubsub_make_stanza, function in wocky-pubsub-helpers
wocky_pubsub_node_delete_async, function in WockyPubsubNode
wocky_pubsub_node_delete_finish, function in WockyPubsubNode
wocky_pubsub_node_get_configuration_async, function in WockyPubsubNode
wocky_pubsub_node_get_configuration_finish, function in WockyPubsubNode
wocky_pubsub_node_get_name, function in WockyPubsubNode
wocky_pubsub_node_get_porter, function in wocky-pubsub-node-protected
wocky_pubsub_node_list_affiliates_async, function in WockyPubsubNode
wocky_pubsub_node_list_affiliates_finish, function in WockyPubsubNode
wocky_pubsub_node_list_subscribers_async, function in WockyPubsubNode
wocky_pubsub_node_list_subscribers_finish, function in WockyPubsubNode
wocky_pubsub_node_make_delete_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_get_configuration_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_list_affiliates_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_list_subscribers_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_modify_affiliates_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_publish_stanza, function in WockyPubsubNode
wocky_pubsub_node_make_subscribe_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_make_unsubscribe_stanza, function in wocky-pubsub-node-protected
wocky_pubsub_node_modify_affiliates_async, function in WockyPubsubNode
wocky_pubsub_node_modify_affiliates_finish, function in WockyPubsubNode
wocky_pubsub_node_parse_affiliations, function in wocky-pubsub-node-protected
wocky_pubsub_node_subscribe_async, function in WockyPubsubNode
wocky_pubsub_node_subscribe_finish, function in WockyPubsubNode
wocky_pubsub_node_unsubscribe_async, function in WockyPubsubNode
wocky_pubsub_node_unsubscribe_finish, function in WockyPubsubNode
wocky_pubsub_service_create_create_node_stanza, function in wocky-pubsub-service-protected
wocky_pubsub_service_create_node_async, function in WockyPubsubService
wocky_pubsub_service_create_node_finish, function in WockyPubsubService
wocky_pubsub_service_create_retrieve_subscriptions_stanza, function in wocky-pubsub-service-protected
wocky_pubsub_service_ensure_node, function in WockyPubsubService
WOCKY_PUBSUB_SERVICE_ERROR, macro in WockyPubsubService
wocky_pubsub_service_error_quark, function in WockyPubsubService
wocky_pubsub_service_get_default_node_configuration_async, function in WockyPubsubService
wocky_pubsub_service_get_default_node_configuration_finish, function in WockyPubsubService
wocky_pubsub_service_get_porter, function in wocky-pubsub-service-protected
wocky_pubsub_service_handle_create_node_reply, function in wocky-pubsub-service-protected
wocky_pubsub_service_lookup_node, function in WockyPubsubService
wocky_pubsub_service_new, function in WockyPubsubService
wocky_pubsub_service_parse_subscription, function in wocky-pubsub-service-protected
wocky_pubsub_service_parse_subscriptions, function in wocky-pubsub-service-protected
wocky_pubsub_service_retrieve_subscriptions_async, function in WockyPubsubService
wocky_pubsub_service_retrieve_subscriptions_finish, function in WockyPubsubService
wocky_pubsub_subscription_copy, function in WockyPubsubService
wocky_pubsub_subscription_free, function in WockyPubsubService
wocky_pubsub_subscription_list_copy, function in WockyPubsubService
wocky_pubsub_subscription_list_free, function in WockyPubsubService
wocky_pubsub_subscription_new, function in WockyPubsubService

Q

WOCKY_QUIRK_ANDROID_GTALK_CLIENT, macro in wocky-namespaces
WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT, macro in wocky-namespaces
WOCKY_QUIRK_OMITS_CONTENT_CREATORS, macro in wocky-namespaces

R

WockyResourceContact, struct in wocky-types
WockyResourceContact:bare-contact, object property in wocky-types
WockyResourceContact:resource, object property in wocky-types
WockyResourceContactClass, struct in WockyResourceContact
wocky_resource_contact_equal, function in WockyResourceContact
wocky_resource_contact_get_bare_contact, function in WockyResourceContact
wocky_resource_contact_get_resource, function in WockyResourceContact
wocky_resource_contact_new, function in WockyResourceContact
WockyRoster::added, object signal in WockyRoster
WockyRoster::removed, object signal in WockyRoster
WockyRoster:session, object property in WockyRoster
WockyRosterClass, struct in WockyRoster
WockyRosterError, enum in WockyRoster
WockyRosterSubscriptionFlags, enum in WockyRoster
wocky_roster_add_contact_async, function in WockyRoster
wocky_roster_add_contact_finish, function in WockyRoster
wocky_roster_change_contact_name_async, function in WockyRoster
wocky_roster_change_contact_name_finish, function in WockyRoster
wocky_roster_contact_add_group_async, function in WockyRoster
wocky_roster_contact_add_group_finish, function in WockyRoster
wocky_roster_contact_remove_group_async, function in WockyRoster
wocky_roster_contact_remove_group_finish, function in WockyRoster
WOCKY_ROSTER_ERROR, macro in WockyRoster
wocky_roster_error_quark, function in WockyRoster
wocky_roster_fetch_roster_async, function in WockyRoster
wocky_roster_fetch_roster_finish, function in WockyRoster
wocky_roster_get_all_contacts, function in WockyRoster
wocky_roster_get_contact, function in WockyRoster
wocky_roster_new, function in WockyRoster
wocky_roster_remove_contact_async, function in WockyRoster
wocky_roster_remove_contact_finish, function in WockyRoster
wocky_roster_subscription_to_string, function in WockyRoster

S

WockySaslAuth:auth-registry, object property in WockySaslAuth
WockySaslAuth:connection, object property in WockySaslAuth
WockySaslAuth:password, object property in WockySaslAuth
WockySaslAuth:server, object property in WockySaslAuth
WockySaslAuth:username, object property in WockySaslAuth
WockySaslAuthClass, struct in WockySaslAuth
wocky_sasl_auth_add_handler, function in WockySaslAuth
wocky_sasl_auth_authenticate_async, function in WockySaslAuth
wocky_sasl_auth_authenticate_finish, function in WockySaslAuth
wocky_sasl_auth_new, function in WockySaslAuth
sasl_calculate_hmac_sha1, function in wocky-sasl-utils
wocky_sasl_digest_md5_new, function in wocky-sasl-digest-md5
sasl_generate_base64_nonce, function in wocky-sasl-utils
wocky_sasl_plain_new, function in wocky-sasl-plain
wocky_sasl_scram_new, function in wocky-sasl-scram
wocky_send_ll_pep_event, function in wocky-pubsub-helpers
WockySession, struct in wocky-types
WockySession:connection, object property in wocky-types
WockySession:contact-factory, object property in wocky-types
WockySession:full-jid, object property in wocky-types
WockySession:porter, object property in wocky-types
WockySessionClass, struct in WockySession
wocky_session_get_contact_factory, function in WockySession
wocky_session_get_jid, function in WockySession
wocky_session_get_porter, function in WockySession
wocky_session_new_ll, function in WockySession
wocky_session_new_with_connection, function in WockySession
wocky_session_set_jid, function in WockySession
wocky_session_start, function in WockySession
WOCKY_SHA1_BLOCK_SIZE, macro in wocky-sasl-utils
WOCKY_SHA1_DIGEST_SIZE, macro in wocky-sasl-utils
WockySIError, enum in wocky-xmpp-error
WOCKY_SI_ERROR, macro in wocky-xmpp-error
wocky_si_error_quark, function in wocky-xmpp-error
WockyStanzaClass, struct in WockyStanza
WockyStanzaSubType, enum in WockyStanza
WockyStanzaType, enum in WockyStanza
wocky_stanza_build, function in WockyStanza
wocky_stanza_build_iq_error, function in WockyStanza
wocky_stanza_build_iq_error_va, function in WockyStanza
wocky_stanza_build_iq_result, function in WockyStanza
wocky_stanza_build_iq_result_va, function in WockyStanza
wocky_stanza_build_to_contact, function in WockyStanza
wocky_stanza_build_va, function in WockyStanza
wocky_stanza_copy, function in WockyStanza
wocky_stanza_error_to_node, function in wocky-xmpp-error
wocky_stanza_extract_errors, function in WockyStanza
wocky_stanza_extract_stream_error, function in WockyStanza
wocky_stanza_get_from, function in WockyStanza
wocky_stanza_get_from_contact, function in WockyStanza
wocky_stanza_get_to, function in WockyStanza
wocky_stanza_get_top_node, function in WockyStanza
wocky_stanza_get_to_contact, function in WockyStanza
wocky_stanza_get_type_info, function in WockyStanza
wocky_stanza_has_type, function in WockyStanza
wocky_stanza_new, function in WockyStanza
wocky_stanza_set_from_contact, function in WockyStanza
wocky_stanza_set_to_contact, function in WockyStanza
wocky_strdiff, function in wocky-utils
WockyStunServer, struct in WockyJingleInfo
WockyStunServerSource, enum in wocky-jingle-info-internal

T

WOCKY_TELEPATHY_NS_CAPS, macro in wocky-namespaces
WOCKY_TELEPATHY_NS_CLIQUE, macro in wocky-namespaces
WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS, macro in wocky-namespaces
WOCKY_TELEPATHY_NS_TUBES, macro in wocky-namespaces
WockyTLSCertStatus, enum in Wocky OpenSSL TLS
WockyTLSCertType, enum in Wocky OpenSSL TLS
WockyTLSConnection:session, object property in Wocky OpenSSL TLS
WockyTLSConnector:tls-handler, object property in WockyTLSConnector
WockyTLSConnectorClass, struct in WockyTLSConnector
WockyTLSHandler:ignore-ssl-errors, object property in WockyTLSHandler
WockyTLSHandlerClass, struct in WockyTLSHandler
WockyTLSHandlerVerifyAsyncFunc, user_function in WockyTLSHandler
WockyTLSHandlerVerifyFinishFunc, user_function in WockyTLSHandler
WockyTLSSession:base-stream, object property in Wocky OpenSSL TLS
WockyTLSSession:dh-bits, object property in Wocky OpenSSL TLS
WockyTLSSession:server, object property in Wocky OpenSSL TLS
WockyTLSSession:x509-cert, object property in Wocky OpenSSL TLS
WockyTLSSession:x509-key, object property in Wocky OpenSSL TLS
WockyTLSVerificationLevel, enum in Wocky OpenSSL TLS
WOCKY_TLS_CERT_ERROR, macro in Wocky OpenSSL TLS
wocky_tls_cert_error_quark, function in Wocky OpenSSL TLS
wocky_tls_connector_new, function in WockyTLSConnector
wocky_tls_connector_secure_async, function in WockyTLSConnector
wocky_tls_connector_secure_finish, function in WockyTLSConnector
WOCKY_TLS_ERROR, macro in Wocky OpenSSL TLS
wocky_tls_error_quark, function in Wocky OpenSSL TLS
wocky_tls_handler_add_ca, function in WockyTLSHandler
wocky_tls_handler_add_crl, function in WockyTLSHandler
wocky_tls_handler_forget_cas, function in WockyTLSHandler
wocky_tls_handler_get_cas, function in WockyTLSHandler
wocky_tls_handler_get_crl, function in WockyTLSHandler
wocky_tls_handler_new, function in WockyTLSHandler
wocky_tls_handler_verify_async, function in WockyTLSHandler
wocky_tls_handler_verify_finish, function in WockyTLSHandler
wocky_tls_session_add_ca, function in Wocky OpenSSL TLS
wocky_tls_session_add_crl, function in Wocky OpenSSL TLS
wocky_tls_session_get_peers_certificate, function in Wocky OpenSSL TLS
wocky_tls_session_handshake, function in Wocky OpenSSL TLS
wocky_tls_session_handshake_async, function in Wocky OpenSSL TLS
wocky_tls_session_handshake_finish, function in Wocky OpenSSL TLS
wocky_tls_session_new, function in Wocky OpenSSL TLS
wocky_tls_session_server_new, function in Wocky OpenSSL TLS
wocky_tls_session_verify_peer, function in Wocky OpenSSL TLS

W

WOCKY_W3C_NS_XHTML, macro in wocky-namespaces

X

WockyXep0115Capabilities::capabilities-changed, object signal in WockyXep0115Capabilities
WockyXep0115CapabilitiesGetDataFormsFunc, user_function in WockyXep0115Capabilities
WockyXep0115CapabilitiesHasFeatureFunc, user_function in WockyXep0115Capabilities
WockyXep0115CapabilitiesInterface, struct in WockyXep0115Capabilities
WOCKY_XEP77_NS_REGISTER, macro in wocky-namespaces
wocky_xep_0115_capabilities_get_data_forms, function in WockyXep0115Capabilities
wocky_xep_0115_capabilities_has_feature, function in WockyXep0115Capabilities
WockyXmppConnection:base-stream, object property in WockyXmppConnection
WockyXmppConnectionClass, struct in WockyXmppConnection
WockyXmppConnectionError, enum in WockyXmppConnection
WockyXmppError, enum in wocky-xmpp-error
WockyXmppErrorDomain, struct in wocky-xmpp-error
WockyXmppErrorSpecialization, struct in wocky-xmpp-error
WockyXmppErrorType, enum in wocky-xmpp-error
WockyXmppReader:default-namespace, object property in WockyXmppReader
WockyXmppReader:from, object property in WockyXmppReader
WockyXmppReader:id, object property in WockyXmppReader
WockyXmppReader:lang, object property in WockyXmppReader
WockyXmppReader:streaming-mode, object property in WockyXmppReader
WockyXmppReader:to, object property in WockyXmppReader
WockyXmppReader:version, object property in WockyXmppReader
WockyXmppReaderClass, struct in WockyXmppReader
WockyXmppReaderError, enum in WockyXmppReader
WockyXmppReaderState, enum in WockyXmppReader
WockyXmppStreamError, enum in wocky-xmpp-error
WockyXmppWriter:streaming-mode, object property in WockyXmppWriter
WockyXmppWriterClass, struct in WockyXmppWriter
WOCKY_XMPP_CONNECTION_ERROR, macro in WockyXmppConnection
wocky_xmpp_connection_error_quark, function in WockyXmppConnection
wocky_xmpp_connection_force_close_async, function in WockyXmppConnection
wocky_xmpp_connection_force_close_finish, function in WockyXmppConnection
wocky_xmpp_connection_new, function in WockyXmppConnection
wocky_xmpp_connection_new_id, function in WockyXmppConnection
wocky_xmpp_connection_recv_open_async, function in WockyXmppConnection
wocky_xmpp_connection_recv_open_finish, function in WockyXmppConnection
wocky_xmpp_connection_recv_stanza_async, function in WockyXmppConnection
wocky_xmpp_connection_recv_stanza_finish, function in WockyXmppConnection
wocky_xmpp_connection_reset, function in WockyXmppConnection
wocky_xmpp_connection_send_close_async, function in WockyXmppConnection
wocky_xmpp_connection_send_close_finish, function in WockyXmppConnection
wocky_xmpp_connection_send_open_async, function in WockyXmppConnection
wocky_xmpp_connection_send_open_finish, function in WockyXmppConnection
wocky_xmpp_connection_send_stanza_async, function in WockyXmppConnection
wocky_xmpp_connection_send_stanza_finish, function in WockyXmppConnection
wocky_xmpp_connection_send_whitespace_ping_async, function in WockyXmppConnection
wocky_xmpp_connection_send_whitespace_ping_finish, function in WockyXmppConnection
WOCKY_XMPP_ERROR, macro in wocky-xmpp-error
wocky_xmpp_error_deinit, function in wocky-xmpp-error
wocky_xmpp_error_description, function in wocky-xmpp-error
wocky_xmpp_error_extract, function in wocky-xmpp-error
wocky_xmpp_error_init, function in wocky-xmpp-error
wocky_xmpp_error_quark, function in wocky-xmpp-error
wocky_xmpp_error_register_domain, function in wocky-xmpp-error
wocky_xmpp_error_string, function in wocky-xmpp-error
WOCKY_XMPP_NS_AMP, macro in wocky-namespaces
WOCKY_XMPP_NS_BIND, macro in wocky-namespaces
WOCKY_XMPP_NS_DATA, macro in wocky-namespaces
WOCKY_XMPP_NS_DELAY, macro in wocky-namespaces
WOCKY_XMPP_NS_EVENT, macro in wocky-namespaces
WOCKY_XMPP_NS_FEATURENEG, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_JINGLE_INFO, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_SESSION, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_SESSION_SHARE, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO, macro in wocky-namespaces
WOCKY_XMPP_NS_GOOGLE_TRANSPORT_P2P, macro in wocky-namespaces
WOCKY_XMPP_NS_IBB, macro in wocky-namespaces
WOCKY_XMPP_NS_IQ_OOB, macro in wocky-namespaces
WOCKY_XMPP_NS_JABBER_CLIENT, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE015, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_DESCRIPTION_AUDIO, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_DESCRIPTION_VIDEO, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_ERRORS, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTCP_FB, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP_AUDIO, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP_ERRORS, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP_HDREXT, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP_INFO, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_RTP_VIDEO, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_TRANSPORT_ICEUDP, macro in wocky-namespaces
WOCKY_XMPP_NS_JINGLE_TRANSPORT_RAWUDP, macro in wocky-namespaces
WOCKY_XMPP_NS_PING, macro in wocky-namespaces
WOCKY_XMPP_NS_PUBSUB, macro in wocky-namespaces
WOCKY_XMPP_NS_PUBSUB_ERRORS, macro in wocky-namespaces
WOCKY_XMPP_NS_PUBSUB_EVENT, macro in wocky-namespaces
WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG, macro in wocky-namespaces
WOCKY_XMPP_NS_PUBSUB_OWNER, macro in wocky-namespaces
WOCKY_XMPP_NS_ROSTER, macro in wocky-namespaces
WOCKY_XMPP_NS_SASL_AUTH, macro in wocky-namespaces
WOCKY_XMPP_NS_SESSION, macro in wocky-namespaces
WOCKY_XMPP_NS_SI, macro in wocky-namespaces
WOCKY_XMPP_NS_STANZAS, macro in wocky-namespaces
WOCKY_XMPP_NS_STREAM, macro in wocky-namespaces
WOCKY_XMPP_NS_STREAMS, macro in wocky-namespaces
WOCKY_XMPP_NS_TLS, macro in wocky-namespaces
WOCKY_XMPP_NS_XHTML_IM, macro in wocky-namespaces
WOCKY_XMPP_NS_X_OOB, macro in wocky-namespaces
WOCKY_XMPP_READER_ERROR, macro in WockyXmppReader
wocky_xmpp_reader_error_quark, function in WockyXmppReader
wocky_xmpp_reader_get_error, function in WockyXmppReader
wocky_xmpp_reader_get_state, function in WockyXmppReader
wocky_xmpp_reader_new, function in WockyXmppReader
wocky_xmpp_reader_new_no_stream, function in WockyXmppReader
wocky_xmpp_reader_new_no_stream_ns, function in WockyXmppReader
wocky_xmpp_reader_peek_stanza, function in WockyXmppReader
wocky_xmpp_reader_pop_stanza, function in WockyXmppReader
wocky_xmpp_reader_push, function in WockyXmppReader
wocky_xmpp_reader_reset, function in WockyXmppReader
wocky_xmpp_stanza_error_to_string, function in wocky-xmpp-error
WOCKY_XMPP_STREAM_ERROR, macro in wocky-xmpp-error
wocky_xmpp_stream_error_from_node, function in wocky-xmpp-error
wocky_xmpp_stream_error_quark, function in wocky-xmpp-error
wocky_xmpp_writer_flush, function in WockyXmppWriter
wocky_xmpp_writer_new, function in WockyXmppWriter
wocky_xmpp_writer_new_no_stream, function in WockyXmppWriter
wocky_xmpp_writer_stream_close, function in WockyXmppWriter
wocky_xmpp_writer_stream_open, function in WockyXmppWriter
wocky_xmpp_writer_write_node_tree, function in WockyXmppWriter
wocky_xmpp_writer_write_stanza, function in WockyXmppWriter
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleSession.html0000644000175000017500000016166613012562226031121 0ustar00gkiagiagkiagia00000000000000 WockyJingleSession: Wocky Reference Manual

WockyJingleSession

WockyJingleSession

Properties

guint dialect Read / Write
WockyJingleFactory * jingle-factory Read / Write / Construct Only
gboolean local-hold Read / Write
gboolean local-initiator Read / Write / Construct Only
WockyContact * peer-contact Read / Write / Construct Only
WockyPorter * porter Read / Write / Construct Only
gboolean remote-hold Read
gboolean remote-ringing Read
gchar * session-id Read / Write / Construct Only
guint state Read / Write

Object Hierarchy

    GObject
    ╰── WockyJingleSession

Description

Functions

wocky_jingle_session_new ()

WockyJingleSession *
wocky_jingle_session_new (WockyJingleFactory *factory,
                          WockyPorter *porter,
                          const gchar *session_id,
                          gboolean local_initiator,
                          WockyContact *peer,
                          WockyJingleDialect dialect,
                          gboolean local_hold);

wocky_jingle_session_detect ()

const gchar *
wocky_jingle_session_detect (WockyStanza *stanza,
                             WockyJingleAction *action,
                             WockyJingleDialect *dialect);

wocky_jingle_session_parse ()

gboolean
wocky_jingle_session_parse (WockyJingleSession *sess,
                            WockyJingleAction action,
                            WockyStanza *stanza,
                            GError **error);

wocky_jingle_session_new_message ()

WockyStanza *
wocky_jingle_session_new_message (WockyJingleSession *sess,
                                  WockyJingleAction action,
                                  WockyNode **sess_node);

wocky_jingle_session_accept ()

void
wocky_jingle_session_accept (WockyJingleSession *sess);

For incoming calls, accepts the call. For outgoing calls, indicates that the initial contents for the call have been created and the offer can be sent to the peer.

The acceptance or offer will only be signalled to the peer once all contents are ready (as returned by wocky_jingle_content_is_ready()). For an RTP session with WockyJingleMediaRtp contents, this translates to a media description and transport candidates having been provided to all contents.

Parameters

sess

the session.

 

wocky_jingle_session_terminate ()

gboolean
wocky_jingle_session_terminate (WockyJingleSession *sess,
                                WockyJingleReason reason,
                                const gchar *text,
                                GError **error);

Ends a session.

If called for an outgoing session which has not yet been signalled to the peer (perhaps because wocky_jingle_session_accept() has not been called, or codecs or candidates have not been provided), the session will quietly terminate without the peer hearing anything about it.

If called for an already-terminated session, this is a no-op.

Parameters

sess

the session

 

reason

the reason the session should be terminated

 

text

human-readable information about why the session terminated.

[allow-none]

error

Unused, because this function never fails.

 

Returns

TRUE.


wocky_jingle_session_remove_content ()

void
wocky_jingle_session_remove_content (WockyJingleSession *sess,
                                     WockyJingleContent *c);

wocky_jingle_session_add_content ()

WockyJingleContent *
wocky_jingle_session_add_content (WockyJingleSession *sess,
                                  WockyJingleMediaType mtype,
                                  WockyJingleContentSenders senders,
                                  const char *name,
                                  const gchar *content_ns,
                                  const gchar *transport_ns);

Adds a content to the session. Once it has its codecs and transport candidates filled in, it will be signalled to the peer (either as part of the session-initiate, if it has not been sent yet, or as a content-add if sess has already been initiated).

Legal values for content_ns and transport_ns depend on the Jingle dialect in use for this session (and in some cases on mtype ); sensible values depend on the peer's capabilities.

Parameters

sess

the session

 

mtype

what kind of media will be exchanged on the content

 

senders

which directions media should initially flow in.

 

name

a descriptive name to use for the content; this is typically not shown to users.

[allow-none]

content_ns

the namespace to use for the content's description

 

transport_ns

the namespace of the media transport to use for the call

 

Returns

the new content, which is guaranteed not to be NULL.

[transfer none]


wocky_jingle_session_get_content_type ()

GType
wocky_jingle_session_get_content_type (WockyJingleSession *Param1);

wocky_jingle_session_get_contents ()

GList *
wocky_jingle_session_get_contents (WockyJingleSession *sess);

wocky_jingle_session_get_peer_resource ()

const gchar *
wocky_jingle_session_get_peer_resource
                               (WockyJingleSession *sess);

wocky_jingle_session_get_initiator ()

const gchar *
wocky_jingle_session_get_initiator (WockyJingleSession *sess);

wocky_jingle_session_get_sid ()

const gchar *
wocky_jingle_session_get_sid (WockyJingleSession *sess);

wocky_jingle_session_get_dialect ()

WockyJingleDialect
wocky_jingle_session_get_dialect (WockyJingleSession *sess);

wocky_jingle_session_can_modify_contents ()

gboolean
wocky_jingle_session_can_modify_contents
                               (WockyJingleSession *sess);

wocky_jingle_session_peer_has_cap ()

gboolean
wocky_jingle_session_peer_has_cap (WockyJingleSession *self,
                                   const gchar *cap_or_quirk);

wocky_jingle_session_send ()

void
wocky_jingle_session_send (WockyJingleSession *sess,
                           WockyStanza *stanza);

A shorthand for sending a Jingle IQ without waiting for the reply.

Parameters

sess

a session

 

stanza

a stanza, of which this function will take ownership.

[transfer full]

wocky_jingle_session_set_local_hold ()

void
wocky_jingle_session_set_local_hold (WockyJingleSession *sess,
                                     gboolean held);

wocky_jingle_session_get_remote_hold ()

gboolean
wocky_jingle_session_get_remote_hold (WockyJingleSession *sess);

wocky_jingle_session_get_remote_ringing ()

gboolean
wocky_jingle_session_get_remote_ringing
                               (WockyJingleSession *sess);

wocky_jingle_session_defines_action ()

gboolean
wocky_jingle_session_defines_action (WockyJingleSession *sess,
                                     WockyJingleAction action);

wocky_jingle_session_get_peer_contact ()

WockyContact *
wocky_jingle_session_get_peer_contact (WockyJingleSession *self);

wocky_jingle_session_get_peer_jid ()

const gchar *
wocky_jingle_session_get_peer_jid (WockyJingleSession *sess);

wocky_jingle_session_get_reason_name ()

const gchar *
wocky_jingle_session_get_reason_name (WockyJingleReason reason);

wocky_jingle_session_get_factory ()

WockyJingleFactory *
wocky_jingle_session_get_factory (WockyJingleSession *self);

wocky_jingle_session_get_porter ()

WockyPorter *
wocky_jingle_session_get_porter (WockyJingleSession *self);

wocky_jingle_session_acknowledge_iq ()

void
wocky_jingle_session_acknowledge_iq (WockyJingleSession *self,
                                     WockyStanza *stanza);

Types and Values

Property Details

The “dialect” property

  “dialect”                  guint

Jingle dialect used for this session.

Flags: Read / Write

Default value: 0


The “jingle-factory” property

  “jingle-factory”           WockyJingleFactory *

The Jingle factory which created this session.

Flags: Read / Write / Construct Only


The “local-hold” property

  “local-hold”               gboolean

TRUE if we've placed the peer on hold.

Flags: Read / Write

Default value: FALSE


The “local-initiator” property

  “local-initiator”          gboolean

Specifies if local end initiated the session.

Flags: Read / Write / Construct Only

Default value: TRUE


The “peer-contact” property

  “peer-contact”             WockyContact *

The WockyContact representing the other party in the session. Note that if this is a WockyBareContact (as opposed to a WockyResourceContact) the session is with the contact's bare JID.

Flags: Read / Write / Construct Only


The “porter” property

  “porter”                   WockyPorter *

The WockyPorter for the current connection.

Flags: Read / Write / Construct Only


The “remote-hold” property

  “remote-hold”              gboolean

TRUE if the peer has placed us on hold.

Flags: Read

Default value: FALSE


The “remote-ringing” property

  “remote-ringing”           gboolean

TRUE if the peer's client is ringing.

Flags: Read

Default value: FALSE


The “session-id” property

  “session-id”               gchar *

A unique session identifier used throughout all communication.

Flags: Read / Write / Construct Only

Default value: NULL


The “state” property

  “state”                    guint

The current state that the session is in.

Flags: Read / Write

Default value: 0

Signal Details

The “about-to-initiate” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               gpointer            user_data)

Flags: Run Last


The “content-rejected” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               GObject            *arg1,
               guint               arg2,
               gchar              *arg3,
               gpointer            user_data)

Flags: Run Last


The “new-content” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               GObject            *arg1,
               gpointer            user_data)

Flags: Run Last


The “query-cap” signal

gboolean
user_function (WockyJingleSession *wockyjinglesession,
               WockyContact       *arg1,
               gchar              *arg2,
               gpointer            user_data)

Flags: Run Last


The “remote-state-changed” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               gpointer            user_data)

Flags: Run Last


The “terminated” signal

void
user_function (WockyJingleSession *session,
               gboolean            locally_terminated,
               guint               reason,
               gchar              *text,
               gpointer            user_data)

Emitted when the session ends, just after “state” moves to WOCKY_JINGLE_STATE_ENDED.

Parameters

session

the session

 

locally_terminated

TRUE if the session ended due to a call to wocky_jingle_session_terminate(); FALSE if the peer ended the session.

 

reason

a WockyJingleReason describing why the session terminated

 

text

a possibly-NULL human-readable string describing why the session terminated

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/right-insensitive.png0000644000175000017500000000056513012562226030611 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME ^IDAT8͒J` /S_$AqrW(>m"]\(49.Nd39{eM#MSIιEiHz|3{̲l3,KkV'@EEQlwyiq]Kh4:mĦ,;ts\aR5/7'Wps׭I,K1=0j0Wg> PU𻤝0 ]?qCҫιg~kA_IENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-digest-md5.html0000644000175000017500000000734513012562226032507 0ustar00gkiagiagkiagia00000000000000 wocky-sasl-digest-md5: Wocky Reference Manual

wocky-sasl-digest-md5

wocky-sasl-digest-md5

Functions

WockySaslDigestMd5 * wocky_sasl_digest_md5_new ()

Description

Functions

wocky_sasl_digest_md5_new ()

WockySaslDigestMd5 *
wocky_sasl_digest_md5_new (const gchar *server,
                           const gchar *username,
                           const gchar *password);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyStanza.html0000644000175000017500000013147413012562226027577 0ustar00gkiagiagkiagia00000000000000 WockyStanza: Wocky Reference Manual

WockyStanza

WockyStanza

Types and Values

Object Hierarchy

    GObject
    ╰── WockyNodeTree
        ╰── WockyStanza

Description

Functions

wocky_stanza_new ()

WockyStanza *
wocky_stanza_new (const gchar *name,
                  const gchar *ns);

wocky_stanza_copy ()

WockyStanza *
wocky_stanza_copy (WockyStanza *old);

wocky_stanza_get_top_node ()

WockyNode *
wocky_stanza_get_top_node (WockyStanza *self);

Parameters

self

a stanza

 

Returns

A pointer to the topmost node of the stanza


wocky_stanza_build ()

WockyStanza *
wocky_stanza_build (WockyStanzaType type,
                    WockyStanzaSubType sub_type,
                    const gchar *from,
                    const gchar *to,
                    ...);

Build a XMPP stanza from a list of arguments. For example, the following invocation:

wocky_stanza_build (
   WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
   "alice@<!-- -->collabora.co.uk", "bob@<!-- -->collabora.co.uk",
   WOCKY_NODE_START, "html",
     WOCKY_NODE_XMLNS, "http://www.w3.org/1999/xhtml",
     WOCKY_NODE, "body",
       WOCKY_NODE_ATTRIBUTE, "textcolor", "red",
       WOCKY_NODE_TEXT, "Telepathy rocks!",
     WOCKY_NODE_END,
   WOCKY_NODE_END,
  NULL);

produces this stanza:

<message from='alice@<!-- -->collabora.co.uk' to='bob@<!-- -->collabora.co.uk'>
  <html xmlns='http://www.w3.org/1999/xhtml'>
    <body textcolor='red'>
      Telepathy rocks!
    </body>
  </html>
</message>

You may optionally use mnemonic ASCII characters in place of the build tags, to better reflect the structure of the stanza in C source. For example, the above stanza could be written as:

wocky_stanza_build (
   WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
   "alice@<!-- -->collabora.co.uk", "bob@<!-- -->collabora.co.uk",
   '(', "html", ':', "http://www.w3.org/1999/xhtml",
     '(', "body", '@', "textcolor", "red",
       '$', "Telepathy rocks!",
     ')',
   ')'
  NULL);

Parameters

type

The type of stanza to build

 

sub_type

The stanza's subtype; valid values depend on type . (For instance, WOCKY_STANZA_TYPE_IQ can use WOCKY_STANZA_SUB_TYPE_GET, but not WOCKY_STANZA_SUB_TYPE_SUBSCRIBED.)

 

from

The sender's JID, or NULL to leave it unspecified.

 

to

The target's JID, or NULL to leave it unspecified.

 

...

the description of the stanza to build, terminated with NULL

 

Returns

a new stanza object


wocky_stanza_build_to_contact ()

WockyStanza *
wocky_stanza_build_to_contact (WockyStanzaType type,
                               WockyStanzaSubType sub_type,
                               const gchar *from,
                               WockyContact *to,
                               ...);

wocky_stanza_get_type_info ()

void
wocky_stanza_get_type_info (WockyStanza *stanza,
                            WockyStanzaType *type,
                            WockyStanzaSubType *sub_type);

wocky_stanza_has_type ()

gboolean
wocky_stanza_has_type (WockyStanza *stanza,
                       WockyStanzaType expected_type);

wocky_stanza_get_from ()

const gchar *
wocky_stanza_get_from (WockyStanza *self);

Parameters

self

a stanza

 

Returns

The sender of self , or NULL if no sender was specified.


wocky_stanza_get_to ()

const gchar *
wocky_stanza_get_to (WockyStanza *self);

Parameters

self

a stanza

 

Returns

The recipient of self , or NULL if no recipient was specified.


wocky_stanza_build_va ()

WockyStanza *
wocky_stanza_build_va (WockyStanzaType type,
                       WockyStanzaSubType sub_type,
                       const gchar *from,
                       const gchar *to,
                       va_list ap);

wocky_stanza_build_iq_result ()

WockyStanza *
wocky_stanza_build_iq_result (WockyStanza *iq,
                              ...);

wocky_stanza_build_iq_result_va ()

WockyStanza *
wocky_stanza_build_iq_result_va (WockyStanza *iq,
                                 va_list ap);

wocky_stanza_build_iq_error ()

WockyStanza *
wocky_stanza_build_iq_error (WockyStanza *iq,
                             ...);

Builds an error reply to iq containing the given body. This function also adds the child element of iq to the reply, as recommended by RFC3920 §9.2.3 ‘IQ Semantics’.

No <error/> element is added to the reply. To add a standard stanza error, plus message, consider using wocky_stanza_error_to_node(). To add a more complicated error with an application-specific condition, specify it when calling this function. For example:

WockyStanza *reply = wocky_stanza_build_iq_error (iq,
   '(', "error",
     '@', "type", "cancel",
     '(', "feature-not-implemented", ':', WOCKY_XMPP_NS_STANZAS, ')',
     '(', "unsupported", ':', WOCKY_XMPP_NS_PUBSUB_ERRORS,
       '@', "feature", "subscribe",
     ')',
   ')', NULL);

Parameters

iq

a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

 

...

a wocky_stanza_build() specification

 

Returns

an error reply for iq


wocky_stanza_build_iq_error_va ()

WockyStanza *
wocky_stanza_build_iq_error_va (WockyStanza *iq,
                                va_list ap);

wocky_stanza_extract_errors ()

gboolean
wocky_stanza_extract_errors (WockyStanza *stanza,
                             WockyXmppErrorType *type,
                             GError **core,
                             GError **specialized,
                             WockyNode **specialized_node);

Given a message, iq or presence stanza with type='error', breaks it down into values describing the error. type and core are guaranteed to be set; specialized and specialized_node will be set if a recognised application-specific error is found, and the latter will be set to NULL if no application-specific error is found.

Any or all of the out parameters may be NULL to ignore the value. The value stored in specialized_node is borrowed from stanza , and is only valid as long as the latter is alive.

Parameters

stanza

a message/iq/presence stanza

 

type

location at which to store the error type

 

core

location at which to store an error in the domain WOCKY_XMPP_ERROR

 

specialized

location at which to store an error in an application-specific domain, if one is found

 

specialized_node

location at which to store the node representing an application-specific error, if one is found

 

Returns

TRUE if the stanza had type='error'; FALSE otherwise


wocky_stanza_extract_stream_error ()

gboolean
wocky_stanza_extract_stream_error (WockyStanza *stanza,
                                   GError **stream_error);

Parameters

stanza

a stanza

 

stream_error

location at which to store an error in domain WOCKY_XMPP_STREAM_ERROR, if one is found.

 

Returns

TRUE and sets stream_error if the stanza was indeed a stream error.


wocky_stanza_get_to_contact ()

WockyContact *
wocky_stanza_get_to_contact (WockyStanza *self);

wocky_stanza_get_from_contact ()

WockyContact *
wocky_stanza_get_from_contact (WockyStanza *self);

wocky_stanza_set_to_contact ()

void
wocky_stanza_set_to_contact (WockyStanza *self,
                             WockyContact *contact);

wocky_stanza_set_from_contact ()

void
wocky_stanza_set_from_contact (WockyStanza *self,
                               WockyContact *contact);

Types and Values

struct WockyStanzaClass

struct WockyStanzaClass {
};

The class of a WockyStanza.


enum WockyStanzaType

XMPP stanza types.

Members

WOCKY_STANZA_TYPE_NONE

no stanza type

 

WOCKY_STANZA_TYPE_MESSAGE

<message/> stanza  

WOCKY_STANZA_TYPE_PRESENCE

<presence/> stanza  

WOCKY_STANZA_TYPE_IQ

<iq/> stanza  

WOCKY_STANZA_TYPE_STREAM

<stream/> stanza  

WOCKY_STANZA_TYPE_STREAM_FEATURES

<stream:features/> stanza  

WOCKY_STANZA_TYPE_AUTH

<auth/> stanza  

WOCKY_STANZA_TYPE_CHALLENGE

<challenge/> stanza  

WOCKY_STANZA_TYPE_RESPONSE

<response/> stanza  

WOCKY_STANZA_TYPE_SUCCESS

<success/> stanza  

WOCKY_STANZA_TYPE_FAILURE

<failure/> stanza  

WOCKY_STANZA_TYPE_STREAM_ERROR

<stream:error/> stanza  

WOCKY_STANZA_TYPE_UNKNOWN

unknown stanza type

 

enum WockyStanzaSubType

XMPP stanza sub types.

Members

WOCKY_STANZA_SUB_TYPE_NONE

no sub type

 

WOCKY_STANZA_SUB_TYPE_AVAILABLE

"available" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_NORMAL

"normal" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_CHAT

"chat" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_GROUPCHAT

"groupchat" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_HEADLINE

"headline" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_UNAVAILABLE

"unavailable" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_PROBE

"probe" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_SUBSCRIBE

"subscribe" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBE

"unsubscribe" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_SUBSCRIBED

"subscribed" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_UNSUBSCRIBED

"unsubscribed" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_GET

"get" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_SET

"set" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_RESULT

"result" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_ERROR

"error" stanza sub type

 

WOCKY_STANZA_SUB_TYPE_UNKNOWN

unknown stanza sub type

 
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-jingle-info-internal.html0000644000175000017500000001053013012562226033606 0ustar00gkiagiagkiagia00000000000000 wocky-jingle-info-internal: Wocky Reference Manual

wocky-jingle-info-internal

wocky-jingle-info-internal

Types and Values

Object Hierarchy

    GEnum
    ╰── WockyStunServerSource

Description

Functions

Types and Values

enum WockyStunServerSource

Members

WOCKY_STUN_SERVER_USER_SPECIFIED

   

WOCKY_STUN_SERVER_DISCOVERED

   

WOCKY_STUN_SERVER_FALLBACK

   
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-WockyCapsHash.html0000644000175000017500000001774113012562226031163 0ustar00gkiagiagkiagia00000000000000 WockyCapsHash: Wocky Reference Manual

WockyCapsHash

WockyCapsHash — Utilities for computing verification string hash

Description

Computes verification string hashes according to XEP-0115 v1.5

Functions

wocky_caps_hash_compute_from_node ()

gchar *
wocky_caps_hash_compute_from_node (WockyNode *node);

Compute the hash as defined by the XEP-0115 from a received WockyNode.

node should be the top-level node from a disco response such as the example given in XEP-0115 §5.3 "Complex Generation Example".

Parameters

node

a WockyNode

 

Returns

the hash. The called must free the returned hash with g_free().


wocky_caps_hash_compute_from_lists ()

gchar *
wocky_caps_hash_compute_from_lists (GPtrArray *features,
                                    GPtrArray *identities,
                                    GPtrArray *dataforms);

Compute the hash as defined by the XEP-0115 from a list of features, identities and dataforms.

Parameters

features

a GPtrArray of strings of features

 

identities

a GPtrArray of WockyDiscoIdentity structures

 

dataforms

a GPtrArray of WockyDataForm objects, or NULL

 

Returns

a newly allocated string of the caps hash which should be freed using g_free()

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html0000644000175000017500000007044013012562226031464 0ustar00gkiagiagkiagia00000000000000 Wocky OpenSSL TLS: Wocky Reference Manual

Wocky OpenSSL TLS

Wocky OpenSSL TLS — Establish TLS sessions

Properties

WockyTLSSession * session Write / Construct Only
GIOStream * base-stream Write / Construct Only
guint dh-bits Write / Construct Only
gboolean server Write / Construct Only
gchar * x509-cert Write / Construct Only
gchar * x509-key Write / Construct Only

Object Hierarchy

    GEnum
    ├── WockyTLSCertStatus
    ├── WockyTLSCertType
    ╰── WockyTLSVerificationLevel
    GObject
    ├── GIOStream
       ╰── WockyTLSConnection
    ╰── WockyTLSSession

Description

The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug output from OpenSSL. To enable it, set it to a value from 1 to 9. Higher values will print more information.

Increasing the value past certain thresholds will also trigger increased debugging output from within wocky-openssl.c as well.

Functions

wocky_tls_cert_error_quark ()

GQuark
wocky_tls_cert_error_quark (void);

wocky_tls_error_quark ()

GQuark
wocky_tls_error_quark (void);

wocky_tls_session_verify_peer ()

int
wocky_tls_session_verify_peer (WockyTLSSession *session,
                               const gchar *peername,
                               GStrv extra_identities,
                               WockyTLSVerificationLevel level,
                               WockyTLSCertStatus *status);

wocky_tls_session_get_peers_certificate ()

GPtrArray *
wocky_tls_session_get_peers_certificate
                               (WockyTLSSession *session,
                                WockyTLSCertType *type);

wocky_tls_session_handshake ()

WockyTLSConnection *
wocky_tls_session_handshake (WockyTLSSession *session,
                             GCancellable *cancellable,
                             GError **error);

wocky_tls_session_handshake_async ()

void
wocky_tls_session_handshake_async (WockyTLSSession *session,
                                   gint io_priority,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

wocky_tls_session_handshake_finish ()

WockyTLSConnection *
wocky_tls_session_handshake_finish (WockyTLSSession *session,
                                    GAsyncResult *result,
                                    GError **error);

wocky_tls_session_add_ca ()

void
wocky_tls_session_add_ca (WockyTLSSession *session,
                          const gchar *path);

wocky_tls_session_add_crl ()

void
wocky_tls_session_add_crl (WockyTLSSession *session,
                           const gchar *path);

wocky_tls_session_new ()

WockyTLSSession *
wocky_tls_session_new (GIOStream *stream);

wocky_tls_session_server_new ()

WockyTLSSession *
wocky_tls_session_server_new (GIOStream *stream,
                              guint dhbits,
                              const gchar *key,
                              const gchar *cert);

Create a new TLS server session

Parameters

stream

a GIOStream on which we expect to receive the client TLS handshake

 

dhbits

size of the DH parameters

 

key

the path to the X509 PEM key file

 

cert

the path to the X509 PEM certificate

 

Returns

a WockyTLSSession object

Types and Values

enum WockyTLSVerificationLevel

Members

WOCKY_TLS_VERIFY_STRICT

   

WOCKY_TLS_VERIFY_NORMAL

   

WOCKY_TLS_VERIFY_LENIENT

   

WOCKY_TLS_CERT_ERROR

#define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ())

WOCKY_TLS_ERROR

#define WOCKY_TLS_ERROR (wocky_tls_error_quark ())

enum WockyTLSCertStatus

Members

WOCKY_TLS_CERT_OK

   

WOCKY_TLS_CERT_INVALID

   

WOCKY_TLS_CERT_NAME_MISMATCH

   

WOCKY_TLS_CERT_REVOKED

   

WOCKY_TLS_CERT_SIGNER_UNKNOWN

   

WOCKY_TLS_CERT_SIGNER_UNAUTHORISED

   

WOCKY_TLS_CERT_INSECURE

   

WOCKY_TLS_CERT_NOT_ACTIVE

   

WOCKY_TLS_CERT_EXPIRED

   

WOCKY_TLS_CERT_NO_CERTIFICATE

   

WOCKY_TLS_CERT_MAYBE_DOS

   

WOCKY_TLS_CERT_INTERNAL_ERROR

   

WOCKY_TLS_CERT_UNKNOWN_ERROR

   

enum WockyTLSCertType

Members

WOCKY_TLS_CERT_TYPE_NONE

   

WOCKY_TLS_CERT_TYPE_X509

   

WOCKY_TLS_CERT_TYPE_OPENPGP

   

Property Details

The “session” property

  “session”                  WockyTLSSession *

the TLS session object for this connection.

Flags: Write / Construct Only


The “base-stream” property

  “base-stream”              GIOStream *

the stream that TLS communicates over.

Flags: Write / Construct Only


The “dh-bits” property

  “dh-bits”                  guint

Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096.

Flags: Write / Construct Only

Allowed values: [768,4096]

Default value: 1024


The “server” property

  “server”                   gboolean

whether this is a server.

Flags: Write / Construct Only

Default value: FALSE


The “x509-cert” property

  “x509-cert”                gchar *

x509 PEM certificate file.

Flags: Write / Construct Only

Default value: NULL


The “x509-key” property

  “x509-key”                 gchar *

x509 PEM key file.

Flags: Write / Construct Only

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-namespaces.html0000644000175000017500000007650413012562226031727 0ustar00gkiagiagkiagia00000000000000 wocky-namespaces: Wocky Reference Manual

wocky-namespaces

wocky-namespaces

Types and Values

#define WOCKY_XMPP_NS_JABBER_CLIENT
#define WOCKY_XMPP_NS_STREAM
#define WOCKY_XMPP_NS_STREAMS
#define WOCKY_XMPP_NS_BIND
#define WOCKY_XMPP_NS_SESSION
#define WOCKY_XMPP_NS_TLS
#define WOCKY_XMPP_NS_SASL_AUTH
#define WOCKY_NS_DISCO_INFO
#define WOCKY_NS_DISCO_ITEMS
#define WOCKY_XMPP_NS_XHTML_IM
#define WOCKY_XMPP_NS_IBB
#define WOCKY_XMPP_NS_AMP
#define WOCKY_W3C_NS_XHTML
#define WOCKY_TELEPATHY_NS_CAPS
#define WOCKY_TELEPATHY_NS_TUBES
#define WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS
#define WOCKY_XMPP_NS_SI
#define WOCKY_XMPP_NS_FEATURENEG
#define WOCKY_XMPP_NS_DATA
#define WOCKY_XMPP_NS_EVENT
#define WOCKY_XMPP_NS_DELAY
#define WOCKY_XMPP_NS_STANZAS
#define WOCKY_XMPP_NS_IQ_OOB
#define WOCKY_XMPP_NS_X_OOB
#define WOCKY_TELEPATHY_NS_CLIQUE
#define WOCKY_XEP77_NS_REGISTER
#define WOCKY_XMPP_NS_JINGLE015
#define WOCKY_XMPP_NS_JINGLE_DESCRIPTION_AUDIO
#define WOCKY_XMPP_NS_JINGLE_DESCRIPTION_VIDEO
#define WOCKY_XMPP_NS_JINGLE
#define WOCKY_XMPP_NS_JINGLE_ERRORS
#define WOCKY_XMPP_NS_JINGLE_RTP
#define WOCKY_XMPP_NS_JINGLE_RTP_ERRORS
#define WOCKY_XMPP_NS_JINGLE_RTP_INFO
#define WOCKY_XMPP_NS_JINGLE_RTP_AUDIO
#define WOCKY_XMPP_NS_JINGLE_RTP_VIDEO
#define WOCKY_XMPP_NS_JINGLE_RTCP_FB
#define WOCKY_XMPP_NS_JINGLE_RTP_HDREXT
#define WOCKY_XMPP_NS_GOOGLE_SESSION
#define WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE
#define WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO
#define WOCKY_XMPP_NS_GOOGLE_SESSION_SHARE
#define WOCKY_XMPP_NS_GOOGLE_TRANSPORT_P2P
#define WOCKY_XMPP_NS_JINGLE_TRANSPORT_RAWUDP
#define WOCKY_XMPP_NS_JINGLE_TRANSPORT_ICEUDP
#define WOCKY_QUIRK_OMITS_CONTENT_CREATORS
#define WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT
#define WOCKY_QUIRK_ANDROID_GTALK_CLIENT
#define WOCKY_XMPP_NS_GOOGLE_JINGLE_INFO
#define WOCKY_JABBER_NS_AUTH
#define WOCKY_JABBER_NS_AUTH_FEATURE
#define WOCKY_GOOGLE_NS_AUTH
#define WOCKY_XMPP_NS_ROSTER
#define WOCKY_XMPP_NS_PUBSUB
#define WOCKY_XMPP_NS_PUBSUB_EVENT
#define WOCKY_XMPP_NS_PUBSUB_OWNER
#define WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG
#define WOCKY_XMPP_NS_PUBSUB_ERRORS
#define WOCKY_XMPP_NS_PING
#define WOCKY_NS_MUC
#define WOCKY_NS_MUC_USER
#define WOCKY_NS_MUC_ADMIN
#define WOCKY_NS_MUC_OWNER
#define WOCKY_NS_MUC_UNIQUE
#define WOCKY_NS_CHATSTATE
#define WOCKY_NS_GOOGLE_SESSION_PHONE
#define WOCKY_NS_GOOGLE_SESSION_VIDEO
#define WOCKY_NS_VCARD_TEMP
#define WOCKY_NS_VCARD_TEMP_UPDATE

Description

Functions

Types and Values

WOCKY_XMPP_NS_JABBER_CLIENT

#define             WOCKY_XMPP_NS_JABBER_CLIENT

WOCKY_XMPP_NS_STREAM

#define             WOCKY_XMPP_NS_STREAM

WOCKY_XMPP_NS_STREAMS

#define             WOCKY_XMPP_NS_STREAMS

WOCKY_XMPP_NS_BIND

#define             WOCKY_XMPP_NS_BIND

WOCKY_XMPP_NS_SESSION

#define             WOCKY_XMPP_NS_SESSION

WOCKY_XMPP_NS_TLS

#define             WOCKY_XMPP_NS_TLS

WOCKY_XMPP_NS_SASL_AUTH

#define             WOCKY_XMPP_NS_SASL_AUTH

WOCKY_NS_DISCO_INFO

#define             WOCKY_NS_DISCO_INFO

WOCKY_NS_DISCO_ITEMS

#define             WOCKY_NS_DISCO_ITEMS

WOCKY_XMPP_NS_XHTML_IM

#define             WOCKY_XMPP_NS_XHTML_IM

WOCKY_XMPP_NS_IBB

#define             WOCKY_XMPP_NS_IBB

WOCKY_XMPP_NS_AMP

#define             WOCKY_XMPP_NS_AMP

WOCKY_W3C_NS_XHTML

#define             WOCKY_W3C_NS_XHTML

WOCKY_TELEPATHY_NS_CAPS

#define             WOCKY_TELEPATHY_NS_CAPS

WOCKY_TELEPATHY_NS_TUBES

#define             WOCKY_TELEPATHY_NS_TUBES

WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS

#define             WOCKY_TELEPATHY_NS_OLPC_ACTIVITY_PROPS

WOCKY_XMPP_NS_SI

#define             WOCKY_XMPP_NS_SI

WOCKY_XMPP_NS_FEATURENEG

#define             WOCKY_XMPP_NS_FEATURENEG

WOCKY_XMPP_NS_DATA

#define             WOCKY_XMPP_NS_DATA

WOCKY_XMPP_NS_EVENT

#define             WOCKY_XMPP_NS_EVENT

WOCKY_XMPP_NS_DELAY

#define             WOCKY_XMPP_NS_DELAY

WOCKY_XMPP_NS_STANZAS

#define             WOCKY_XMPP_NS_STANZAS

WOCKY_XMPP_NS_IQ_OOB

#define             WOCKY_XMPP_NS_IQ_OOB

WOCKY_XMPP_NS_X_OOB

#define             WOCKY_XMPP_NS_X_OOB

WOCKY_TELEPATHY_NS_CLIQUE

#define             WOCKY_TELEPATHY_NS_CLIQUE

WOCKY_XEP77_NS_REGISTER

#define             WOCKY_XEP77_NS_REGISTER

WOCKY_XMPP_NS_JINGLE015

#define             WOCKY_XMPP_NS_JINGLE015

WOCKY_XMPP_NS_JINGLE_DESCRIPTION_AUDIO

#define             WOCKY_XMPP_NS_JINGLE_DESCRIPTION_AUDIO

WOCKY_XMPP_NS_JINGLE_DESCRIPTION_VIDEO

#define             WOCKY_XMPP_NS_JINGLE_DESCRIPTION_VIDEO

WOCKY_XMPP_NS_JINGLE

#define             WOCKY_XMPP_NS_JINGLE

WOCKY_XMPP_NS_JINGLE_ERRORS

#define             WOCKY_XMPP_NS_JINGLE_ERRORS

WOCKY_XMPP_NS_JINGLE_RTP

#define             WOCKY_XMPP_NS_JINGLE_RTP

WOCKY_XMPP_NS_JINGLE_RTP_ERRORS

#define             WOCKY_XMPP_NS_JINGLE_RTP_ERRORS

WOCKY_XMPP_NS_JINGLE_RTP_INFO

#define             WOCKY_XMPP_NS_JINGLE_RTP_INFO

WOCKY_XMPP_NS_JINGLE_RTP_AUDIO

#define             WOCKY_XMPP_NS_JINGLE_RTP_AUDIO

WOCKY_XMPP_NS_JINGLE_RTP_VIDEO

#define             WOCKY_XMPP_NS_JINGLE_RTP_VIDEO

WOCKY_XMPP_NS_JINGLE_RTCP_FB

#define WOCKY_XMPP_NS_JINGLE_RTCP_FB       "urn:xmpp:jingle:apps:rtp:rtcp-fb:0"

WOCKY_XMPP_NS_JINGLE_RTP_HDREXT

#define WOCKY_XMPP_NS_JINGLE_RTP_HDREXT    "urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"

WOCKY_XMPP_NS_GOOGLE_SESSION

#define WOCKY_XMPP_NS_GOOGLE_SESSION       "http://www.google.com/session"

WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE

#define WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE "http://www.google.com/session/phone"

WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO

#define WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO "http://www.google.com/session/video"

WOCKY_XMPP_NS_GOOGLE_SESSION_SHARE

#define WOCKY_XMPP_NS_GOOGLE_SESSION_SHARE "http://www.google.com/session/share"

WOCKY_XMPP_NS_GOOGLE_TRANSPORT_P2P

#define WOCKY_XMPP_NS_GOOGLE_TRANSPORT_P2P "http://www.google.com/transport/p2p"

WOCKY_XMPP_NS_JINGLE_TRANSPORT_RAWUDP

#define WOCKY_XMPP_NS_JINGLE_TRANSPORT_RAWUDP "urn:xmpp:jingle:transports:raw-udp:1"

WOCKY_XMPP_NS_JINGLE_TRANSPORT_ICEUDP

#define WOCKY_XMPP_NS_JINGLE_TRANSPORT_ICEUDP "urn:xmpp:jingle:transports:ice-udp:1"

WOCKY_QUIRK_OMITS_CONTENT_CREATORS

#define WOCKY_QUIRK_OMITS_CONTENT_CREATORS "\x07omits-content-creators"

WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT

#define WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT "\x07google-webmail-client"

WOCKY_QUIRK_ANDROID_GTALK_CLIENT

#define WOCKY_QUIRK_ANDROID_GTALK_CLIENT "\x07android-gtalk-client"

WOCKY_XMPP_NS_GOOGLE_JINGLE_INFO

#define WOCKY_XMPP_NS_GOOGLE_JINGLE_INFO   "google:jingleinfo"

WOCKY_JABBER_NS_AUTH

#define             WOCKY_JABBER_NS_AUTH

WOCKY_JABBER_NS_AUTH_FEATURE

#define             WOCKY_JABBER_NS_AUTH_FEATURE

WOCKY_GOOGLE_NS_AUTH

#define             WOCKY_GOOGLE_NS_AUTH

WOCKY_XMPP_NS_ROSTER

#define             WOCKY_XMPP_NS_ROSTER

WOCKY_XMPP_NS_PUBSUB

#define             WOCKY_XMPP_NS_PUBSUB

WOCKY_XMPP_NS_PUBSUB_EVENT

#define             WOCKY_XMPP_NS_PUBSUB_EVENT

WOCKY_XMPP_NS_PUBSUB_OWNER

#define             WOCKY_XMPP_NS_PUBSUB_OWNER

WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG

#define             WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG

WOCKY_XMPP_NS_PUBSUB_ERRORS

#define             WOCKY_XMPP_NS_PUBSUB_ERRORS

WOCKY_XMPP_NS_PING

#define             WOCKY_XMPP_NS_PING

WOCKY_NS_MUC

#define             WOCKY_NS_MUC

WOCKY_NS_MUC_USER

#define             WOCKY_NS_MUC_USER

WOCKY_NS_MUC_ADMIN

#define             WOCKY_NS_MUC_ADMIN

WOCKY_NS_MUC_OWNER

#define             WOCKY_NS_MUC_OWNER

WOCKY_NS_MUC_UNIQUE

#define             WOCKY_NS_MUC_UNIQUE

WOCKY_NS_CHATSTATE

#define             WOCKY_NS_CHATSTATE

WOCKY_NS_GOOGLE_SESSION_PHONE

#define             WOCKY_NS_GOOGLE_SESSION_PHONE

WOCKY_NS_GOOGLE_SESSION_VIDEO

#define             WOCKY_NS_GOOGLE_SESSION_VIDEO

WOCKY_NS_VCARD_TEMP

#define WOCKY_NS_VCARD_TEMP           "vcard-temp"

WOCKY_NS_VCARD_TEMP_UPDATE

#define WOCKY_NS_VCARD_TEMP_UPDATE    "vcard-temp:x:update"
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleTransportGoogle.html0000644000175000017500000002470713012562226032621 0ustar00gkiagiagkiagia00000000000000 WockyJingleTransportGoogle: Wocky Reference Manual

WockyJingleTransportGoogle

WockyJingleTransportGoogle

Properties

WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only

Signals

Object Hierarchy

    GObject
    ╰── WockyJingleTransportGoogle

Implemented Interfaces

WockyJingleTransportGoogle implements

Description

Functions

jingle_transport_google_register ()

void
jingle_transport_google_register (WockyJingleFactory *factory);

jingle_transport_google_set_component_name ()

gboolean
jingle_transport_google_set_component_name
                               (WockyJingleTransportGoogle *transport,
                                const gchar *name,
                                guint component_id);

Types and Values

Property Details

The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “new-candidates” signal

void
user_function (WockyJingleTransportGoogle *wockyjingletransportgoogle,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleMediaRtp.html0000644000175000017500000011325513012562226031172 0ustar00gkiagiagkiagia00000000000000 WockyJingleMediaRtp: Wocky Reference Manual

WockyJingleMediaRtp

WockyJingleMediaRtp

Properties

guint media-type Read / Write / Construct Only
gboolean remote-mute Read / Write

Object Hierarchy

    GObject
    ╰── WockyJingleContent
        ╰── WockyJingleMediaRtp

Description

Functions

jingle_media_rtp_register ()

void
jingle_media_rtp_register (WockyJingleFactory *factory);

jingle_media_rtp_set_local_media_description ()

gboolean
jingle_media_rtp_set_local_media_description
                               (WockyJingleMediaRtp *self,
                                WockyJingleMediaDescription *md,
                                gboolean ready,
                                GError **error);

Sets or updates the media description (codecs, feedback messages, etc) for self .

Parameters

self

a content in an RTP session

 

md

new media description for this content.

[transfer full]

ready

whether the codecs can regarded as ready to sent from now on

 

error

used to return a WOCKY_XMPP_ERROR if the codec update is illegal.

 

Returns

TRUE if no description was previously set, or if the update is compatible with the existing description; FALSE if the update is illegal (due to adding previously-unknown codecs or renaming an existing codec, for example)


wocky_jingle_media_rtp_get_remote_media_description ()

WockyJingleMediaDescription *
wocky_jingle_media_rtp_get_remote_media_description
                               (WockyJingleMediaRtp *self);

Gets the current remote media description, if known. The “remote-media-description” signal is emitted when this value changes.

Parameters

self

the RTP content

 

Returns

the current remote media description, which may be NULL for outgoing calls until it is first received.

[transfer none]


jingle_media_rtp_codec_new ()

WockyJingleCodec *
jingle_media_rtp_codec_new (guint id,
                            const gchar *name,
                            guint clockrate,
                            guint channels,
                            GHashTable *params);

Creates a new structure describing a codec, suitable for including in a WockyJingleMediaDescription.

Parameters

id

a codec ID, as specified in tables 4 and 5 of RFC 3551.

 

name

the codec's name. This is optional if id is one of the statically-defined codec identifiers, and required if id is in the range 96–127. (This is not enforced by this library.).

[allow-none]

clockrate

the clock rate for this codec, or 0 to not specify a clock rate.

 

channels

the number of channels, or 0 to leave this unspecified (which the peer should interpret as the default value, 1).

 

params

parameters for this codec. This is referenced, not copied, so you should avoid modifying this parameter after calling this function.

[element-type utf8 utf8][transfer none][allow-none]

Returns

the codec description.

[transfer full]


jingle_media_rtp_codec_free ()

void
jingle_media_rtp_codec_free (WockyJingleCodec *p);

jingle_media_rtp_free_codecs ()

void
jingle_media_rtp_free_codecs (GList *codecs);

jingle_media_rtp_copy_codecs ()

GList *
jingle_media_rtp_copy_codecs (GList *codecs);

jingle_media_rtp_compare_codecs ()

gboolean
jingle_media_rtp_compare_codecs (GList *old,
                                 GList *new,
                                 GList **changed,
                                 GError **e);

wocky_jingle_media_description_new ()

WockyJingleMediaDescription *
wocky_jingle_media_description_new (void);

Allocates a new media description. You should fill in all the fields yourself.

Returns

a new, empty, media description


wocky_jingle_media_description_free ()

void
wocky_jingle_media_description_free (WockyJingleMediaDescription *md);

wocky_jingle_media_description_copy ()

WockyJingleMediaDescription *
wocky_jingle_media_description_copy (WockyJingleMediaDescription *md);

Performs a deep copy of a media description.

Parameters

md

a media description

 

Returns

a deep copy of md .

[transfer full]


wocky_jingle_rtp_header_extension_new ()

WockyJingleRtpHeaderExtension *
wocky_jingle_rtp_header_extension_new (guint id,
                                       WockyJingleContentSenders senders,
                                       const gchar *uri);

wocky_jingle_rtp_header_extension_free ()

void
wocky_jingle_rtp_header_extension_free
                               (WockyJingleRtpHeaderExtension *hdrext);

wocky_jingle_feedback_message_new ()

WockyJingleFeedbackMessage *
wocky_jingle_feedback_message_new (const gchar *type,
                                   const gchar *subtype);

wocky_jingle_feedback_message_free ()

void
wocky_jingle_feedback_message_free (WockyJingleFeedbackMessage *fb);

wocky_jingle_media_description_simplify ()

void
wocky_jingle_media_description_simplify
                               (WockyJingleMediaDescription *md);

Removes duplicated Feedback message and put them in the global structure

This function will iterate over every codec in a description and look for feedback messages that are exactly the same in every codec and will instead put the in the list in the description and remove them from the childs. This limits the amount of duplication in the resulting XML.

Parameters

md

a description to simplify

 

Types and Values

WockyJingleCodec

typedef struct {
  guint id;
  gchar *name;
  guint clockrate;
  guint channels;
  GHashTable *params;
  guint trr_int;
  GList *feedback_msgs;
} WockyJingleCodec;

WockyJingleFeedbackMessage

typedef struct {
  gchar *type;
  gchar *subtype;
} WockyJingleFeedbackMessage;

WockyJingleRtpHeaderExtension

typedef struct {
  guint id;
  WockyJingleContentSenders senders;
  gchar *uri;
} WockyJingleRtpHeaderExtension;

WockyJingleMediaDescription

typedef struct {
  GList *codecs;
  GList *hdrexts;
  guint trr_int;
  GList *feedback_msgs;
} WockyJingleMediaDescription;

Media description for a WockyJingleMediaRtp content.

Members

GList *codecs;

a list of WockyJingleCodecs, allocated with jingle_media_rtp_codec_new()

 

GList *hdrexts;

a list of WockyJingleRtpHeaderExtensions, allocated with wocky_jingle_rtp_header_extension_new()

 

guint trr_int;

number of milliseconds between regular RTCP reports

 

GList *feedback_msgs;

a list of WockyJingleFeedbackMessages, allocated with wocky_jingle_feedback_message_new()

 

Property Details

The “media-type” property

  “media-type”               guint

Media type.

Flags: Read / Write / Construct Only

Default value: 0


The “remote-mute” property

  “remote-mute”              gboolean

TRUE if the peer has muted this stream.

Flags: Read / Write

Default value: FALSE

Signal Details

The “remote-media-description” signal

void
user_function (WockyJingleMediaRtp *content,
               gpointer             md,
               gpointer             user_data)

Emitted when the remote media description is received or subsequently updated.

Parameters

content

the RTP content

 

md

a WockyJingleMediaDescription

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-service-protected.html0000644000175000017500000003311213012562226034521 0ustar00gkiagiagkiagia00000000000000 wocky-pubsub-service-protected: Wocky Reference Manual

wocky-pubsub-service-protected

wocky-pubsub-service-protected

Description

Functions

wocky_pubsub_service_create_retrieve_subscriptions_stanza ()

WockyStanza *
wocky_pubsub_service_create_retrieve_subscriptions_stanza
                               (WockyPubsubService *self,
                                WockyPubsubNode *node,
                                WockyNode **pubsub_node,
                                WockyNode **subscriptions_node);

wocky_pubsub_service_parse_subscription ()

WockyPubsubSubscription *
wocky_pubsub_service_parse_subscription
                               (WockyPubsubService *self,
                                WockyNode *subscription_node,
                                const gchar *parent_node_attr,
                                GError **error);

wocky_pubsub_service_parse_subscriptions ()

GList *
wocky_pubsub_service_parse_subscriptions
                               (WockyPubsubService *self,
                                WockyNode *subscriptions_node,
                                GList **subscription_nodes);

wocky_pubsub_service_create_create_node_stanza ()

WockyStanza *
wocky_pubsub_service_create_create_node_stanza
                               (WockyPubsubService *self,
                                const gchar *name,
                                WockyDataForm *config,
                                WockyNode **pubsub_node,
                                WockyNode **create_node);

wocky_pubsub_service_handle_create_node_reply ()

WockyPubsubNode *
wocky_pubsub_service_handle_create_node_reply
                               (WockyPubsubService *self,
                                WockyNodeTree *create_tree,
                                const gchar *requested_name,
                                GError **error);

Handles the body of a reply to a create node request. This is ever-so-slightly involved, because the server is allowed to omit the body of the reply if you specified a node name and it created a node with that name, but it may also tell you "hey, you asked for 'ringo', but I gave you 'george'". Good times.

Parameters

self

a pubsub service

 

create_tree

the <create/> tree from the reply to an attempt to create a node, or NULL if none was present in the reply.

 

requested_name

the name we asked the server to use for the node, or NULL if we requested an instant node

 

error

location at which to store an error

 

Returns

a pubsub node if the reply made sense, or NULL with error set if not.


wocky_pubsub_service_get_porter ()

WockyPorter *
wocky_pubsub_service_get_porter (WockyPubsubService *self);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyDiscoIdentity.html0000644000175000017500000005135513012562226031111 0ustar00gkiagiagkiagia00000000000000 WockyDiscoIdentity: Wocky Reference Manual

WockyDiscoIdentity

WockyDiscoIdentity — Structure holding XMPP disco identity information.

Types and Values

Object Hierarchy

    GBoxed
    ╰── WockyDiscoIdentity

Description

Contains information regarding the identity information in disco replies, as described in XEP-0030.

Functions

wocky_disco_identity_new ()

WockyDiscoIdentity *
wocky_disco_identity_new (const gchar *category,
                          const gchar *type,
                          const gchar *lang,
                          const gchar *name);

Parameters

category

disco category

 

type

disco type

 

lang

disco language

 

name

disco name

 

Returns

a new WockyDiscoIdentity which should be freed using wocky_disco_identity_free().


wocky_disco_identity_copy ()

WockyDiscoIdentity *
wocky_disco_identity_copy (const WockyDiscoIdentity *source);

Creates a new WockyDiscoIdentity structure with the data given by source . The copy also copies the internal data so source can be freed after this function is called.

Parameters

source

the WockyDiscoIdentity to copy

 

Returns

a new WockyDiscoIdentity which is a deep copy of source


wocky_disco_identity_free ()

void
wocky_disco_identity_free (WockyDiscoIdentity *identity);

Frees the memory used by identity .

Parameters

identity

a WockyDiscoIdentity

 

wocky_disco_identity_cmp ()

gint
wocky_disco_identity_cmp (WockyDiscoIdentity *left,
                          WockyDiscoIdentity *right);

Compares left and right . It returns an integer less than, equal to, or greater than zero if left is found, respectively, to be less than, to match, or be greater than right.

This function can be casted to a GCompareFunc to sort a list of WockyDiscoIdentity structures.

Parameters

left

a WockyDiscoIdentity

 

right

a WockyDiscoIdentity

 

Returns

the result of comparing left and right


wocky_disco_identity_array_new ()

GPtrArray *
wocky_disco_identity_array_new (void);

Creates a new array of WockyDiscoIdentity structures.

Returns

A newly instantiated array. wocky_disco_identity_array_free() should beq used to free the memory allocated by this array. See: wocky_disco_identity_array_free()


wocky_disco_identity_array_copy ()

GPtrArray *
wocky_disco_identity_array_copy (const GPtrArray *source);

Copies an array of WockyDiscoIdentity objects. The returned array contains new copies of the contents of the source array.

Parameters

source

The source array to be copied.

 

Returns

A newly instantiated array with new copies of the contents of the source array. See: wocky_disco_identity_array_new()


wocky_disco_identity_array_free ()

void
wocky_disco_identity_array_free (GPtrArray *arr);

Frees an array of WockyDiscoIdentity objects created with wocky_disco_identity_array_new() or returned by wocky_disco_identity_array_copy().

Note that if this method is called with an array created with g_ptr_array_new(), the caller should also free the array contents.

See: wocky_disco_identity_array_new(), wocky_disco_identity_array_copy()

Parameters

arr

Array to be freed.

 

Types and Values

struct WockyDiscoIdentity

struct WockyDiscoIdentity {
  gchar *category;
  gchar *type;
  gchar *lang;
  gchar *name;
};

A structure used to hold information regarding an identity from a disco reply as described in XEP-0030.

Members

gchar *category;

the identity category

 

gchar *type;

the identity type

 

gchar *lang;

the identity language

 

gchar *name;

the identity name

 
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyRoster.html0000644000175000017500000010214413012562226027605 0ustar00gkiagiagkiagia00000000000000 WockyRoster: Wocky Reference Manual

WockyRoster

WockyRoster — TODO

Properties

WockySession * session Read / Write / Construct Only

Signals

Object Hierarchy

    GObject
    ╰── WockyRoster

Description

TODO

Functions

wocky_roster_error_quark ()

GQuark
wocky_roster_error_quark (void);

Get the error quark used by the roster.

Returns

the quark for roster errors.


wocky_roster_new ()

WockyRoster *
wocky_roster_new (WockySession *session);

wocky_roster_fetch_roster_async ()

void
wocky_roster_fetch_roster_async (WockyRoster *self,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

wocky_roster_fetch_roster_finish ()

gboolean
wocky_roster_fetch_roster_finish (WockyRoster *self,
                                  GAsyncResult *result,
                                  GError **error);

wocky_roster_get_contact ()

WockyBareContact *
wocky_roster_get_contact (WockyRoster *self,
                          const gchar *jid);

wocky_roster_get_all_contacts ()

GSList *
wocky_roster_get_all_contacts (WockyRoster *self);

wocky_roster_add_contact_async ()

void
wocky_roster_add_contact_async (WockyRoster *self,
                                const gchar *jid,
                                const gchar *name,
                                const gchar * const *groups,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_roster_add_contact_finish ()

gboolean
wocky_roster_add_contact_finish (WockyRoster *self,
                                 GAsyncResult *result,
                                 GError **error);

wocky_roster_remove_contact_async ()

void
wocky_roster_remove_contact_async (WockyRoster *self,
                                   WockyBareContact *contact,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

wocky_roster_remove_contact_finish ()

gboolean
wocky_roster_remove_contact_finish (WockyRoster *self,
                                    GAsyncResult *result,
                                    GError **error);

wocky_roster_change_contact_name_async ()

void
wocky_roster_change_contact_name_async
                               (WockyRoster *self,
                                WockyBareContact *contact,
                                const gchar *name,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_roster_change_contact_name_finish ()

gboolean
wocky_roster_change_contact_name_finish
                               (WockyRoster *self,
                                GAsyncResult *result,
                                GError **error);

wocky_roster_contact_add_group_async ()

void
wocky_roster_contact_add_group_async (WockyRoster *self,
                                      WockyBareContact *contact,
                                      const gchar *group,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

wocky_roster_contact_add_group_finish ()

gboolean
wocky_roster_contact_add_group_finish (WockyRoster *self,
                                       GAsyncResult *result,
                                       GError **error);

wocky_roster_contact_remove_group_async ()

void
wocky_roster_contact_remove_group_async
                               (WockyRoster *self,
                                WockyBareContact *contact,
                                const gchar *group,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_roster_contact_remove_group_finish ()

gboolean
wocky_roster_contact_remove_group_finish
                               (WockyRoster *self,
                                GAsyncResult *result,
                                GError **error);

wocky_roster_subscription_to_string ()

const gchar *
wocky_roster_subscription_to_string (WockyRosterSubscriptionFlags subscription);

Types and Values

struct WockyRosterClass

struct WockyRosterClass {
};

The class of a WockyRoster.


enum WockyRosterSubscriptionFlags

Flags to document the subscription information between contacts.

Members

WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE

the user does not have a subscription to the contact's presence information, and the contact does not have a subscription to the user's presence information

 

WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO

the user has a subscription to the contact's presence information, but the contact does not have a subscription to the user's presence information

 

WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM

the contact has a subscription to the user's presence information, but the user does not have a subscription to the contact's presence information

 

WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH

both the user and the contact have subscriptions to each other's presence information

 

enum WockyRosterError

The WockyRosterError specific errors.

Members

WOCKY_ROSTER_ERROR_INVALID_STANZA

received an invalid roster stanza from the server

 

WOCKY_ROSTER_ERROR_NOT_IN_ROSTER

the contact is not in the roster

 

WOCKY_ROSTER_ERROR

#define WOCKY_ROSTER_ERROR (wocky_roster_error_quark ())

Get access to the error quark of the roster.

Property Details

The “session” property

  “session”                  WockySession *

the wocky session used by this roster.

Flags: Read / Write / Construct Only

Signal Details

The “added” signal

void
user_function (WockyRoster *wockyroster,
               GObject     *arg1,
               gpointer     user_data)

Flags: Run Last


The “removed” signal

void
user_function (WockyRoster *wockyroster,
               GObject     *arg1,
               gpointer     user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/object-tree.html0000644000175000017500000003070213012562226027515 0ustar00gkiagiagkiagia00000000000000 Object Hierarchy: Wocky Reference Manual

Object Hierarchy

    GObject
    ├── WockyAuthRegistry
    ├── WockyContact
       ├── WockyBareContact
       ├── WockyLLContact
       ╰── WockyResourceContact
    ├── WockyC2SPorter
    ├── WockyCapsCache
    ├── WockyConnector
    ├── WockyContactFactory
    ├── WockyDataForm
    ├── WockyJabberAuth
    ├── WockyJingleContent
       ╰── WockyJingleMediaRtp
    ├── WockyJingleFactory
    ├── WockyJingleInfo
    ├── WockyJingleSession
    ├── WockyJingleTransportGoogle
    ├── WockyJingleTransportIceUdp
    ├── WockyJingleTransportRawUdp
    ├── WockyLLConnectionFactory
    ├── WockyLLConnector
    ├── GIOStream
       ├── WockyLoopbackStream
       ╰── WockyTLSConnection
    ├── WockyMetaPorter
    ├── WockyMuc
    ├── WockyNodeTree
       ╰── WockyStanza
    ├── WockyPepService
    ├── WockyPing
    ├── WockyPubsubNode
    ├── WockyPubsubService
    ├── WockyRoster
    ├── WockySaslAuth
    ├── WockySession
    ├── WockyTLSConnector
    ├── WockyTLSHandler
    ├── WockyTLSSession
    ├── WockyXmppConnection
    ├── WockyXmppReader
    ╰── WockyXmppWriter
    GInterface
    ├── WockyAuthHandler
    ├── WockyPorter
    ├── WockyJingleTransportIface
    ╰── WockyXep0115Capabilities
    GEnum
    ├── WockyAuthError
    ├── WockyConnectorError
    ├── WockyDataFormError
    ├── WockyDataFormFieldType
    ├── WockyJingleError
    ├── WockyJingleReason
    ├── WockyMucAffiliation
    ├── WockyMucMsgState
    ├── WockyMucMsgType
    ├── WockyMucRole
    ├── WockyMucState
    ├── WockyPubsubAffiliationState
    ├── WockyPubsubServiceError
    ├── WockyPubsubSubscriptionState
    ├── WockySIError
    ├── WockyStunServerSource
    ├── WockyTLSCertStatus
    ├── WockyTLSCertType
    ├── WockyTLSVerificationLevel
    ├── WockyXmppError
    ├── WockyXmppErrorType
    ├── WockyXmppReaderError
    ├── WockyXmppReaderState
    ╰── WockyXmppStreamError
    GBoxed
    ├── WockyDiscoIdentity
    ├── WockyPubsubAffiliation
    ╰── WockyPubsubSubscription
    GFlags
    ├── WockyMucFeature
    ╰── WockyMucStatusCode
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-xmpp-error.html0000644000175000017500000015176713012562226031730 0ustar00gkiagiagkiagia00000000000000 wocky-xmpp-error: Wocky Reference Manual

wocky-xmpp-error

wocky-xmpp-error

Object Hierarchy

    GEnum
    ├── WockyJingleError
    ├── WockySIError
    ├── WockyXmppError
    ├── WockyXmppErrorType
    ╰── WockyXmppStreamError

Description

Functions

wocky_xmpp_error_quark ()

GQuark
wocky_xmpp_error_quark (void);

wocky_xmpp_error_register_domain ()

void
wocky_xmpp_error_register_domain (WockyXmppErrorDomain *domain);

Registers a new set of application-specific stanza errors. This allows GErrors in that domain to be passed to wocky_stanza_error_to_node(), and to be recognized and returned by wocky_xmpp_error_extract() (and wocky_stanza_extract_errors(), by extension).

Parameters

domain

a description of the error domain

 

wocky_jingle_error_quark ()

GQuark
wocky_jingle_error_quark (void);

wocky_si_error_quark ()

GQuark
wocky_si_error_quark (void);

wocky_xmpp_stream_error_quark ()

GQuark
wocky_xmpp_stream_error_quark (void);

Get the error quark used for stream errors

Returns

the quark for stream errors.


wocky_xmpp_error_string ()

const gchar *
wocky_xmpp_error_string (WockyXmppError error);

Parameters

error

a core stanza error

 

Returns

the name of the tag corresponding to error


wocky_xmpp_error_description ()

const gchar *
wocky_xmpp_error_description (WockyXmppError error);

Parameters

error

a core stanza error

 

Returns

a description of the error, in English, as specified in XMPP Core


wocky_xmpp_stream_error_from_node ()

GError *
wocky_xmpp_stream_error_from_node (WockyNode *error);

Parameters

error

the root node of a WOCKY_STANZA_TYPE_STREAM_ERROR stanza

 

Returns

a GError in the WOCKY_XMPP_STREAM_ERROR domain.


wocky_stanza_error_to_node ()

WockyNode *
wocky_stanza_error_to_node (const GError *error,
                            WockyNode *parent_node);

wocky_xmpp_stanza_error_to_string ()

const gchar *
wocky_xmpp_stanza_error_to_string (GError *error);

Returns the name of the XMPP stanza error element represented by error . This is intended for use in debugging messages, with GErrors returned by wocky_stanza_extract_errors().

Parameters

error

an error in the domain WOCKY_XMPP_ERROR, or another domain registered with wocky_xmpp_error_register_domain() (such as WOCKY_JINGLE_ERROR).

 

Returns

the error code as a string, or NULL if

error->domain is not known to Wocky.

wocky_xmpp_error_extract ()

void
wocky_xmpp_error_extract (WockyNode *error,
                          WockyXmppErrorType *type,
                          GError **core,
                          GError **specialized,
                          WockyNode **specialized_node);

Given an <error/> node, breaks it down into values describing the error. type and core are guaranteed to be set; specialized and specialized_node will be set if a recognised application-specific error is found, and the latter will be set to NULL if no application-specific error is found.

Any or all of the out parameters may be NULL to ignore the value. The value stored in specialized_node is borrowed from stanza , and is only valid as long as the latter is alive.

Parameters

error

the <error/> child of a stanza with type='error'

 

type

location at which to store the error type

 

core

location at which to store an error in the domain WOCKY_XMPP_ERROR

 

specialized

location at which to store an error in an application-specific domain, if one is found

 

specialized_node

location at which to store the node representing an application-specific error, if one is found

 

wocky_xmpp_error_init ()

void
wocky_xmpp_error_init (void);

wocky_xmpp_error_deinit ()

void
wocky_xmpp_error_deinit (void);

Types and Values

enum WockyXmppErrorType

XMPP error types as described in RFC 3920 §9.3.2.

Members

WOCKY_XMPP_ERROR_TYPE_CANCEL

do not retry (the error is unrecoverable)

 

WOCKY_XMPP_ERROR_TYPE_CONTINUE

proceed (the condition was only a warning)

 

WOCKY_XMPP_ERROR_TYPE_MODIFY

retry after changing the data sent

 

WOCKY_XMPP_ERROR_TYPE_AUTH

retry after providing credentials

 

WOCKY_XMPP_ERROR_TYPE_WAIT

retry after waiting (the error is temporary)

 

enum WockyXmppError

Possible stanza-level errors, as defined by RFC 6210 §8.3.3.

Members

WOCKY_XMPP_ERROR_UNDEFINED_CONDITION

the error condition is not one of those defined by the other conditions in this list

 

WOCKY_XMPP_ERROR_REDIRECT

the recipient or server is redirecting requests for this information to another entity

 

WOCKY_XMPP_ERROR_GONE

the recipient or server can no longer be contacted at this address

 

WOCKY_XMPP_ERROR_BAD_REQUEST

the sender has sent XML that is malformed or that cannot be processed

 

WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST

the recipient or server understood the request but was not expecting it at this time

 

WOCKY_XMPP_ERROR_JID_MALFORMED

the sending entity has provided or communicated an XMPP address

 

WOCKY_XMPP_ERROR_NOT_AUTHORIZED

the sender must provide proper credentials before being allowed to perform the action, or has provided improper credentials

 

WOCKY_XMPP_ERROR_PAYMENT_REQUIRED

the requesting entity is not authorized to access the requested service because payment is required. This code is no longer defined in RFC 6120, the current version of XMPP Core. It's preserved here for interoperability, but new applications should not send it.

 

WOCKY_XMPP_ERROR_FORBIDDEN

the requesting entity does not possess the required permissions to perform the action

 

WOCKY_XMPP_ERROR_ITEM_NOT_FOUND

the addressed JID or item requested cannot be found

 

WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE

the intended recipient is temporarily unavailable

 

WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND

a remote server or service specified as part or all of the JID of the intended recipient does not exist

 

WOCKY_XMPP_ERROR_NOT_ALLOWED

the recipient or server does not allow any entity to perform the action

 

WOCKY_XMPP_ERROR_NOT_ACCEPTABLE

the recipient or server understands the request but is refusing to process it because it does not meet criteria defined by the recipient or server

 

WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED

the requesting entity is not authorized to access the requested service because registration is required

 

WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED

the requesting entity is not authorized to access the requested service because a subscription is required

 

WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT

a remote server or service specified as part or all of the JID of the intended recipient (or required to fulfill a request) could not be contacted within a reasonable amount of time

 

WOCKY_XMPP_ERROR_CONFLICT

access cannot be granted because an existing resource or session exists with the same name or address

 

WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR

the server could not process the stanza because of a misconfiguration or an otherwise-undefined internal server error

 

WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT

the server or recipient lacks the system resources necessary to service the request

 

WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED

the feature requested is not implemented by the recipient or server and therefore cannot be processed

 

WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE

the server or recipient does not currently provide the requested service

 

WOCKY_XMPP_ERROR_POLICY_VIOLATION

the entity has violated some local service policy (e.g., a message contains words that are prohibited by the service) and the server MAY choose to specify the policy as the text of the error or in an application-specific condition element; the associated error type SHOULD be WOCKY_XMPP_ERROR_TYPE_MODIFY or WOCKY_XMPP_ERROR_TYPE_WAIT depending on the policy being violated.

 

WOCKY_XMPP_ERROR

#define WOCKY_XMPP_ERROR (wocky_xmpp_error_quark ())

struct WockyXmppErrorSpecialization

struct WockyXmppErrorSpecialization {
  const gchar *description;
  WockyXmppError specializes;
  gboolean override_type;
  WockyXmppErrorType type;
};

A struct to represent a specialization of an existing WockyXmppError member.

Members

const gchar *description;

description of the error

 

WockyXmppError specializes;

which WockyXmppError this error specializes

 

gboolean override_type;

TRUE if type should be used, or FALSE if the default error type for specializes should be used

 

WockyXmppErrorType type;

the XMPP error type

 

struct WockyXmppErrorDomain

struct WockyXmppErrorDomain {
  GQuark domain;
  GType enum_type;
  WockyXmppErrorSpecialization *codes;
};

A struct to represent extra XMPP error domains added.

Members

GQuark domain;

a GQuark of the error domain

 

GType enum_type;

the GType of the error enum

 

WockyXmppErrorSpecialization *codes;

a NULL-terminated array of of WockyXmppErrorSpecializations

 

enum WockyJingleError

Jingle specific errors.

Members

WOCKY_JINGLE_ERROR_OUT_OF_ORDER

the request cannot occur at this point in the state machine

 

WOCKY_JINGLE_ERROR_TIE_BREAK

the request is rejected because it was sent while the initiator was awaiting a reply on a similar request

 

WOCKY_JINGLE_ERROR_UNKNOWN_SESSION

the 'sid' attribute specifies a session that is unknown to the recipient

 

WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO

the recipient does not support the informational payload of a session-info action.

 

WOCKY_JINGLE_ERROR

#define WOCKY_JINGLE_ERROR (wocky_jingle_error_quark ())

enum WockySIError

SI specific errors.

Members

WOCKY_SI_ERROR_NO_VALID_STREAMS

none of the available streams are acceptable

 

WOCKY_SI_ERROR_BAD_PROFILE

the profile is not understood or invalid

 

WOCKY_SI_ERROR

#define WOCKY_SI_ERROR (wocky_si_error_quark ())

enum WockyXmppStreamError

Stream-level error conditions as described in RFC 3920 §4.7.3.

Members

WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT

the entity has sent XML that cannot be processed

 

WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX

the entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix

 

WOCKY_XMPP_STREAM_ERROR_CONFLICT

the server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream

 

WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT

the entity has not generated any traffic over the stream for some period of time

 

WOCKY_XMPP_STREAM_ERROR_HOST_GONE

the value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server

 

WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN

the value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server

 

WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING

a stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value)

 

WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR

the server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream

 

WOCKY_XMPP_STREAM_ERROR_INVALID_FROM

the JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource binding

 

WOCKY_XMPP_STREAM_ERROR_INVALID_ID

the stream ID or dialback ID is invalid or does not match an ID previously provided

 

WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE

the streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback"

 

WOCKY_XMPP_STREAM_ERROR_INVALID_XML

the entity has sent invalid XML over the stream to a server that performs validation

 

WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED

the entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation

 

WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION

the entity has violated some local service policy

 

WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED

the server is unable to properly connect to a remote entity that is required for authentication or authorization

 

WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT

the server lacks the system resources necessary to service the stream

 

WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML

the entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character

 

WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST

the server will not provide service to the initiating entity but is redirecting traffic to another host

 

WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN

the server is being shut down and all active streams are being closed

 

WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION

the error condition is not one of those defined by the other conditions in this list

 

WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING

the initiating entity has encoded the stream in an encoding that is not supported by the server

 

WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE

the initiating entity has sent a first-level child of the stream that is not supported by the server

 

WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION

the value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server

 

WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED

the initiating entity has sent XML that is not well-formed

 

WOCKY_XMPP_STREAM_ERROR_UNKNOWN

an unknown stream error

 

WOCKY_XMPP_STREAM_ERROR

#define WOCKY_XMPP_STREAM_ERROR (wocky_xmpp_stream_error_quark ())

Get access to the error quark of the xmpp stream errors.

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-heartbeat-source.html0000644000175000017500000002002113012562226033024 0ustar00gkiagiagkiagia00000000000000 wocky-heartbeat-source: Wocky Reference Manual

wocky-heartbeat-source

wocky-heartbeat-source

Description

Functions

WockyHeartbeatCallback ()

void
(*WockyHeartbeatCallback) (gpointer user_data);

wocky_heartbeat_source_new ()

GSource *
wocky_heartbeat_source_new (guint max_interval);

Creates a source which calls its callback at least every max_interval seconds. This is similar to g_timeout_source_new_seconds(), except that the callback may be called slightly earlier than requested, in sync with other periodic network activity (from other XMPP connections, or other applications entirely).

When calling g_source_set_callback() on this source, the supplied callback's signature should match WockyHeartbeatCallback.

Parameters

max_interval

the maximum interval between calls to the source's callback, in seconds. Pass 0 to prevent the callback being called.

 

Returns

the newly-created source.


wocky_heartbeat_source_update_interval ()

void
wocky_heartbeat_source_update_interval
                               (GSource *source,
                                guint max_interval);

Updates the interval between calls to source 's callback. The new interval may not take effect until after the next call to the callback.

Parameters

source

a source returned by wocky_heartbeat_source_new()

 

max_interval

the new maximum interval between calls to the source's callback, in seconds. Pass 0 to stop the callback being called.

 

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/up.png0000644000175000017500000000040413012562226025552 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME IDAT81 @D{xa;$]r =JR1, Sd-}0̟oL:m-QO[ k TzMޠL,:ךu!tK; Pp Ot@l/̵*l}IENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleTransportIceUdp.html0000644000175000017500000002217013012562226032546 0ustar00gkiagiagkiagia00000000000000 WockyJingleTransportIceUdp: Wocky Reference Manual

WockyJingleTransportIceUdp

WockyJingleTransportIceUdp

Properties

WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only

Signals

Object Hierarchy

    GObject
    ╰── WockyJingleTransportIceUdp

Implemented Interfaces

WockyJingleTransportIceUdp implements

Description

Functions

jingle_transport_iceudp_register ()

void
jingle_transport_iceudp_register (WockyJingleFactory *factory);

Types and Values

Property Details

The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “new-candidates” signal

void
user_function (WockyJingleTransportIceUdp *wockyjingletransporticeudp,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyTLSHandler.html0000644000175000017500000006212113012562226030267 0ustar00gkiagiagkiagia00000000000000 WockyTLSHandler: Wocky Reference Manual

WockyTLSHandler

WockyTLSHandler

Properties

gboolean ignore-ssl-errors Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── WockyTLSHandler

Description

Functions

WockyTLSHandlerVerifyAsyncFunc ()

void
(*WockyTLSHandlerVerifyAsyncFunc) (WockyTLSHandler *self,
                                   WockyTLSSession *tls_session,
                                   const gchar *peername,
                                   GStrv extra_identities,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

WockyTLSHandlerVerifyFinishFunc ()

gboolean
(*WockyTLSHandlerVerifyFinishFunc) (WockyTLSHandler *self,
                                    GAsyncResult *res,
                                    GError **error);

wocky_tls_handler_new ()

WockyTLSHandler *
wocky_tls_handler_new (gboolean ignore_ssl_errors);

wocky_tls_handler_verify_async ()

void
wocky_tls_handler_verify_async (WockyTLSHandler *self,
                                WockyTLSSession *tls_session,
                                const gchar *peername,
                                GStrv extra_identities,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_tls_handler_verify_finish ()

gboolean
wocky_tls_handler_verify_finish (WockyTLSHandler *self,
                                 GAsyncResult *result,
                                 GError **error);

wocky_tls_handler_add_ca ()

gboolean
wocky_tls_handler_add_ca (WockyTLSHandler *self,
                          const gchar *path);

Adds a single CA certificate, or directory full of CA certificates, to the set used to check certificates. By default, Wocky will check the system-wide certificate directory (as determined at compile time), so you need only add additional CA paths if you want to trust additional CAs.

Parameters

self

a WockyTLSHandler instance

 

path

a path to a directory or file containing PEM encoded CA certificates

 

Returns

TRUE if path could be resolved to an absolute path. Note that this does not indicate that there was actually a file or directory there or that any CAs were actually found. The CAs won't actually be loaded until just before the TLS session setup is attempted.


wocky_tls_handler_forget_cas ()

void
wocky_tls_handler_forget_cas (WockyTLSHandler *self);

Removes all known locations for CA certificates, including the system-wide certificate directory and any paths added by previous calls to wocky_tls_handler_add_ca(). This is only useful if you want Wocky to distrust your system CAs for some reason.

Parameters

self

a WockyTLSHandler instance

 

wocky_tls_handler_add_crl ()

gboolean
wocky_tls_handler_add_crl (WockyTLSHandler *self,
                           const gchar *path);

Adds a single certificate revocation list file, or a directory of CRLs, to the set used to check certificates. Unlike for CA certificates, there is typically no good default path, so no CRLs are used by default. The path to use depends on the CRL-management software you use; dirmngr (for example) will cache CRLs in /var/cache/dirmngr/crls.d.

Parameters

self

a WockyTLSHandler instance

 

path

a path to a directory or file containing PEM encoded CRL certificates

 

Returns

TRUE if path could be resolved to an absolute path. Note that this does not indicate that there was actually a file or directory there or that any CRLs were actually found. The CRLs won't actually be loaded until just before the TLS session setup is attempted.


wocky_tls_handler_get_cas ()

GSList *
wocky_tls_handler_get_cas (WockyTLSHandler *self);

Gets the CA certificate search path, including any extra paths added with wocky_tls_handler_add_ca().

Parameters

self

a WockyTLSHandler instance

 

Returns

the paths to search for CA certificates.

[transfer none][element-type utf8]


wocky_tls_handler_get_crl ()

GSList *
wocky_tls_handler_get_crl (WockyTLSHandler *self);

Gets the CRL search path, consisting of all paths added with wocky_tls_handler_add_crl().

Parameters

self

a WockyTLSHandler instance

 

Returns

the CRL search path.

[transfer none][element-type utf8]

Types and Values

struct WockyTLSHandlerClass

struct WockyTLSHandlerClass {
  WockyTLSHandlerVerifyAsyncFunc verify_async_func;
  WockyTLSHandlerVerifyFinishFunc verify_finish_func;
};

The class of a WockyTLSHandler.

Members

WockyTLSHandlerVerifyAsyncFunc verify_async_func;

a function to call to start an asychronous verify operation; see wocky_tls_handler_verify_async() for more details

 

WockyTLSHandlerVerifyFinishFunc verify_finish_func;

a function to call to finish an asychronous verify operation; see wocky_tls_handler_verify_finish() for more details

 

Property Details

The “ignore-ssl-errors” property

  “ignore-ssl-errors”        gboolean

Whether to ignore recoverable SSL errors (certificate insecurity/expiry etc).

Flags: Read / Write / Construct

Default value: FALSE

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyCapsCache.html0000644000175000017500000003616213012562226030147 0ustar00gkiagiagkiagia00000000000000 WockyCapsCache: Wocky Reference Manual

WockyCapsCache

WockyCapsCache

Properties

gchar * path Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyCapsCache

Description

Functions

wocky_caps_cache_lookup ()

WockyNodeTree *
wocky_caps_cache_lookup (WockyCapsCache *self,
                         const gchar *node);

Look up node in the caps cache self . The caller is responsible for unreffing the returned WockyNodeTree.

Parameters

self

a WockyCapsCache

 

node

the node to look up in the cache

 

Returns

a WockyNodeTree if node was found in the cache, or NULL if a match was not found


wocky_caps_cache_insert ()

void
wocky_caps_cache_insert (WockyCapsCache *self,
                         const gchar *node,
                         WockyNodeTree *query_node);

Adds a new item to the caps cache. node is associated with query_node so that subsequent calls to wocky_caps_cache_lookup() with the same node value will return query_node .

Parameters

self

a WockyCapsCache

 

node

the capability node

 

query_node

the query WockyNodeTree associated with node

 

wocky_caps_cache_new ()

WockyCapsCache *
wocky_caps_cache_new (const gchar *path);

Convenience function to create a new WockyCapsCache.

Parameters

path

full path to where the cache SQLite database should be stored

 

Returns

a new WockyCapsCache.


wocky_caps_cache_dup_shared ()

WockyCapsCache *
wocky_caps_cache_dup_shared (void);

Returns a new or existing WockyCapsCache object.

The returned WockyCapsCache is cached; the same WockyCapsCache object will be returned by this function repeatedly in the same process. At the end of the process, the caller should call wocky_caps_cache_free_shared() to shared the shared WockyCapsCache object.

Returns

a new, or cached, WockyCapsCache.


wocky_caps_cache_free_shared ()

void
wocky_caps_cache_free_shared (void);

Free the shared WockyCapsCache instance which was created by calling wocky_caps_cache_dup_shared(), or do nothing if said function was not called.

Types and Values

struct WockyCapsCache

struct WockyCapsCache;

An object providing a permanent cache for capabilities.


struct WockyCapsCacheClass

struct WockyCapsCacheClass {
};

The class of a WockyCapsCache.

Property Details

The “path” property

  “path”                     gchar *

The path on disk to the SQLite database where this WockyCapsCache stores its information.

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-node-protected.html0000644000175000017500000004377713012562226034030 0ustar00gkiagiagkiagia00000000000000 wocky-pubsub-node-protected: Wocky Reference Manual

wocky-pubsub-node-protected

wocky-pubsub-node-protected

Description

Functions

wocky_pubsub_node_get_porter ()

WockyPorter *
wocky_pubsub_node_get_porter (WockyPubsubNode *self);

wocky_pubsub_node_make_subscribe_stanza ()

WockyStanza *
wocky_pubsub_node_make_subscribe_stanza
                               (WockyPubsubNode *self,
                                const gchar *jid,
                                WockyNode **pubsub_node,
                                WockyNode **subscribe_node);

wocky_pubsub_node_make_unsubscribe_stanza ()

WockyStanza *
wocky_pubsub_node_make_unsubscribe_stanza
                               (WockyPubsubNode *self,
                                const gchar *jid,
                                const gchar *subid,
                                WockyNode **pubsub_node,
                                WockyNode **unsubscribe_node);

wocky_pubsub_node_make_delete_stanza ()

WockyStanza *
wocky_pubsub_node_make_delete_stanza (WockyPubsubNode *self,
                                      WockyNode **pubsub_node,
                                      WockyNode **delete_node);

wocky_pubsub_node_make_list_subscribers_stanza ()

WockyStanza *
wocky_pubsub_node_make_list_subscribers_stanza
                               (WockyPubsubNode *self,
                                WockyNode **pubsub_node,
                                WockyNode **subscriptions_node);

wocky_pubsub_node_make_list_affiliates_stanza ()

WockyStanza *
wocky_pubsub_node_make_list_affiliates_stanza
                               (WockyPubsubNode *self,
                                WockyNode **pubsub_node,
                                WockyNode **affiliations_node);

wocky_pubsub_node_parse_affiliations ()

GList *
wocky_pubsub_node_parse_affiliations (WockyPubsubNode *self,
                                      WockyNode *affiliations_node);

wocky_pubsub_node_make_modify_affiliates_stanza ()

WockyStanza *
wocky_pubsub_node_make_modify_affiliates_stanza
                               (WockyPubsubNode *self,
                                GList *affiliates,
                                WockyNode **pubsub_node,
                                WockyNode **affiliations_node);

Parameters

self

a pubsub node

 

affiliates

a list of WockyPubsubAffiliation structures, describing only the affiliations which should be changed.

 

pubsub_node

location at which to store a pointer to the <pubsub/> node, or NULL

 

affiliations_node

location at which to store a pointer to the <affiliations/> node, or NULL

 

Returns

an IQ stanza to modify the entities affiliated to a node that you own.


wocky_pubsub_node_make_get_configuration_stanza ()

WockyStanza *
wocky_pubsub_node_make_get_configuration_stanza
                               (WockyPubsubNode *self,
                                WockyNode **pubsub_node,
                                WockyNode **configure_node);

Parameters

self

a pubsub node

 

pubsub_node

location at which to store a pointer to the <pubsub/> node, or NULL

 

configure_node

location at which to store a pointer to the <configure/> node, or NULL

 

Returns

an IQ stanza to retrieve the configuration of self

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyContact.html0000644000175000017500000001361513012562226027726 0ustar00gkiagiagkiagia00000000000000 WockyContact: Wocky Reference Manual

WockyContact

WockyContact

Types and Values

Object Hierarchy

    GObject
    ╰── WockyContact
        ├── WockyBareContact
        ├── WockyLLContact
        ╰── WockyResourceContact

Includes

#include <wocky/wocky-contact.h>

Description

Functions

WockyContactDupJidImpl ()

gchar *
(*WockyContactDupJidImpl) (WockyContact *self);

wocky_contact_dup_jid ()

gchar *
wocky_contact_dup_jid (WockyContact *self);

Types and Values

struct WockyContactClass

struct WockyContactClass {
};

The class of a WockyContact.

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/annotation-glossary.html0000644000175000017500000000672413012562226031334 0ustar00gkiagiagkiagia00000000000000 Annotation Glossary: Wocky Reference Manual

Annotation Glossary

A

allow-none

NULL is OK, both for passing and for returning.

E

element-type

Generics and defining elements of containers and arrays.

O

out

Parameter for returning results. Default is transfer full.

S

skip

Exposed in C code, not necessarily available in other languages.

T

transfer full

Free data after the code is done.

transfer none

Don't free data after the code is done.

type

Override the parsed C type with given type.

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyC2SPorter.html0000644000175000017500000010422313012562226030112 0ustar00gkiagiagkiagia00000000000000 WockyC2SPorter: Wocky Reference Manual

WockyC2SPorter

WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.

Types and Values

Object Hierarchy

    GObject
    ╰── WockyC2SPorter

Implemented Interfaces

WockyC2SPorter implements

Description

Sends and receives WockyStanza from an underlying WockyXmppConnection.

Functions

wocky_c2s_porter_new ()

WockyPorter *
wocky_c2s_porter_new (WockyXmppConnection *connection,
                      const gchar *full_jid);

Convenience function to create a new WockyC2SPorter.

Parameters

connection

WockyXmppConnection which will be used to receive and send WockyStanza

 

full_jid

the full JID of the user

 

Returns

a new WockyPorter.


wocky_c2s_porter_send_whitespace_ping_async ()

void
wocky_c2s_porter_send_whitespace_ping_async
                               (WockyC2SPorter *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request asynchronous sending of a whitespace ping. When the operation is finished callback will be called. You can then call wocky_c2s_porter_send_whitespace_ping_finish() to get the result of the operation. No pings are sent if there are already other stanzas or pings being sent when this function is called; it would be useless.

Parameters

self

a WockyC2SPorter

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_c2s_porter_send_whitespace_ping_finish ()

gboolean
wocky_c2s_porter_send_whitespace_ping_finish
                               (WockyC2SPorter *self,
                                GAsyncResult *result,
                                GError **error);

Finishes sending a whitespace ping.

Parameters

self

a WockyC2SPorter

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE if the ping was succesfully sent, FALSE on error.


wocky_c2s_porter_register_handler_from_server_va ()

guint
wocky_c2s_porter_register_handler_from_server_va
                               (WockyC2SPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                va_list ap);

A va_list version of wocky_c2s_porter_register_handler_from_server(); see that function for more details.

Parameters

self

A WockyC2SPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

ap

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_c2s_porter_register_handler_from_server_by_stanza ()

guint
wocky_c2s_porter_register_handler_from_server_by_stanza
                               (WockyC2SPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                WockyStanza *stanza);

A WockyStanza version of wocky_c2s_porter_register_handler_from_server(); see that function for more details.

Parameters

self

A WockyC2SPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

stanza

a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_c2s_porter_register_handler_from_server ()

guint
wocky_c2s_porter_register_handler_from_server
                               (WockyC2SPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                ...);

Registers a handler for incoming stanzas from the local user's server; that is, stanzas with no "from" attribute, or where the sender is the user's own bare or full JID.

For example, to register a handler for roster pushes, call:

id = wocky_c2s_porter_register_handler_from_server (porter,
  WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_SET,
  WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, roster_push_received_cb, NULL,
  '(',
    "query", ':', WOCKY_XMPP_NS_ROSTER,
  ')', NULL);

Parameters

self

A WockyC2SPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

...

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_c2s_porter_enable_power_saving_mode ()

void
wocky_c2s_porter_enable_power_saving_mode
                               (WockyC2SPorter *porter,
                                gboolean enable);

Enable or disable power saving. In power saving mode, Wocky will attempt to queue "uninteresting" stanza until it is either manually flushed, until important stanza arrives, or until the power saving mode is disabled.

Queueable stanzas are:

  • <presence/> and <presence type="unavailable"/>;
  • PEP updates for a hardcoded list of namespaces.

Whenever stanza is handled, all previously queued stanzas (if any) are handled as well, in the order they arrived. This preserves stanza ordering.

Note that exiting the power saving mode will immediately handle any queued stanzas.

Parameters

porter

a WockyC2SPorter

 

enable

A boolean specifying whether power saving mode should be used

 

Types and Values

struct WockyC2SPorterClass

struct WockyC2SPorterClass {
};

The class of a WockyC2SPorter.


struct WockyC2SPorter

struct WockyC2SPorter;

An object providing a convenient wrapper around a WockyXmppConnection to send and receive stanzas.

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyXmppReader.html0000644000175000017500000007300213012562226030376 0ustar00gkiagiagkiagia00000000000000 WockyXmppReader: Wocky Reference Manual

WockyXmppReader

WockyXmppReader — Xmpp XML to stanza deserializer

Properties

gchar * default-namespace Read / Write / Construct Only
gchar * from Read
gchar * id Read
gchar * lang Read
gboolean streaming-mode Read / Write / Construct Only
gchar * to Read
gchar * version Read

Object Hierarchy

    GEnum
    ├── WockyXmppReaderError
    ╰── WockyXmppReaderState
    GObject
    ╰── WockyXmppReader

Description

The WockyXmppReader deserializes XML to WockyStanzas, misc, other

Functions

wocky_xmpp_reader_error_quark ()

GQuark
wocky_xmpp_reader_error_quark (void);

Get the error quark used by the reader.

Returns

the quark for reader errors.


wocky_xmpp_reader_new ()

WockyXmppReader *
wocky_xmpp_reader_new (void);

Convenience function to create a new WockyXmppReader.

Returns

a new WockyXmppReader


wocky_xmpp_reader_new_no_stream ()

WockyXmppReader *
wocky_xmpp_reader_new_no_stream (void);

Convenience function to create a new WockyXmppReader that has streaming mode disabled.

Returns

a new WockyXmppReader in non-streaming mode


wocky_xmpp_reader_new_no_stream_ns ()

WockyXmppReader *
wocky_xmpp_reader_new_no_stream_ns (const gchar *default_namespace);

Create a new WockyXmppReader, with “streaming-mode” disabled and the specified “default-namespace”.

Parameters

default_namespace

default XML namespace to apply to the top-level element

 

Returns

a new WockyXmppReader in non-streaming mode.

[transfer full]


wocky_xmpp_reader_get_state ()

WockyXmppReaderState
wocky_xmpp_reader_get_state (WockyXmppReader *reader);

Parameters

reader

a WockyXmppReader

 

Returns

The current state of the reader


wocky_xmpp_reader_push ()

void
wocky_xmpp_reader_push (WockyXmppReader *reader,
                        const guint8 *data,
                        gsize length);

Push an amount of data to parse.

Parameters

reader

a WockyXmppReader

 

data

Data to read

 

length

Size of data

 

wocky_xmpp_reader_pop_stanza ()

WockyStanza *
wocky_xmpp_reader_pop_stanza (WockyXmppReader *reader);

Gets one WockyStanza out of the reader or NULL if there are no available stanzas.

Parameters

reader

a WockyXmppReader

 

Returns

One WockyStanza or NULL if there are no available stanzas. Caller owns the returned stanza.


wocky_xmpp_reader_peek_stanza ()

WockyStanza *
wocky_xmpp_reader_peek_stanza (WockyXmppReader *reader);

Returns the first WockyStanza available from reader or NULL if there are no available stanzas. The stanza is not removed from the readers queue

Parameters

reader

a WockyXmppReader

 

Returns

One WockyStanza or NULL if there are no available stanzas. The stanza is owned by the WockyXmppReader


wocky_xmpp_reader_get_error ()

GError *
wocky_xmpp_reader_get_error (WockyXmppReader *reader);

Get the error from the reader

Parameters

reader

a WockyXmppReader

 

Returns

A copy of the error as encountered by the reader or NULL if there was no error. Free after use.


wocky_xmpp_reader_reset ()

void
wocky_xmpp_reader_reset (WockyXmppReader *reader);

Reset the xml parser.

Parameters

reader

a WockyXmppReader

 

Types and Values

struct WockyXmppReaderClass

struct WockyXmppReaderClass {
};

The class of a WockyXmppReader.


enum WockyXmppReaderState

The possible states a reader can be in.

Members

WOCKY_XMPP_READER_STATE_INITIAL

initial state

 

WOCKY_XMPP_READER_STATE_OPENED

stream is open

 

WOCKY_XMPP_READER_STATE_CLOSED

stream has been closed

 

WOCKY_XMPP_READER_STATE_ERROR

stream reader hit an error

 

enum WockyXmppReaderError

The different errors that can occur while reading a stream

Members

WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START

invalid start of xmpp stream

 

WOCKY_XMPP_READER_ERROR_PARSE_ERROR

error in parsing the XML

 

WOCKY_XMPP_READER_ERROR

#define WOCKY_XMPP_READER_ERROR (wocky_xmpp_reader_error_quark ())

Get access to the error quark of the reader.

Property Details

The “default-namespace” property

  “default-namespace”        gchar *

The default namespace for the root element of the document. Only meaningful if streaming-mode is FALSE.

Flags: Read / Write / Construct Only

Default value: ""


The “from” property

  “from”                     gchar *

from attribute in the xml stream opening.

Flags: Read

Default value: NULL


The “id” property

  “id”                       gchar *

id attribute in the xml stream opening.

Flags: Read

Default value: NULL


The “lang” property

  “lang”                     gchar *

xml:lang attribute in the xml stream opening.

Flags: Read

Default value: NULL


The “streaming-mode” property

  “streaming-mode”           gboolean

Whether the xml to be read is one big stream or separate documents.

Flags: Read / Write / Construct Only

Default value: TRUE


The “to” property

  “to”                       gchar *

to attribute in the xml stream opening.

Flags: Read

Default value: NULL


The “version” property

  “version”                  gchar *

version attribute in the xml stream opening.

Flags: Read

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-enumtypes.html0000644000175000017500000000446313012562226031634 0ustar00gkiagiagkiagia00000000000000 wocky-enumtypes: Wocky Reference Manual

wocky-enumtypes

wocky-enumtypes

Description

Functions

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/home.png0000644000175000017500000000040013012562226026052 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME &IDAT8ҽ Aߞf`n v`6`/`Yܡ`f&k$,} 0b+ԸaQW~b O e{y N[L}.piBzmm o.I]7^[;%:VIENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleFactory.html0000644000175000017500000004450413012562226031074 0ustar00gkiagiagkiagia00000000000000 WockyJingleFactory: Wocky Reference Manual

WockyJingleFactory

WockyJingleFactory

Properties

WockySession * session Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── WockyJingleFactory

Description

Functions

wocky_jingle_factory_new ()

WockyJingleFactory *
wocky_jingle_factory_new (WockySession *session);

wocky_jingle_factory_stop ()

void
wocky_jingle_factory_stop (WockyJingleFactory *self);

wocky_jingle_factory_register_content_type ()

void
wocky_jingle_factory_register_content_type
                               (WockyJingleFactory *self,
                                gchar *xmlns,
                                GType content_type);

wocky_jingle_factory_lookup_content_type ()

GType
wocky_jingle_factory_lookup_content_type
                               (WockyJingleFactory *self,
                                const gchar *xmlns);

wocky_jingle_factory_register_transport ()

void
wocky_jingle_factory_register_transport
                               (WockyJingleFactory *self,
                                gchar *xmlns,
                                GType transport_type);

wocky_jingle_factory_lookup_transport ()

GType
wocky_jingle_factory_lookup_transport (WockyJingleFactory *self,
                                       const gchar *xmlns);

wocky_jingle_factory_create_session ()

WockyJingleSession *
wocky_jingle_factory_create_session (WockyJingleFactory *fac,
                                     const gchar *jid,
                                     WockyJingleDialect dialect,
                                     gboolean local_hold);

Creates a new WockyJingleSession to the specified contact. Note that the session will not be initiated until at least one content is added with wocky_jingle_session_add_content(), and those contents are ready.

You would typically determine which dialect to use from the peer's capabilities.

Parameters

fac

the factory

 

jid

the full JID (typically including a resource) to establish a session with

 

dialect

the variant of the Jingle protocol to use

 

local_hold

whether the call should start out on hold; if in doubt, pass FALSE

 

Returns

the new session, which will not be NULL.

[transfer none]


wocky_jingle_factory_get_jingle_info ()

WockyJingleInfo *
wocky_jingle_factory_get_jingle_info (WockyJingleFactory *fac);

Types and Values

Property Details

The “session” property

  “session”                  WockySession *

WockySession to listen for Jingle sessions on.

Flags: Read / Write / Construct Only

Signal Details

The “new-session” signal

void
user_function (WockyJingleFactory *wockyjinglefactory,
               WockyJingleSession *arg1,
               gboolean            arg2,
               gpointer            user_data)

Flags: Run Last


The “query-cap” signal

gboolean
user_function (WockyJingleFactory *wockyjinglefactory,
               WockyContact       *arg1,
               gchar              *arg2,
               gpointer            user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/style.css0000644000175000017500000002115413012562226026277 0ustar00gkiagiagkiagia00000000000000body { font-family: cantarell, sans-serif; } .synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; background: rgba(238, 238, 236, 0.5); border: solid 1px rgb(238, 238, 236); padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ /* fallback for no rgba support */ background: #e6f3ff; border: solid 1px #729fcf; background: rgba(114, 159, 207, 0.1); border: solid 1px rgba(114, 159, 207, 0.2); padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.informaltable table { border-collapse: separate; border-spacing: 1em 0.3em; border: none; } div.informaltable table td, div.informaltable table th { vertical-align: top; } .function_type, .variable_type, .property_type, .signal_type, .parameter_name, .struct_member_name, .union_member_name, .define_keyword, .datatype_keyword, .typedef_keyword { text-align: right; } /* dim non-primary columns */ .c_punctuation, .function_type, .variable_type, .property_type, .signal_type, .define_keyword, .datatype_keyword, .typedef_keyword, .property_flags, .signal_flags, .parameter_annotations, .enum_member_annotations, .struct_member_annotations, .union_member_annotations { color: #888a85; } .function_type a, .function_type a:visited, .function_type a:hover, .property_type a, .property_type a:visited, .property_type a:hover, .signal_type a, .signal_type a:visited, .signal_type a:hover, .signal_flags a, .signal_flags a:visited, .signal_flags a:hover { color: #729fcf; } td p { margin: 0.25em; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } h4 { color: #555753; margin-top: 1em; margin-bottom: 1em; } hr { /* tango:aluminium 1 */ color: #d3d7cf; background: #d3d7cf; border: none 0px; height: 1px; clear: both; margin: 2.0em 0em 2.0em 0em; } dl.toc dt { padding-bottom: 0.25em; } dl.toc > dt { padding-top: 0.25em; padding-bottom: 0.25em; font-weight: bold; } dl.toc > dl { padding-bottom: 0.5em; } .parameter { font-style: normal; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .informalfigure, .figure { margin: 1em; } .informalexample, .example { margin-top: 1em; margin-bottom: 1em; } .warning { /* tango:orange 0/1 */ background: #ffeed9; background: rgba(252, 175, 62, 0.1); border-color: #ffb04f; border-color: rgba(252, 175, 62, 0.2); } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; background: rgba(138, 226, 52, 0.1); border-color: #abf562; border-color: rgba(138, 226, 52, 0.2); } div.blockquote { border-color: #eeeeec; } .note, .warning, div.blockquote { padding: 0.5em; border-width: 1px; border-style: solid; margin: 2em; } .note p, .warning p { margin: 0; } div.warning h3.title, div.note h3.title { display: none; } p + div.section { margin-top: 1em; } div.refnamediv, div.refsynopsisdiv, div.refsect1, div.refsect2, div.toc, div.section { margin-bottom: 1em; } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .lineart { color: #d3d7cf; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-weight: normal; } .structfield { font-style: normal; font-weight: normal; } acronym,abbr { border-bottom: 1px dotted gray; } /* code listings */ .listing_code .programlisting .normal, .listing_code .programlisting .normal a, .listing_code .programlisting .number, .listing_code .programlisting .cbracket, .listing_code .programlisting .symbol { color: #555753; } .listing_code .programlisting .comment, .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .function, .listing_code .programlisting .function a, .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ .listing_code .programlisting .keyword, .listing_code .programlisting .usertype, .listing_code .programlisting .type, .listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; border: solid 1px rgba(114, 159, 207, 0.2); padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; background: rgba(114, 159, 207, 0.2); /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; background: rgba(114, 159, 207, 0.1); } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; background: none; } .listing_lines pre, .listing_code pre { margin: 0px; } @media screen { /* these have a as a first child, but since there are no parent selectors * we can't use that. */ a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 2.5em; padding-bottom: 500px; max-width: 60em; } p { max-width: 60em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; background: #e2e2e2; border-bottom: solid 1px #babdb6; border-spacing: 5px; margin-top: 0; margin-bottom: 0; top: 0; left: 0; z-index: 10; } table.navigation#top td { padding-left: 6px; padding-right: 6px; } .navigation a, .navigation a:visited { /* tango:sky blue 3 */ color: #204a87; } .navigation a:hover { /* tango:sky blue 2 */ color: #3465a4; } td.shortcuts { /* tango:sky blue 2 */ color: #3465a4; font-size: 80%; white-space: nowrap; } td.shortcuts .dim { color: #babdb6; } .navigation .title { font-size: 80%; max-width: none; margin: 0px; font-weight: normal; } } @media screen and (min-width: 60em) { /* screen larger than 60em */ body { margin: auto; } } @media screen and (max-width: 60em) { /* screen less than 60em */ #nav_hierarchy { display: none; } #nav_interfaces { display: none; } #nav_prerequisites { display: none; } #nav_derived_interfaces { display: none; } #nav_implementations { display: none; } #nav_child_properties { display: none; } #nav_style_properties { display: none; } #nav_index { display: none; } #nav_glossary { display: none; } .gallery_image { display: none; } .property_flags { display: none; } .signal_flags { display: none; } .parameter_annotations { display: none; } .enum_member_annotations { display: none; } .struct_member_annotations { display: none; } .union_member_annotations { display: none; } /* now that a column is hidden, optimize space */ col.parameters_name { width: auto; } col.parameters_description { width: auto; } col.struct_members_name { width: auto; } col.struct_members_description { width: auto; } col.enum_members_name { width: auto; } col.enum_members_description { width: auto; } col.union_members_name { width: auto; } col.union_members_description { width: auto; } .listing_lines { display: none; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; background: #e2e2e2; border: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockySaslAuth.html0000644000175000017500000003311713012562226030056 0ustar00gkiagiagkiagia00000000000000 WockySaslAuth: Wocky Reference Manual

WockySaslAuth

WockySaslAuth

Properties

WockyAuthRegistry * auth-registry Read / Write / Construct Only
WockyXmppConnection * connection Read / Write / Construct Only
gchar * password Write / Construct
gchar * server Read / Write / Construct
gchar * username Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── WockySaslAuth

Description

Functions

wocky_sasl_auth_new ()

WockySaslAuth *
wocky_sasl_auth_new (const gchar *server,
                     const gchar *username,
                     const gchar *password,
                     WockyXmppConnection *connection,
                     WockyAuthRegistry *auth_registry);

wocky_sasl_auth_add_handler ()

void
wocky_sasl_auth_add_handler (WockySaslAuth *sasl,
                             WockyAuthHandler *handler);

wocky_sasl_auth_authenticate_async ()

void
wocky_sasl_auth_authenticate_async (WockySaslAuth *sasl,
                                    WockyStanza *features,
                                    gboolean allow_plain,
                                    gboolean is_secure,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

wocky_sasl_auth_authenticate_finish ()

gboolean
wocky_sasl_auth_authenticate_finish (WockySaslAuth *sasl,
                                     GAsyncResult *result,
                                     GError **error);

Types and Values

struct WockySaslAuthClass

struct WockySaslAuthClass {
};

The class of a WockySaslAuth.

Property Details

The “auth-registry” property

  “auth-registry”            WockyAuthRegistry *

Authentication Registry.

Flags: Read / Write / Construct Only


The “connection” property

  “connection”               WockyXmppConnection *

The Xmpp connection to user.

Flags: Read / Write / Construct Only


The “password” property

  “password”                 gchar *

The password to authenticate with.

Flags: Write / Construct

Default value: NULL


The “server” property

  “server”                   gchar *

The name of the server.

Flags: Read / Write / Construct

Default value: NULL


The “username” property

  “username”                 gchar *

The username to authenticate with.

Flags: Write / Construct

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJabberAuth.html0000644000175000017500000003505613012562226030345 0ustar00gkiagiagkiagia00000000000000 WockyJabberAuth: Wocky Reference Manual

WockyJabberAuth

WockyJabberAuth

Properties

WockyAuthRegistry * auth-registry Read / Write / Construct Only
WockyXmppConnection * connection Read / Write / Construct Only
gchar * password Write / Construct
gchar * resource Write / Construct
gchar * session-id Read / Write / Construct
gchar * username Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── WockyJabberAuth

Description

Functions

wocky_jabber_auth_new ()

WockyJabberAuth *
wocky_jabber_auth_new (const gchar *server,
                       const gchar *username,
                       const gchar *resource,
                       const gchar *password,
                       WockyXmppConnection *connection,
                       WockyAuthRegistry *auth_registry);

wocky_jabber_auth_add_handler ()

void
wocky_jabber_auth_add_handler (WockyJabberAuth *self,
                               WockyAuthHandler *handler);

wocky_jabber_auth_authenticate_async ()

void
wocky_jabber_auth_authenticate_async (WockyJabberAuth *self,
                                      gboolean allow_plain,
                                      gboolean is_secure,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

wocky_jabber_auth_authenticate_finish ()

gboolean
wocky_jabber_auth_authenticate_finish (WockyJabberAuth *self,
                                       GAsyncResult *result,
                                       GError **error);

Types and Values

struct WockyJabberAuthClass

struct WockyJabberAuthClass {
};

The class of a WockyJabberAuth.

Property Details

The “auth-registry” property

  “auth-registry”            WockyAuthRegistry *

Authentication Registry.

Flags: Read / Write / Construct Only


The “connection” property

  “connection”               WockyXmppConnection *

The Xmpp connection to user.

Flags: Read / Write / Construct Only


The “password” property

  “password”                 gchar *

The password to authenticate with.

Flags: Write / Construct

Default value: NULL


The “resource” property

  “resource”                 gchar *

The XMPP resource to bind to.

Flags: Write / Construct

Default value: NULL


The “session-id” property

  “session-id”               gchar *

The XMPP session ID.

Flags: Read / Write / Construct

Default value: NULL


The “username” property

  “username”                 gchar *

The username to authenticate with.

Flags: Write / Construct

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-pubsub-helpers.html0000644000175000017500000010541513012562226032542 0ustar00gkiagiagkiagia00000000000000 wocky-pubsub-helpers: Wocky Reference Manual

wocky-pubsub-helpers

wocky-pubsub-helpers

Description

Functions

wocky_pubsub_make_event_stanza ()

WockyStanza *
wocky_pubsub_make_event_stanza (const gchar *node,
                                const gchar *from,
                                WockyNode **item_out);

Generates a new message stanza to send to other contacts about an updated PEP node.

Note that this should only be used in link-local connections. Regular pubsub consists of making a publish stanza with wocky_pubsub_make_publish_stanza() and sending it to your own server. The server will then send the event stanza on to your contacts who have the appropriate capability.

Parameters

node

the the name of the pubsub node; may not be NULL

 

from

a JID to use as the 'from' attribute, or NULL

 

item_out

a location to store the item WockyNode, or NULL

 

Returns

a new WockyStanza pubsub event stanza; free with g_object_unref()


wocky_pubsub_make_stanza ()

WockyStanza *
wocky_pubsub_make_stanza (const gchar *service,
                          WockyStanzaSubType sub_type,
                          const gchar *pubsub_ns,
                          const gchar *action_name,
                          WockyNode **pubsub_node,
                          WockyNode **action_node);

Parameters

service

the JID of a PubSub service, or NULL

 

sub_type

WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET, as you wish

 

pubsub_ns

the namespace for the <pubsub/> node of the stanza

 

action_name

the action node to add to <pubsub/>

 

pubsub_node

address at which to store a pointer to the <pubsub/> node

 

action_node

address at wihch to store a pointer to the <action /> node

 

Returns

a new iq[type=sub_type ]/pubsub/action stanza


wocky_pubsub_make_publish_stanza ()

WockyStanza *
wocky_pubsub_make_publish_stanza (const gchar *service,
                                  const gchar *node,
                                  WockyNode **pubsub_out,
                                  WockyNode **publish_out,
                                  WockyNode **item_out);

Parameters

service

the JID of a PubSub service, or NULL

 

node

the name of a node on service ; may not be NULL

 

pubsub_out

address at which to store a pointer to the <pubsub/> node

 

publish_out

address at which to store a pointer to the <publish/> node

 

item_out

address at which to store a pointer to the <item/> node

 

Returns

a new iq[type='set']/pubsub/publish/item stanza


wocky_send_ll_pep_event ()

void
wocky_send_ll_pep_event (WockySession *session,
                         WockyStanza *stanza);

Send a PEP event to all link-local contacts interested in receiving it.

Parameters

session

the WockySession to send on

 

stanza

the PEP event stanza to send

 

wocky_pubsub_distill_iq_reply ()

gboolean
wocky_pubsub_distill_iq_reply (GObject *source,
                               GAsyncResult *res,
                               const gchar *pubsub_ns,
                               const gchar *child_name,
                               WockyNodeTree **child_out,
                               GError **error);

Helper function to finish a wocky_porter_send_iq_async() operation and extract a particular pubsub child from the resulting reply, if needed.

Parameters

source

a WockyPorter instance

 

res

a result passed to the callback for wocky_porter_send_iq_async()

 

pubsub_ns

the namespace of the <pubsub/> node expected in this reply (such as WOCKY_XMPP_NS_PUBSUB), or NULL if one is not expected

 

child_name

the name of the child of <pubsub/> expected in this reply (such as "subscriptions"); ignored if pubsub_ns is NULL

 

child_out

location at which to store a reference to the node tree at child_name , or NULL if you don't need it.

 

error

location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

 

Returns

TRUE if the desired pubsub child was found; FALSE if sending the IQ failed, the reply had type='error', or the pubsub child was not found, with error set appropriately.


wocky_pubsub_distill_ambivalent_iq_reply ()

gboolean
wocky_pubsub_distill_ambivalent_iq_reply
                               (GObject *source,
                                GAsyncResult *res,
                                const gchar *pubsub_ns,
                                const gchar *child_name,
                                WockyNodeTree **child_out,
                                GError **error);

Helper function to finish a wocky_porter_send_iq_async() operation and extract a particular pubsub child from the resulting reply, if it is present. This is like wocky_pubsub_distill_iq_reply(), but is ambivalent as to whether the <pubsub/> structure has to be included.

Parameters

source

a WockyPorter instance

 

res

a result passed to the callback for wocky_porter_send_iq_async()

 

pubsub_ns

the namespace of the <pubsub/> node accepted in this reply (such as WOCKY_XMPP_NS_PUBSUB)

 

child_name

the name of the child of <pubsub/> accepted in this reply (such as "subscriptions")

 

child_out

location at which to store a reference to the node tree at child_name , if it is found, or to be set to NULL if it is not found

 

error

location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

 

Returns

TRUE if the IQ was a success; FALSE if sending the IQ failed or the reply had type='error', with error set appropriately.


wocky_pubsub_distill_void_iq_reply ()

gboolean
wocky_pubsub_distill_void_iq_reply (GObject *source,
                                    GAsyncResult *res,
                                    GError **error);

Helper function to finish a wocky_porter_send_iq_async() operation where no pubsub child is expected in the resulting reply.

Parameters

source

a WockyPorter instance

 

res

a result passed to the callback for wocky_porter_send_iq_async()

 

error

location at which to store an error if the call to wocky_porter_send_iq_async() returned an error, or if the reply was an error

 

Returns

TRUE if the IQ was a success; FALSE if sending the IQ failed or the reply had type='error', with error set appropriately.


wocky_pubsub_distill_stanza ()

gboolean
wocky_pubsub_distill_stanza (WockyStanza *result,
                             const gchar *pubsub_ns,
                             const gchar *child_name,
                             gboolean body_optional,
                             WockyNodeTree **child_out,
                             GError **error);

Helper function to extract a particular pubsub child node from a reply, if it is present. If body_optional is FALSE, the <pubsub><child_name /></pubsub> tree being absent is not considered an error: child_out is set to NULL and the function returns TRUE.

If you are happy to delegate calling wocky_porter_send_iq_finish() and extracting stanza errors, you would probably be better served by one of wocky_pubsub_distill_iq_reply() or wocky_pubsub_distill_ambivalent_iq_reply().

Parameters

result

an iq type='result'

 

pubsub_ns

the namespace of the <pubsub/> node expected in this reply (such as WOCKY_XMPP_NS_PUBSUB)

 

child_name

the name of the child of <pubsub/> expected in this reply (such as "subscriptions")

 

body_optional

If TRUE, the child being absent is not considered an error

 

child_out

location at which to store a reference to the node tree at child_name , if it is found, or to be set to NULL if it is not.

 

error

location at which to store an error if the child node is not found and body_optional is FALSE

 

Returns

TRUE if the child was found or was optional; FALSE with error set otherwise.

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleContent.html0000644000175000017500000015343213012562226031100 0ustar00gkiagiagkiagia00000000000000 WockyJingleContent: Wocky Reference Manual

WockyJingleContent

WockyJingleContent

Functions

void wocky_jingle_content_parse_add ()
void wocky_jingle_content_update_senders ()
void wocky_jingle_content_produce_node ()
void wocky_jingle_content_parse_accept ()
void wocky_jingle_content_parse_info ()
void wocky_jingle_content_parse_transport_info ()
void wocky_jingle_content_parse_description_info ()
guint wocky_jingle_content_create_share_channel ()
void wocky_jingle_content_add_candidates ()
gboolean wocky_jingle_content_is_ready ()
void wocky_jingle_content_set_transport_state ()
void wocky_jingle_content_remove ()
void wocky_jingle_content_reject ()
GList * wocky_jingle_content_get_remote_candidates ()
GList * wocky_jingle_content_get_local_candidates ()
gboolean wocky_jingle_content_get_credentials ()
gboolean wocky_jingle_content_change_direction ()
void wocky_jingle_content_retransmit_candidates ()
void wocky_jingle_content_inject_candidates ()
gboolean wocky_jingle_content_is_created_by_us ()
gboolean wocky_jingle_content_creator_is_initiator ()
const gchar * wocky_jingle_content_get_name ()
const gchar * wocky_jingle_content_get_ns ()
const gchar * wocky_jingle_content_get_disposition ()
WockyJingleTransportType wocky_jingle_content_get_transport_type ()
const gchar * wocky_jingle_content_get_transport_ns ()
void wocky_jingle_content_maybe_send_description ()
gboolean wocky_jingle_content_sending ()
gboolean wocky_jingle_content_receiving ()
void wocky_jingle_content_set_sending ()
void wocky_jingle_content_request_receiving ()
void wocky_jingle_content_send_complete ()

Properties

gchar * content-ns Read / Write
gchar * disposition Read / Write
gboolean locally-created Read
gchar * name Read / Write / Construct Only
guint senders Read / Write
WockyJingleSession * session Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write

Object Hierarchy

    GObject
    ╰── WockyJingleContent
        ╰── WockyJingleMediaRtp

Description

Functions

wocky_jingle_content_parse_add ()

void
wocky_jingle_content_parse_add (WockyJingleContent *c,
                                WockyNode *content_node,
                                gboolean google_mode,
                                GError **error);

wocky_jingle_content_update_senders ()

void
wocky_jingle_content_update_senders (WockyJingleContent *c,
                                     WockyNode *content_node,
                                     GError **error);

wocky_jingle_content_produce_node ()

void
wocky_jingle_content_produce_node (WockyJingleContent *c,
                                   WockyNode *parent,
                                   gboolean include_description,
                                   gboolean include_transport,
                                   WockyNode **trans_node_out);

wocky_jingle_content_parse_accept ()

void
wocky_jingle_content_parse_accept (WockyJingleContent *c,
                                   WockyNode *content_node,
                                   gboolean google_mode,
                                   GError **error);

wocky_jingle_content_parse_info ()

void
wocky_jingle_content_parse_info (WockyJingleContent *c,
                                 WockyNode *content_node,
                                 GError **error);

wocky_jingle_content_parse_transport_info ()

void
wocky_jingle_content_parse_transport_info
                               (WockyJingleContent *self,
                                WockyNode *trans_node,
                                GError **error);

wocky_jingle_content_parse_description_info ()

void
wocky_jingle_content_parse_description_info
                               (WockyJingleContent *self,
                                WockyNode *trans_node,
                                GError **error);

wocky_jingle_content_create_share_channel ()

guint
wocky_jingle_content_create_share_channel
                               (WockyJingleContent *self,
                                const gchar *name);

wocky_jingle_content_add_candidates ()

void
wocky_jingle_content_add_candidates (WockyJingleContent *self,
                                     GList *li);

Adds the candidates listed in li to the content, communicating them to the peer if appropriate.

Parameters

self

the content

 

li

a list of WockyJingleCandidate structs, allocated with wocky_jingle_candidate_new().

[element-type WockyJingleCandidate][transfer full]

wocky_jingle_content_is_ready ()

gboolean
wocky_jingle_content_is_ready (WockyJingleContent *self);

wocky_jingle_content_set_transport_state ()

void
wocky_jingle_content_set_transport_state
                               (WockyJingleContent *content,
                                WockyJingleTransportState state);

wocky_jingle_content_remove ()

void
wocky_jingle_content_remove (WockyJingleContent *c,
                             gboolean signal_peer);

wocky_jingle_content_reject ()

void
wocky_jingle_content_reject (WockyJingleContent *c,
                             WockyJingleReason reason);

wocky_jingle_content_get_remote_candidates ()

GList *
wocky_jingle_content_get_remote_candidates
                               (WockyJingleContent *c);

wocky_jingle_content_get_local_candidates ()

GList *
wocky_jingle_content_get_local_candidates
                               (WockyJingleContent *c);

wocky_jingle_content_get_credentials ()

gboolean
wocky_jingle_content_get_credentials (WockyJingleContent *c,
                                      gchar **ufrag,
                                      gchar **pwd);

wocky_jingle_content_change_direction ()

gboolean
wocky_jingle_content_change_direction (WockyJingleContent *c,
                                       WockyJingleContentSenders senders);

wocky_jingle_content_retransmit_candidates ()

void
wocky_jingle_content_retransmit_candidates
                               (WockyJingleContent *self,
                                gboolean all);

wocky_jingle_content_inject_candidates ()

void
wocky_jingle_content_inject_candidates
                               (WockyJingleContent *self,
                                WockyNode *transport_node);

wocky_jingle_content_is_created_by_us ()

gboolean
wocky_jingle_content_is_created_by_us (WockyJingleContent *c);

wocky_jingle_content_creator_is_initiator ()

gboolean
wocky_jingle_content_creator_is_initiator
                               (WockyJingleContent *c);

wocky_jingle_content_get_name ()

const gchar *
wocky_jingle_content_get_name (WockyJingleContent *self);

wocky_jingle_content_get_ns ()

const gchar *
wocky_jingle_content_get_ns (WockyJingleContent *self);

wocky_jingle_content_get_disposition ()

const gchar *
wocky_jingle_content_get_disposition (WockyJingleContent *self);

wocky_jingle_content_get_transport_type ()

WockyJingleTransportType
wocky_jingle_content_get_transport_type
                               (WockyJingleContent *c);

wocky_jingle_content_get_transport_ns ()

const gchar *
wocky_jingle_content_get_transport_ns (WockyJingleContent *self);

wocky_jingle_content_maybe_send_description ()

void
wocky_jingle_content_maybe_send_description
                               (WockyJingleContent *self);

wocky_jingle_content_sending ()

gboolean
wocky_jingle_content_sending (WockyJingleContent *self);

wocky_jingle_content_receiving ()

gboolean
wocky_jingle_content_receiving (WockyJingleContent *self);

wocky_jingle_content_set_sending ()

void
wocky_jingle_content_set_sending (WockyJingleContent *self,
                                  gboolean send);

wocky_jingle_content_request_receiving ()

void
wocky_jingle_content_request_receiving
                               (WockyJingleContent *self,
                                gboolean receive);

wocky_jingle_content_send_complete ()

void
wocky_jingle_content_send_complete (WockyJingleContent *self);

Types and Values

enum WockyJingleMediaType

Members

WOCKY_JINGLE_MEDIA_TYPE_NONE

   

WOCKY_JINGLE_MEDIA_TYPE_AUDIO

   

WOCKY_JINGLE_MEDIA_TYPE_VIDEO

   

enum WockyJingleContentState

Members

WOCKY_JINGLE_CONTENT_STATE_EMPTY

   

WOCKY_JINGLE_CONTENT_STATE_NEW

   

WOCKY_JINGLE_CONTENT_STATE_SENT

   

WOCKY_JINGLE_CONTENT_STATE_ACKNOWLEDGED

   

WOCKY_JINGLE_CONTENT_STATE_REMOVING

   

WockyJingleCandidate

typedef struct {
  WockyJingleTransportProtocol protocol;
  WockyJingleCandidateType type;

  gchar *id;
  gchar *address;
  int port;
  int component;
  int generation;

  int preference;
  gchar *username;
  gchar *password;
  int network;
} WockyJingleCandidate;

Property Details

The “content-ns” property

  “content-ns”               gchar *

Namespace identifying the content type.

Flags: Read / Write

Default value: NULL


The “disposition” property

  “disposition”              gchar *

Distinguishes between 'session' and other contents.

Flags: Read / Write

Default value: NULL


The “locally-created” property

  “locally-created”          gboolean

True if the content was created by the local client.

Flags: Read

Default value: FALSE


The “name” property

  “name”                     gchar *

A unique content name in the session.

Flags: Read / Write / Construct Only

Default value: NULL


The “senders” property

  “senders”                  guint

Valid senders for the stream.

Flags: Read / Write

Default value: 0


The “session” property

  “session”                  WockyJingleSession *

Jingle session object that owns this content.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

The current state that the content is in.

Flags: Read / Write

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write

Default value: NULL

Signal Details

The “completed” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Run Last


The “new-candidates” signal

void
user_function (WockyJingleContent *content,
               gpointer            candidates,
               gpointer            user_data)

Emitted when new candidates are received from the peer.

Parameters

content

the content

 

candidates

a GList of new candidates.

[type GList][element-type WockyJingleCandidate]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-share-channel” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gchar              *arg1,
               guint               arg2,
               gpointer            user_data)

Flags: Run Last


The “ready” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Has Details


The “removed” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Has Details

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyPepService.html0000644000175000017500000006110013012562226030370 0ustar00gkiagiagkiagia00000000000000 WockyPepService: Wocky Reference Manual

WockyPepService

WockyPepService — Object to represent a single PEP service

Properties

gchar * node Read / Write / Construct Only
gboolean subscribe Read / Write / Construct Only

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── WockyPepService

Includes

#include <wocky/wocky-pep-service.h>

Description

Object to aid with looking up PEP nodes and listening for changes.

Functions

wocky_pep_service_new ()

WockyPepService *
wocky_pep_service_new (const gchar *node,
                       gboolean subscribe);

A convenience function to create a new WockyPepService object.

Parameters

node

the namespace of the PEP node

 

subscribe

TRUE if Wocky is to subscribe to the notifications of the node, otherwise FALSE

 

Returns

a new WockyPepService


wocky_pep_service_start ()

void
wocky_pep_service_start (WockyPepService *self,
                         WockySession *session);

Start listening to the PEP node node and signal changes by using “changed”.

Parameters

self

a WockyPepService object

 

session

a WockySession object

 

wocky_pep_service_get_async ()

void
wocky_pep_service_get_async (WockyPepService *self,
                             WockyBareContact *contact,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

Starts an asynchronous operation to get the PEP node, “node”.

When the operation is complete, callback will be called and the function should call wocky_pep_service_get_finish().

Parameters

self

a WockyPepService object

 

contact

a WockyBareContact object

 

cancellable

an optional GCancellable object, or NULL

 

callback

a function to call when the node is retrieved

 

user_data

user data for callback

 

wocky_pep_service_get_finish ()

WockyStanza *
wocky_pep_service_get_finish (WockyPepService *self,
                              GAsyncResult *result,
                              WockyNode **item,
                              GError **error);

Finishes an asynchronous operation to get the PEP node, “node”. For more details, see wocky_pep_service_get_async().

Parameters

self

a WockyPepService object

 

result

a GAsyncResult

 

item

on success, the first <item> element in the result, or NULL if self has no published items.

[out][allow-none]

error

a location to store a GError if an error occurs

 

Returns

the WockyStanza retrieved from getting the PEP node.


wocky_pep_service_make_publish_stanza ()

WockyStanza *
wocky_pep_service_make_publish_stanza (WockyPepService *self,
                                       WockyNode **item);

Generates a new IQ type='set' PEP publish stanza.

Parameters

self

a WockyPepService

 

item

a location to store the item WockyNode, or NULL

 

Returns

a new WockyStanza PEP publish stanza; free with g_object_unref()

Types and Values

struct WockyPepServiceClass

struct WockyPepServiceClass {
};

The class of a WockyPepService.


struct WockyPepService

struct WockyPepService;

Object to aid with looking up PEP nodes and listening for changes.

Property Details

The “node” property

  “node”                     gchar *

Namespace of the PEP node.

Flags: Read / Write / Construct Only

Default value: NULL


The “subscribe” property

  “subscribe”                gboolean

TRUE if Wocky is to subscribe to the notifications of the node.

Flags: Read / Write / Construct Only

Default value: FALSE

Signal Details

The “changed” signal

void
user_function (WockyPepService  *self,
               WockyBareContact *contact,
               WockyStanza      *stanza,
               gpointer          item,
               gpointer          user_data)

Emitted when the node value changes.

Parameters

self

a WockyPepService object

 

contact

the WockyBareContact who changed the node

 

stanza

the WockyStanza

 

item

the first—and typically only—<item> element in stanza , or NULL if there is none.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleTransportIface.html0000644000175000017500000005521013012562226032405 0ustar00gkiagiagkiagia00000000000000 WockyJingleTransportIface: Wocky Reference Manual

WockyJingleTransportIface

WockyJingleTransportIface

Properties

WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only

Types and Values

Object Hierarchy

    GInterface
    ╰── WockyJingleTransportIface

Description

Functions

wocky_jingle_transport_iface_parse_candidates ()

void
wocky_jingle_transport_iface_parse_candidates
                               (WockyJingleTransportIface *Param1,
                                WockyNode *Param2,
                                GError **Param3);

wocky_jingle_transport_iface_new_local_candidates ()

void
wocky_jingle_transport_iface_new_local_candidates
                               (WockyJingleTransportIface *self,
                                GList *candidates);

wocky_jingle_transport_iface_inject_candidates ()

void
wocky_jingle_transport_iface_inject_candidates
                               (WockyJingleTransportIface *self,
                                WockyNode *transport_node);

wocky_jingle_transport_iface_send_candidates ()

void
wocky_jingle_transport_iface_send_candidates
                               (WockyJingleTransportIface *self,
                                gboolean all);

wocky_jingle_transport_iface_can_accept ()

gboolean
wocky_jingle_transport_iface_can_accept
                               (WockyJingleTransportIface *self);

wocky_jingle_transport_iface_get_remote_candidates ()

GList *
wocky_jingle_transport_iface_get_remote_candidates
                               (WockyJingleTransportIface *Param1);

wocky_jingle_transport_iface_get_local_candidates ()

GList *
wocky_jingle_transport_iface_get_local_candidates
                               (WockyJingleTransportIface *Param1);

wocky_jingle_transport_iface_get_transport_type ()

WockyJingleTransportType
wocky_jingle_transport_iface_get_transport_type
                               (WockyJingleTransportIface *Param1);

jingle_transport_get_credentials ()

gboolean
jingle_transport_get_credentials (WockyJingleTransportIface *Param1,
                                  gchar **ufrag,
                                  gchar **pwd);

wocky_jingle_transport_iface_new ()

WockyJingleTransportIface *
wocky_jingle_transport_iface_new (GType type,
                                  WockyJingleContent *content,
                                  const gchar *transport_ns);

wocky_jingle_candidate_new ()

WockyJingleCandidate *
wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol,
                            WockyJingleCandidateType type,
                            const gchar *id,
                            int component,
                            const gchar *address,
                            int port,
                            int generation,
                            int preference,
                            const gchar *username,
                            const gchar *password,
                            int network);

wocky_jingle_candidate_free ()

void
wocky_jingle_candidate_free (WockyJingleCandidate *c);

jingle_transport_free_candidates ()

void
jingle_transport_free_candidates (GList *candidates);

Types and Values

enum WockyJingleTransportState

Members

WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED

   

WOCKY_JINGLE_TRANSPORT_STATE_CONNECTING

   

WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED

   

Property Details

The “content” property

  “content”                  WockyJingleContent *

Jingle content that's using this jingle transport object.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/left.png0000644000175000017500000000040613012562226026062 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME,`m;IDAT8үa?DAPY\$[p+IIMlf('}Mpy{_ޥ}^q xZ <=Yj) <04\~+Pl#",Qϑp Iǐlsw>[/]_i03IENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockySession.html0000644000175000017500000003220513012562226027752 0ustar00gkiagiagkiagia00000000000000 WockySession: Wocky Reference Manual

WockySession

WockySession

Properties

WockyXmppConnection * connection Read / Write / Construct Only
WockyContactFactory * contact-factory Read
gchar * full-jid Read / Write / Construct Only
WockyPorter * porter Read

Types and Values

Object Hierarchy

    GObject
    ╰── WockySession

Includes

#include <wocky/wocky-session.h>

Description

Functions

wocky_session_new_ll ()

WockySession *
wocky_session_new_ll (const gchar *full_jid);

wocky_session_new_with_connection ()

WockySession *
wocky_session_new_with_connection (WockyXmppConnection *conn,
                                   const gchar *full_jid);

wocky_session_start ()

void
wocky_session_start (WockySession *session);

wocky_session_get_porter ()

WockyPorter *
wocky_session_get_porter (WockySession *session);

wocky_session_get_contact_factory ()

WockyContactFactory *
wocky_session_get_contact_factory (WockySession *session);

wocky_session_set_jid ()

void
wocky_session_set_jid (WockySession *session,
                       const gchar *jid);

wocky_session_get_jid ()

const gchar *
wocky_session_get_jid (WockySession *session);

Types and Values

struct WockySessionClass

struct WockySessionClass {
};

The class of a WockySession.

Property Details

The “connection” property

  “connection”               WockyXmppConnection *

The WockyXmppConnection associated with this session.

Flags: Read / Write / Construct Only


The “contact-factory” property

  “contact-factory”          WockyContactFactory *

The WockyContactFactory associated with this session.

Flags: Read


The “full-jid” property

  “full-jid”                 gchar *

The user's JID in this session.

Flags: Read / Write / Construct Only

Default value: NULL


The “porter” property

  “porter”                   WockyPorter *

The WockyPorter associated with this session.

Flags: Read

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyPorter.html0000644000175000017500000036476513012562226027625 0ustar00gkiagiagkiagia00000000000000 WockyPorter: Wocky Reference Manual

WockyPorter

WockyPorter

Properties

gchar * bare-jid Read
WockyXmppConnection * connection Read / Write / Construct Only
gchar * full-jid Read / Write / Construct Only
gchar * resource Read

Object Hierarchy

    GInterface
    ╰── WockyPorter

Description

Functions

wocky_porter_error_quark ()

GQuark
wocky_porter_error_quark (void);

Get the error quark used by the porter.

Returns

the quark for porter errors.


WockyPorterHandlerFunc ()

gboolean
(*WockyPorterHandlerFunc) (WockyPorter *porter,
                           WockyStanza *stanza,
                           gpointer user_data);

Handler called when a matching stanza has been received by the WockyPorter.

If a handler returns TRUE, this means that it has taken responsibility for handling the stanza and (if applicable) sending a reply.

If a handler returns FALSE, this indicates that it has declined to process the stanza. The next handler (if any) is invoked.

A handler must not assume that stanza will continue to exist after the handler has returned, unless it has taken a reference to stanza using g_object_ref().

Parameters

porter

the WockyPorter dispatching the WockyStanza

 

stanza

the WockyStanza being dispatched

 

user_data

the data passed when the handler has been registered

 

Returns

TRUE if the stanza has been handled, FALSE if not


wocky_porter_start ()

void
wocky_porter_start (WockyPorter *porter);

Start a WockyPorter to make it read and dispatch incoming stanzas.

Parameters

porter

a WockyPorter

 

wocky_porter_get_full_jid ()

const gchar *
wocky_porter_get_full_jid (WockyPorter *self);

[skip]

Parameters

self

a porter

 

Returns

the value of “full-jid”.

[transfer none]


wocky_porter_get_bare_jid ()

const gchar *
wocky_porter_get_bare_jid (WockyPorter *self);

[skip]

Parameters

self

a porter

 

Returns

the value of “bare-jid”.

[transfer none]


wocky_porter_get_resource ()

const gchar *
wocky_porter_get_resource (WockyPorter *self);

[skip]

Parameters

self

a porter

 

Returns

the value of “resource”.

[transfer none]


wocky_porter_send_async ()

void
wocky_porter_send_async (WockyPorter *porter,
                         WockyStanza *stanza,
                         GCancellable *cancellable,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Request asynchronous sending of a WockyStanza. When the stanza has been sent callback will be called. You can then call wocky_porter_send_finish() to get the result of the operation.

Parameters

porter

a WockyPorter

 

stanza

the WockyStanza to send

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

callback to call when the request is satisfied

 

user_data

the data to pass to callback function

 

wocky_porter_send_finish ()

gboolean
wocky_porter_send_finish (WockyPorter *porter,
                          GAsyncResult *result,
                          GError **error);

Finishes sending a WockyStanza.

Parameters

porter

a WockyPorter

 

result

a GAsyncResult

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE on success or FALSE on error.


wocky_porter_send ()

void
wocky_porter_send (WockyPorter *porter,
                   WockyStanza *stanza);

Send a WockyStanza. This is a convenient function to not have to call wocky_porter_send_async() with lot of NULL arguments if you don't care to know when the stanza has been actually sent.

Parameters

porter

a WockyPorter

 

stanza

the WockyStanza to send

 

wocky_porter_register_handler_from_va ()

guint
wocky_porter_register_handler_from_va (WockyPorter *self,
                                       WockyStanzaType type,
                                       WockyStanzaSubType sub_type,
                                       const gchar *from,
                                       guint priority,
                                       WockyPorterHandlerFunc callback,
                                       gpointer user_data,
                                       va_list ap);

A va_list version of wocky_porter_register_handler_from(); see that function for more details.

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

from

the JID whose messages this handler is intended for (may not be NULL)

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

ap

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_register_handler_from_by_stanza ()

guint
wocky_porter_register_handler_from_by_stanza
                               (WockyPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                const gchar *from,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                WockyStanza *stanza);

A WockyStanza version of wocky_porter_register_handler_from(); see that function for more details.

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

from

the JID whose messages this handler is intended for (may not be NULL)

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

stanza

a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_register_handler_from ()

guint
wocky_porter_register_handler_from (WockyPorter *self,
                                    WockyStanzaType type,
                                    WockyStanzaSubType sub_type,
                                    const gchar *from,
                                    guint priority,
                                    WockyPorterHandlerFunc callback,
                                    gpointer user_data,
                                    ...);

Register a new stanza handler. Stanza handlers are called when the Porter receives a new stanza matching the rules of the handler. Matching handlers are sorted by priority and are called until one claims to have handled the stanza (by returning TRUE).

If from is a bare JID, then the resource of the JID in the from attribute will be ignored: In other words, a handler registered against a bare JID will match all stanzas from a JID with the same node and domain:

"foo@bar.org" will match "foo@bar.org", "foo@bar.org/moose" and so forth.

To register an IQ handler from Juliet for all the Jingle stanzas related to one Jingle session:

id = wocky_porter_register_handler_from (porter,
  WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE,
  "juliet@example.com/Balcony",
  WOCKY_PORTER_HANDLER_PRIORITY_NORMAL,
  jingle_cb,
  '(', "jingle",
    ':', "urn:xmpp:jingle:1",
    '@', "sid", "my_sid",
  ')', NULL);

To match stanzas from any sender, see wocky_porter_register_handler_from_anyone(). If the porter is a WockyC2SPorter, one can match stanzas sent by the server; see wocky_c2s_porter_register_handler_from_server().

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

from

the JID whose messages this handler is intended for (may not be NULL)

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

...

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_register_handler_from_anyone_va ()

guint
wocky_porter_register_handler_from_anyone_va
                               (WockyPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                va_list ap);

A va_list version of wocky_porter_register_handler_from_anyone(); see that function for more details.

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

ap

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_register_handler_from_anyone_by_stanza ()

guint
wocky_porter_register_handler_from_anyone_by_stanza
                               (WockyPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                WockyStanza *stanza);

A WockyStanza version of wocky_porter_register_handler_from_anyone(); see that function for more details.

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

stanza

a WockyStanza. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_register_handler_from_anyone ()

guint
wocky_porter_register_handler_from_anyone
                               (WockyPorter *self,
                                WockyStanzaType type,
                                WockyStanzaSubType sub_type,
                                guint priority,
                                WockyPorterHandlerFunc callback,
                                gpointer user_data,
                                ...);

Registers a handler for incoming stanzas from anyone, including those where the from attribute is missing.

For example, to register a handler matching all message stanzas received from anyone, call:

id = wocky_porter_register_handler (porter,
  WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL,
  WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, message_received_cb, NULL,
  NULL);

As a more interesting example, the following matches incoming PEP notifications for contacts' geolocation information:

id = wocky_porter_register_handler_from_anyone (porter,
   WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE,
   WOCKY_PORTER_HANDLER_PRIORITY_MAX,
   msg_event_cb, self,
   '(', "event",
     ':', WOCKY_XMPP_NS_PUBSUB_EVENT,
     '(', "items",
       '@', "node", "http://jabber.org/protocol/geoloc",
     ')',
   ')',
   NULL);

Parameters

self

A WockyPorter instance (passed to callback ).

 

type

The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match any type of stanza.

 

sub_type

The subtype of stanza to be handled, or WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza.

 

priority

a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority (larger number) are called first.

 

callback

A WockyPorterHandlerFunc, which should return FALSE to decline the stanza (Wocky will continue to the next handler, if any), or TRUE to stop further processing.

 

user_data

Passed to callback .

 

...

a wocky_stanza_build() specification. The handler will match a stanza only if the stanza received is a superset of the one passed to this function, as per wocky_node_is_superset().

 

Returns

a non-zero ID for use with wocky_porter_unregister_handler().


wocky_porter_unregister_handler ()

void
wocky_porter_unregister_handler (WockyPorter *porter,
                                 guint id);

Unregister a registered handler. This handler won't be called when receiving stanzas anymore.

Parameters

porter

a WockyPorter

 

id

the id of the handler to unregister

 

wocky_porter_close_async ()

void
wocky_porter_close_async (WockyPorter *porter,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Request asynchronous closing of a WockyPorter. This fires the WockyPorter::closing signal, flushes the sending queue, closes the XMPP stream and waits that the other side closes the XMPP stream as well. When this is done, callback is called. You can then call wocky_porter_close_finish() to get the result of the operation.

Parameters

porter

a WockyPorter

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

callback to call when the request is satisfied

 

user_data

the data to pass to callback function

 

wocky_porter_close_finish ()

gboolean
wocky_porter_close_finish (WockyPorter *porter,
                           GAsyncResult *result,
                           GError **error);

Finishes a close operation.

Parameters

porter

a WockyPorter

 

result

a GAsyncResult

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE on success or FALSE on error.


wocky_porter_send_iq_async ()

void
wocky_porter_send_iq_async (WockyPorter *porter,
                            WockyStanza *stanza,
                            GCancellable *cancellable,
                            GAsyncReadyCallback callback,
                            gpointer user_data);

Request asynchronous sending of a WockyStanza of type WOCKY_STANZA_TYPE_IQ and sub-type WOCKY_STANZA_SUB_TYPE_GET or WOCKY_STANZA_SUB_TYPE_SET. When the reply to this IQ has been received callback will be called. You can then call wocky_porter_send_iq_finish to get the reply stanza.

Parameters

porter

a WockyPorter

 

stanza

the WockyStanza to send

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

callback to call when the request is satisfied

 

user_data

the data to pass to callback function

 

wocky_porter_send_iq_finish ()

WockyStanza *
wocky_porter_send_iq_finish (WockyPorter *porter,
                             GAsyncResult *result,
                             GError **error);

Get the reply of an IQ query.

Parameters

porter

a WockyPorter

 

result

a GAsyncResult

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

a reffed WockyStanza on success, NULL on error


wocky_porter_acknowledge_iq ()

void
wocky_porter_acknowledge_iq (WockyPorter *porter,
                             WockyStanza *stanza,
                             ...);

Sends an acknowledgement for stanza back to the sender, as a shorthand for calling wocky_stanza_build_iq_result() and wocky_porter_send().

Parameters

porter

a WockyPorter

 

stanza

a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

 

...

a wocky_stanza_build() specification; pass NULL to include no body in the reply.

 

wocky_porter_send_iq_error ()

void
wocky_porter_send_iq_error (WockyPorter *porter,
                            WockyStanza *stanza,
                            WockyXmppError error_code,
                            const gchar *message);

Sends an error reply for stanza back to its sender, with the given error_code and message , and including the child element from the original stanza.

To send error replies with more detailed error elements, see wocky_porter_send_iq_gerror(), or use wocky_stanza_build_iq_error() and wocky_porter_send() directly, possibly using wocky_stanza_error_to_node() to construct the error element.

Parameters

porter

the porter whence stanza came

 

stanza

a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

 

error_code

an XMPP Core stanza error code

 

message

an optional error message to include with the reply.

[allow-none]

wocky_porter_send_iq_gerror ()

void
wocky_porter_send_iq_gerror (WockyPorter *porter,
                             WockyStanza *stanza,
                             const GError *error);

Sends an error reply for stanza back to its sender, building the

<error/> element from the given error. To send error

replies with simple XMPP Core stanza errors in the WOCKY_XMPP_ERROR domain, wocky_porter_send_iq_error() may be more convenient to use.

Parameters

porter

the porter whence stanza came

 

stanza

a stanza of type WOCKY_STANZA_TYPE_IQ and sub-type either WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET

 

error

an error whose domain is either WOCKY_XMPP_ERROR, some other stanza error domain supplied with Wocky (such as WOCKY_JINGLE_ERROR or WOCKY_SI_ERROR), or a custom domain registered with wocky_xmpp_error_register_domain()

 

wocky_porter_force_close_async ()

void
wocky_porter_force_close_async (WockyPorter *porter,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Force the WockyPorter to close the TCP connection of the underlying WockyXmppConnection. If a close operation is pending, it will be completed with the WOCKY_PORTER_ERROR_FORCIBLY_CLOSED error. When the connection has been closed, callback will be called. You can then call wocky_porter_force_close_finish() to get the result of the operation.

Parameters

porter

a WockyPorter

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

callback to call when the request is satisfied

 

user_data

the data to pass to callback function

 

wocky_porter_force_close_finish ()

gboolean
wocky_porter_force_close_finish (WockyPorter *porter,
                                 GAsyncResult *result,
                                 GError **error);

Finishes a force close operation.

Parameters

porter

a WockyPorter

 

result

a GAsyncResult

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE on success or FALSE on error.

Types and Values

enum WockyPorterError

The WockyPorter specific errors.

Members

WOCKY_PORTER_ERROR_NOT_STARTED

The WockyPorter has not been started yet

 

WOCKY_PORTER_ERROR_CLOSING

The WockyPorter is closing

 

WOCKY_PORTER_ERROR_CLOSED

The WockyPorter is closed

 

WOCKY_PORTER_ERROR_NOT_IQ

The WockyStanza is not an IQ

 

WOCKY_PORTER_ERROR_FORCIBLY_CLOSED

The WockyPorter has been forced to close

 

WOCKY_PORTER_ERROR

#define WOCKY_PORTER_ERROR (wocky_porter_error_quark ())

Get access to the error quark of the xmpp porter.


WOCKY_PORTER_HANDLER_PRIORITY_MIN

#define WOCKY_PORTER_HANDLER_PRIORITY_MIN 0

WOCKY_PORTER_HANDLER_PRIORITY_NORMAL

#define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL (guint) (G_MAXUINT / 2)

WOCKY_PORTER_HANDLER_PRIORITY_MAX

#define WOCKY_PORTER_HANDLER_PRIORITY_MAX G_MAXUINT

struct WockyPorterInterface

struct WockyPorterInterface {
  GTypeInterface parent_iface;

  const gchar * (*get_full_jid) (WockyPorter *self);
  const gchar * (*get_bare_jid) (WockyPorter *self);
  const gchar * (*get_resource) (WockyPorter *self);

  void (*start) (WockyPorter *porter);

  void (*send_async) (WockyPorter *porter,
      WockyStanza *stanza,
      GCancellable *cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data);

  gboolean (*send_finish) (WockyPorter *porter,
      GAsyncResult *result,
      GError **error);

  guint (*register_handler_from_by_stanza) (
      WockyPorter *self,
      WockyStanzaType type,
      WockyStanzaSubType sub_type,
      const gchar *from,
      guint priority,
      WockyPorterHandlerFunc callback,
      gpointer user_data,
      WockyStanza *stanza);

  guint (*register_handler_from_anyone_by_stanza) (
      WockyPorter *self,
      WockyStanzaType type,
      WockyStanzaSubType sub_type,
      guint priority,
      WockyPorterHandlerFunc callback,
      gpointer user_data,
      WockyStanza *stanza);

  void (*unregister_handler) (WockyPorter *self,
      guint id);

  void (*close_async) (WockyPorter *self,
      GCancellable *cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data);

  gboolean (*close_finish) (WockyPorter *self,
      GAsyncResult *result,
      GError **error);

  void (*send_iq_async) (WockyPorter *porter,
      WockyStanza *stanza,
      GCancellable *cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data);

  WockyStanza * (*send_iq_finish) (WockyPorter *porter,
      GAsyncResult *result,
      GError **error);

  void (*force_close_async) (WockyPorter *porter,
      GCancellable *cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data);

  gboolean (*force_close_finish) (WockyPorter *porter,
      GAsyncResult *result,
      GError **error);
};

The vtable for a porter implementation.

Members

GTypeInterface parent_iface;

Fields shared with GTypeInterface.

 

get_full_jid ()

Return the full JID of the user according to the porter; see wocky_porter_get_full_jid() for more details.

 

get_bare_jid ()

Return the bare JID of the user according to the porter; see wocky_porter_get_full_jid() for more details.

 

get_resource ()

Return the resource of the user according to the porter; see wocky_porter_get_full_jid() for more details.

 

start ()

Start the porter; see wocky_porter_start() for more details.

 

send_async ()

Start an asynchronous stanza send operation; see wocky_porter_send_async() for more details.

 

send_finish ()

Finish an asynchronous stanza send operation; see wocky_porter_send_finish() for more details.

 

register_handler_from_by_stanza ()

Register a stanza handler from a specific contact; see wocky_porter_register_handler_from_by_stanza() for more details.

 

register_handler_from_anyone_by_stanza ()

Register a stanza hander from any contact; see wocky_porter_register_handler_from_anyone_by_stanza() for more details.

 

unregister_handler ()

Unregister a stanza handler; see wocky_porter_unregister_handler() for more details.

 

close_async ()

Start an asynchronous porter close operation; see wocky_porter_close_async() for more details.

 

close_finish ()

Finish an asynchronous porter close operation; see wocky_porter_close_finish() for more details.

 

send_iq_async ()

Start an asynchronous IQ stanza send operation; see wocky_porter_send_iq_async() for more details.

 

send_iq_finish ()

Finish an asynchronous IQ stanza send operation; see wocky_porter_send_iq_finish() for more details.

 

force_close_async ()

Start an asynchronous porter force close operation; see wocky_porter_force_close_async() for more details.

 

force_close_finish ()

Finish an asynchronous porter force close operation; see wocky_porter_force_close_finish() for more details.

 

Property Details

The “bare-jid” property

  “bare-jid”                 gchar *

The user's bare JID (node@domain).

Flags: Read

Default value: NULL


The “connection” property

  “connection”               WockyXmppConnection *

The underlying WockyXmppConnection wrapped by the WockyPorter

Flags: Read / Write / Construct Only


The “full-jid” property

  “full-jid”                 gchar *

The user's full JID (node@domain/resource).

Flags: Read / Write / Construct Only

Default value: NULL


The “resource” property

  “resource”                 gchar *

The resource part of the user's full JID, or NULL if their full JID does not contain a resource at all.

Flags: Read

Default value: NULL

Signal Details

The “closing” signal

void
user_function (WockyPorter *porter,
               gpointer     user_data)

The ::closing signal is emitted when the WockyPorter starts to close its XMPP connection. Once this signal has been emitted, the WockyPorter can't be used to send stanzas any more.

Parameters

porter

the object on which the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “remote-closed” signal

void
user_function (WockyPorter *porter,
               gpointer     user_data)

The ::remote-closed signal is emitted when the other side closed the XMPP stream.

Parameters

porter

the object on which the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “remote-error” signal

void
user_function (WockyPorter *porter,
               guint        domain,
               gint         code,
               gchar       *message,
               gpointer     user_data)

The ::remote-error signal is emitted when an error has been detected on the XMPP stream.

Parameters

porter

the object on which the signal is emitted

 

domain

error domain (a GQuark)

 

code

error code

 

message

human-readable informative error message

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “sending” signal

void
user_function (WockyPorter *porter,
               WockyStanza *stanza,
               gpointer     user_data)

The ::sending signal is emitted whenever WockyPorter sends data on the XMPP connection.

Parameters

porter

the object on which the signal is emitted

 

stanza

the WockyStanza being sent, or NULL if porter is just sending whitespace

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyResourceContact.html0000644000175000017500000002512013012562226031430 0ustar00gkiagiagkiagia00000000000000 WockyResourceContact: Wocky Reference Manual

WockyResourceContact

WockyResourceContact

Properties

WockyBareContact * bare-contact Read / Write / Construct Only
gchar * resource Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyContact
        ╰── WockyResourceContact

Includes

#include <wocky/wocky-resource-contact.h>

Description

Functions

wocky_resource_contact_new ()

WockyResourceContact *
wocky_resource_contact_new (WockyBareContact *bare,
                            const gchar *resource);

wocky_resource_contact_get_resource ()

const gchar *
wocky_resource_contact_get_resource (WockyResourceContact *contact);

wocky_resource_contact_get_bare_contact ()

WockyBareContact *
wocky_resource_contact_get_bare_contact
                               (WockyResourceContact *contact);

wocky_resource_contact_equal ()

gboolean
wocky_resource_contact_equal (WockyResourceContact *a,
                              WockyResourceContact *b);

Types and Values

struct WockyResourceContactClass

struct WockyResourceContactClass {
};

The class of a WockyResourceContact.

Property Details

The “bare-contact” property

  “bare-contact”             WockyBareContact *

The WockyBareContact associated with this WockyResourceContact

Flags: Read / Write / Construct Only


The “resource” property

  “resource”                 gchar *

The resource of the contact.

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-jingle-types.html0000644000175000017500000022327213012562226032216 0ustar00gkiagiagkiagia00000000000000 wocky-jingle-types: Wocky Reference Manual

wocky-jingle-types

wocky-jingle-types

Properties

gchar * content-ns Read / Write
gchar * disposition Read / Write
gboolean locally-created Read
gchar * name Read / Write / Construct Only
guint senders Read / Write
WockyJingleSession * session Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write
WockySession * session Read / Write / Construct Only
guint media-type Read / Write / Construct Only
gboolean remote-mute Read / Write
guint dialect Read / Write
WockyJingleFactory * jingle-factory Read / Write / Construct Only
gboolean local-hold Read / Write
gboolean local-initiator Read / Write / Construct Only
WockyContact * peer-contact Read / Write / Construct Only
WockyPorter * porter Read / Write / Construct Only
gboolean remote-hold Read
gboolean remote-ringing Read
gchar * session-id Read / Write / Construct Only
guint state Read / Write
WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only
WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only
WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only

Object Hierarchy

    GEnum
    ╰── WockyJingleReason
    GObject
    ├── WockyJingleContent
       ╰── WockyJingleMediaRtp
    ├── WockyJingleFactory
    ├── WockyJingleSession
    ├── WockyJingleTransportGoogle
    ├── WockyJingleTransportIceUdp
    ╰── WockyJingleTransportRawUdp

Implemented Interfaces

WockyJingleTransportGoogle implements

WockyJingleTransportIceUdp implements

WockyJingleTransportRawUdp implements

Description

Functions

Types and Values

enum WockyJingleDialect

Members

WOCKY_JINGLE_DIALECT_ERROR

   

WOCKY_JINGLE_DIALECT_GTALK3

   

WOCKY_JINGLE_DIALECT_GTALK4

   

WOCKY_JINGLE_DIALECT_V015

   

WOCKY_JINGLE_DIALECT_V032

   

enum WockyJingleState

Possible states of a WockyJingleSession.

Members

WOCKY_JINGLE_STATE_PENDING_CREATED

on outgoing sessions, no offer has been sent to the peer yet.

 

WOCKY_JINGLE_STATE_PENDING_INITIATE_SENT

on outgoing sessions, we have sent the session-initiate and are awaiting the peer's acknowledgement.

 

WOCKY_JINGLE_STATE_PENDING_INITIATED

on outgoing sessions, the peer has received our session-initiate and we're waiting for them to accept; on incoming sessions, the peer is waiting for us to accept.

 

WOCKY_JINGLE_STATE_PENDING_ACCEPT_SENT

on incoming sessions, we have sent session-accept and are waiting for the peer to acknowledge it.

 

WOCKY_JINGLE_STATE_ACTIVE

the session is active.

 

WOCKY_JINGLE_STATE_ENDED

the session has ended. The “terminated” signal describes how the session ended.

 

enum WockyJingleAction

Members

WOCKY_JINGLE_ACTION_UNKNOWN

   

WOCKY_JINGLE_ACTION_CONTENT_ACCEPT

   

WOCKY_JINGLE_ACTION_CONTENT_ADD

   

WOCKY_JINGLE_ACTION_CONTENT_MODIFY

   

WOCKY_JINGLE_ACTION_CONTENT_REMOVE

   

WOCKY_JINGLE_ACTION_CONTENT_REPLACE

   

WOCKY_JINGLE_ACTION_CONTENT_REJECT

   

WOCKY_JINGLE_ACTION_SESSION_ACCEPT

   

WOCKY_JINGLE_ACTION_SESSION_INFO

   

WOCKY_JINGLE_ACTION_SESSION_INITIATE

   

WOCKY_JINGLE_ACTION_SESSION_TERMINATE

   

WOCKY_JINGLE_ACTION_TRANSPORT_INFO

   

WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT

   

WOCKY_JINGLE_ACTION_DESCRIPTION_INFO

   

WOCKY_JINGLE_ACTION_INFO

   

enum WockyJingleContentSenders

Members

WOCKY_JINGLE_CONTENT_SENDERS_NONE

   

WOCKY_JINGLE_CONTENT_SENDERS_INITIATOR

   

WOCKY_JINGLE_CONTENT_SENDERS_RESPONDER

   

WOCKY_JINGLE_CONTENT_SENDERS_BOTH

   

enum WockyJingleTransportType

Members

JINGLE_TRANSPORT_UNKNOWN

   

JINGLE_TRANSPORT_GOOGLE_P2P

   

JINGLE_TRANSPORT_RAW_UDP

   

JINGLE_TRANSPORT_ICE_UDP

   

enum WockyJingleTransportProtocol

Members

WOCKY_JINGLE_TRANSPORT_PROTOCOL_UDP

   

WOCKY_JINGLE_TRANSPORT_PROTOCOL_TCP

   

enum WockyJingleCandidateType

Members

WOCKY_JINGLE_CANDIDATE_TYPE_LOCAL

   

WOCKY_JINGLE_CANDIDATE_TYPE_STUN

   

WOCKY_JINGLE_CANDIDATE_TYPE_RELAY

   

enum WockyJingleReason

The reason for a Jingle action occurring—specifically, the reason for terminating a call. See XEP-0166 Jingle §7.4 for definitions of the codes.

Members

WOCKY_JINGLE_REASON_UNKNOWN

no known reason

 

WOCKY_JINGLE_REASON_ALTERNATIVE_SESSION

   

WOCKY_JINGLE_REASON_BUSY

   

WOCKY_JINGLE_REASON_CANCEL

   

WOCKY_JINGLE_REASON_CONNECTIVITY_ERROR

   

WOCKY_JINGLE_REASON_DECLINE

   

WOCKY_JINGLE_REASON_EXPIRED

   

WOCKY_JINGLE_REASON_FAILED_APPLICATION

   

WOCKY_JINGLE_REASON_FAILED_TRANSPORT

   

WOCKY_JINGLE_REASON_GENERAL_ERROR

   

WOCKY_JINGLE_REASON_GONE

   

WOCKY_JINGLE_REASON_INCOMPATIBLE_PARAMETERS

   

WOCKY_JINGLE_REASON_MEDIA_ERROR

   

WOCKY_JINGLE_REASON_SECURITY_ERROR

   

WOCKY_JINGLE_REASON_SUCCESS

   

WOCKY_JINGLE_REASON_TIMEOUT

   

WOCKY_JINGLE_REASON_UNSUPPORTED_APPLICATIONS

   

WOCKY_JINGLE_REASON_UNSUPPORTED_TRANSPORTS

   

WockyJingleCandidate

typedef struct {
  WockyJingleTransportProtocol protocol;
  WockyJingleCandidateType type;

  gchar *id;
  gchar *address;
  int port;
  int component;
  int generation;

  int preference;
  gchar *username;
  gchar *password;
  int network;
} WockyJingleCandidate;

WockyJingleContent

typedef struct _WockyJingleContent WockyJingleContent;

WockyJingleFactory

typedef struct _WockyJingleFactory WockyJingleFactory;

WockyJingleMediaRtp

typedef struct _WockyJingleMediaRtp WockyJingleMediaRtp;

WockyJingleSession

typedef struct _WockyJingleSession WockyJingleSession;

WockyJingleTransportGoogle

typedef struct _WockyJingleTransportGoogle WockyJingleTransportGoogle;

WockyJingleTransportIceUdp

typedef struct _WockyJingleTransportIceUdp WockyJingleTransportIceUdp;

WockyJingleTransportRawUdp

typedef struct _WockyJingleTransportRawUdp WockyJingleTransportRawUdp;

Property Details

The “content-ns” property

  “content-ns”               gchar *

Namespace identifying the content type.

Flags: Read / Write

Default value: NULL


The “disposition” property

  “disposition”              gchar *

Distinguishes between 'session' and other contents.

Flags: Read / Write

Default value: NULL


The “locally-created” property

  “locally-created”          gboolean

True if the content was created by the local client.

Flags: Read

Default value: FALSE


The “name” property

  “name”                     gchar *

A unique content name in the session.

Flags: Read / Write / Construct Only

Default value: NULL


The “senders” property

  “senders”                  guint

Valid senders for the stream.

Flags: Read / Write

Default value: 0


The “session” property

  “session”                  WockyJingleSession *

Jingle session object that owns this content.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

The current state that the content is in.

Flags: Read / Write

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write

Default value: NULL


The “session” property

  “session”                  WockySession *

WockySession to listen for Jingle sessions on.

Flags: Read / Write / Construct Only


The “media-type” property

  “media-type”               guint

Media type.

Flags: Read / Write / Construct Only

Default value: 0


The “remote-mute” property

  “remote-mute”              gboolean

TRUE if the peer has muted this stream.

Flags: Read / Write

Default value: FALSE


The “dialect” property

  “dialect”                  guint

Jingle dialect used for this session.

Flags: Read / Write

Default value: 0


The “jingle-factory” property

  “jingle-factory”           WockyJingleFactory *

The Jingle factory which created this session.

Flags: Read / Write / Construct Only


The “local-hold” property

  “local-hold”               gboolean

TRUE if we've placed the peer on hold.

Flags: Read / Write

Default value: FALSE


The “local-initiator” property

  “local-initiator”          gboolean

Specifies if local end initiated the session.

Flags: Read / Write / Construct Only

Default value: TRUE


The “peer-contact” property

  “peer-contact”             WockyContact *

The WockyContact representing the other party in the session. Note that if this is a WockyBareContact (as opposed to a WockyResourceContact) the session is with the contact's bare JID.

Flags: Read / Write / Construct Only


The “porter” property

  “porter”                   WockyPorter *

The WockyPorter for the current connection.

Flags: Read / Write / Construct Only


The “remote-hold” property

  “remote-hold”              gboolean

TRUE if the peer has placed us on hold.

Flags: Read

Default value: FALSE


The “remote-ringing” property

  “remote-ringing”           gboolean

TRUE if the peer's client is ringing.

Flags: Read

Default value: FALSE


The “session-id” property

  “session-id”               gchar *

A unique session identifier used throughout all communication.

Flags: Read / Write / Construct Only

Default value: NULL


The “state” property

  “state”                    guint

The current state that the session is in.

Flags: Read / Write

Default value: 0


The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL


The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL


The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “completed” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Run Last


The “new-candidates” signal

void
user_function (WockyJingleContent *content,
               gpointer            candidates,
               gpointer            user_data)

Emitted when new candidates are received from the peer.

Parameters

content

the content

 

candidates

a GList of new candidates.

[type GList][element-type WockyJingleCandidate]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-share-channel” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gchar              *arg1,
               guint               arg2,
               gpointer            user_data)

Flags: Run Last


The “ready” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Has Details


The “removed” signal

void
user_function (WockyJingleContent *wockyjinglecontent,
               gpointer            user_data)

Flags: Has Details


The “new-session” signal

void
user_function (WockyJingleFactory *wockyjinglefactory,
               WockyJingleSession *arg1,
               gboolean            arg2,
               gpointer            user_data)

Flags: Run Last


The “query-cap” signal

gboolean
user_function (WockyJingleFactory *wockyjinglefactory,
               WockyContact       *arg1,
               gchar              *arg2,
               gpointer            user_data)

Flags: Run Last


The “remote-media-description” signal

void
user_function (WockyJingleMediaRtp *content,
               gpointer             md,
               gpointer             user_data)

Emitted when the remote media description is received or subsequently updated.

Parameters

content

the RTP content

 

md

a WockyJingleMediaDescription

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “about-to-initiate” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               gpointer            user_data)

Flags: Run Last


The “content-rejected” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               GObject            *arg1,
               guint               arg2,
               gchar              *arg3,
               gpointer            user_data)

Flags: Run Last


The “new-content” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               GObject            *arg1,
               gpointer            user_data)

Flags: Run Last


The “query-cap” signal

gboolean
user_function (WockyJingleSession *wockyjinglesession,
               WockyContact       *arg1,
               gchar              *arg2,
               gpointer            user_data)

Flags: Run Last


The “remote-state-changed” signal

void
user_function (WockyJingleSession *wockyjinglesession,
               gpointer            user_data)

Flags: Run Last


The “terminated” signal

void
user_function (WockyJingleSession *session,
               gboolean            locally_terminated,
               guint               reason,
               gchar              *text,
               gpointer            user_data)

Emitted when the session ends, just after “state” moves to WOCKY_JINGLE_STATE_ENDED.

Parameters

session

the session

 

locally_terminated

TRUE if the session ended due to a call to wocky_jingle_session_terminate(); FALSE if the peer ended the session.

 

reason

a WockyJingleReason describing why the session terminated

 

text

a possibly-NULL human-readable string describing why the session terminated

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-candidates” signal

void
user_function (WockyJingleTransportGoogle *wockyjingletransportgoogle,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last


The “new-candidates” signal

void
user_function (WockyJingleTransportIceUdp *wockyjingletransporticeudp,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last


The “new-candidates” signal

void
user_function (WockyJingleTransportRawUdp *wockyjingletransportrawudp,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyNodeTree.html0000644000175000017500000002607713012562226030046 0ustar00gkiagiagkiagia00000000000000 WockyNodeTree: Wocky Reference Manual

WockyNodeTree

WockyNodeTree

Properties

gpointer top-node Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyNodeTree
        ╰── WockyStanza

Description

Functions

wocky_node_tree_new ()

WockyNodeTree *
wocky_node_tree_new (const gchar *name,
                     const gchar *ns,
                     ...);

Build a node-tree from a list of arguments. Example:

Example 2. 

wocky_node_tree_new ("html", "http://www.w3.org/1999/xhtml",
   '(', "body", '@', "textcolor", "red",
      '$', "Wocky wooo",
   ')',
  NULL);

Parameters

name

The name of the toplevel node

 

ns

The namespace of the toplevel node

 

...

the description of the node tree to build, terminated with NULL

 

Returns

a new node-tree object


wocky_node_tree_new_va ()

WockyNodeTree *
wocky_node_tree_new_va (const gchar *name,
                        const char *ns,
                        va_list va);

wocky_node_tree_new_from_node ()

WockyNodeTree *
wocky_node_tree_new_from_node (WockyNode *node);

Build a new WockyNodeTree that contains a copy of the given node.

Parameters

node

The node to copy

 

Returns

a new node-tree object


wocky_node_tree_get_top_node ()

WockyNode *
wocky_node_tree_get_top_node (WockyNodeTree *self);

Types and Values

struct WockyNodeTreeClass

struct WockyNodeTreeClass {
};

The class of a WockyNodeTree.

Property Details

The “top-node” property

  “top-node”                 gpointer

The topmost node of the node-tree.

Flags: Read / Write / Construct Only

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/left-insensitive.png0000644000175000017500000000061313012562226030420 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIMEƫqIDAT8͒NQ@pds`*4@W@ A!Ԇ@6^ 5hxIH R`sQp̙339B|sKEQTK@۝΁i^~Wʆ`0TJ6TcYn6A ƀ~߱>}ǭs; lYkwr 5U= /" "uU=ɲlArDzp5I4^E+P3Ɯq_p ̥iUYp=#IENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleInfo.html0000644000175000017500000004576113012562226030366 0ustar00gkiagiagkiagia00000000000000 WockyJingleInfo: Wocky Reference Manual

WockyJingleInfo

WockyJingleInfo

Properties

WockyC2SPorter * porter Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── WockyJingleInfo

Description

Functions

wocky_jingle_info_new ()

WockyJingleInfo *
wocky_jingle_info_new (WockyPorter *porter);

wocky_jingle_info_take_stun_server ()

void
wocky_jingle_info_take_stun_server (WockyJingleInfo *self,
                                    gchar *stun_server,
                                    guint16 stun_port,
                                    gboolean is_fallback);

wocky_jingle_info_send_request ()

void
wocky_jingle_info_send_request (WockyJingleInfo *self,
                                gboolean google_jingleinfo_supported);

wocky_jingle_info_get_stun_servers ()

GList *
wocky_jingle_info_get_stun_servers (WockyJingleInfo *self);

wocky_jingle_info_get_google_relay_token ()

const gchar *
wocky_jingle_info_get_google_relay_token
                               (WockyJingleInfo *self);

wocky_jingle_relay_new ()

WockyJingleRelay *
wocky_jingle_relay_new (WockyJingleRelayType type,
                        const gchar *ip,
                        guint port,
                        const gchar *username,
                        const gchar *password,
                        guint component);

wocky_jingle_relay_free ()

void
wocky_jingle_relay_free (WockyJingleRelay *relay);

WockyJingleInfoRelaySessionCb ()

void
(*WockyJingleInfoRelaySessionCb) (GPtrArray *relays,
                                  gpointer user_data);

wocky_jingle_info_create_google_relay_session ()

void
wocky_jingle_info_create_google_relay_session
                               (WockyJingleInfo *self,
                                guint components,
                                WockyJingleInfoRelaySessionCb callback,
                                gpointer user_data);

wocky_jingle_info_set_test_mode ()

void
wocky_jingle_info_set_test_mode (void);

Types and Values

WockyStunServer

typedef struct {
    gchar *address;
    guint16 port;
} WockyStunServer;

enum WockyJingleRelayType

Members

WOCKY_JINGLE_RELAY_TYPE_UDP

   

WOCKY_JINGLE_RELAY_TYPE_TCP

   

WOCKY_JINGLE_RELAY_TYPE_TLS

   

WOCKY_N_JINGLE_RELAY_TYPES

#define WOCKY_N_JINGLE_RELAY_TYPES 3

WockyJingleRelay

typedef struct {
    WockyJingleRelayType type;
    gchar *ip;
    guint port;
    gchar *username;
    gchar *password;
    guint component;
} WockyJingleRelay;

Property Details

The “porter” property

  “porter”                   WockyC2SPorter *

Porter for the current connection.

Flags: Read / Write / Construct Only

Signal Details

The “stun-server-changed” signal

void
user_function (WockyJingleInfo *wockyjingleinfo,
               gchar           *arg1,
               guint            arg2,
               gpointer         user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-plain.html0000644000175000017500000000674013012562226031646 0ustar00gkiagiagkiagia00000000000000 wocky-sasl-plain: Wocky Reference Manual

wocky-sasl-plain

wocky-sasl-plain

Functions

WockySaslPlain * wocky_sasl_plain_new ()

Description

Functions

wocky_sasl_plain_new ()

WockySaslPlain *
wocky_sasl_plain_new (const gchar *username,
                      const gchar *password);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/up-insensitive.png0000644000175000017500000000056613012562226030121 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIMEwIIDAT8?/Qϙ?[u$VHTDۈBM+! WockyDataForm: Wocky Reference Manual

WockyDataForm

WockyDataForm — An object to represent an XMPP data form

Properties

gchar * instructions Read / Write / Construct Only
gchar * title Read / Write / Construct Only

Object Hierarchy

    GEnum
    ├── WockyDataFormError
    ╰── WockyDataFormFieldType
    GObject
    ╰── WockyDataForm

Includes

#include <wocky/wocky-data-form.h>

Description

An object that represents an XMPP data form as described in XEP-0004.

Functions

wocky_data_form_error_quark ()

GQuark
wocky_data_form_error_quark (void);

wocky_data_form_new_from_form ()

WockyDataForm *
wocky_data_form_new_from_form (WockyNode *node,
                               GError **error);

wocky_data_form_new_from_node ()

WockyDataForm *
wocky_data_form_new_from_node (WockyNode *x,
                               GError **error);

wocky_data_form_set_type ()

gboolean
wocky_data_form_set_type (WockyDataForm *self,
                          const gchar *form_type);

Creates a hidden FORM_TYPE field in self and sets its value to form_type . This is intended only to be used on empty forms created for blind submission.

Parameters

self

a WockyDataForm

 

form_type

the URI to use as the FORM_TYPE field; may not be NULL

 

Returns

TRUE if the form's type was set; FALSE if the form already had a type.


wocky_data_form_set_boolean ()

gboolean
wocky_data_form_set_boolean (WockyDataForm *self,
                             const gchar *field_name,
                             gboolean field_value,
                             gboolean create_if_missing);

Parameters

self

a data form

 

field_name

the name of a boolean field of self

 

field_value

the value to fill in for field_name

 

create_if_missing

if no field named field_name exists, create it

 

Returns

TRUE if the field was successfully filled in; FALSE if the field did not exist or does not accept a boolean


wocky_data_form_set_string ()

gboolean
wocky_data_form_set_string (WockyDataForm *self,
                            const gchar *field_name,
                            const gchar *field_value,
                            gboolean create_if_missing);

Parameters

self

a data form

 

field_name

the name of a string field of self

 

field_value

the value to fill in for field_name

 

create_if_missing

if no field named field_name exists, create it

 

Returns

TRUE if the field was successfully filled in; FALSE if the field did not exist or does not accept a string


wocky_data_form_set_strv ()

gboolean
wocky_data_form_set_strv (WockyDataForm *self,
                          const gchar *field_name,
                          const gchar * const *field_values,
                          gboolean create_if_missing);

wocky_data_form_submit ()

void
wocky_data_form_submit (WockyDataForm *self,
                        WockyNode *node);

Adds a node tree which submits self based on the current values set on self 's fields.

Parameters

self

a data form

 

node

a node to which to add a form submission

 

wocky_data_form_parse_result ()

gboolean
wocky_data_form_parse_result (WockyDataForm *self,
                              WockyNode *node,
                              GError **error);

wocky_data_form_get_title ()

const gchar *
wocky_data_form_get_title (WockyDataForm *self);

wocky_data_form_get_instructions ()

const gchar *
wocky_data_form_get_instructions (WockyDataForm *self);

wocky_data_form_field_cmp ()

gint
wocky_data_form_field_cmp (const WockyDataFormField *left,
                           const WockyDataFormField *right);

wocky_data_form_add_to_node ()

void
wocky_data_form_add_to_node (WockyDataForm *self,
                             WockyNode *node);

Adds a node tree with default values of self based on the defaults set on each field when first created.

This function is for adding a data form to an existing node, like the query node of a disco response. wocky_data_form_submit(), in contrast, is for adding a node tree which submits the data form based on the current values set on its fields.

Parameters

self

the WockyDataForm object

 

node

a node to which to add the form

 

Types and Values

enum WockyDataFormFieldType

Data form field types, as documented in XEP-0004 §3.3.

Members

WOCKY_DATA_FORM_FIELD_TYPE_UNSPECIFIED

Unspecified field type

 

WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN

Boolean field type

 

WOCKY_DATA_FORM_FIELD_TYPE_FIXED

Fixed description field type

 

WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN

Hidden field type

 

WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI

A list of multiple JIDs

 

WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE

A single JID

 

WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI

Many options to choose one or more from

 

WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE

Many options to choose one from

 

WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI

Multiple lines of text

 

WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE

A single line of text that should be obscured (by, say, asterisks)

 

WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE

A single line of text

 

struct WockyDataFormFieldOption

struct WockyDataFormFieldOption {
  gchar *label;
  gchar *value;
};

A single data form field option.

Members

gchar *label;

the option label

 

gchar *value;

the option value

 

struct WockyDataFormField

struct WockyDataFormField {
  WockyDataFormFieldType type;
  gchar *var;
  gchar *label;
  gchar *desc;
  gboolean required;
  GValue *default_value;
  gchar **raw_value_contents;
  GValue *value;
  /* for LIST_MULTI and LIST_SINGLE only.
   * List of (WockyDataFormFieldOption *)*/
  GSList *options;
};

Details about a single data form field in a WockyDataForm.

Members

WockyDataFormFieldType type;

the type of the field

 

gchar *var;

the field name

 

gchar *label;

the label of the field

 

gchar *desc;

the description of the field

 

gboolean required;

TRUE if the field is required, otherwise FALSE

 

GValue *default_value;

the default of the field

 

gchar **raw_value_contents;

a NULL-terminated array holding the literal value(s) as specified in the original XML. For example, this might be something like

{ "1", NULL }

or

{ "false", NULL }

for a WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN field, or

{ "hi", "there", NULL }

for a WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI field.

 

GValue *value;

the field value

 

GSList *options;

a GSList of WockyDataFormFieldOptions if type if WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI or WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE

 

enum WockyDataFormError

WockyDataForm specific errors.

Members

WOCKY_DATA_FORM_ERROR_NOT_FORM

Node is not a data form

 

WOCKY_DATA_FORM_ERROR_WRONG_TYPE

Data form is of the wrong type

 

WOCKY_DATA_FORM_ERROR

#define WOCKY_DATA_FORM_ERROR (wocky_data_form_error_quark ())

struct WockyDataFormClass

struct WockyDataFormClass {
};

The class of a WockyDataForm.


struct WockyDataForm

struct WockyDataForm {
  /* (gchar *) owned by the WockyDataFormField =>
   * borrowed (WockyDataFormField *) */
  GHashTable *fields;
  /* list containing owned (WockyDataFormField *) in the order they
   * have been presented in the form */
  GSList *fields_list;

  /* list of GSList * of (WockyDataFormField *), representing one or more sets
   * of results */
  GSList *results;
};

An object that represents an XMPP data form as described in XEP-0004.

Members

GHashTable *fields;

a GHashTable of strings to WockyDataFormFields

 

GSList *fields_list;

a list of WockyDataFormFields in the order they have been presented in the form

 

GSList *results;

a list of GSLists of WockyDataFormFields representing one or more sets of result.

 

Property Details

The “instructions” property

  “instructions”             gchar *

Instructions.

Flags: Read / Write / Construct Only

Default value: NULL


The “title” property

  “title”                    gchar *

Title.

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/index.html0000644000175000017500000002333113012562226026421 0ustar00gkiagiagkiagia00000000000000 Wocky Reference Manual: Wocky Reference Manual

API Reference
WockyAuthHandler
WockyAuthRegistry
WockyBareContact — Wrapper around a roster item.
WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.
WockyCapsCache
WockyCapsHash — Utilities for computing verification string hash
WockyConnector — Low-level XMPP connection generator.
WockyContactFactory — creates and looks up WockyContact objects
WockyContact
WockyDataForm — An object to represent an XMPP data form
wocky-debug
wocky-enumtypes
wocky
wocky-heartbeat-source
WockyDiscoIdentity — Structure holding XMPP disco identity information.
WockyJabberAuth
wocky-jabber-auth-digest
wocky-jabber-auth-password
WockyMetaPorter
WockyMuc — multi-user chat rooms
wocky-namespaces
WockyNode — representation of a XMPP node
WockyNodeTree
WockyPepService — Object to represent a single PEP service
WockyPing — support for pings/keepalives
WockyPorter
wocky-pubsub-helpers
WockyPubsubNode
wocky-pubsub-node-protected
WockyPubsubService
wocky-pubsub-service-protected
WockyResourceContact
WockyRoster — TODO
WockySaslAuth
wocky-sasl-digest-md5
wocky-sasl-utils
wocky-sasl-plain
wocky-sasl-scram
WockySession
WockyStanza
WockyTLSConnector
Wocky OpenSSL TLS — Establish TLS sessions
WockyTLSHandler
wocky-utils
WockyXmppConnection — Low-level XMPP connection.
wocky-xmpp-error
WockyXmppReader — Xmpp XML to stanza deserializer
WockyXmppWriter — Xmpp stanza to XML serializer
WockyJingleContent
WockyJingleFactory
wocky-jingle-info-internal
WockyJingleInfo
WockyJingleMediaRtp
WockyJingleSession
WockyJingleTransportGoogle
WockyJingleTransportIceUdp
WockyJingleTransportIface
WockyJingleTransportRawUdp
wocky-jingle-types
Object Hierarchy
API Index
Annotation Glossary
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-utils.html0000644000175000017500000001340513012562226031677 0ustar00gkiagiagkiagia00000000000000 wocky-sasl-utils: Wocky Reference Manual

wocky-sasl-utils

wocky-sasl-utils

Types and Values

Description

Functions

sasl_generate_base64_nonce ()

gchar *
sasl_generate_base64_nonce (void);

sasl_calculate_hmac_sha1 ()

GByteArray *
sasl_calculate_hmac_sha1 (guint8 *key,
                          gsize key_len,
                          guint8 *text,
                          gsize text_len);

Types and Values

WOCKY_SHA1_BLOCK_SIZE

#define WOCKY_SHA1_BLOCK_SIZE 64

WOCKY_SHA1_DIGEST_SIZE

#define WOCKY_SHA1_DIGEST_SIZE 20
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-jabber-auth-digest.html0000644000175000017500000000721313012562226033240 0ustar00gkiagiagkiagia00000000000000 wocky-jabber-auth-digest: Wocky Reference Manual

wocky-jabber-auth-digest

wocky-jabber-auth-digest

Functions

WockyJabberAuthDigest * wocky_jabber_auth_digest_new ()

Description

Functions

wocky_jabber_auth_digest_new ()

WockyJabberAuthDigest *
wocky_jabber_auth_digest_new (const gchar *server,
                              const gchar *password);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-sasl-scram.html0000644000175000017500000000717313012562226031651 0ustar00gkiagiagkiagia00000000000000 wocky-sasl-scram: Wocky Reference Manual

wocky-sasl-scram

wocky-sasl-scram

Functions

WockySaslScram * wocky_sasl_scram_new ()

Description

Functions

wocky_sasl_scram_new ()

WockySaslScram *
wocky_sasl_scram_new (const gchar *server,
                      const gchar *username,
                      const gchar *password);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyBareContact.html0000644000175000017500000011315113012562226030514 0ustar00gkiagiagkiagia00000000000000 WockyBareContact: Wocky Reference Manual

WockyBareContact

WockyBareContact — Wrapper around a roster item.

Properties

GStrv groups Read / Write / Construct
gchar * jid Read / Write / Construct Only
gchar * name Read / Write / Construct
guint subscription Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── WockyContact
        ╰── WockyBareContact

Includes

#include <wocky/wocky-bare-contact.h>

Description

Stores information regarding a roster item and provides a higher level API for altering its details.

Functions

wocky_bare_contact_new ()

WockyBareContact *
wocky_bare_contact_new (const gchar *jid);

Creates a new WockyBareContact for a given JID.

Parameters

jid

the JID of the contact to create

 

Returns

a newly constructed WockyBareContact


wocky_bare_contact_get_jid ()

const gchar *
wocky_bare_contact_get_jid (WockyBareContact *contact);

Returns the JID of the contact wrapped by contact .

Parameters

contact

a WockyBareContact instance

 

Returns

contact 's JID.


wocky_bare_contact_get_name ()

const gchar *
wocky_bare_contact_get_name (WockyBareContact *contact);

Returns the name of the contact wrapped by contact .

Parameters

contact

WockyBareContact instance

 

Returns

contact 's name


wocky_bare_contact_set_name ()

void
wocky_bare_contact_set_name (WockyBareContact *contact,
                             const gchar *name);

Sets contact 's name to name .

Parameters

contact

a WockyBareContact instance

 

name

the name to set contact

 

wocky_bare_contact_get_subscription ()

WockyRosterSubscriptionFlags
wocky_bare_contact_get_subscription (WockyBareContact *contact);

Gets the subscription type contact has.

Parameters

contact

a WockyBareContact instance

 

Returns

contact 's subscription.


wocky_bare_contact_set_subscription ()

void
wocky_bare_contact_set_subscription (WockyBareContact *contact,
                                     WockyRosterSubscriptionFlags subscription);

Sets the subscription of contact .

Parameters

contact

a WockyBareContact instance

 

subscription

the new subscription type

 

wocky_bare_contact_get_groups ()

const gchar * const *
wocky_bare_contact_get_groups (WockyBareContact *contact);

Returns the list of the groups of contact .

Parameters

contact

a WockyBareContact instance

 

Returns

a list of contact 's groups


wocky_bare_contact_set_groups ()

void
wocky_bare_contact_set_groups (WockyBareContact *contact,
                               gchar **groups);

Sets contact 's groups.

Parameters

contact

a WockyBareContact instance

 

groups

a list of groups

 

wocky_bare_contact_equal ()

gboolean
wocky_bare_contact_equal (WockyBareContact *a,
                          WockyBareContact *b);

Compares whether two WockyBareContact instances refer to the same roster item.

Parameters

a

a WockyBareContact instance

 

b

a WockyBareContact instance to compare with a

 

Returns

TRUE if the two contacts match.


wocky_bare_contact_add_group ()

void
wocky_bare_contact_add_group (WockyBareContact *contact,
                              const gchar *group);

Adds group to contact's groups.

Parameters

contact

a WockyBareContact instance

 

group

a group

 

wocky_bare_contact_in_group ()

gboolean
wocky_bare_contact_in_group (WockyBareContact *contact,
                             const gchar *group);

Determines whether the given contact is in group .

Parameters

contact

a WockyBareContact instance

 

group

a group

 

Returns

TRUE if the contact is in the given group.


wocky_bare_contact_remove_group ()

void
wocky_bare_contact_remove_group (WockyBareContact *contact,
                                 const gchar *group);

Removes group from the contact's groups.

Parameters

contact

a WockyBareContact instance

 

group

a group

 

wocky_bare_contact_copy ()

WockyBareContact *
wocky_bare_contact_copy (WockyBareContact *contact);

Convenience function to obtain a copy of the given WockyBareContact.

Parameters

contact

a WockyBareContact instance

 

Returns

a newly created WockyBareContact which is a copy of the given one.


wocky_bare_contact_debug_print ()

void
wocky_bare_contact_debug_print (WockyBareContact *contact);

Prints debug information for the given WockyBareContact.

Parameters

contact

a WockyBareContact instance

 

wocky_bare_contact_add_resource ()

void
wocky_bare_contact_add_resource (WockyBareContact *contact,
                                 WockyResourceContact *resource);

Adds resource to the contact's resources. The WockyBareContact instance doesn't assume a reference to resource .

Parameters

contact

a WockyBareContact instance

 

resource

a WockyResourceContact instance

 

wocky_bare_contact_get_resources ()

GSList *
wocky_bare_contact_get_resources (WockyBareContact *contact);

Gets a GSList of all the contact's resources. You should call g_slist_free on the list when done with it.

Parameters

contact

a WockyBareContact instance

 

Returns

a GSList of WockyResourceContact objects.

Types and Values

struct WockyBareContactClass

struct WockyBareContactClass {
};

The class of a WockyBareContact.

Property Details

The “groups” property

  “groups”                   GStrv

A list of the contact's groups, according to the roster.

Flags: Read / Write / Construct


The “jid” property

  “jid”                      gchar *

The contact's bare JID, according to the roster.

Flags: Read / Write / Construct Only

Default value: ""


The “name” property

  “name”                     gchar *

The contact's name, according to the roster.

Flags: Read / Write / Construct

Default value: ""


The “subscription” property

  “subscription”             guint

The subscription type of the contact, according to the roster.

Flags: Read / Write / Construct

Allowed values: <= 3

Default value: 0

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyJingleTransportRawUdp.html0000644000175000017500000002215413012562226032601 0ustar00gkiagiagkiagia00000000000000 WockyJingleTransportRawUdp: Wocky Reference Manual

WockyJingleTransportRawUdp

WockyJingleTransportRawUdp

Properties

WockyJingleContent * content Read / Write / Construct Only
guint state Read / Write
gchar * transport-ns Read / Write / Construct Only

Signals

Object Hierarchy

    GObject
    ╰── WockyJingleTransportRawUdp

Implemented Interfaces

WockyJingleTransportRawUdp implements

Description

Functions

jingle_transport_rawudp_register ()

void
jingle_transport_rawudp_register (WockyJingleFactory *factory);

Types and Values

Property Details

The “content” property

  “content”                  WockyJingleContent *

Jingle content object using this transport.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    guint

Enum specifying the connection state of the transport.

Flags: Read / Write

Allowed values: <= 2

Default value: 0


The “transport-ns” property

  “transport-ns”             gchar *

Namespace identifying the transport type.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “new-candidates” signal

void
user_function (WockyJingleTransportRawUdp *wockyjingletransportrawudp,
               gpointer                    arg1,
               gpointer                    user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyPubsubNode.html0000644000175000017500000020703713012562226030404 0ustar00gkiagiagkiagia00000000000000 WockyPubsubNode: Wocky Reference Manual

WockyPubsubNode

WockyPubsubNode

Properties

gchar * name Read / Write / Construct Only
WockyPubsubService * service Read / Write / Construct Only

Types and Values

Object Hierarchy

    GBoxed
    ╰── WockyPubsubAffiliation
    GEnum
    ╰── WockyPubsubAffiliationState
    GObject
    ╰── WockyPubsubNode

Description

Functions

wocky_pubsub_node_get_name ()

const gchar *
wocky_pubsub_node_get_name (WockyPubsubNode *self);

wocky_pubsub_node_make_publish_stanza ()

WockyStanza *
wocky_pubsub_node_make_publish_stanza (WockyPubsubNode *self,
                                       WockyNode **pubsub_out,
                                       WockyNode **publish_out,
                                       WockyNode **item_out);

wocky_pubsub_node_subscribe_async ()

void
wocky_pubsub_node_subscribe_async (WockyPubsubNode *self,
                                   const gchar *jid,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Attempts to subscribe to self .

Parameters

self

a pubsub node

 

jid

the JID to use as the subscribed JID (usually the connection's bare or full JID); may not be NULL

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is completed

 

user_data

data to pass to callback

 

wocky_pubsub_node_subscribe_finish ()

WockyPubsubSubscription *
wocky_pubsub_node_subscribe_finish (WockyPubsubNode *self,
                                    GAsyncResult *result,
                                    GError **error);

wocky_pubsub_node_unsubscribe_async ()

void
wocky_pubsub_node_unsubscribe_async (WockyPubsubNode *self,
                                     const gchar *jid,
                                     const gchar *subid,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Attempts to unsubscribe from self .

Parameters

self

a pubsub node

 

jid

the JID subscribed to self (usually the connection's bare or full JID); may not be NULL

 

subid

the identifier associated with the subscription

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is completed

 

user_data

data to pass to callback

 

wocky_pubsub_node_unsubscribe_finish ()

gboolean
wocky_pubsub_node_unsubscribe_finish (WockyPubsubNode *self,
                                      GAsyncResult *result,
                                      GError **error);

wocky_pubsub_node_delete_async ()

void
wocky_pubsub_node_delete_async (WockyPubsubNode *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_pubsub_node_delete_finish ()

gboolean
wocky_pubsub_node_delete_finish (WockyPubsubNode *self,
                                 GAsyncResult *result,
                                 GError **error);

wocky_pubsub_node_list_subscribers_async ()

void
wocky_pubsub_node_list_subscribers_async
                               (WockyPubsubNode *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Retrieves the list of subscriptions to a node you own. callback may complete the call using wocky_pubsub_node_list_subscribers_finish().

(A note on naming: this is §8.8.1 — Retrieve Subscriptions List — in XEP-0060, not to be confused with §5.6 — Retrieve Subscriptions. The different terminology in Wocky is intended to help disambiguate!)

Parameters

self

a pubsub node

 

cancellable

optional GCancellable object

 

callback

function to call when the subscribers have been retrieved or an error has occured

 

user_data

data to pass to callback .

 

wocky_pubsub_node_list_subscribers_finish ()

gboolean
wocky_pubsub_node_list_subscribers_finish
                               (WockyPubsubNode *self,
                                GAsyncResult *result,
                                GList **subscribers,
                                GError **error);

Completes a call to wocky_pubsub_node_list_subscribers_async(). The list returned in subscribers should be freed with wocky_pubsub_subscription_list_free() when it is no longer needed.

Parameters

self

a pubsub node

 

result

the result passed to a callback

 

subscribers

location at which to store a list of WockyPubsubSubscription pointers, or NULL

 

error

location at which to store an error, or NULL

 

Returns

TRUE if the list of subscribers was successfully retrieved; FALSE and sets error if an error occured.


wocky_pubsub_affiliation_new ()

WockyPubsubAffiliation *
wocky_pubsub_affiliation_new (WockyPubsubNode *node,
                              const gchar *jid,
                              WockyPubsubAffiliationState state);

Parameters

node

a node

 

jid

the JID affiliated to node

 

state

the state of jid 's affiliation to node

 

Returns

a new structure representing an affiliation, which should ultimately be freed with wocky_pubsub_affiliation_free()


wocky_pubsub_affiliation_copy ()

WockyPubsubAffiliation *
wocky_pubsub_affiliation_copy (WockyPubsubAffiliation *aff);

Parameters

aff

an existing affiliation structure

 

Returns

a duplicate of aff ; the duplicate should ultimately be freed with wocky_pubsub_affiliation_free()


wocky_pubsub_affiliation_free ()

void
wocky_pubsub_affiliation_free (WockyPubsubAffiliation *aff);

Frees an affiliation, previously allocated with wocky_pubsub_affiliation_new() or wocky_pubsub_affiliation_copy()

Parameters

aff

an affiliation

 

wocky_pubsub_affiliation_list_copy ()

GList *
wocky_pubsub_affiliation_list_copy (GList *affs);

Shorthand for manually copying affs , duplicating each element with wocky_pubsub_affiliation_copy().

Parameters

affs

a list of WockyPubsubAffiliation

 

Returns

a deep copy of affs , which should ultimately be freed with wocky_pubsub_affiliation_list_free().


wocky_pubsub_affiliation_list_free ()

void
wocky_pubsub_affiliation_list_free (GList *affs);

Frees a list of WockyPubsubAffiliation structures, as shorthand for calling wocky_pubsub_affiliation_free() for each element, followed by g_list_free().

Parameters

affs

a list of WockyPubsubAffiliation

 

wocky_pubsub_node_list_affiliates_async ()

void
wocky_pubsub_node_list_affiliates_async
                               (WockyPubsubNode *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Retrieves the list of entities affilied to a node you own. callback may complete the call using wocky_pubsub_node_list_affiliates_finish().

(A note on naming: this is §8.9.1 — Retrieve Affiliations List — in XEP-0060, not to be confused with §5.7 — Retrieve Affiliations. The slightly different terminology in Wocky is intended to help disambiguate!)

Parameters

self

a pubsub node

 

cancellable

optional GCancellable object

 

callback

function to call when the affiliates have been retrieved or an error has occured

 

user_data

data to pass to callback .

 

wocky_pubsub_node_list_affiliates_finish ()

gboolean
wocky_pubsub_node_list_affiliates_finish
                               (WockyPubsubNode *self,
                                GAsyncResult *result,
                                GList **affiliates,
                                GError **error);

Completes a call to wocky_pubsub_node_list_affiliates_async(). The list returned in affiliates should be freed with wocky_pubsub_affiliation_list_free() when it is no longer needed.

Parameters

self

a pubsub node

 

result

the result passed to a callback

 

affiliates

location at which to store a list of WockyPubsubAffiliation pointers, or NULL

 

error

location at which to store an error, or NULL

 

Returns

TRUE if the list of subscribers was successfully retrieved; FALSE and sets error if an error occured.


wocky_pubsub_node_modify_affiliates_async ()

void
wocky_pubsub_node_modify_affiliates_async
                               (WockyPubsubNode *self,
                                GList *affiliates,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Modifies the entities affiliated to a node that you own.

Parameters

self

a pubsub node

 

affiliates

a list of WockyPubsubAffiliation structures, describing only the affiliations which should be changed.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is completed

 

user_data

data to pass to callback

 

wocky_pubsub_node_modify_affiliates_finish ()

gboolean
wocky_pubsub_node_modify_affiliates_finish
                               (WockyPubsubNode *self,
                                GAsyncResult *result,
                                GError **error);

Complete a call to wocky_pubsub_node_modify_affiliates_async().

Parameters

self

a node

 

result

the result

 

error

location at which to store an error, if one occurred.

 

Returns

TRUE if the affiliates were successfully modified; FALSE and sets error otherwise.


wocky_pubsub_node_get_configuration_async ()

void
wocky_pubsub_node_get_configuration_async
                               (WockyPubsubNode *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Retrieves the current configuration for a node owned by the user.

Parameters

self

a node

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is completed

 

user_data

data to pass to callback

 

wocky_pubsub_node_get_configuration_finish ()

WockyDataForm *
wocky_pubsub_node_get_configuration_finish
                               (WockyPubsubNode *self,
                                GAsyncResult *result,
                                GError **error);

Complete a call to wocky_pubsub_node_get_configuration_async().

Parameters

self

a node

 

result

the result

 

error

location at which to store an error, if one occurred.

 

Returns

a form representing the node configuration on success; NULL and sets error otherwise

Types and Values

struct WockyPubsubNodeClass

struct WockyPubsubNodeClass {
};

The class of a WockyPubsubNode.


enum WockyPubsubAffiliationState

Possible affiliations to a PubSub node, which determine privileges an entity has. See XEP-0060 §4.1 for the details.

Members

WOCKY_PUBSUB_AFFILIATION_OWNER

Owner

 

WOCKY_PUBSUB_AFFILIATION_PUBLISHER

Publisher

 

WOCKY_PUBSUB_AFFILIATION_PUBLISH_ONLY

Publish-Only

 

WOCKY_PUBSUB_AFFILIATION_MEMBER

Member

 

WOCKY_PUBSUB_AFFILIATION_NONE

None

 

WOCKY_PUBSUB_AFFILIATION_OUTCAST

Outcast

 

Property Details

The “name” property

  “name”                     gchar *

The name of the pubsub node.

Flags: Read / Write / Construct Only

Default value: NULL


The “service” property

  “service”                  WockyPubsubService *

the Wocky Pubsub service associated with this pubsub node.

Flags: Read / Write / Construct Only

Signal Details

The “deleted” signal

void
user_function (WockyPubsubNode *node,
               WockyStanza     *stanza,
               gpointer         event_node,
               gpointer         delete_node,
               gpointer         user_data)

Emitted when a notification of this node's deletion is received from the server.

Parameters

node

a pubsub node

 

stanza

the message/event stanza in its entirety

 

event_node

the event node from stanza

 

delete_node

the delete node from stanza

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “event-received” signal

void
user_function (WockyPubsubNode *node,
               WockyStanza     *event_stanza,
               gpointer         event_node,
               gpointer         items_node,
               gpointer         items,
               gpointer         user_data)

Parameters

node

a pubsub node

 

event_stanza

the message/event stanza in its entirity

 

event_node

the event node from the stanza

 

items_node

the items node from the stanza

 

items

a list of WockyNode *s for each item child of items_node

 

user_data

user data set when the signal handler was connected.

 

The “subscription-state-changed” signal

void
user_function (WockyPubsubNode         *node,
               WockyStanza             *stanza,
               gpointer                 event_node,
               gpointer                 subscription_node,
               WockyPubsubSubscription *subscription,
               gpointer                 user_data)

Parameters

node

a pubsub node

 

stanza

the message/event stanza in its entirety

 

event_node

the event node from stanza

 

subscription_node

the subscription node from stanza

 

subscription

subscription information parsed from subscription_node

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky.devhelp20000644000175000017500000054550613012562226027230 0ustar00gkiagiagkiagia00000000000000 telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyPubsubService.html0000644000175000017500000012065413012562226031116 0ustar00gkiagiagkiagia00000000000000 WockyPubsubService: Wocky Reference Manual

WockyPubsubService

WockyPubsubService

Properties

gchar * jid Read / Write / Construct Only
WockySession * session Read / Write / Construct Only

Object Hierarchy

    GBoxed
    ╰── WockyPubsubSubscription
    GEnum
    ├── WockyPubsubServiceError
    ╰── WockyPubsubSubscriptionState
    GObject
    ╰── WockyPubsubService

Description

Functions

wocky_pubsub_service_error_quark ()

GQuark
wocky_pubsub_service_error_quark (void);

wocky_pubsub_service_new ()

WockyPubsubService *
wocky_pubsub_service_new (WockySession *session,
                          const gchar *jid);

wocky_pubsub_service_ensure_node ()

WockyPubsubNode *
wocky_pubsub_service_ensure_node (WockyPubsubService *self,
                                  const gchar *name);

Fetches or creates an object representing a node on the pubsub service. Note that this does not ensure that a node exists on the server; it merely ensures a local representation.

Parameters

self

a pubsub service

 

name

the name of a node on self

 

Returns

a new reference to an object representing a node named name on self


wocky_pubsub_service_lookup_node ()

WockyPubsubNode *
wocky_pubsub_service_lookup_node (WockyPubsubService *self,
                                  const gchar *name);

Fetches an object representing a node on a pubsub service, if the object already exists; if not, returns NULL. Note that this does not check whether a node exists on the server; it only checks for a local representation.

Parameters

self

a pubsub service

 

name

the name of a node on self

 

Returns

a borrowed reference to a node, or NULL


wocky_pubsub_service_get_default_node_configuration_async ()

void
wocky_pubsub_service_get_default_node_configuration_async
                               (WockyPubsubService *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_pubsub_service_get_default_node_configuration_finish ()

WockyDataForm *
wocky_pubsub_service_get_default_node_configuration_finish
                               (WockyPubsubService *self,
                                GAsyncResult *result,
                                GError **error);

wocky_pubsub_service_retrieve_subscriptions_async ()

void
wocky_pubsub_service_retrieve_subscriptions_async
                               (WockyPubsubService *self,
                                WockyPubsubNode *node,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_pubsub_service_retrieve_subscriptions_finish ()

gboolean
wocky_pubsub_service_retrieve_subscriptions_finish
                               (WockyPubsubService *self,
                                GAsyncResult *result,
                                GList **subscriptions,
                                GError **error);

wocky_pubsub_service_create_node_async ()

void
wocky_pubsub_service_create_node_async
                               (WockyPubsubService *self,
                                const gchar *name,
                                WockyDataForm *config,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_pubsub_service_create_node_finish ()

WockyPubsubNode *
wocky_pubsub_service_create_node_finish
                               (WockyPubsubService *self,
                                GAsyncResult *result,
                                GError **error);

wocky_pubsub_subscription_new ()

WockyPubsubSubscription *
wocky_pubsub_subscription_new (WockyPubsubNode *node,
                               const gchar *jid,
                               WockyPubsubSubscriptionState state,
                               const gchar *subid);

wocky_pubsub_subscription_copy ()

WockyPubsubSubscription *
wocky_pubsub_subscription_copy (WockyPubsubSubscription *sub);

wocky_pubsub_subscription_free ()

void
wocky_pubsub_subscription_free (WockyPubsubSubscription *sub);

wocky_pubsub_subscription_list_copy ()

GList *
wocky_pubsub_subscription_list_copy (GList *subs);

wocky_pubsub_subscription_list_free ()

void
wocky_pubsub_subscription_list_free (GList *subs);

Types and Values

enum WockyPubsubServiceError

WockyPubsubService specific errors.

Members

WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY

A wrong reply was received

 

WOCKY_PUBSUB_SERVICE_ERROR

#define WOCKY_PUBSUB_SERVICE_ERROR (wocky_pubsub_service_error_quark ())

enum WockyPubsubSubscriptionState

Describes the state of a subscription to a node. Definitions are taken from

XEP-0060 §4.2.

Members

WOCKY_PUBSUB_SUBSCRIPTION_NONE

The node MUST NOT send event notifications or payloads to the Entity.

 

WOCKY_PUBSUB_SUBSCRIPTION_PENDING

An entity has requested to subscribe to a node and the request has not yet been approved by a node owner. The node MUST NOT send event notifications or payloads to the entity while it is in this state.

 

WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED

An entity has subscribed but its subscription options have not yet been configured. The node MAY send event notifications or payloads to the entity while it is in this state. The service MAY timeout unconfigured subscriptions.

 

WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED

An entity is subscribed to a node. The node MUST send all event notifications (and, if configured, payloads) to the entity while it is in this state (subject to subscriber configuration and content filtering).

 

Property Details

The “jid” property

  “jid”                      gchar *

The jid of the pubsub service.

Flags: Read / Write / Construct Only

Default value: NULL


The “session” property

  “session”                  WockySession *

the Wocky Session associated with this pubsub service.

Flags: Read / Write / Construct Only

Signal Details

The “event-received” signal

void
user_function (WockyPubsubService *service,
               WockyPubsubNode    *node,
               WockyStanza        *event_stanza,
               gpointer            event_node,
               gpointer            items_node,
               gpointer            items,
               gpointer            user_data)

Emitted when an event is received for a node.

Parameters

service

a pubsub service

 

node

the node on service for which an event has been received wire

 

event_stanza

the message/event stanza in its entirity

 

event_node

the event node from the stanza

 

items_node

the items node from the stanza

 

items

a list of WockyNode *s for each item child of items_node

 

user_data

user data set when the signal handler was connected.

 

The “node-deleted” signal

void
user_function (WockyPubsubService *node,
               WockyPubsubNode    *stanza,
               WockyStanza        *event_node,
               gpointer            delete_node,
               gpointer            arg4,
               gpointer            user_data)

Emitted when a notification of a node's deletion is received from the server.

Parameters

node

a pubsub node

 

stanza

the message/event stanza in its entirety

 

event_node

the event node from stanza

 

delete_node

the delete node from stanza

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “subscription-state-changed” signal

void
user_function (WockyPubsubService      *service,
               WockyPubsubNode         *node,
               WockyStanza             *stanza,
               gpointer                 event_node,
               gpointer                 subscription_node,
               WockyPubsubSubscription *subscription,
               gpointer                 user_data)

Parameters

service

a pubsub service

 

node

a pubsub node for which the subscription state has changed

 

stanza

the message/event stanza in its entirety

 

event_node

the event node from stanza

 

subscription_node

the subscription node from stanza

 

subscription

subscription information parsed from subscription_node

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyMetaPorter.html0000644000175000017500000006756613012562226030433 0ustar00gkiagiagkiagia00000000000000 WockyMetaPorter: Wocky Reference Manual

WockyMetaPorter

WockyMetaPorter

Properties

WockyContactFactory * contact-factory Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyMetaPorter

Description

Functions

wocky_meta_porter_error_quark ()

GQuark
wocky_meta_porter_error_quark (void);

wocky_meta_porter_new ()

WockyPorter *
wocky_meta_porter_new (const gchar *jid,
                       WockyContactFactory *contact_factory);

Convenience function to create a new WockyMetaPorter object. The JID can be set later by using wocky_meta_porter_set_jid().

Parameters

jid

the JID of the local user, or NULL

 

contact_factory

a WockyContactFactory object

 

Returns

a new WockyMetaPorter


wocky_meta_porter_get_port ()

guint16
wocky_meta_porter_get_port (WockyMetaPorter *porter);

Returns the port porter is listening in on for new incoming XMPP connections, or 0 if it has not been started yet with wocky_porter_start().

Parameters

porter

a WockyMetaPorter

 

Returns

the port porter is listening in on for new incoming XMPP connections, or 0 if it has not been started.


wocky_meta_porter_hold ()

void
wocky_meta_porter_hold (WockyMetaPorter *porter,
                        WockyContact *contact);

Increases the hold count of the porter to contact by one. This means that if there is a connection open to contact then it will not disconnected after a timeout. Note that calling this function does not mean a connection will be opened. The hold count on a contact survives across connections.

To decrement the hold count of the porter to contact , one must call wocky_meta_porter_unhold().

Parameters

porter

a WockyMetaPorter

 

contact

a WockyContact

 

wocky_meta_porter_unhold ()

void
wocky_meta_porter_unhold (WockyMetaPorter *porter,
                          WockyContact *contact);

Decreases the hold count of the porter to contact by one. This means that if there is a connection open to contact and the hold count is zero, a connection timeout will be started.

Parameters

porter

a WockyMetaPorter

 

contact

a WockyContact

 

wocky_meta_porter_set_jid ()

void
wocky_meta_porter_set_jid (WockyMetaPorter *porter,
                           const gchar *jid);

Changes the local JID according to porter . Note that this function can only be called once, and only if NULL was passed to wocky_meta_porter_new() when creating porter . Calling it again will be a no-op.

Parameters

porter

a WockyMetaPorter

 

jid

a new JID

 

wocky_meta_porter_open_async ()

void
wocky_meta_porter_open_async (WockyMetaPorter *porter,
                              WockyLLContact *contact,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Make an asynchronous request to open a connection to contact if one is not already open. The hold count of the porter to contact will be incrememented and so after completion wocky_meta_porter_unhold() should be called on contact to release the hold.

When the request is complete, callback will be called and the user should call wocky_meta_porter_open_finish() to finish the request.

Parameters

porter

a WockyMetaPorter

 

contact

the WockyLLContact

 

cancellable

an optional GCancellable, or NULL

 

callback

a callback to be called

 

user_data

data for callback

 

wocky_meta_porter_open_finish ()

gboolean
wocky_meta_porter_open_finish (WockyMetaPorter *porter,
                               GAsyncResult *result,
                               GError **error);

Finishes an asynchronous request to open a connection if one is not already open. See wocky_meta_porter_open_async() for more details.

Parameters

porter

a WockyMetaPorter

 

result

the GAsyncResult

 

error

an optional GError location to store an error message

 

Returns

TRUE if the operation was a success, otherwise FALSE


wocky_meta_porter_borrow_connection ()

GSocketConnection *
wocky_meta_porter_borrow_connection (WockyMetaPorter *porter,
                                     WockyLLContact *contact);

Borrow the GSocketConnection of the porter to contact , if one exists, otherwise NULL will be returned.

Note that the connection returned should be reffed using g_object_ref() if it needs to be kept. However, it will still be operated on by the underlying WockyXmppConnection object so can close spontaneously unless wocky_meta_porter_hold() is called with contact .

Parameters

porter

a WockyMetaPorter

 

contact

the WockyContact

 

Returns

the GSocketConnection or NULL if no connection is open

Types and Values

enum WockyMetaPorterError

Members

WOCKY_META_PORTER_ERROR_NO_CONTACT_ADDRESS

   

WOCKY_META_PORTER_ERROR_FAILED_TO_CLOSE

   

WOCKY_META_PORTER_ERROR

#define WOCKY_META_PORTER_ERROR (wocky_meta_porter_error_quark ())

Property Details

The “contact-factory” property

  “contact-factory”          WockyContactFactory *

The WockyContactFactory object in use by this meta porter.

Flags: Read / Write / Construct Only

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyConnector.html0000644000175000017500000017007413012562226030270 0ustar00gkiagiagkiagia00000000000000 WockyConnector: Wocky Reference Manual

WockyConnector

WockyConnector — Low-level XMPP connection generator.

Properties

WockyAuthRegistry * auth-registry Read / Write / Construct Only
gchar * email Read / Write
gboolean encrypted-plain-auth-ok Read / Write / Construct
WockyStanza * features Read
gchar * identity Read
gchar * jid Read / Write
gboolean legacy Read / Write / Construct
gboolean old-ssl Read / Write / Construct
gchar * password Read / Write
gboolean plaintext-auth-allowed Read / Write / Construct
gchar * resource Read / Write / Construct Only
gchar * session-id Read
WockyTLSHandler * tls-handler Read / Write / Construct Only
gboolean tls-required Read / Write / Construct
guint xmpp-port Read / Write / Construct
gchar * xmpp-server Read / Write

Types and Values

Object Hierarchy

    GEnum
    ╰── WockyConnectorError
    GObject
    ╰── WockyConnector

Includes

#include <wocky/wocky-connector.h>

Description

See: RFC3920 XEP-0077

Sends and receives WockyStanzas from an underlying GIOStream. negotiating TLS if possible and completing authentication with the server by the "most suitable" method available. Returns a WockyXmppConnection object to the user on successful completion.

Can also be used to register or unregister an account: When unregistering (cancelling) an account, a WockyXmppConnection is NOT returned - a gboolean value indicating success or failure is returned instead.

The WOCKY_DEBUG tag for this module is "connector".

The flow of control during connection is roughly as follows: (registration/cancellation flows are not represented with here)

tcp_srv_connected
│
├→ tcp_host_connected
│  ↓
└→ maybe_old_ssl
   ↓
   xmpp_init ←─────────────────┬──┐
   ↓                           │  │
   xmpp_init_sent_cb           │  │
   ↓                           │  │
   xmpp_init_recv_cb           │  │
   │ ↓                         │  │
   │ xmpp_features_cb          │  │
   │ │ │ ↓                     │  │
   │ │ │ tls_module_secure_cb ─┘  │             ①
   │ │ ↓                      │             ↑
   │ │ sasl_request_auth      │             jabber_auth_done
   │ │ ↓                      │             ↑
   │ │ sasl_auth_done ────────┴─[no sasl]─→ jabber_request_auth
   │ ↓                                      ↑
   │ iq_bind_resource                       │
   │ ↓                                      │
   │ iq_bind_resource_sent_cb               │
   │ ↓                                      │
   │ iq_bind_resource_recv_cb               │
   │ ↓                                      │
   │ ①                                      │
   └──────────[old auth]────────────────────┘

   ①
   ↓
   establish_session ─────────→ success
   ↓                              ↑
   establish_session_sent_cb      │
   ↓                              │
   establish_session_recv_cb ─────┘
 

Functions

wocky_connector_error_quark ()

GQuark
wocky_connector_error_quark (void);

wocky_connector_connect_finish ()

WockyXmppConnection *
wocky_connector_connect_finish (WockyConnector *self,
                                GAsyncResult *res,
                                gchar **jid,
                                gchar **sid,
                                GError **error);

Called by the callback passed to wocky_connector_connect_async().

Parameters

self

a WockyConnector instance.

 

res

a GAsyncResult (from your wocky_connector_connect_async() callback).

 

jid

(NULL to ignore) the user JID from the server is stored here.

 

sid

(NULL to ignore) the Session ID is stored here.

 

error

(NULL to ignore) the GError (if any) is sored here.

 

Returns

a WockyXmppConnection instance (success), or NULL (failure).


wocky_connector_register_finish ()

WockyXmppConnection *
wocky_connector_register_finish (WockyConnector *self,
                                 GAsyncResult *res,
                                 gchar **jid,
                                 gchar **sid,
                                 GError **error);

Called by the callback passed to wocky_connector_register_async().

Parameters

self

a WockyConnector instance.

 

res

a GAsyncResult (from your wocky_connector_register_async() callback).

 

jid

(NULL to ignore) the JID in effect after connection is stored here.

 

sid

(NULL to ignore) the Session ID after connection is stored here.

 

error

(NULL to ignore) the GError (if any) is stored here.

 

Returns

a WockyXmppConnection instance (success), or NULL (failure).


wocky_connector_connect_async ()

void
wocky_connector_connect_async (WockyConnector *self,
                               GCancellable *cancellable,
                               GAsyncReadyCallback cb,
                               gpointer user_data);

Connect to the account/server specified by the self . cb should invoke wocky_connector_connect_finish().

Parameters

self

a WockyConnector instance.

 

cancellable

an GCancellable, or NULL

 

cb

a GAsyncReadyCallback to call when the operation completes.

 

user_data

a gpointer to pass to the callback.

 

wocky_connector_new ()

WockyConnector *
wocky_connector_new (const gchar *jid,
                     const gchar *pass,
                     const gchar *resource,
                     WockyAuthRegistry *auth_registry,
                     WockyTLSHandler *tls_handler);

Connect to the account/server specified by self . To set other WockyConnector properties, use g_object_new() instead.

Parameters

jid

a JID (user AT domain).

 

pass

the password.

 

resource

the resource (sans '/'), or NULL to autogenerate one.

 

auth_registry

a WockyAuthRegistry, or NULL

 

tls_handler

a WockyTLSHandler, or NULL

 

Returns

a WockyConnector instance which can be used to connect to, register or cancel an account


wocky_connector_register_async ()

void
wocky_connector_register_async (WockyConnector *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback cb,
                                gpointer user_data);

Connect to the account/server specified by self , register (set up) the account there and then log in to it. cb should invoke wocky_connector_register_finish().

Parameters

self

a WockyConnector instance.

 

cancellable

an GCancellable, or NULL

 

cb

a GAsyncReadyCallback to call when the operation completes.

 

user_data

a gpointer to pass to the callback cb .

 

wocky_connector_unregister_async ()

void
wocky_connector_unregister_async (WockyConnector *self,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback cb,
                                  gpointer user_data);

Connect to the account/server specified by self , and unregister (cancel) the account there. cb should invoke wocky_connector_unregister_finish().

Parameters

self

a WockyConnector instance.

 

cancellable

an GCancellable, or NULL

 

cb

a GAsyncReadyCallback to call when the operation completes.

 

user_data

a gpointer to pass to the callback cb .

 

wocky_connector_unregister_finish ()

gboolean
wocky_connector_unregister_finish (WockyConnector *self,
                                   GAsyncResult *res,
                                   GError **error);

Called by the callback passed to wocky_connector_unregister_async().

Parameters

self

a WockyConnector instance.

 

res

a GAsyncResult (from the wocky_connector_unregister_async() callback).

 

error

(NULL to ignore) the GError (if any) is stored here.

 

Returns

a gboolean value TRUE (success), or FALSE (failure).


wocky_connector_set_auth_registry ()

void
wocky_connector_set_auth_registry (WockyConnector *self,
                                   WockyAuthRegistry *registry);

Types and Values

enum WockyConnectorError

The WockyConnector specific errors that can occur while connecting.

Members

WOCKY_CONNECTOR_ERROR_UNKNOWN

Unexpected error condition

 

WOCKY_CONNECTOR_ERROR_IN_PROGRESS

Connection already underway

 

WOCKY_CONNECTOR_ERROR_BAD_JID

JID is invalid

 

WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER

XMPP version < 1

 

WOCKY_CONNECTOR_ERROR_BAD_FEATURES

Feature stanza invalid

 

WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE

TLS unavailable

 

WOCKY_CONNECTOR_ERROR_TLS_REFUSED

TLS refused by server

 

WOCKY_CONNECTOR_ERROR_TLS_SESSION_FAILED

TLS handshake failed

 

WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE

Bind not available

 

WOCKY_CONNECTOR_ERROR_BIND_FAILED

Bind failed

 

WOCKY_CONNECTOR_ERROR_BIND_INVALID

Bind args invalid

 

WOCKY_CONNECTOR_ERROR_BIND_DENIED

Bind not allowed

 

WOCKY_CONNECTOR_ERROR_BIND_CONFLICT

Bind resource in use

 

WOCKY_CONNECTOR_ERROR_BIND_REJECTED

Bind error (generic)

 

WOCKY_CONNECTOR_ERROR_SESSION_FAILED

Session failed

 

WOCKY_CONNECTOR_ERROR_SESSION_DENIED

Session refused by server

 

WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT

Session not allowed

 

WOCKY_CONNECTOR_ERROR_SESSION_REJECTED

Session error

 

WOCKY_CONNECTOR_ERROR_INSECURE

Insufficent security for requested operation

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED

Account registration error

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_UNAVAILABLE

Account registration not available

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED

Account registration not implemented

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_EMPTY

Account registration makes no sense

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_CONFLICT

Account already registered

 

WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED

Account registration rejected

 

WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED

Account cancellation failed

 

WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED

Account cancellation refused

 

WOCKY_CONNECTOR_ERROR

#define WOCKY_CONNECTOR_ERROR (wocky_connector_error_quark ())

Get access to the error quark of the connector.


struct WockyConnectorClass

struct WockyConnectorClass {
};

The class of a WockyConnector.

Property Details

The “auth-registry” property

  “auth-registry”            WockyAuthRegistry *

An authentication registry that holds handlers for different authentication mechanisms, arbitrates mechanism selection and relays challenges and responses between the handlers and the connection.

Flags: Read / Write / Construct Only


The “email” property

  “email”                    gchar *

The XMPP account's email address (optional, MAY be required by the server if we are registering an account, not required otherwise).

Flags: Read / Write

Default value: NULL


The “encrypted-plain-auth-ok” property

  “encrypted-plain-auth-ok”  gboolean

Whether PLAINTEXT auth is ok when encrypted.

Flags: Read / Write / Construct

Default value: TRUE


The “features” property

  “features”                 WockyStanza *

A WockyStanza instance, the last WockyStanza instance received by the connector during the connection procedure (there may be several, the most recent one always being the one we should refer to).

Flags: Read


The “identity” property

  “identity”                 gchar *

JID + resource (a AT b SLASH c) that is in effect _after_ a successful resource binding operation. This is NOT guaranteed to be related to the JID specified in the original “jid” property. The resource, in particular, is often different, and with gtalk the domain is often different.

Flags: Read

Default value: NULL


The “jid” property

  “jid”                      gchar *

The XMPP account's JID (with or without a /resource).

Flags: Read / Write

Default value: NULL


The “legacy” property

  “legacy”                   gboolean

Whether to attempt old-style (non-SASL) jabber auth.

Flags: Read / Write / Construct

Default value: FALSE


The “old-ssl” property

  “old-ssl”                  gboolean

Whether to use old-style SSL-at-connect-time encryption rather than the more modern STARTTLS approach.

Flags: Read / Write / Construct

Default value: FALSE


The “password” property

  “password”                 gchar *

XMPP Account password.

Flags: Read / Write

Default value: NULL


The “plaintext-auth-allowed” property

  “plaintext-auth-allowed”   gboolean

Whether auth info can be sent in the clear (eg PLAINTEXT auth). This is independent of any encryption (TLS, SSL) that has been negotiated.

Flags: Read / Write / Construct

Default value: FALSE


The “resource” property

  “resource”                 gchar *

The resource (sans '/') for this connection. If NULL or the empty string, Wocky will let the server decide. Even if you specify a particular resource, the server may modify it.

Flags: Read / Write / Construct Only

Default value: NULL


The “session-id” property

  “session-id”               gchar *

The Session ID supplied by the server upon successfully connecting. May be useful later on as some XEPs suggest this value should be used at various stages as part of a hash or as an ID.

Flags: Read

Default value: NULL


The “tls-handler” property

  “tls-handler”              WockyTLSHandler *

A TLS handler that carries out the interactive verification of the TLS certitificates provided by the server.

Flags: Read / Write / Construct Only


The “tls-required” property

  “tls-required”             gboolean

Whether we require successful tls/ssl negotiation to continue.

Flags: Read / Write / Construct

Default value: TRUE


The “xmpp-port” property

  “xmpp-port”                guint

Optional XMPP connect port. Any DNS SRV record will be ignored if this is set. (So the host will be either the WockyConnector:xmpp-server property or the domain part of the JID, in descending order of preference)

Flags: Read / Write / Construct

Allowed values: <= 65535

Default value: 0


The “xmpp-server” property

  “xmpp-server”              gchar *

Optional XMPP connect server. Any DNS SRV record and the host specified in “jid” will be ignored if this is set. May be a hostname (fully qualified or otherwise), a dotted quad or an ipv6 address.

Flags: Read / Write

Default value: NULL

Signal Details

The “connection-established” signal

void
user_function (WockyConnector    *connection,
               GSocketConnection *arg1,
               gpointer           user_data)

Emitted as soon as a connection to the remote server has been established. This can be useful if you want to do something unusual to the connection early in its lifetime not supported by the WockyConnector APIs.

As the connection process has only just started and the stream not even opened yet, no data must be sent over connection . This signal is merely intended to set esoteric socket options (such as TCP_NODELAY) on the connection.

Parameters

connection

the GSocketConnection

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/right.png0000644000175000017500000000040513012562226026244 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME!GIDAT8үa?MIdEr,-hAIl ry}sX6 !9#D r$-Br$G"$;WZ&!cq \`軀O=QoufIENDB`telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyXmppWriter.html0000644000175000017500000005054413012562226030456 0ustar00gkiagiagkiagia00000000000000 WockyXmppWriter: Wocky Reference Manual

WockyXmppWriter

WockyXmppWriter — Xmpp stanza to XML serializer

Properties

gboolean streaming-mode Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyXmppWriter

Description

The WockyXmppWriter serializes WockyStanzas and XMPP stream opening and closing to raw XML. The various functions provide a pointer to an internal buffer, which remains valid until the next call to the writer.

Functions

wocky_xmpp_writer_new ()

WockyXmppWriter *
wocky_xmpp_writer_new (void);

Convenience function to create a new WockyXmppWriter.

Returns

a new WockyXmppWriter


wocky_xmpp_writer_new_no_stream ()

WockyXmppWriter *
wocky_xmpp_writer_new_no_stream (void);

Convenience function to create a new WockyXmppWriter that has streaming mode disabled.

Returns

a new WockyXmppWriter in non-streaming mode


wocky_xmpp_writer_stream_open ()

void
wocky_xmpp_writer_stream_open (WockyXmppWriter *writer,
                               const gchar *to,
                               const gchar *from,
                               const gchar *version,
                               const gchar *lang,
                               const gchar *id,
                               const guint8 **data,
                               gsize *length);

Create the XML opening header of an XMPP stream. The result is available in the data buffer. The buffer is only valid until the next call to a function the writer.

This function can only be called in streaming mode.

Parameters

writer

a WockyXmppWriter

 

to

the target of the stream opening (usually the xmpp server name)

 

from

the sender of the stream opening (usually the jid of the client)

 

version

XMPP version

 

lang

default XMPP stream language

 

id

XMPP Stream ID, if any, or NULL

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_stream_close ()

void
wocky_xmpp_writer_stream_close (WockyXmppWriter *writer,
                                const guint8 **data,
                                gsize *length);

Create the XML closing footer of an XMPP stream . The result is available in the data buffer. The buffer is only valid until the next call to a function

This function can only be called in streaming mode.

Parameters

writer

a WockyXmppWriter

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_write_stanza ()

void
wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer,
                                WockyStanza *stanza,
                                const guint8 **data,
                                gsize *length);

Serialize the stanza to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function

Parameters

writer

a WockyXmppWriter

 

stanza

the stanza to serialize

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_write_node_tree ()

void
wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer,
                                   WockyNodeTree *tree,
                                   const guint8 **data,
                                   gsize *length);

Serialize the tree to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function. This function may only be called in non-streaming mode.

Parameters

writer

a WockyXmppWriter

 

tree

the node tree to serialize

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_flush ()

void
wocky_xmpp_writer_flush (WockyXmppWriter *writer);

Flushes and frees the internal data buffer

Parameters

writer

a WockyXmppWriter

 

Types and Values

struct WockyXmppWriterClass

struct WockyXmppWriterClass {
};

The class of a WockyXmppWriter.

Property Details

The “streaming-mode” property

  “streaming-mode”           gboolean

Whether the xml to be written is one big stream or separate documents.

Flags: Read / Write / Construct Only

Default value: TRUE

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyMuc.html0000644000175000017500000024225213012562226027060 0ustar00gkiagiagkiagia00000000000000 WockyMuc: Wocky Reference Manual

WockyMuc

WockyMuc — multi-user chat rooms

Properties

WockyMucAffiliation affiliation Read
gchar * category Read
gchar * description Read
gchar * jid Read / Write
gulong muc-flags Read
gchar * name Read
gchar * nickname Read
gchar * password Read / Write
WockyPorter * porter Read / Write / Construct Only
gchar * reserved-nick Read
guint role Read
gchar * room Read
gchar * service Read
gchar * status-message Read
gchar * type Read
gchar * user Read / Write / Construct Only

Object Hierarchy

    GEnum
    ├── WockyMucAffiliation
    ├── WockyMucMsgState
    ├── WockyMucMsgType
    ├── WockyMucRole
    ╰── WockyMucState
    GFlags
    ├── WockyMucFeature
    ╰── WockyMucStatusCode
    GObject
    ╰── WockyMuc

Includes

#include <wocky/wocky.h>

Description

Represents a multi-user chat room. Because the MUC protocol is so terrible, you will find yourself consulting XEP-0045 and shedding more than a few tears while using this class.

Functions

wocky_muc_disco_info_async ()

void
wocky_muc_disco_info_async (WockyMuc *muc,
                            GAsyncReadyCallback callback,
                            GCancellable *cancel,
                            gpointer data);

wocky_muc_disco_info_finish ()

gboolean
wocky_muc_disco_info_finish (WockyMuc *muc,
                             GAsyncResult *res,
                             GError **error);

wocky_muc_create_presence ()

WockyStanza *
wocky_muc_create_presence (WockyMuc *muc,
                           WockyStanzaSubType type,
                           const gchar *status);

wocky_muc_join ()

void
wocky_muc_join (WockyMuc *muc,
                GCancellable *cancel);

wocky_muc_jid ()

const gchar *
wocky_muc_jid (WockyMuc *muc);

wocky_muc_user ()

const gchar *
wocky_muc_user (WockyMuc *muc);

wocky_muc_role ()

WockyMucRole
wocky_muc_role (WockyMuc *muc);

wocky_muc_affiliation ()

WockyMucAffiliation
wocky_muc_affiliation (WockyMuc *muc);

wocky_muc_members ()

GHashTable *
wocky_muc_members (WockyMuc *muc);

wocky_muc_get_state ()

WockyMucState
wocky_muc_get_state (WockyMuc *muc);

Types and Values

enum WockyMucStatusCode

MUC status codes, as defined by XEP-0045 §15.6.

Members

WOCKY_MUC_CODE_UNKNOWN

Unknown code

 

WOCKY_MUC_CODE_ONYMOUS

Room entered is not anonymous

 

WOCKY_MUC_CODE_AF_CHANGE_OOB

Affiliation changed when not present

 

WOCKY_MUC_CODE_CFG_SHOW_UNAVAILABLE

Unavailable members visible

 

WOCKY_MUC_CODE_CFG_HIDE_UNAVAILABLE

Unavailable members invisible

 

WOCKY_MUC_CODE_CFG_NONPRIVACY

Non-privacy config change

 

WOCKY_MUC_CODE_OWN_PRESENCE

User's own presence

 

WOCKY_MUC_CODE_CFG_LOGGING_ENABLED

Logging enabled

 

WOCKY_MUC_CODE_CFG_LOGGING_DISABLED

Logging disabled

 

WOCKY_MUC_CODE_CFG_ONYMOUS

Room is now non-anonymous

 

WOCKY_MUC_CODE_CFG_SEMIONYMOUS

Room is now semi-anonymous

 

WOCKY_MUC_CODE_CFG_ANONYMOUS

Room is now fully-anonymous

 

WOCKY_MUC_CODE_NEW_ROOM

Room created (eg by joining)

 

WOCKY_MUC_CODE_NICK_CHANGE_FORCED

Service enforced nick change

 

WOCKY_MUC_CODE_BANNED

User has been banned

 

WOCKY_MUC_CODE_NICK_CHANGE_USER

User's nick changed

 

WOCKY_MUC_CODE_KICKED

Kicked from the room

 

WOCKY_MUC_CODE_KICKED_AFFILIATION

Kicked (affiliation change)

 

WOCKY_MUC_CODE_KICKED_ROOM_PRIVATISED

Kicked (room is now members-only)

 

WOCKY_MUC_CODE_KICKED_SHUTDOWN

Kicked (shutdown)

 

enum WockyMucRole

WockyMuc roles as described in XEP-0045 §5.1.

Members

WOCKY_MUC_ROLE_NONE

no role

 

WOCKY_MUC_ROLE_VISITOR

visitor role

 

WOCKY_MUC_ROLE_PARTICIPANT

participant role

 

WOCKY_MUC_ROLE_MODERATOR

moderator role

 

enum WockyMucAffiliation

WockyMuc affiliations as described in XEP-0045 §5.2.

Members

WOCKY_MUC_AFFILIATION_OUTCAST

outcast affiliation

 

WOCKY_MUC_AFFILIATION_NONE

no affiliation

 

WOCKY_MUC_AFFILIATION_MEMBER

member affiliation

 

WOCKY_MUC_AFFILIATION_ADMIN

admin affiliation

 

WOCKY_MUC_AFFILIATION_OWNER

owner affiliation

 

enum WockyMucFeature

WockyMuc feature flags.

Members

WOCKY_MUC_MODERN

the MUC is modern, as documented in XEP-0045

 

WOCKY_MUC_FORM_REGISTER

the MUC has support for the mucregister FORM_TYPE

 

WOCKY_MUC_FORM_ROOMCONFIG

the MUC has support for the mucregister FORM_TYPE

 

WOCKY_MUC_FORM_ROOMINFO

the MUC has support for the mucregister FORM_TYPE

 

WOCKY_MUC_HIDDEN

the MUC is hidden

 

WOCKY_MUC_MEMBERSONLY

only members can join this MUC

 

WOCKY_MUC_MODERATED

the MUC is moderated

 

WOCKY_MUC_NONANONYMOUS

the MUC is non-anonymous

 

WOCKY_MUC_OPEN

the MUC is open

 

WOCKY_MUC_PASSWORDPROTECTED

the MUC is password protected

 

WOCKY_MUC_PERSISTENT

the MUC is persistent

 

WOCKY_MUC_PUBLIC

the MUC is public

 

WOCKY_MUC_ROOMS

the MUC has a list of MUC rooms

 

WOCKY_MUC_SEMIANONYMOUS

the MUC is semi-anonymous

 

WOCKY_MUC_TEMPORARY

the MUC is temporary

 

WOCKY_MUC_UNMODERATED

the MUC is unmoderated

 

WOCKY_MUC_UNSECURED

the MUC is unsecured

 

WOCKY_MUC_OBSOLETE

the MUC has obsolete groupchat 1.0 features

 

enum WockyMucMsgType

XMPP MUC message types.

Members

WOCKY_MUC_MSG_NONE

no message type

 

WOCKY_MUC_MSG_NORMAL

a normal message

 

WOCKY_MUC_MSG_ACTION

an action message

 

WOCKY_MUC_MSG_NOTICE

a notice message

 

enum WockyMucMsgState

XMPP MUC message states as documeted in XEP-0085.

Members

WOCKY_MUC_MSG_STATE_NONE

no message state applies

 

WOCKY_MUC_MSG_STATE_ACTIVE

the contact in the MUC is active

 

WOCKY_MUC_MSG_STATE_COMPOSING

the contact in the MUC is composing a message

 

WOCKY_MUC_MSG_STATE_INACTIVE

the contact in the MUC is inactive

 

WOCKY_MUC_MSG_STATE_PAUSED

the contact in the MUC has paused composing a message

 

enum WockyMucState

WockyMuc states.

Members

WOCKY_MUC_CREATED

the WockyMuc has been created

 

WOCKY_MUC_INITIATED

the MUC has been initiated on the server

 

WOCKY_MUC_AUTH

the user is authenticating with the MUC

 

WOCKY_MUC_JOINED

the user has joined the MUC and can chat

 

WOCKY_MUC_ENDED

the MUC has ended

 

WockyMucMember

typedef struct {
  gchar *from;   /* room@service/nick     */
  gchar *jid;    /* owner@domain/resource */
  gchar *nick;   /* nick */
  WockyMucRole role;
  WockyMucAffiliation affiliation;
  gchar *status; /* user set status string */
  WockyStanza *presence_stanza;
} WockyMucMember;

Members

gchar *from;

the JID of the member (room@server/nick)

 

gchar *jid;

the JID of the owner (owner@domain/resource)

 

gchar *nick;

the nickname of the member

 

WockyMucRole role;

the WockyMucRole of the member

 

WockyMucAffiliation affiliation;

the WockyMucAffiliation of the member

 

gchar *status;

the user set status string

 

WockyStanza *presence_stanza;

the WockyStanza that was received regarding the member's presence

 

struct WockyMucClass

struct WockyMucClass {
};

The class of a WockyMuc.

Property Details

The “affiliation” property

  “affiliation”              WockyMucAffiliation

The affiliation of the user with the MUC room.

Flags: Read

Default value: WOCKY_MUC_AFFILIATION_NONE


The “category” property

  “category”                 gchar *

Category of the MUC, usually "conference".

Flags: Read

Default value: NULL


The “description” property

  “description”              gchar *

The long description oof the room.

Flags: Read

Default value: NULL


The “jid” property

  “jid”                      gchar *

Full room@service/nick JID of the MUC room.

Flags: Read / Write

Default value: NULL


The “muc-flags” property

  “muc-flags”                gulong

ORed set of WockyMucFeature MUC property flags.

Flags: Read


The “name” property

  “name”                     gchar *

The human-readable name of the room (usually a short label).

Flags: Read

Default value: NULL


The “nickname” property

  “nickname”                 gchar *

The user's in-room nickname.

Flags: Read

Default value: NULL


The “password” property

  “password”                 gchar *

User's MUC room password.

Flags: Read / Write

Default value: NULL


The “porter” property

  “porter”                   WockyPorter *

The WockyPorter instance doing all the actual XMPP interaction.

Flags: Read / Write / Construct Only


The “reserved-nick” property

  “reserved-nick”            gchar *

The user's reserved in-room nickname, if any.

Flags: Read

Default value: NULL


The “role” property

  “role”                     guint

The role (WockyMucRole) of the user in the MUC room.

Flags: Read

Allowed values: <= 3

Default value: 0


The “room” property

  “room”                     gchar *

The node part of the MUC room JID.

Flags: Read

Default value: NULL


The “service” property

  “service”                  gchar *

The service (domain) part of the MUC JID.

Flags: Read

Default value: NULL


The “status-message” property

  “status-message”           gchar *

User's MUC status message.

Flags: Read

Default value: NULL


The “type” property

  “type”                     gchar *

Type of the MUC, eg "text".

Flags: Read

Default value: NULL


The “user” property

  “user”                     gchar *

Full JID of the user (node@domain/resource) who is connecting.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “error” signal

void
user_function (WockyMuc          *muc,
               WockyStanza       *stanza,
               WockyXmppErrorType error_type,
               GError            *error,
               gpointer           user_data)

Emitted when a presence error is received from the MUC, which is generally in response to trying to join the MUC.

Parameters

muc

the MUC

 

stanza

the presence stanza

 

error_type

the type of error

 

error

an error in domain WOCKY_XMPP_ERROR, whose message (if not NULL) is a human-readable message from the server

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “fill-presence” signal

void
user_function (WockyMuc    *wockymuc,
               WockyStanza *arg1,
               gpointer     user_data)

Flags: Run Last


The “joined” signal

void
user_function (WockyMuc    *muc,
               WockyStanza *stanza,
               guint        codes,
               gpointer     user_data)

Emitted when the local user successfully joins muc .

Parameters

muc

the MUC

 

stanza

the presence stanza

 

codes

bitwise OR of WockyMucStatusCode flags with miscellaneous information about the MUC

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “left” signal

void
user_function (WockyMuc    *muc,
               WockyStanza *stanza,
               guint        codes,
               gpointer     member,
               gchar       *actor,
               gchar       *reason,
               gchar       *message,
               gpointer     user_data)

Emitted when another participant leaves, or is kicked from, the MUC

Parameters

muc

the MUC

 

stanza

the presence stanza

 

codes

bitwise OR of WockyMucStatusCode flags describing why member left the MUC

 

member

the (now ex-)member of the MUC who left

 

actor

if member was removed from the MUC by another participant, that participant's JID

 

reason

if member was removed from the MUC by another participant, a human-readable reason given by that participant

 

message

a parting message provided by member , or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “message” signal

void
user_function (WockyMuc        *muc,
               WockyStanza     *stanza,
               WockyMucMsgType  message_type,
               gchar           *id,
               GDateTime       *timestamp,
               gpointer         sender,
               gchar           *body,
               gchar           *subject,
               WockyMucMsgState state,
               gpointer         user_data)

Emitted when a non-error message stanza is received. This may indicate:

  • if body is not NULL, a message sent by sender to the MUC;
  • or, if subject is not NULL, sender changed the subject of the MUC;
  • additionally, that sender is typing, or maybe stopped typing, depending on state.

Parameters

muc

the MUC

 

stanza

the incoming message stanza

 

message_type

the message's type

 

id

the stanza's identifier (which may be NULL if neither the sender nor the MUC specified one)

 

timestamp

for messages received as scrollback when joining the MUC, the time the message was sent; NULL for messages received while in the MUC

 

sender

a WockyMucMember struct describing the sender of the message

 

body

the body of the message, or NULL

 

subject

the new subject for the MUC, or NULL

 

state

whether sender is currently typing.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “message-error” signal

void
user_function (WockyMuc          *muc,
               WockyStanza       *stanza,
               WockyMucMsgType    message_type,
               gchar             *id,
               GDateTime         *timestamp,
               gpointer           member,
               gchar             *body,
               WockyXmppErrorType error_type,
               GError            *error,
               gpointer           user_data)

Emitted when we receive an error from the MUC in response to sending a message stanza to the MUC.

Parameters

muc

the MUC

 

stanza

the incoming WOCKY_STANZA_SUB_TYPE_ERROR message

 

message_type

the type of the message which was rejected

 

id

the identifier for the original message and this error (which may be NULL)

 

timestamp

the timestamp attached to the original message, which is probably NULL because timestamps are only attached to scrollback messages

 

member

a WockyMucMember struct describing the sender of the original message (which is, we presume, us)

 

body

the body of the message which failed to send

 

error_type

the type of error

 

error

an error in domain WOCKY_XMPP_ERROR, whose message (if not NULL) is a human-readable message from the server

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “nick-change” signal

void
user_function (WockyMuc    *wockymuc,
               WockyStanza *arg1,
               guint        arg2,
               gpointer     user_data)

Flags: Run Last


The “own-presence” signal

void
user_function (WockyMuc    *wockymuc,
               WockyStanza *arg1,
               guint        arg2,
               gpointer     user_data)

Flags: Run Last


The “parted” signal

void
user_function (WockyMuc    *muc,
               WockyStanza *stanza,
               guint        codes,
               gchar       *actor,
               gchar       *reason,
               gchar       *message,
               gpointer     user_data)

Emitted when the local user leaves the MUC, whether by choice or by force.

Parameters

muc

the MUC

 

stanza

the presence stanza

 

codes

bitwise OR of WockyMucStatusCode flags describing why the user left the MUC

 

actor

if the user was removed from the MUC by another participant, that participant's JID

 

reason

if the user was removed from the MUC by another participant, a human-readable reason given by that participant

 

message

a parting message we provided to other participants, or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “permissions” signal

void
user_function (WockyMuc    *muc,
               WockyStanza *stanza,
               guint        codes,
               gchar       *actor_jid,
               gchar       *reason,
               gpointer     user_data)

Emitted when our permissions within the MUC are changed.

Parameters

muc

the muc

 

stanza

the presence stanza heralding the change

 

codes

bitwise OR of WockyMucStatusCode flags

 

actor_jid

the JID of the user who changed our permissions, or NULL

 

reason

a human-readable reason for the change, or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “presence” signal

void
user_function (WockyMuc    *wockymuc,
               WockyStanza *arg1,
               guint        arg2,
               gpointer     arg3,
               gpointer     user_data)

Flags: Run Last

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html0000644000175000017500000035604413012562226030360 0ustar00gkiagiagkiagia00000000000000 WockyNode: Wocky Reference Manual

WockyNode

WockyNode — representation of a XMPP node

Functions

gboolean (*wocky_node_each_attr_func) ()
gboolean (*wocky_node_each_child_func) ()
void wocky_node_each_attribute ()
void wocky_node_each_child ()
const gchar * wocky_node_get_attribute ()
const gchar * wocky_node_get_attribute_ns ()
void wocky_node_set_attribute ()
void wocky_node_set_attributes ()
void wocky_node_set_attribute_ns ()
void wocky_node_set_attribute_n ()
void wocky_node_set_attribute_n_ns ()
const gchar * wocky_node_attribute_ns_get_prefix_from_urn ()
const gchar * wocky_node_attribute_ns_get_prefix_from_quark ()
void wocky_node_attribute_ns_set_prefix ()
WockyNode * wocky_node_get_child ()
WockyNode * wocky_node_get_child_ns ()
WockyNode * wocky_node_get_first_child ()
WockyNode * wocky_node_get_first_child_ns ()
const gchar * wocky_node_get_content_from_child ()
const gchar * wocky_node_get_content_from_child_ns ()
WockyNode * wocky_node_add_child ()
WockyNode * wocky_node_add_child_ns ()
WockyNode * wocky_node_add_child_ns_q ()
WockyNode * wocky_node_add_child_with_content ()
WockyNode * wocky_node_add_child_with_content_ns ()
WockyNode * wocky_node_add_child_with_content_ns_q ()
const gchar * wocky_node_get_ns ()
gboolean wocky_node_has_ns ()
gboolean wocky_node_has_ns_q ()
gboolean wocky_node_matches_q ()
gboolean wocky_node_matches ()
const gchar * wocky_node_get_language ()
void wocky_node_set_language ()
void wocky_node_set_language_n ()
void wocky_node_set_content ()
void wocky_node_append_content ()
void wocky_node_append_content_n ()
gchar * wocky_node_to_string ()
WockyNode * wocky_node_new ()
void wocky_node_free ()
gboolean wocky_node_equal ()
gboolean wocky_node_is_superset ()
void wocky_node_iter_init ()
gboolean wocky_node_iter_next ()
void wocky_node_iter_remove ()
void wocky_node_add_build ()
void wocky_node_add_build_va ()
WockyNode * wocky_node_add_node_tree ()
WockyNode * wocky_node_prepend_node_tree ()
void wocky_node_init ()
void wocky_node_deinit ()

Types and Values

Includes

#include <wocky/wocky-node.h>

Description

Low level representation of a XMPP node. Provides ways to set various parameters on the node, such as content, language, namespaces and prefixes. It also offers methods to lookup children of a node.

Functions

wocky_node_each_attr_func ()

gboolean
(*wocky_node_each_attr_func) (const gchar *key,
                              const gchar *value,
                              const gchar *pref,
                              const gchar *ns,
                              gpointer user_data);

Specifies the type of functions passed to wocky_node_each_attribute().

Parameters

key

the attribute's key

 

value

the attribute's value

 

pref

the attribute's prefix

 

ns

the attribute's namespace

 

user_data

user data passed to wocky_node_each_attribute()

 

Returns

FALSE to stop further attributes from being examined.


wocky_node_each_child_func ()

gboolean
(*wocky_node_each_child_func) (WockyNode *node,
                               gpointer user_data);

Specifies the type of functions passed to wocky_node_each_child().

Parameters

node

a WockyNode

 

user_data

user data passed to wocky_node_each_child()

 

Returns

FALSE to stop further children from being examined.


wocky_node_each_attribute ()

void
wocky_node_each_attribute (WockyNode *node,
                           wocky_node_each_attr_func func,
                           gpointer user_data);

Calls a function for each attribute of a WockyNode.

Parameters

node

a WockyNode

 

func

the function to be called on each node's attribute

 

user_data

user data to pass to the function

 

wocky_node_each_child ()

void
wocky_node_each_child (WockyNode *node,
                       wocky_node_each_child_func func,
                       gpointer user_data);

Calls a function for each child of a WockyNode.

Parameters

node

a WockyNode

 

func

the function to be called on each node's child

 

user_data

user data to pass to the function

 

wocky_node_get_attribute ()

const gchar *
wocky_node_get_attribute (WockyNode *node,
                          const gchar *key);

Returns the value of an attribute in a WockyNode.

Parameters

node

a WockyNode

 

key

the attribute name

 

Returns

the value of the attribute key , or NULL if node doesn't have such attribute.


wocky_node_get_attribute_ns ()

const gchar *
wocky_node_get_attribute_ns (WockyNode *node,
                             const gchar *key,
                             const gchar *ns);

Returns the value of an attribute in a WockyNode, limiting the search within a specific namespace. If the namespace is NULL, this is equivalent to wocky_node_get_attribute().

Parameters

node

a WockyNode

 

key

the attribute name

 

ns

the namespace to search within, or NULL

 

Returns

the value of the attribute key , or NULL if node doesn't have such attribute in ns .


wocky_node_set_attribute ()

void
wocky_node_set_attribute (WockyNode *node,
                          const gchar *key,
                          const gchar *value);

Sets an attribute in a WockyNode to a specific value.

Parameters

node

a WockyNode

 

key

the attribute name to set

 

value

the value to set

 

wocky_node_set_attributes ()

void
wocky_node_set_attributes (WockyNode *node,
                           const gchar *key,
                           ...);

Sets attributes in a WockyNode to specific values.

Parameters

node

a WockyNode

 

key

the attribute name to set

 

...

pairs of keys and values, terminated by NULL

 

wocky_node_set_attribute_ns ()

void
wocky_node_set_attribute_ns (WockyNode *node,
                             const gchar *key,
                             const gchar *value,
                             const gchar *ns);

Sets an attribute in a WockyNode, within a specific namespace. If the namespace is NULL, this is equivalent to wocky_node_set_attribute().

Parameters

node

a WockyNode

 

key

the attribute name to set

 

value

the value to set

 

ns

a namespace, or NULL

 

wocky_node_set_attribute_n ()

void
wocky_node_set_attribute_n (WockyNode *node,
                            const gchar *key,
                            const gchar *value,
                            gsize value_size);

Sets a new attribute to a WockyNode, with the supplied values.

Parameters

node

a WockyNode

 

key

the attribute to set

 

value

the value to set

 

value_size

the number of bytes of value to set as a value

 

wocky_node_set_attribute_n_ns ()

void
wocky_node_set_attribute_n_ns (WockyNode *node,
                               const gchar *key,
                               const gchar *value,
                               gsize value_size,
                               const gchar *ns);

Sets a new attribute to a WockyNode, with the supplied values. If the namespace is NULL, this is equivalent to wocky_node_set_attribute_n().

Parameters

node

a WockyNode

 

key

the attribute to set

 

value

the value to set

 

value_size

the number of bytes of value to set as a value

 

ns

a namespace, or NULL

 

wocky_node_attribute_ns_get_prefix_from_urn ()

const gchar *
wocky_node_attribute_ns_get_prefix_from_urn
                               (const gchar *urn);

Gets the prefix of the namespace identified by the URN.

Parameters

urn

a string containing an URN

 

Returns

a string containing the prefix of the namespace urn .


wocky_node_attribute_ns_get_prefix_from_quark ()

const gchar *
wocky_node_attribute_ns_get_prefix_from_quark
                               (GQuark ns);

Gets the prefix of the namespace identified by the quark.

Parameters

ns

a quark corresponding to an XML namespace URN

 

Returns

a string containing the prefix of the namespace ns .


wocky_node_attribute_ns_set_prefix ()

void
wocky_node_attribute_ns_set_prefix (GQuark ns,
                                    const gchar *prefix);

Sets a desired prefix for a namespace.

Parameters

ns

a GQuark

 

prefix

a string containing the desired prefix

 

wocky_node_get_child ()

WockyNode *
wocky_node_get_child (WockyNode *node,
                      const gchar *name);

Gets a child of a node, searching by name.

Parameters

node

a WockyNode

 

name

the name of the child to get

 

Returns

a WockyNode.


wocky_node_get_child_ns ()

WockyNode *
wocky_node_get_child_ns (WockyNode *node,
                         const gchar *name,
                         const gchar *ns);

Gets the child of a node, searching by name and limiting the search to the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_get_child()

Parameters

node

a WockyNode

 

name

the name of the child to get

 

ns

the namespace of the child to get, or NULL

 

Returns

a WockyNode.


wocky_node_get_first_child ()

WockyNode *
wocky_node_get_first_child (WockyNode *node);

Convenience function to return the first child of a WockyNode.

Parameters

node

a WockyNode

 

Returns

a WockyNode, or NULL if node has no children.


wocky_node_get_first_child_ns ()

WockyNode *
wocky_node_get_first_child_ns (WockyNode *node,
                               const gchar *ns);

Returns the first child of node whose namespace is ns , saving you the bother of faffing around with a WockyNodeIter.

Parameters

node

a WockyNode

 

ns

the namespace of the child node you seek.

 

Returns

the first child of node whose namespace is ns , or NULL if none is found.


wocky_node_get_content_from_child ()

const gchar *
wocky_node_get_content_from_child (WockyNode *node,
                                   const gchar *name);

Retrieves the content from a child of a node, if it exists.

Parameters

node

a WockyNode

 

name

the name of the child whose content to retrieve

 

Returns

the content of the child of node named name , or NULL if node has no such child.


wocky_node_get_content_from_child_ns ()

const gchar *
wocky_node_get_content_from_child_ns (WockyNode *node,
                                      const gchar *name,
                                      const gchar *ns);

Retrieves the content from a child of a node, if it exists.

Parameters

node

a WockyNode

 

name

the name of the child whose content to retrieve

 

ns

the namespace of the child whose content to retrieve

 

Returns

the content of the child of node named name in ns , or NULL if node has no such child.


wocky_node_add_child ()

WockyNode *
wocky_node_add_child (WockyNode *node,
                      const gchar *name);

Adds a WockyNode with the specified name to an already existing node.

Parameters

node

a WockyNode

 

name

the name of the child to add

 

Returns

the newly added WockyNode.


wocky_node_add_child_ns ()

WockyNode *
wocky_node_add_child_ns (WockyNode *node,
                         const gchar *name,
                         const gchar *ns);

Adds a WockyNode with the specified name to an already existing node, under the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_add_child().

Parameters

node

a WockyNode

 

name

the name of the child to add

 

ns

a namespace

 

Returns

the newly added WockyNode.


wocky_node_add_child_ns_q ()

WockyNode *
wocky_node_add_child_ns_q (WockyNode *node,
                           const gchar *name,
                           GQuark ns);

Adds a WockyNode with the specified name to an already existing node, under the specified namespace. If the namespace is 0, this is equivalent to wocky_node_add_child().

Parameters

node

a WockyNode

 

name

the name of the child to add

 

ns

a namespace

 

Returns

the newly added WockyNode.


wocky_node_add_child_with_content ()

WockyNode *
wocky_node_add_child_with_content (WockyNode *node,
                                   const gchar *name,
                                   const char *content);

Adds a WockyNode with the specified name and containing the specified content to an already existing node.

Parameters

node

a WockyNode

 

name

the name of the child to add

 

content

the content of the child to add

 

Returns

the newly added WockyNode.


wocky_node_add_child_with_content_ns ()

WockyNode *
wocky_node_add_child_with_content_ns (WockyNode *node,
                                      const gchar *name,
                                      const gchar *content,
                                      const gchar *ns);

Adds a WockyNode with the specified name and the specified content to an already existing node, under the specified namespace. If the namespace is NULL, this is equivalent to wocky_node_add_child_with_content().

Parameters

node

a WockyNode

 

name

the name of the child to add

 

content

the content of the child to add

 

ns

a namespace

 

Returns

the newly added WockyNode.


wocky_node_add_child_with_content_ns_q ()

WockyNode *
wocky_node_add_child_with_content_ns_q
                               (WockyNode *node,
                                const gchar *name,
                                const gchar *content,
                                GQuark ns);

Adds a WockyNode with the specified name and the specified content to an already existing node, under the specified namespace. If the namespace is 0, this is equivalent to wocky_node_add_child_with_content().

Parameters

node

a WockyNode

 

name

the name of the child to add

 

content

the content of the child to add

 

ns

a namespace

 

Returns

the newly added WockyNode.


wocky_node_get_ns ()

const gchar *
wocky_node_get_ns (WockyNode *node);

Gets the namespace of a WockyNode

Parameters

node

a WockyNode

 

Returns

a string containing the namespace of the node.


wocky_node_has_ns ()

gboolean
wocky_node_has_ns (WockyNode *node,
                   const gchar *ns);

wocky_node_has_ns_q ()

gboolean
wocky_node_has_ns_q (WockyNode *node,
                     GQuark ns);

wocky_node_matches_q ()

gboolean
wocky_node_matches_q (WockyNode *node,
                      const gchar *name,
                      GQuark ns);

Checks whether a node has a particular name and namespace.

Parameters

node

a WockyNode

 

name

the expected element name, which may not be NULL

 

ns

the expected element namespace, which may not be 0

 

Returns

TRUE if node is named name , in namespace ns .


wocky_node_matches ()

gboolean
wocky_node_matches (WockyNode *node,
                    const gchar *name,
                    const gchar *ns);

Checks whether a node has a particular name and namespace.

Parameters

node

a WockyNode

 

name

the expected element name, which may not be NULL

 

ns

the expected element namespace, which may not be NULL

 

Returns

TRUE if node is named name , in namespace ns .


wocky_node_get_language ()

const gchar *
wocky_node_get_language (WockyNode *node);

Gets the language of a WockyNode

Parameters

node

a WockyNode

 

Returns

a string containing the language of the node.


wocky_node_set_language ()

void
wocky_node_set_language (WockyNode *node,
                         const gchar *lang);

Sets the language of a WockyNode.

Parameters

node

a WockyNode

 

lang

a NULL-terminated string containing the language

 

wocky_node_set_language_n ()

void
wocky_node_set_language_n (WockyNode *node,
                           const gchar *lang,
                           gsize lang_size);

Sets the language of a WockyNode.

Parameters

node

a WockyNode

 

lang

a language

 

lang_size

the length of lang , in bytes.

 

wocky_node_set_content ()

void
wocky_node_set_content (WockyNode *node,
                        const gchar *content);

Sets the content of a WockyNode.

Parameters

node

a WockyNode

 

content

the content to set to the node

 

wocky_node_append_content ()

void
wocky_node_append_content (WockyNode *node,
                           const gchar *content);

Appends some content to the content of a WockyNode.

Parameters

node

a WockyNode

 

content

the content to append to the node

 

wocky_node_append_content_n ()

void
wocky_node_append_content_n (WockyNode *node,
                             const gchar *content,
                             gsize size);

Appends a specified number of content bytes to the content of a WockyNode.

Parameters

node

a WockyNode

 

content

the content to append to the node

 

size

the size of the content to append

 

wocky_node_to_string ()

gchar *
wocky_node_to_string (WockyNode *node);

Obtains a string representation of a WockyNode.

Parameters

node

a WockyNode

 

Returns

a newly allocated string containing a serialization of the node.


wocky_node_new ()

WockyNode *
wocky_node_new (const char *name,
                const gchar *ns);

Convenience function which creates a WockyNode and sets its name to name .

Parameters

name

the node's name (may not be NULL)

 

ns

the nodes namespace (may not be NULL)

 

Returns

a newly allocated WockyNode.


wocky_node_free ()

void
wocky_node_free (WockyNode *node);

Convenience function that frees the passed in WockyNode and all of its children.

Parameters

node

a WockyNode.

 

wocky_node_equal ()

gboolean
wocky_node_equal (WockyNode *node0,
                  WockyNode *node1);

Compares two WockyNodes for equality.

Parameters

node0

a WockyNode

 

node1

a WockyNode to compare to node0

 

Returns

TRUE if the two nodes are equal.


wocky_node_is_superset ()

gboolean
wocky_node_is_superset (WockyNode *node,
                        WockyNode *subset);

Parameters

node

the WockyNode to test

 

subset

the supposed subset

 

Returns

TRUE if node is a superset of subset .


wocky_node_iter_init ()

void
wocky_node_iter_init (WockyNodeIter *iter,
                      WockyNode *node,
                      const gchar *name,
                      const gchar *ns);

Initializes an iterator that can be used to iterate over the children of node , filtered by name and ns

WockyNodeIter iter;
WockyNode *child;

wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza),
   "payload-type",
   WOCKY_XMPP_NS_JINGLE_RTP);
while (wocky_node_iter_next (iter, &child))
  {
    /<!-- -->* do something with the child *<!-- -->/
  }

Parameters

iter

unitialized iterator

 

node

Node whose children to iterate over

 

name

Name to filter on or NULL

 

ns

namespace to filter on or NULL

 

wocky_node_iter_next ()

gboolean
wocky_node_iter_next (WockyNodeIter *iter,
                      WockyNode **next);

Advances iter to the next child that matches its filter. if FALSE is returned next is not set and the iterator becomes invalid

Parameters

iter

an initialized WockyNodeIter

 

next

a location to store the next child

 

Returns

FALSE if the last child has been reached


wocky_node_iter_remove ()

void
wocky_node_iter_remove (WockyNodeIter *iter);

Removes and frees the node returned by the last call to wocky_node_iter_next() from its parent. Can only be called after wocky_node_iter_next() returned TRUE, and cannot be called more than once per successful call to wocky_node_iter_next().

Parameters

iter

an initialized WockyNodeIter

 

wocky_node_add_build ()

void
wocky_node_add_build (WockyNode *node,
                      ...);

Add a node subtree to an existing parent node.

Example 1. 

wocky_node_add_build (node,
   '(', "body",
       '$', "Telepathy rocks!",
   ')',
  NULL);

The above examples adds the following subtree under the given node:

<body>
   Telepathy rocks!
</body>

Parameters

node

The node under which to add a new subtree

 

...

the description of the stanza to build, terminated with NULL

 

wocky_node_add_build_va ()

void
wocky_node_add_build_va (WockyNode *node,
                         va_list va);

wocky_node_add_node_tree ()

WockyNode *
wocky_node_add_node_tree (WockyNode *node,
                          WockyNodeTree *tree);

Copies the nodes from tree , and appends them to node 's children.

Parameters

node

A node

 

tree

The node tree to add

 

Returns

the root of the copy of tree added to node .


wocky_node_prepend_node_tree ()

WockyNode *
wocky_node_prepend_node_tree (WockyNode *node,
                              WockyNodeTree *tree);

Copies the nodes from tree , and inserts them as the first child of node , before any existing children.

Parameters

node

a node

 

tree

the node tree to prepend to node 's children

 

Returns

the root of the copy of tree added to node .


wocky_node_init ()

void
wocky_node_init (void);

Initializes the caches used by WockyNode. This should be always called before using WockyNode structs.


wocky_node_deinit ()

void
wocky_node_deinit (void);

Releases all the resources used by the WockyNode caches.

Types and Values

enum WockyNodeBuildTag

Tags for building a stanza using wocky_stanza_build() or wocky_node_add_build().

Members

WOCKY_NODE_START

Start of a node

 

WOCKY_NODE_TEXT

Text content of a node

 

WOCKY_NODE_END

End of a node

 

WOCKY_NODE_ATTRIBUTE

A node attribute

 

WOCKY_NODE_XMLNS

A node XML namespace

 

WOCKY_NODE_ASSIGN_TO

a WockyNode to assign

 

WOCKY_NODE_LANGUAGE

xml:lang of a node

 

struct WockyNode

struct WockyNode {
  gchar *name;
  gchar *content;
};

A single WockyNode structure that relates to an element in an XMPP stanza.

Members

gchar *name;

name of the node

 

gchar *content;

content of the node

 

WockyNodeIter

typedef struct {
} WockyNodeIter;

Iterate over a node's children. See wocky_node_iter_init() for more details.

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky.html0000644000175000017500000001131413012562226027576 0ustar00gkiagiagkiagia00000000000000 wocky: Wocky Reference Manual

wocky

wocky

Functions

void wocky_init ()
void wocky_deinit ()

Types and Values

#define WOCKY_H_INSIDE

Description

Functions

wocky_init ()

void
wocky_init (void);

Initializes the Wocky library.

This function should be called before calling any other Wocky functions.


wocky_deinit ()

void
wocky_deinit (void);

Clean up any resources created by Wocky in wocky_init().

It is normally not needed to call this function in a normal application as the resources will automatically be freed when the program terminates. This function is therefore mostly used by testsuites and other memory profiling tools.

After this call Wocky (including this method) should not be used anymore.

Types and Values

WOCKY_H_INSIDE

#define WOCKY_H_INSIDE
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyAuthHandler.html0000644000175000017500000007143313012562226030534 0ustar00gkiagiagkiagia00000000000000 WockyAuthHandler: Wocky Reference Manual

WockyAuthHandler

WockyAuthHandler

Types and Values

Object Hierarchy

    GInterface
    ╰── WockyAuthHandler

Description

Functions

WockyAuthInitialResponseFunc ()

gboolean
(*WockyAuthInitialResponseFunc) (WockyAuthHandler *handler,
                                 GString **initial_data,
                                 GError **error);

Called when authentication begins, if the mechanism allows a response to an implicit challenge during AUTH initiation (which, in XMPP, corresponds to sending the <auth/> stanza to the server).

The function should return TRUE on success, and optionally set the initial_data to a string if there is initial data to send. On error, it should return FALSE and set error .

Parameters

handler

a WockyAuthHandler object

 

initial_data

a GString location to fill with the initial data.

[out]

error

an optional location for a GError to fill, or NULL

 

Returns

TRUE on success, otherwise FALSE


WockyAuthAuthDataFunc ()

gboolean
(*WockyAuthAuthDataFunc) (WockyAuthHandler *handler,
                          const GString *data,
                          GString **response,
                          GError **error);

WockyAuthSuccessFunc ()

gboolean
(*WockyAuthSuccessFunc) (WockyAuthHandler *handler,
                         GError **error);

Called when a <success/> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the

<success/> stanza was received earlier than

expected)

Parameters

handler

a WockyAuthHandler object

 

error

an optional location for a GError to fill, or NULL

 

Returns

TRUE on success, otherwise FALSE


wocky_auth_handler_get_mechanism ()

const gchar *
wocky_auth_handler_get_mechanism (WockyAuthHandler *handler);

Returns the name of the SASL mechanism handler implements.

Parameters

handler

a handler for a SASL mechanism.

 

Returns

the name of the SASL mechanism handler implements.


wocky_auth_handler_is_plain ()

gboolean
wocky_auth_handler_is_plain (WockyAuthHandler *handler);

Checks whether handler sends secrets in plaintext. This may be used to decide whether to use handler on an insecure XMPP connection.

Parameters

handler

a handler for a SASL mechanism.

 

Returns

TRUE if handler sends secrets in plaintext.


wocky_auth_handler_get_initial_response ()

gboolean
wocky_auth_handler_get_initial_response
                               (WockyAuthHandler *handler,
                                GString **initial_data,
                                GError **error);

Called when authentication begins to fetch the initial data to send to the server in the <auth/> stanza.

If this function returns TRUE, initial_data will be non-NULL if handler provides an initial response, and NULL otherwise.

Parameters

handler

a handler for a SASL mechanism

 

initial_data

initial data to send to the server, if any.

[out][transfer full]

error

an optional location for a GError to fill, or NULL

 

Returns

TRUE on success; FALSE otherwise.


wocky_auth_handler_handle_auth_data ()

gboolean
wocky_auth_handler_handle_auth_data (WockyAuthHandler *handler,
                                     const GString *data,
                                     GString **response,
                                     GError **error);

Asks handler to respond to a <challenge/> stanza or a

<success/> with data. On success, handler will put

response data into response , Base64-encoding it if appropriate.

Parameters

handler

a WockyAuthHandler object

 

data

the challenge string

 

response

a location to fill with a challenge response in a GString.

[out][transfer full]

error

an optional location for a GError to fill, or NULL

 

Returns

TRUE on success, otherwise FALSE


wocky_auth_handler_handle_success ()

gboolean
wocky_auth_handler_handle_success (WockyAuthHandler *handler,
                                   GError **error);

Called when a <success/> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the

<success/> stanza was received earlier than

expected)

Parameters

handler

a WockyAuthHandler object

 

error

an optional location for a GError to fill, or NULL

 

Returns

TRUE on success, otherwise FALSE

Types and Values

struct WockyAuthHandlerIface

struct WockyAuthHandlerIface {
    GTypeInterface parent;
    gchar *mechanism;
    gboolean plain;
    WockyAuthInitialResponseFunc initial_response_func;
    WockyAuthAuthDataFunc auth_data_func;
    WockyAuthSuccessFunc success_func;
};

Members

GTypeInterface parent;

The parent interface.

 

gchar *mechanism;

The AUTH mechanism which this handler responds to challenges for.

 

gboolean plain;

Whether the mechanism this handler handles sends secrets in plaintext.

 

WockyAuthInitialResponseFunc initial_response_func;

Called when the initial <auth /> stanza is generated

 

WockyAuthAuthDataFunc auth_data_func;

Called when any authentication data from the server is received

 

WockyAuthSuccessFunc success_func;

Called when a <success/> stanza is received.

 
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-debug.html0000644000175000017500000001102713012562226030663 0ustar00gkiagiagkiagia00000000000000 wocky-debug: Wocky Reference Manual

wocky-debug

wocky-debug

Functions

Types and Values

Description

Functions

wocky_debug_set_flags ()

void
wocky_debug_set_flags (WockyDebugFlags flags);

Types and Values

enum WockyDebugFlags

Members


WOCKY_DEBUG_XMPP

#define WOCKY_DEBUG_XMPP (WOCKY_DEBUG_XMPP_READER | WOCKY_DEBUG_XMPP_WRITER)
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyPing.html0000644000175000017500000001653313012562226027232 0ustar00gkiagiagkiagia00000000000000 WockyPing: Wocky Reference Manual

WockyPing

WockyPing — support for pings/keepalives

Properties

guint ping-interval Read / Write / Construct
WockyC2SPorter * porter Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyPing

Description

Support for XEP-0199 pings.

Functions

wocky_ping_error_quark ()

GQuark
wocky_ping_error_quark (void);

wocky_ping_new ()

WockyPing *
wocky_ping_new (WockyC2SPorter *porter,
                guint interval);

Types and Values

struct WockyPingClass

struct WockyPingClass {
};

The class of a WockyPing.

Property Details

The “ping-interval” property

  “ping-interval”            guint

keepalive ping interval in seconds, or 0 to disable.

Flags: Read / Write / Construct

Default value: 0


The “porter” property

  “porter”                   WockyC2SPorter *

the wocky porter to set up keepalive pings on.

Flags: Read / Write / Construct Only

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-utils.html0000644000175000017500000017635013012562226030750 0ustar00gkiagiagkiagia00000000000000 wocky-utils: Wocky Reference Manual

wocky-utils

wocky-utils

Description

Functions

wocky_strdiff ()

gboolean
wocky_strdiff (const gchar *left,
               const gchar *right);

Return TRUE if the given strings are different. Unlike strcmp this function will handle null pointers, treating them as distinct from any string.

Parameters

left

The first string to compare (may be NULL)

 

right

The second string to compare (may be NULL)

 

Returns

FALSE if left and right are both NULL, or if neither is NULL and both have the same contents; TRUE otherwise


wocky_normalise_jid ()

gchar *
wocky_normalise_jid (const gchar *jid);

Parameters

jid

a JID

 

Returns

a normalised JID, using the same rules as wocky_decode_jid(), or NULL if the JID could not be sensibly decoded. This value should be freed when you are done with it.


wocky_decode_jid ()

gboolean
wocky_decode_jid (const gchar *jid,
                  gchar **node,
                  gchar **domain,
                  gchar **resource);

If jid is valid, returns TRUE and sets the caller's node , domain and resource pointers. node and resource will be set to NULL if the respective part is not present in jid . If jid is invalid, sets node , domain and resource to NULL and returns FALSE.

In theory, the returned parts will be normalised as specified in RFC 6122 (XMPP Address Format); in practice, Wocky does not fully implement the normalisation and validation algorithms. FIXME: Do nodeprep/resourceprep and length checking.

Parameters

jid

a JID

 

node

address to store the normalised localpart of the JID.

[allow-none]

domain

address to store the normalised domainpart of the JID.

[allow-none]

resource

address to store the resourcepart of the JID

 

Returns

TRUE if the JID is valid


wocky_compose_jid ()

gchar *
wocky_compose_jid (const gchar *node,
                   const gchar *domain,
                   const gchar *resource);

Composes a JID from its parts. If node is empty or NULL, the '@' separator is also omitted; if resource is empty or NULL, the '/' separator is also omitted. node and domain are assumed to have already been normalised.

Parameters

node

the node part of a JID, possibly empty or NULL.

[allow-none]

domain

the non-NULL domain part of a JID

 

resource

the resource part of a JID, possibly empty or NULL.

[allow-none]

Returns

a JID constructed from node , domain and resource


wocky_g_value_slice_new ()

GValue *
wocky_g_value_slice_new (GType type);

Slice-allocate an empty GValue. wocky_g_value_slice_new_boolean() and similar functions are likely to be more convenient to use for the types supported.

Parameters

type

The type desired for the new GValue

 

Returns

a newly allocated, newly initialized GValue, to be freed with wocky_g_value_slice_free() or g_slice_free().

Since: 0.5.14


wocky_g_value_slice_new_boolean ()

GValue *
wocky_g_value_slice_new_boolean (gboolean b);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

b

a boolean value

 

Returns

a GValue of type G_TYPE_BOOLEAN with value b , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_int ()

GValue *
wocky_g_value_slice_new_int (gint n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

n

an integer

 

Returns

a GValue of type G_TYPE_INT with value n , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_int64 ()

GValue *
wocky_g_value_slice_new_int64 (gint64 n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

n

a 64-bit integer

 

Returns

a GValue of type G_TYPE_INT64 with value n , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_uint ()

GValue *
wocky_g_value_slice_new_uint (guint n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

n

an unsigned integer

 

Returns

a GValue of type G_TYPE_UINT with value n , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_uint64 ()

GValue *
wocky_g_value_slice_new_uint64 (guint64 n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

n

a 64-bit unsigned integer

 

Returns

a GValue of type G_TYPE_UINT64 with value n , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_double ()

GValue *
wocky_g_value_slice_new_double (double d);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

d

a number

 

Returns

a GValue of type G_TYPE_DOUBLE with value n , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_string ()

GValue *
wocky_g_value_slice_new_string (const gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

string

a string to be copied into the value

 

Returns

a GValue of type G_TYPE_STRING whose value is a copy of string , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_static_string ()

GValue *
wocky_g_value_slice_new_static_string (const gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

string

a static string which must remain valid forever, to be pointed to by the value

 

Returns

a GValue of type G_TYPE_STRING whose value is string , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_take_string ()

GValue *
wocky_g_value_slice_new_take_string (gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

string

a string which will be freed with g_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

 

Returns

a GValue of type G_TYPE_STRING whose value is string , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_boxed ()

GValue *
wocky_g_value_slice_new_boxed (GType type,
                               gconstpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

type

a boxed type

 

p

a pointer of type type , which will be copied

 

Returns

a GValue of type type whose value is a copy of p , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_static_boxed ()

GValue *
wocky_g_value_slice_new_static_boxed (GType type,
                                      gconstpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

type

a boxed type

 

p

a pointer of type type , which must remain valid forever

 

Returns

a GValue of type type whose value is p , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_new_take_boxed ()

GValue *
wocky_g_value_slice_new_take_boxed (GType type,
                                    gpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

Parameters

type

a boxed type

 

p

a pointer of type type which will be freed with g_boxed_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

 

Returns

a GValue of type type whose value is p , to be freed with wocky_g_value_slice_free() or g_slice_free()

Since: 0.7.27


wocky_g_value_slice_free ()

void
wocky_g_value_slice_free (GValue *value);

Unset and free a slice-allocated GValue.

(GDestroyNotify) wocky_g_value_slice_free can be used as a destructor for values in a GHashTable, for example.

Parameters

value

A GValue which was allocated with the g_slice API

 

wocky_g_value_slice_dup ()

GValue *
wocky_g_value_slice_dup (const GValue *value);

Parameters

value

A GValue

 

Returns

a newly allocated copy of value , to be freed with wocky_g_value_slice_free() or g_slice_free().

Since: 0.5.14


wocky_enum_from_nick ()

gboolean
wocky_enum_from_nick (GType enum_type,
                      const gchar *nick,
                      gint *value);

Parameters

enum_type

the GType of a subtype of GEnum

 

nick

a non-NULL string purporting to be the nickname of a value of enum_type

 

value

the address at which to store the value of enum_type corresponding to nick if this functions returns TRUE; if this function returns FALSE, this variable will be left untouched.

 

Returns

TRUE if nick is a member of enum_type , or FALSE otherwise


wocky_enum_to_nick ()

const gchar *
wocky_enum_to_nick (GType enum_type,
                    gint value);

Parameters

enum_type

the GType of a subtype of GEnum

 

value

a value of enum_type

 

Returns

the nickname of value , or NULL if it is not, in fact, a value of enum_type


wocky_absolutize_path ()

gchar *
wocky_absolutize_path (const gchar *path);

Return an absolute form of path . This cleans up duplicate slashes, "." or ".." path segments, etc., and prepends g_get_current_dir() if necessary, but does not necessarily resolve symlinks.

Parameters

path

an absolute or relative path

 

Returns

an absolute path which must be freed with g_free(), or possibly NULL for invalid filenames


wocky_list_deep_copy ()

GList *
wocky_list_deep_copy (GBoxedCopyFunc copy,
                      GList *items);

wocky_g_string_dup ()

GString *
wocky_g_string_dup (const GString *str);

wocky_g_string_free ()

void
wocky_g_string_free (GString *str);

wocky_implement_finish_void()

#define             wocky_implement_finish_void(source, tag)

wocky_implement_finish_copy_pointer()

#define             wocky_implement_finish_copy_pointer(source, tag, copy_func, \
                out_param)

wocky_implement_finish_return_copy_pointer()

#define             wocky_implement_finish_return_copy_pointer(source, tag, \
                copy_func)

wocky_implement_finish_return_pointer()

#define             wocky_implement_finish_return_pointer(source, tag)

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/ch01.html0000644000175000017500000002377513012562226026061 0ustar00gkiagiagkiagia00000000000000 API Reference: Wocky Reference Manual

API Reference

WockyAuthHandler
WockyAuthRegistry
WockyBareContact — Wrapper around a roster item.
WockyC2SPorter — Wrapper around a WockyXmppConnection providing a higher level API.
WockyCapsCache
WockyCapsHash — Utilities for computing verification string hash
WockyConnector — Low-level XMPP connection generator.
WockyContactFactory — creates and looks up WockyContact objects
WockyContact
WockyDataForm — An object to represent an XMPP data form
wocky-debug
wocky-enumtypes
wocky
wocky-heartbeat-source
WockyDiscoIdentity — Structure holding XMPP disco identity information.
WockyJabberAuth
wocky-jabber-auth-digest
wocky-jabber-auth-password
WockyMetaPorter
WockyMuc — multi-user chat rooms
wocky-namespaces
WockyNode — representation of a XMPP node
WockyNodeTree
WockyPepService — Object to represent a single PEP service
WockyPing — support for pings/keepalives
WockyPorter
wocky-pubsub-helpers
WockyPubsubNode
wocky-pubsub-node-protected
WockyPubsubService
wocky-pubsub-service-protected
WockyResourceContact
WockyRoster — TODO
WockySaslAuth
wocky-sasl-digest-md5
wocky-sasl-utils
wocky-sasl-plain
wocky-sasl-scram
WockySession
WockyStanza
WockyTLSConnector
Wocky OpenSSL TLS — Establish TLS sessions
WockyTLSHandler
wocky-utils
WockyXmppConnection — Low-level XMPP connection.
wocky-xmpp-error
WockyXmppReader — Xmpp XML to stanza deserializer
WockyXmppWriter — Xmpp stanza to XML serializer
WockyJingleContent
WockyJingleFactory
wocky-jingle-info-internal
WockyJingleInfo
WockyJingleMediaRtp
WockyJingleSession
WockyJingleTransportGoogle
WockyJingleTransportIceUdp
WockyJingleTransportIface
WockyJingleTransportRawUdp
wocky-jingle-types
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyXmppConnection.html0000644000175000017500000015715413012562226031306 0ustar00gkiagiagkiagia00000000000000 WockyXmppConnection: Wocky Reference Manual

WockyXmppConnection

WockyXmppConnection — Low-level XMPP connection.

Properties

GIOStream * base-stream Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── WockyXmppConnection

Description

Sends and receives WockyStanzas from an underlying GIOStream.

Functions

wocky_xmpp_connection_error_quark ()

GQuark
wocky_xmpp_connection_error_quark (void);

Get the error quark used by the connection.

Returns

the quark for connection errors.


wocky_xmpp_connection_new ()

WockyXmppConnection *
wocky_xmpp_connection_new (GIOStream *stream);

Convenience function to create a new WockyXmppConnection.

Parameters

stream

GIOStream over wich all the data will be sent/received.

 

Returns

a new WockyXmppConnection.


wocky_xmpp_connection_send_open_async ()

void
wocky_xmpp_connection_send_open_async (WockyXmppConnection *connection,
                                       const gchar *to,
                                       const gchar *from,
                                       const gchar *version,
                                       const gchar *lang,
                                       const gchar *id,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Request asynchronous sending of an XMPP stream opening over the stream. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_open_finish() to get the result of the operation.

Parameters

connection

a WockyXmppConnection.

 

to

destination in the XMPP opening (can be NULL).

 

from

sender in the XMPP opening (can be NULL).

 

version

XMPP version sent (can be NULL).

 

lang

language sent (can be NULL).

 

id

XMPP Stream ID, if any, or NULL

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_send_open_finish ()

gboolean
wocky_xmpp_connection_send_open_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes sending a stream opening.

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE if the opening was succesfully sent, FALSE on error.


wocky_xmpp_connection_recv_open_async ()

void
wocky_xmpp_connection_recv_open_async (WockyXmppConnection *connection,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Request asynchronous receiving of an XMPP stream opening over the stream. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_recv_open_finish() to get the result of the operation.

Parameters

connection

a WockyXmppConnection.

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_recv_open_finish ()

gboolean
wocky_xmpp_connection_recv_open_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                gchar **to,
                                gchar **from,
                                gchar **version,
                                gchar **lang,
                                gchar **id,
                                GError **error);

Finishes receiving a stream opening.

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

to

Optional location to store the to attribute in the XMPP open stanza will be stored (free after usage).

 

from

Optional location to store the from attribute in the XMPP open stanza will be stored (free after usage).

 

version

Optional location to store the version attribute in the XMPP open stanza will be stored (free after usage).

 

lang

Optional location to store the lang attribute in the XMPP open stanza will be stored (free after usage).

 

id

Optional location to store the Session ID of the XMPP stream (free after usage)

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE if the opening was succesfully received, FALSE on error.


wocky_xmpp_connection_send_stanza_async ()

void
wocky_xmpp_connection_send_stanza_async
                               (WockyXmppConnection *connection,
                                WockyStanza *stanza,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request asynchronous sending of a WockyStanza. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_stanza_finish() to get the result of the operation.

Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

Parameters

connection

a WockyXmppConnection

 

stanza

WockyStanza to send.

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_send_stanza_finish ()

gboolean
wocky_xmpp_connection_send_stanza_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes sending a stanza.

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE if the stanza was succesfully sent, FALSE on error.


wocky_xmpp_connection_recv_stanza_async ()

void
wocky_xmpp_connection_recv_stanza_async
                               (WockyXmppConnection *connection,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronous receive a WockyStanza. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_recv_stanza_finish() to get the result of the operation.

Can only be called after wocky_xmpp_connection_recv_open_async has finished its operation.

Parameters

connection

a WockyXmppConnection

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_recv_stanza_finish ()

WockyStanza *
wocky_xmpp_connection_recv_stanza_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes receiving a stanza

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

A WockyStanza or NULL on error (unref after usage)


wocky_xmpp_connection_send_close_async ()

void
wocky_xmpp_connection_send_close_async
                               (WockyXmppConnection *connection,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request asynchronous sending of an XMPP stream close. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_close_finish() to get the result of the operation.

Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

Parameters

connection

a WockyXmppConnection.

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_send_close_finish ()

gboolean
wocky_xmpp_connection_send_close_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes send the xmpp stream close.

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE on success or FALSE on error.


wocky_xmpp_connection_force_close_async ()

void
wocky_xmpp_connection_force_close_async
                               (WockyXmppConnection *connection,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

wocky_xmpp_connection_force_close_finish ()

gboolean
wocky_xmpp_connection_force_close_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

wocky_xmpp_connection_send_whitespace_ping_async ()

void
wocky_xmpp_connection_send_whitespace_ping_async
                               (WockyXmppConnection *connection,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request asynchronous sending of a whitespace ping. When the operation is finished callback will be called. You can then call wocky_xmpp_connection_send_whitespace_ping_finish() to get the result of the operation.

Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.

Parameters

connection

a WockyXmppConnection

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

callback to call when the request is satisfied.

 

user_data

the data to pass to callback function.

 

wocky_xmpp_connection_send_whitespace_ping_finish ()

gboolean
wocky_xmpp_connection_send_whitespace_ping_finish
                               (WockyXmppConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes sending a whitespace ping.

Parameters

connection

a WockyXmppConnection.

 

result

a GAsyncResult.

 

error

a GError location to store the error occuring, or NULL to ignore.

 

Returns

TRUE if the ping was succesfully sent, FALSE on error.


wocky_xmpp_connection_reset ()

void
wocky_xmpp_connection_reset (WockyXmppConnection *connection);

Reset the XMPP Connection. After the reset the connection is back in its initial state (as if wocky_xmpp_connection_send_open_async() and wocky_xmpp_connection_recv_open_async() were never called).

Parameters

connection

a WockyXmppConnection.

 

wocky_xmpp_connection_new_id ()

gchar *
wocky_xmpp_connection_new_id (WockyXmppConnection *self);

Parameters

self

a WockyXmppConnection.

 

Returns

A short unique string for usage as the id attribute on a stanza (free after usage).

Types and Values

enum WockyXmppConnectionError

The WockyXmppConnection specific errors that can occur while reading a stream.

Members

WOCKY_XMPP_CONNECTION_ERROR_EOS

Connection got closed before receiving an XMPP stream close.

 

WOCKY_XMPP_CONNECTION_ERROR_CLOSED

Other side closed the xmpp stream.

 

WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN

Trying to send or receive while the connection isn't open.

 

WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED

Trying to send or receive while the connection is closed.

 

WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN

Trying to send or receive the connection opening when it's already open

 

WOCKY_XMPP_CONNECTION_ERROR

#define WOCKY_XMPP_CONNECTION_ERROR (wocky_xmpp_connection_error_quark ())

Get access to the error quark of the xmpp connection.


struct WockyXmppConnectionClass

struct WockyXmppConnectionClass {
};

The class of a WockyXmppConnection.

Property Details

The “base-stream” property

  “base-stream”              GIOStream *

the stream that the XMPP connection communicates over.

Flags: Read / Write / Construct Only

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyAuthRegistry.html0000644000175000017500000017154713012562226030776 0ustar00gkiagiagkiagia00000000000000 WockyAuthRegistry: Wocky Reference Manual

WockyAuthRegistry

WockyAuthRegistry

Object Hierarchy

    GEnum
    ╰── WockyAuthError
    GObject
    ╰── WockyAuthRegistry

Description

Functions

wocky_auth_error_quark ()

GQuark
wocky_auth_error_quark (void);

WockyAuthRegistryStartAuthAsyncFunc ()

void
(*WockyAuthRegistryStartAuthAsyncFunc)
                               (WockyAuthRegistry *self,
                                GSList *mechanisms,
                                gboolean allow_plain,
                                gboolean is_secure_channel,
                                const gchar *username,
                                const gchar *password,
                                const gchar *server,
                                const gchar *session_id,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Starts a async authentication: chooses mechanism and gets initial data. The default function chooses a WockyAuthHandler by which mechanism it supports and gets the initial data from the chosen handler.

Parameters

self

a WockyAuthRegistry object

 

mechanisms

a list of avahilable mechanisms

 

allow_plain

TRUE if PLAIN is allowed, otherwise FALSE

 

is_secure_channel

TRUE if channel is secure, otherwise FALSE

 

username

the username

 

password

the password

 

server

the server

 

session_id

the session ID

 

callback

a callback to be called when finished

 

user_data

data to pass to callback

 

WockyAuthRegistryStartAuthFinishFunc ()

gboolean
(*WockyAuthRegistryStartAuthFinishFunc)
                               (WockyAuthRegistry *self,
                                GAsyncResult *result,
                                WockyAuthRegistryStartData **start_data,
                                GError **error);

Called to finish the GAsyncResult task for authentication start. By default, it extracts a WockyAuthRegistryStartData pointer from a given GSimpleAsyncResult and copies it to the out param.

Parameters

self

a WockyAuthRegistry object

 

result

a GAsyncResult object

 

start_data

a location to fill with a WockyAuthRegistryStartData structure

 

error

a location to fill with a GError if an error is hit, or NULL

 

Returns

TRUE on success, otherwise FALSE


WockyAuthRegistryChallengeAsyncFunc ()

void
(*WockyAuthRegistryChallengeAsyncFunc)
                               (WockyAuthRegistry *self,
                                const GString *challenge_data,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Recieves a challenge and asynchronously provides a reply. By default the challenge is passed on to the chosen WockyAuthHandler.

Parameters

self

a WockyAuthRegistry object

 

challenge_data

the challenge data string

 

callback

a callback to call when finished

 

user_data

data to pass to callback

 

WockyAuthRegistryChallengeFinishFunc ()

gboolean
(*WockyAuthRegistryChallengeFinishFunc)
                               (WockyAuthRegistry *self,
                                GAsyncResult *result,
                                GString **response,
                                GError **error);

Finishes a GAsyncResult from WockyAuthRegistryChallengeAsyncFunc. By default it extracts a GString response from the given GSimpleAsyncResult and copies it to the out param.

Parameters

self

a WockyAuthRegistry object

 

result

a GAsyncResult object

 

response

a location to be filled with the response string

 

error

a location to fill with a GError if an error is hit, or NULL

 

Returns

TRUE on success, otherwise FALSE


WockyAuthRegistrySuccessAsyncFunc ()

void
(*WockyAuthRegistrySuccessAsyncFunc) (WockyAuthRegistry *self,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Notifies the registry of authentication success, and allows a last ditch attempt at aborting the authentication at the client's discretion.

Parameters

self

a WockyAuthRegistry object

 

callback

a callback to be called when finished

 

user_data

data to pass to callback

 

WockyAuthRegistrySuccessFinishFunc ()

gboolean
(*WockyAuthRegistrySuccessFinishFunc) (WockyAuthRegistry *self,
                                       GAsyncResult *result,
                                       GError **error);

Finishes a GAsyncResult from WockyAuthRegistrySuccessAsyncFunc. It checks for any errors set on the given GSimpleAsyncResult, copies the GError to an out param and returns FALSE if there was an error.

Parameters

self

a WockyAuthRegistry object

 

result

a GAsyncResult object

 

error

a location to fill with a GError if an error is hit, or NULL

 

Returns

TRUE on success, otherwise FALSE


WockyAuthRegistryFailureFunc ()

void
(*WockyAuthRegistryFailureFunc) (WockyAuthRegistry *self,
                                 GError *error);

Notifies the client of a server-side error. By default this is not implemented.

Parameters

self

a WockyAuthRegistry object

 

error

a GError describing the failure

 

wocky_auth_registry_new ()

WockyAuthRegistry *
wocky_auth_registry_new (void);

wocky_auth_registry_start_auth_async ()

void
wocky_auth_registry_start_auth_async (WockyAuthRegistry *self,
                                      GSList *mechanisms,
                                      gboolean allow_plain,
                                      gboolean is_secure_channel,
                                      const gchar *username,
                                      const gchar *password,
                                      const gchar *server,
                                      const gchar *session_id,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

wocky_auth_registry_start_auth_finish ()

gboolean
wocky_auth_registry_start_auth_finish (WockyAuthRegistry *self,
                                       GAsyncResult *result,
                                       WockyAuthRegistryStartData **start_data,
                                       GError **error);

wocky_auth_registry_challenge_async ()

void
wocky_auth_registry_challenge_async (WockyAuthRegistry *self,
                                     const GString *challenge_data,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

wocky_auth_registry_challenge_finish ()

gboolean
wocky_auth_registry_challenge_finish (WockyAuthRegistry *self,
                                      GAsyncResult *res,
                                      GString **response,
                                      GError **error);

wocky_auth_registry_success_async ()

void
wocky_auth_registry_success_async (WockyAuthRegistry *self,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

wocky_auth_registry_success_finish ()

gboolean
wocky_auth_registry_success_finish (WockyAuthRegistry *self,
                                    GAsyncResult *res,
                                    GError **error);

wocky_auth_registry_add_handler ()

void
wocky_auth_registry_add_handler (WockyAuthRegistry *self,
                                 WockyAuthHandler *handler);

wocky_auth_registry_start_data_free ()

void
wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data);

wocky_auth_registry_start_data_new ()

WockyAuthRegistryStartData *
wocky_auth_registry_start_data_new (const gchar *mechanism,
                                    const GString *initial_response);

wocky_auth_registry_start_data_dup ()

WockyAuthRegistryStartData *
wocky_auth_registry_start_data_dup (WockyAuthRegistryStartData *start_data);

wocky_auth_registry_failure ()

void
wocky_auth_registry_failure (WockyAuthRegistry *self,
                             GError *error);

wocky_auth_registry_supports_one_of ()

gboolean
wocky_auth_registry_supports_one_of (WockyAuthRegistry *self,
                                     GSList *mechanisms,
                                     gboolean allow_plain);

Checks whether at least one of mechanisms is supported by Wocky. At present, Wocky itself only implements password-based authentication mechanisms.

Parameters

self

a WockyAuthRegistry

 

allow_plain

Whether auth in plain text is allowed

 

mechanisms

a GSList of gchar* of auth mechanisms

 

Returns

TRUE if one of the mechanisms is supported by wocky, FALSE otherwise.

Types and Values

WOCKY_AUTH_ERROR

#define             WOCKY_AUTH_ERROR

enum WockyAuthError

WockyAuthRegistry specific errors.

Members

WOCKY_AUTH_ERROR_INIT_FAILED

Failed to initialize our auth support

 

WOCKY_AUTH_ERROR_NOT_SUPPORTED

Server doesn't support this authentication method

 

WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS

Server doesn't support any mechanisms that we support

 

WOCKY_AUTH_ERROR_NETWORK

Couldn't send our stanzas to the server

 

WOCKY_AUTH_ERROR_INVALID_REPLY

Server sent an invalid reply

 

WOCKY_AUTH_ERROR_NO_CREDENTIALS

Failure to provide user credentials

 

WOCKY_AUTH_ERROR_FAILURE

Server sent a failure

 

WOCKY_AUTH_ERROR_CONNRESET

disconnected

 

WOCKY_AUTH_ERROR_STREAM

XMPP stream error while authing

 

WOCKY_AUTH_ERROR_RESOURCE_CONFLICT

Resource conflict (relevant in in jabber auth)

 

WOCKY_AUTH_ERROR_NOT_AUTHORIZED

Provided credentials are not valid

 

WOCKY_AUTH_MECH_JABBER_DIGEST

#define WOCKY_AUTH_MECH_JABBER_DIGEST "X-WOCKY-JABBER-DIGEST"

WOCKY_AUTH_MECH_JABBER_PASSWORD

#define WOCKY_AUTH_MECH_JABBER_PASSWORD "X-WOCKY-JABBER-PASSWORD"

WOCKY_AUTH_MECH_SASL_DIGEST_MD5

#define WOCKY_AUTH_MECH_SASL_DIGEST_MD5 "DIGEST-MD5"

WOCKY_AUTH_MECH_SASL_PLAIN

#define WOCKY_AUTH_MECH_SASL_PLAIN "PLAIN"

WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1

#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1 "SCRAM-SHA-1"

WockyAuthRegistryStartData

typedef struct {
  gchar *mechanism;
  GString *initial_response;
} WockyAuthRegistryStartData;

A structure to hold the mechanism and response data.

Members

gchar *mechanism;

the name of the mechanism

 

GString *initial_response;

the data in the response

 

struct WockyAuthRegistryClass

struct WockyAuthRegistryClass {
  WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func;
  WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func;

  WockyAuthRegistryChallengeAsyncFunc challenge_async_func;
  WockyAuthRegistryChallengeFinishFunc challenge_finish_func;

  WockyAuthRegistrySuccessAsyncFunc success_async_func;
  WockyAuthRegistrySuccessFinishFunc success_finish_func;

  WockyAuthRegistryFailureFunc failure_func;
};

The class of a WockyAuthRegistry.

Members

WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func;

a function to call to start an asynchronous start auth operation; see wocky_auth_registry_start_auth_async() for more details.

 

WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func;

a function to call to finish an asynchronous start auth operation; see wocky_auth_registry_start_auth_finish() for more details.

 

WockyAuthRegistryChallengeAsyncFunc challenge_async_func;

a function to call to start an asynchronous challenge operation; see wocky_auth_registry_challenge_async() for more details.

 

WockyAuthRegistryChallengeFinishFunc challenge_finish_func;

a function to call to finish an asynchronous challenge operation; see wocky_auth_registry_challenge_finish() for more details.

 

WockyAuthRegistrySuccessAsyncFunc success_async_func;

a function to call to start an asynchronous success operation; see wocky_auth_registry_success_async() for more details.

 

WockyAuthRegistrySuccessFinishFunc success_finish_func;

a function to call to finish an asynchronous success operation; see wocky_auth_registry_success_finish() for more details.

 

WockyAuthRegistryFailureFunc failure_func;

a function to call on failure; see wocky_auth_registry_failure() for more details.

 
telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/WockyTLSConnector.html0000644000175000017500000002302613012562226030645 0ustar00gkiagiagkiagia00000000000000 WockyTLSConnector: Wocky Reference Manual

WockyTLSConnector

WockyTLSConnector

Properties

WockyTLSHandler * tls-handler Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyTLSConnector

Description

Functions

wocky_tls_connector_new ()

WockyTLSConnector *
wocky_tls_connector_new (WockyTLSHandler *handler);

wocky_tls_connector_secure_async ()

void
wocky_tls_connector_secure_async (WockyTLSConnector *self,
                                  WockyXmppConnection *connection,
                                  gboolean old_style_ssl,
                                  const gchar *peername,
                                  GStrv extra_identities,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

wocky_tls_connector_secure_finish ()

WockyXmppConnection *
wocky_tls_connector_secure_finish (WockyTLSConnector *self,
                                   GAsyncResult *res,
                                   GError **error);

Types and Values

struct WockyTLSConnectorClass

struct WockyTLSConnectorClass {
};

The class of a WockyTLSConnector.

Property Details

The “tls-handler” property

  “tls-handler”              WockyTLSHandler *

The WockyTLSHandler object used for the TLS handshake.

Flags: Read / Write / Construct Only

telepathy-gabble-0.18.4/lib/ext/wocky/docs/reference/html/wocky-wocky-jabber-auth-password.html0000644000175000017500000000676013012562226033631 0ustar00gkiagiagkiagia00000000000000 wocky-jabber-auth-password: Wocky Reference Manual

wocky-jabber-auth-password

wocky-jabber-auth-password

Functions

WockyJabberAuthPassword * wocky_jabber_auth_password_new ()

Description

Functions

wocky_jabber_auth_password_new ()

WockyJabberAuthPassword *
wocky_jabber_auth_password_new (const gchar *password);

Types and Values

telepathy-gabble-0.18.4/lib/ext/wocky/docs/Makefile.am0000644000175000017500000000002412735676345023573 0ustar00gkiagiagkiagia00000000000000SUBDIRS = reference telepathy-gabble-0.18.4/lib/ext/wocky/docs/Makefile.in0000644000175000017500000004562313012560753023602 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/ext/wocky/COPYING0000644000175000017500000006363712735676345021665 0ustar00gkiagiagkiagia00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! telepathy-gabble-0.18.4/lib/ext/wocky/config.guess0000755000175000017500000012612313012560753023120 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) eval $set_cc_for_build X86_64_ABI= # If there is a compiler, see if it is configured for 32-bit objects. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then X86_64_ABI=x32 fi fi echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-gabble-0.18.4/lib/ext/wocky/AUTHORS0000644000175000017500000000015012735676345021657 0ustar00gkiagiagkiagia00000000000000Sjoerd Simons Guillaume Desmottes telepathy-gabble-0.18.4/lib/ext/wocky/rules/0000755000175000017500000000000013012562225021721 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/rules/lcov.mak0000644000175000017500000000221112735676345023376 0ustar00gkiagiagkiagia00000000000000COVERAGE_DIR=coverage if HAVE_LCOV # run lcov from scratch lcov: $(MAKE) lcov-run $(MAKE) lcov-report else lcov: @echo "lcov not found or lacking --compat-libtool support" @exit 1 endif # reset run coverage tests lcov-run: @-rm -rf $(COVERAGE_DIR) @-find . -name "*.gcda" -exec rm {} \; -$(MAKE) check # generate report based on current coverage data lcov-report: @mkdir -p $(COVERAGE_DIR) @lcov --quiet --compat-libtool --directory . --capture --output-file $(COVERAGE_DIR)/lcov.info @lcov --quiet --compat-libtool -l $(COVERAGE_DIR)/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > $(COVERAGE_DIR)/remove @lcov --quiet --compat-libtool -l $(COVERAGE_DIR)/lcov.info | grep "tests/" | cut -d: -f1 >> $(COVERAGE_DIR)/remove @lcov --quiet --compat-libtool -r $(COVERAGE_DIR)/lcov.info `cat $(COVERAGE_DIR)/remove` > $(COVERAGE_DIR)/lcov.cleaned.info @rm $(COVERAGE_DIR)/remove @mv $(COVERAGE_DIR)/lcov.cleaned.info $(COVERAGE_DIR)/lcov.info @genhtml -t "$(PACKAGE_STRING)" -o $(COVERAGE_DIR) $(COVERAGE_DIR)/lcov.info @(find $(COVERAGE_DIR) -name \*.html -exec \ sed -i -e 's|charset=ISO-8859-1">|charset=UTF-8">|g' {} \;) telepathy-gabble-0.18.4/lib/ext/wocky/install-sh0000755000175000017500000003325613012560753022610 0ustar00gkiagiagkiagia00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-gabble-0.18.4/lib/ext/wocky/depcomp0000755000175000017500000005064313012560753022160 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-gabble-0.18.4/lib/ext/wocky/configure0000755000175000017500000203650713012560752022516 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Wocky 0.0.0.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Wocky' PACKAGE_TARNAME='wocky' PACKAGE_VERSION='0.0.0.1' PACKAGE_STRING='Wocky 0.0.0.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HAVE_GTK_DOC_FALSE HAVE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK_PATH GTKDOC_CHECK WOCKY_CFLAGS HAVE_LCOV_FALSE HAVE_LCOV_TRUE LCOV_PATH HAVE_GCOV_FALSE HAVE_GCOV_TRUE GCOV GCOV_LIBS GCOV_CFLAGS FFLAGS CXXFLAGS MOSTLYCLEANFILES have_gcov ENABLE_GOOGLE_RELAY_FALSE ENABLE_GOOGLE_RELAY_TRUE SOUP_LIBS SOUP_CFLAGS LIBIPHB_LIBS LIBIPHB_CFLAGS HAVE_LIBSASL2_FALSE HAVE_LIBSASL2_TRUE LIBSASL2_CFLAGS LIBSASL2_LIBS SQLITE_LIBS SQLITE_CFLAGS LIBXML2_LIBS LIBXML2_CFLAGS GLIB_GENMARSHAL GNUTLS_FOR_STREAM_CIPHERS_LIBS GNUTLS_FOR_STREAM_CIPHERS_CFLAGS USING_OPENSSL_FALSE USING_OPENSSL_TRUE TLS_LIBS TLS_CFLAGS GLIB_LIBS GLIB_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG SHARED_SUFFIX ENABLE_SHARED_SUFFIX_FALSE ENABLE_SHARED_SUFFIX_TRUE HEADER_DIR INSTALL_HEADERS_FALSE INSTALL_HEADERS_TRUE ENABLE_CODING_STYLE_CHECKS ERROR_CFLAGS am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_silent_rules enable_Werror enable_coding_style_checks enable_debug with_installed_headers enable_shared_suffix with_tls enable_prefer_stream_ciphers with_ca_certificates enable_google_relay enable_coverage with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP CCAS CCASFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS TLS_CFLAGS TLS_LIBS GNUTLS_FOR_STREAM_CIPHERS_CFLAGS GNUTLS_FOR_STREAM_CIPHERS_LIBS LIBXML2_CFLAGS LIBXML2_LIBS SQLITE_CFLAGS SQLITE_LIBS LIBIPHB_CFLAGS LIBIPHB_LIBS SOUP_CFLAGS SOUP_LIBS GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Wocky 0.0.0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/wocky] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Wocky 0.0.0.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --disable-Werror compile without -Werror (normally enabled in development builds) --disable-coding-style-checks do not check coding style using grep --disable-debug compile without debug code --enable-shared-suffix= install a shared library with a version-specific suffix --enable-prefer-stream-ciphers prefer stream ciphers over block ciphers to save bandwidth (at the possible expense of security) --disable-google-relay disable Google Jingle relay support --enable-coverage compile with coverage profiling instrumentation (gcc only) --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-installed-headers=DIR install development headers to DIR [default=nowhere] --with-tls=BACKEND which TLS backend to use (gnutls, openssl, or auto) [default=auto] --with-ca-certificates=[path] path to system Certificate Authority list --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config TLS_CFLAGS C compiler flags for TLS, overriding pkg-config TLS_LIBS linker flags for TLS, overriding pkg-config GNUTLS_FOR_STREAM_CIPHERS_CFLAGS C compiler flags for GNUTLS_FOR_STREAM_CIPHERS, overriding pkg-config GNUTLS_FOR_STREAM_CIPHERS_LIBS linker flags for GNUTLS_FOR_STREAM_CIPHERS, overriding pkg-config LIBXML2_CFLAGS C compiler flags for LIBXML2, overriding pkg-config LIBXML2_LIBS linker flags for LIBXML2, overriding pkg-config SQLITE_CFLAGS C compiler flags for SQLITE, overriding pkg-config SQLITE_LIBS linker flags for SQLITE, overriding pkg-config LIBIPHB_CFLAGS C compiler flags for LIBIPHB, overriding pkg-config LIBIPHB_LIBS linker flags for LIBIPHB, overriding pkg-config SOUP_CFLAGS C compiler flags for SOUP, overriding pkg-config SOUP_LIBS linker flags for SOUP, overriding pkg-config GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Wocky configure 0.0.0.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Wocky $as_me 0.0.0.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " unistd.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='wocky' VERSION='0.0.0.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_config_headers="$ac_config_headers config.h" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case $ac_cv_prog_cc_stdc in #( no) : ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if ${ac_cv_prog_cc_stdc+:} false; then : $as_echo_n "(cached) " >&6 fi case $ac_cv_prog_cc_stdc in #( no) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; #( '') : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CCAS_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac official_release=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands " >&5 $as_echo_n "checking to see if compiler understands ... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS " CXXFLAGS="$CXXFLAGS " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } tp_warnings="" for tp_flag in all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -W$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -W$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -W$tp_flag" CXXFLAGS="$CXXFLAGS -W$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -W$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done tp_error_flags="-Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 $as_echo_n "checking to see if compiler understands -Werror... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_werror=yes true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } for tp_flag in missing-field-initializers \ unused-parameter; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -Wno-$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-error=$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-error=$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-error=$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-error=$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_error_flags="$tp_error_flags -Wno-error=$tp_flag" true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done # Check whether --enable-Werror was given. if test "${enable_Werror+set}" = set; then : enableval=$enable_Werror; tp_werror=$enableval else : fi if test "x$tp_werror" = xyes && test "x$official_release" = xno; then ERROR_CFLAGS="$tp_warnings $tp_error_flags" else ERROR_CFLAGS="$tp_warnings" fi # Wocky is version x.y.z.1 - enable coding style checks by default # Check whether --enable-coding-style-checks was given. if test "${enable_coding_style_checks+set}" = set; then : enableval=$enable_coding_style_checks; ENABLE_CODING_STYLE_CHECKS=$enableval else ENABLE_CODING_STYLE_CHECKS=yes fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; case "${enableval}" in yes|no) enable_debug="${enableval}" ;; *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; esac else enable_debug=yes fi if test "$enable_debug" = yes; then $as_echo "#define ENABLE_DEBUG /**/" >>confdefs.h else enable_debug=no fi # Check whether --with-installed-headers was given. if test "${with_installed_headers+set}" = set; then : withval=$with_installed_headers; else with_installed_headers= fi if test x$with_installed_headers != x; then INSTALL_HEADERS_TRUE= INSTALL_HEADERS_FALSE='#' else INSTALL_HEADERS_TRUE='#' INSTALL_HEADERS_FALSE= fi HEADER_DIR=$with_installed_headers # Check whether --enable-shared-suffix was given. if test "${enable_shared_suffix+set}" = set; then : enableval=$enable_shared_suffix; else enable_shared_suffix= fi if test x$enable_shared_suffix != x; then ENABLE_SHARED_SUFFIX_TRUE= ENABLE_SHARED_SUFFIX_FALSE='#' else ENABLE_SHARED_SUFFIX_TRUE='#' ENABLE_SHARED_SUFFIX_FALSE= fi SHARED_SUFFIX="$enable_shared_suffix" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.44, gobject-2.0 >= 2.44, gthread-2.0 >= 2.44, gio-2.0 >= 2.44) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_44" >>confdefs.h $as_echo "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_44" >>confdefs.h # Check whether --with-tls was given. if test "${with_tls+set}" = set; then : withval=$with_tls; else with_tls=auto fi case $with_tls in #( gnutls) : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test -n "$TLS_CFLAGS"; then pkg_cv_TLS_CFLAGS="$TLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.8.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.8.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.8.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TLS_LIBS"; then pkg_cv_TLS_LIBS="$TLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.8.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.8.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.8.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 2.8.2 " 2>&1` else TLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 2.8.2 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TLS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gnutls >= 2.8.2 ) were not met: $TLS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables TLS_CFLAGS and TLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables TLS_CFLAGS and TLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else TLS_CFLAGS=$pkg_cv_TLS_CFLAGS TLS_LIBS=$pkg_cv_TLS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ;; #( openssl) : USING_OPENSSL=yes $as_echo "#define USING_OPENSSL 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test -n "$TLS_CFLAGS"; then pkg_cv_TLS_CFLAGS="$TLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TLS_LIBS"; then pkg_cv_TLS_LIBS="$TLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` else TLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TLS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (openssl >= 0.9.8g) were not met: $TLS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables TLS_CFLAGS and TLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables TLS_CFLAGS and TLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else TLS_CFLAGS=$pkg_cv_TLS_CFLAGS TLS_LIBS=$pkg_cv_TLS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ;; #( auto) : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test -n "$TLS_CFLAGS"; then pkg_cv_TLS_CFLAGS="$TLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.8.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.8.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.8.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TLS_LIBS"; then pkg_cv_TLS_LIBS="$TLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.8.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.8.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.8.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 2.8.2 " 2>&1` else TLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 2.8.2 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TLS_PKG_ERRORS" >&5 USING_OPENSSL=yes $as_echo "#define USING_OPENSSL 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test -n "$TLS_CFLAGS"; then pkg_cv_TLS_CFLAGS="$TLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TLS_LIBS"; then pkg_cv_TLS_LIBS="$TLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` else TLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TLS_PKG_ERRORS" >&5 as_fn_error $? "Neither gnutls nor openssl found" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Neither gnutls nor openssl found" "$LINENO" 5 else TLS_CFLAGS=$pkg_cv_TLS_CFLAGS TLS_LIBS=$pkg_cv_TLS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_tls=openssl fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } USING_OPENSSL=yes $as_echo "#define USING_OPENSSL 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test -n "$TLS_CFLAGS"; then pkg_cv_TLS_CFLAGS="$TLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TLS_LIBS"; then pkg_cv_TLS_LIBS="$TLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8g\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8g") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TLS_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.8g" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` else TLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 0.9.8g" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TLS_PKG_ERRORS" >&5 as_fn_error $? "Neither gnutls nor openssl found" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Neither gnutls nor openssl found" "$LINENO" 5 else TLS_CFLAGS=$pkg_cv_TLS_CFLAGS TLS_LIBS=$pkg_cv_TLS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_tls=openssl fi else TLS_CFLAGS=$pkg_cv_TLS_CFLAGS TLS_LIBS=$pkg_cv_TLS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_tls=gnutls fi ;; #( *) : as_fn_error $? "Must have a TLS backend (gnutls or openssl)" "$LINENO" 5 ;; #( *) : ;; esac if test x$USING_OPENSSL = xyes; then USING_OPENSSL_TRUE= USING_OPENSSL_FALSE='#' else USING_OPENSSL_TRUE='#' USING_OPENSSL_FALSE= fi # Check whether --enable-prefer-stream-ciphers was given. if test "${enable_prefer_stream_ciphers+set}" = set; then : enableval=$enable_prefer_stream_ciphers; prefer_stream_ciphers=$enableval else prefer_stream_ciphers=no fi if test x$prefer_stream_ciphers = xyes; then $as_echo "#define ENABLE_PREFER_STREAM_CIPHERS /**/" >>confdefs.h if test $with_tls = gnutls; then # The *-ALL priority strings require gnutls 2.12.0. # We do this check here and not earlier to avoid accidentally falling # back to openssl because of the use of --enable-prefer-stream-ciphers. pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS_FOR_STREAM_CIPHERS" >&5 $as_echo_n "checking for GNUTLS_FOR_STREAM_CIPHERS... " >&6; } if test -n "$GNUTLS_FOR_STREAM_CIPHERS_CFLAGS"; then pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_CFLAGS="$GNUTLS_FOR_STREAM_CIPHERS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.12.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.12.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.12.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GNUTLS_FOR_STREAM_CIPHERS_LIBS"; then pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_LIBS="$GNUTLS_FOR_STREAM_CIPHERS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.12.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnutls >= 2.12.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.12.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GNUTLS_FOR_STREAM_CIPHERS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 2.12.0" 2>&1` else GNUTLS_FOR_STREAM_CIPHERS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 2.12.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GNUTLS_FOR_STREAM_CIPHERS_PKG_ERRORS" >&5 as_fn_error $? "gnutls 2.12.0 is needed to use --enable-prefer-stream-cihpers" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "gnutls 2.12.0 is needed to use --enable-prefer-stream-cihpers" "$LINENO" 5 else GNUTLS_FOR_STREAM_CIPHERS_CFLAGS=$pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_CFLAGS GNUTLS_FOR_STREAM_CIPHERS_LIBS=$pkg_cv_GNUTLS_FOR_STREAM_CIPHERS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi # ----------------------------------------------------------- # Make CA certificates path configurable # Stolen from GIO's TLS # ----------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of system Certificate Authority list" >&5 $as_echo_n "checking location of system Certificate Authority list... " >&6; } # Check whether --with-ca-certificates was given. if test "${with_ca_certificates+set}" = set; then : withval=$with_ca_certificates; fi if test "$with_ca_certificates" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } else if test -z "$with_ca_certificates"; then for f in /etc/pki/tls/certs/ca-bundle.crt \ /etc/ssl/certs/ca-certificates.crt; do if test -f "$f"; then with_ca_certificates="$f" fi done if test -z "$with_ca_certificates"; then as_fn_error $? "could not find. Use --with-ca-certificates=path to set, or --without-ca-certificates to disable" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ca_certificates" >&5 $as_echo "$with_ca_certificates" >&6; } cat >>confdefs.h <<_ACEOF #define GTLS_SYSTEM_CA_CERTIFICATES "$with_ca_certificates" _ACEOF fi if test -n "$with_ca_certificates"; then if ! test -f "$with_ca_certificates"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Specified certificate authority file '$with_ca_certificates' does not exist" >&5 $as_echo "$as_me: WARNING: Specified certificate authority file '$with_ca_certificates' does not exist" >&2;} fi fi GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5 $as_echo_n "checking for LIBXML2... " >&6; } if test -n "$LIBXML2_CFLAGS"; then pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBXML2_LIBS"; then pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1` else LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBXML2_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libxml-2.0) were not met: $LIBXML2_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBXML2_CFLAGS and LIBXML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBXML2_CFLAGS and LIBXML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE" >&5 $as_echo_n "checking for SQLITE... " >&6; } if test -n "$SQLITE_CFLAGS"; then pkg_cv_SQLITE_CFLAGS="$SQLITE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SQLITE_LIBS"; then pkg_cv_SQLITE_LIBS="$SQLITE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE_LIBS=`$PKG_CONFIG --libs "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SQLITE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3" 2>&1` else SQLITE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SQLITE_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (sqlite3) were not met: $SQLITE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SQLITE_CFLAGS and SQLITE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SQLITE_CFLAGS and SQLITE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SQLITE_CFLAGS=$pkg_cv_SQLITE_CFLAGS SQLITE_LIBS=$pkg_cv_SQLITE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_server_new in -lsasl2" >&5 $as_echo_n "checking for sasl_server_new in -lsasl2... " >&6; } if ${ac_cv_lib_sasl2_sasl_server_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsasl2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sasl_server_new (); int main () { return sasl_server_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sasl2_sasl_server_new=yes else ac_cv_lib_sasl2_sasl_server_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_server_new" >&5 $as_echo "$ac_cv_lib_sasl2_sasl_server_new" >&6; } if test "x$ac_cv_lib_sasl2_sasl_server_new" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "sasl/sasl.h" "ac_cv_header_sasl_sasl_h" "$ac_includes_default" if test "x$ac_cv_header_sasl_sasl_h" = xyes; then : LIBSASL2_LIBS="-lsasl2" LIBSASL2_CFLAGS="" HAVE_LIBSASL2=yes $as_echo "#define HAVE_LIBSASL2 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libsasl2 headers missing: skipping sasl tests" >&5 $as_echo "$as_me: WARNING: libsasl2 headers missing: skipping sasl tests" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libsasl2 not found: skipping sasl tests" >&5 $as_echo "$as_me: WARNING: libsasl2 not found: skipping sasl tests" >&2;} HAVE_LIBSASL2=no fi if test "x$HAVE_LIBSASL2" = "xyes"; then HAVE_LIBSASL2_TRUE= HAVE_LIBSASL2_FALSE='#' else HAVE_LIBSASL2_TRUE='#' HAVE_LIBSASL2_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBIPHB" >&5 $as_echo_n "checking for LIBIPHB... " >&6; } if test -n "$LIBIPHB_CFLAGS"; then pkg_cv_LIBIPHB_CFLAGS="$LIBIPHB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiphb >= 0.61.31\""; } >&5 ($PKG_CONFIG --exists --print-errors "libiphb >= 0.61.31") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBIPHB_CFLAGS=`$PKG_CONFIG --cflags "libiphb >= 0.61.31" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBIPHB_LIBS"; then pkg_cv_LIBIPHB_LIBS="$LIBIPHB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiphb >= 0.61.31\""; } >&5 ($PKG_CONFIG --exists --print-errors "libiphb >= 0.61.31") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBIPHB_LIBS=`$PKG_CONFIG --libs "libiphb >= 0.61.31" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBIPHB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libiphb >= 0.61.31" 2>&1` else LIBIPHB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libiphb >= 0.61.31" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBIPHB_PKG_ERRORS" >&5 have_iphb=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_iphb=no else LIBIPHB_CFLAGS=$pkg_cv_LIBIPHB_CFLAGS LIBIPHB_LIBS=$pkg_cv_LIBIPHB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_IPHB 1" >>confdefs.h have_iphb=yes fi # Check whether --enable-google-relay was given. if test "${enable_google_relay+set}" = set; then : enableval=$enable_google_relay; enable_google_relay=$enableval else enable_google_relay=yes fi if test x$enable_google_relay = xyes; then $as_echo "#define ENABLE_GOOGLE_RELAY /**/" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOUP" >&5 $as_echo_n "checking for SOUP... " >&6; } if test -n "$SOUP_CFLAGS"; then pkg_cv_SOUP_CFLAGS="$SOUP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.42\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.42") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= 2.42" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SOUP_LIBS"; then pkg_cv_SOUP_LIBS="$SOUP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.42\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.42") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= 2.42" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsoup-2.4 >= 2.42" 2>&1` else SOUP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsoup-2.4 >= 2.42" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SOUP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libsoup-2.4 >= 2.42) were not met: $SOUP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SOUP_CFLAGS and SOUP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SOUP_CFLAGS and SOUP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SOUP_CFLAGS=$pkg_cv_SOUP_CFLAGS SOUP_LIBS=$pkg_cv_SOUP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$enable_google_relay" = xyes; then ENABLE_GOOGLE_RELAY_TRUE= ENABLE_GOOGLE_RELAY_FALSE='#' else ENABLE_GOOGLE_RELAY_TRUE='#' ENABLE_GOOGLE_RELAY_FALSE= fi # Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; case "${enableval}" in "yes"|"no") enable_coverage="${enableval}" ;; *) as_fn_error $? "bad value ${enableval} for --enable-coverage" "$LINENO" 5 ;; esac fi enable=${enable_coverage} GCOV=`echo $CC | sed s/gcc/gcov/g` # Extract the first word of "$GCOV", so it can be a program name with args. set dummy $GCOV; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_gcov+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_gcov"; then ac_cv_prog_have_gcov="$have_gcov" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_gcov="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_gcov" && ac_cv_prog_have_gcov="no" fi fi have_gcov=$ac_cv_prog_have_gcov if test -n "$have_gcov"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcov" >&5 $as_echo "$have_gcov" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands \"-fprofile-arcs\"" >&5 $as_echo_n "checking to see if compiler understands \"-fprofile-arcs\"... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS "-fprofile-arcs"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then flag_profile_arcs=yes true else flag_profile_arcs=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands \"-ftest-coverage\"" >&5 $as_echo_n "checking to see if compiler understands \"-ftest-coverage\"... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS "-ftest-coverage"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then flag_test_coverage=yes true else flag_test_coverage=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } if test "x$enable" = xyes && test "x$GCC" = "xyes" && test "$flag_profile_arcs" = yes && test "$flag_test_coverage" = yes ; then GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs -ftest-coverage" GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[0-9]*//g'` GCOV_LIBS=-lgcov MOSTLYCLEANFILES="*.bb *.bbg *.da *.gcov *.gcda *.gcno" cat >>confdefs.h <<_ACEOF #define HAVE_GCOV 1 _ACEOF CFLAGS="-O0" CXXFLAGS="-O0" FFLAGS="-O0" CCASFLAGS="-O0" { $as_echo "$as_me:${as_lineno-$LINENO}: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&5 $as_echo "$as_me: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&6;} fi if test x$have_gcov = xyes; then HAVE_GCOV_TRUE= HAVE_GCOV_FALSE='#' else HAVE_GCOV_TRUE='#' HAVE_GCOV_FALSE= fi enable=${enable_coverage} for ac_prog in lcov do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LCOV_PATH+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LCOV_PATH"; then ac_cv_prog_LCOV_PATH="$LCOV_PATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LCOV_PATH="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LCOV_PATH=$ac_cv_prog_LCOV_PATH if test -n "$LCOV_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV_PATH" >&5 $as_echo "$LCOV_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LCOV_PATH" && break done if test -n "$LCOV_PATH" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lcov accepts --compat-libtool" >&5 $as_echo_n "checking whether lcov accepts --compat-libtool... " >&6; } if $LCOV_PATH --compat-libtool --help > /dev/null 2>&1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: lcov option --compat-libtool is not supported" >&5 $as_echo "$as_me: WARNING: lcov option --compat-libtool is not supported" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: update lcov to version > 1.5" >&5 $as_echo "$as_me: WARNING: update lcov to version > 1.5" >&2;} LCOV_PATH="" fi fi if test -n "$LCOV_PATH" && test "x$enable" = xyes; then HAVE_LCOV_TRUE= HAVE_LCOV_FALSE='#' else HAVE_LCOV_TRUE='#' HAVE_LCOV_FALSE= fi if test "x$enable_coverage" = "x"; then enable_coverage=no fi WOCKY_CFLAGS='-I${top_builddir} -I${top_srcdir}' gtk_doc_requires="gtk-doc >= 1.17" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 $as_echo_n "checking for gtk-doc... " >&6; } if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then have_gtk_doc=yes else have_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 $as_echo "$have_gtk_doc" >&6; } if test "$have_gtk_doc" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&5 $as_echo "$as_me: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&2;} fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GTKDOC_CHECK"; then ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH if test -n "$GTKDOC_CHECK_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 $as_echo "$GTKDOC_CHECK_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then as_fn_error $? " You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 $as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$have_gtk_doc = xyes; then HAVE_GTK_DOC_TRUE= HAVE_GTK_DOC_FALSE='#' else HAVE_GTK_DOC_TRUE='#' HAVE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi ac_config_files="$ac_config_files Makefile wocky/Makefile wocky/wocky-uninstalled.pc wocky/wocky.pc m4/Makefile tools/Makefile examples/Makefile tests/Makefile docs/Makefile docs/reference/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_HEADERS_TRUE}" && test -z "${INSTALL_HEADERS_FALSE}"; then as_fn_error $? "conditional \"INSTALL_HEADERS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SHARED_SUFFIX_TRUE}" && test -z "${ENABLE_SHARED_SUFFIX_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SHARED_SUFFIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USING_OPENSSL_TRUE}" && test -z "${USING_OPENSSL_FALSE}"; then as_fn_error $? "conditional \"USING_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBSASL2_TRUE}" && test -z "${HAVE_LIBSASL2_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBSASL2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GOOGLE_RELAY_TRUE}" && test -z "${ENABLE_GOOGLE_RELAY_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GOOGLE_RELAY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GCOV_TRUE}" && test -z "${HAVE_GCOV_FALSE}"; then as_fn_error $? "conditional \"HAVE_GCOV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LCOV_TRUE}" && test -z "${HAVE_LCOV_FALSE}"; then as_fn_error $? "conditional \"HAVE_LCOV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Wocky $as_me 0.0.0.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Wocky config.status 0.0.0.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "wocky/Makefile") CONFIG_FILES="$CONFIG_FILES wocky/Makefile" ;; "wocky/wocky-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES wocky/wocky-uninstalled.pc" ;; "wocky/wocky.pc") CONFIG_FILES="$CONFIG_FILES wocky/wocky.pc" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo " Configure summary: Compiler Flags.......: ${CFLAGS} Prefix...............: ${prefix} Coverage profiling...: ${enable_coverage} Coding style checks..: ${ENABLE_CODING_STYLE_CHECKS} Debug................: ${enable_debug} Features: TLS Backend..........: ${with_tls} Prefer stream ciphers: ${prefer_stream_ciphers} System CA certs......: ${with_ca_certificates} SASL2 Tests..........: ${HAVE_LIBSASL2} gtk-doc documentation: ${enable_gtk_doc} libiphb integration..: ${have_iphb} Google relay support.: ${enable_google_relay} " telepathy-gabble-0.18.4/lib/ext/wocky/tests/0000755000175000017500000000000013012562226021732 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-jid-validation-test.c0000644000175000017500000000344012735676345027127 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "wocky-test-helper.h" static void valid (gconstpointer data) { const gchar *jid = data; g_assert (wocky_decode_jid (jid, NULL, NULL, NULL)); } static void invalid (gconstpointer data) { const gchar *jid = data; g_assert (!wocky_decode_jid (jid, NULL, NULL, NULL)); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_data_func ("/jid/valid/simple", "foo@bar.com/baz", valid); g_test_add_data_func ("/jid/valid/no-resource", "foo@bar.com", valid); g_test_add_data_func ("/jid/valid/no-node", "bar.com/baz", valid); g_test_add_data_func ("/jid/valid/just-domain", "bar.com", valid); g_test_add_data_func ("/jid/valid/ip", "foo@127.0.0.1", valid); g_test_add_data_func ("/jid/valid/ipv6", "foo@2:0:1cfe:face:b00c::3", valid); g_test_add_data_func ("/jid/valid/russian", "Анна@Каренина.ru", valid); g_test_add_data_func ("/jid/invalid/empty", "", invalid); g_test_add_data_func ("/jid/invalid/just-node", "foo@", invalid); g_test_add_data_func ("/jid/invalid/node-and-resource", "foo@/lol", invalid); g_test_add_data_func ("/jid/invalid/just-resource", "/lol", invalid); g_test_add_data_func ("/jid/invalid/garbage", "(*&$(*)", invalid); g_test_add_data_func ("/jid/invalid/space-domain", "foo bar", invalid); g_test_add_data_func ("/jid/invalid/two-ats", "squid@cat@battle", invalid); #if 0 /* These are improperly accepted. */ g_test_add_data_func ("/jid/invalid/space-node", "i am a@fish", invalid); /* U+00A0 NO-BREAK SPACE is in Table C.1.2, which is forbidden in domains. */ g_test_add_data_func ("/jid/invalid/nbsp-domain", "foo bar", invalid); #endif result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-loopback-test.c0000644000175000017500000001046312735676345026026 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "wocky-test-helper.h" /* I'm not happy about this, but the existing test stuff really relies * on having multiple streams */ typedef struct { test_data_t data; GIOStream *stream; WockyXmppConnection *conn; WockySession *session; WockyPorter *porter; } loopback_test_t; static gboolean test_timeout (gpointer data) { g_test_message ("Timeout reached :("); g_assert_not_reached (); return FALSE; } static loopback_test_t * setup (void) { loopback_test_t *test = g_slice_new0 (loopback_test_t); test->data.loop = g_main_loop_new (NULL, FALSE); test->data.cancellable = g_cancellable_new (); test->data.timeout_id = g_timeout_add_seconds (10, test_timeout, NULL); test->data.expected_stanzas = g_queue_new (); test->stream = wocky_loopback_stream_new (); test->conn = wocky_xmpp_connection_new (test->stream); test->session = wocky_session_new_with_connection (test->conn, "example.com"); test->porter = wocky_session_get_porter (test->session); return test; } static void send_received_open_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); loopback_test_t *d = (loopback_test_t *) user_data; g_assert (wocky_xmpp_connection_recv_open_finish (conn, res, NULL, NULL, NULL, NULL, NULL, NULL)); wocky_session_start (d->session); d->data.outstanding--; g_main_loop_quit (d->data.loop); } static void send_open_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); g_assert (wocky_xmpp_connection_send_open_finish (conn, res, NULL)); wocky_xmpp_connection_recv_open_async (conn, NULL, send_received_open_cb, user_data); } static void start_test (loopback_test_t *test) { wocky_xmpp_connection_send_open_async (test->conn, NULL, NULL, NULL, NULL, NULL, NULL, send_open_cb, test); test->data.outstanding++; test_wait_pending (&(test->data)); } static void close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { loopback_test_t *test = user_data; g_assert (wocky_porter_close_finish (WOCKY_PORTER (source), res, NULL)); test->data.outstanding--; g_main_loop_quit (test->data.loop); g_main_loop_unref (test->data.loop); g_object_unref (test->session); g_object_unref (test->conn); g_object_unref (test->data.cancellable); g_source_remove (test->data.timeout_id); g_assert (g_queue_get_length (test->data.expected_stanzas) == 0); g_queue_free (test->data.expected_stanzas); g_slice_free (loopback_test_t, test); } static void cleanup (loopback_test_t *test) { wocky_porter_close_async (test->porter, NULL, close_cb, test); test->data.outstanding++; test_wait_pending (&(test->data)); } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_porter_send_finish ( WOCKY_PORTER (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } /* receive testing */ static gboolean test_receive_stanza_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_receive (void) { loopback_test_t *test = setup (); WockyStanza *s; start_test (test); wocky_porter_register_handler_from_anyone (test->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_receive_stanza_received_cb, test, NULL); /* Send a stanza */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_async (test->porter, s, NULL, send_stanza_cb, test); g_queue_push_tail (test->data.expected_stanzas, s); /* We are waiting for the stanza to be sent and received on the other * side */ test->data.outstanding += 2; test_wait_pending (&(test->data)); cleanup (test); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/loopback-porter/receive", test_receive); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-sasl-auth.c0000644000175000017500000002254412735676345026140 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "wocky-test-sasl-auth-server.h" #include "wocky-test-sasl-handler.h" #include "wocky-test-stream.h" #include "wocky-test-helper.h" #include typedef struct { gchar *description; gchar *mech; gboolean allow_plain; GQuark domain; int code; ServerProblem problem; gboolean wrong_username; gboolean wrong_password; const gchar *username; const gchar *password; const gchar *servername; } test_t; GMainLoop *mainloop; GIOStream *xmpp_connection; WockyXmppConnection *conn; WockySaslAuth *sasl = NULL; gboolean authenticated = FALSE; gboolean run_done = FALSE; test_t *current_test = NULL; GError *error = NULL; static void post_auth_recv_stanza (GObject *source, GAsyncResult *result, gpointer user_data) { WockyStanza *stanza; GError *e = NULL; /* ignore all stanza until close */ stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &e); if (stanza != NULL) { g_object_unref (stanza); wocky_xmpp_connection_recv_stanza_async ( WOCKY_XMPP_CONNECTION (source), NULL, post_auth_recv_stanza, user_data); } else { g_assert_error (e, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (e); run_done = TRUE; g_main_loop_quit (mainloop); } } static void post_auth_close_sent (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), NULL, post_auth_recv_stanza, user_data); } static void post_auth_open_received (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL, NULL, NULL, NULL, NULL, NULL)); wocky_xmpp_connection_send_close_async (WOCKY_XMPP_CONNECTION (source), NULL, post_auth_close_sent, user_data); } static void post_auth_open_sent (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (source), NULL, post_auth_open_received, user_data); } static void sasl_auth_finished_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GError *auth_error = NULL; test_t *test = (test_t *) user_data; if (wocky_sasl_auth_authenticate_finish (WOCKY_SASL_AUTH (source), res, &auth_error)) { authenticated = TRUE; wocky_xmpp_connection_reset (conn); wocky_xmpp_connection_send_open_async (conn, test->servername, NULL, "1.0", NULL, NULL, NULL, post_auth_open_sent, NULL); } else { error = auth_error; run_done = TRUE; g_main_loop_quit (mainloop); } } static void feature_stanza_received (GObject *source, GAsyncResult *res, gpointer user_data) { WockyStanza *stanza; WockyAuthHandler *test_handler; WockyAuthRegistry *auth_registry; test_t *test = (test_t *) user_data; stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL); g_assert (stanza != NULL); g_assert (sasl == NULL); sasl = wocky_sasl_auth_new (test->servername, test->wrong_username ? "wrong" : test->username, test->wrong_password ? "wrong" : test->password, WOCKY_XMPP_CONNECTION (source), NULL); g_object_get (sasl, "auth-registry", &auth_registry, NULL); test_handler = WOCKY_AUTH_HANDLER (wocky_test_sasl_handler_new ()); wocky_auth_registry_add_handler (auth_registry, test_handler); g_object_unref (test_handler); g_object_unref (auth_registry); wocky_sasl_auth_authenticate_async (sasl, stanza, current_test->allow_plain, FALSE, NULL, sasl_auth_finished_cb, test); g_object_unref (stanza); } static void stream_open_received (GObject *source, GAsyncResult *res, gpointer user_data) { g_assert (wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL, NULL, NULL, NULL, NULL, NULL)); /* Get the features stanza and wait for the connection closing*/ wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), NULL, feature_stanza_received, user_data); } static void stream_open_sent (GObject *source, GAsyncResult *res, gpointer user_data) { g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (source), NULL, stream_open_received, user_data); } static void run_test (gconstpointer user_data) { TestSaslAuthServer *server; WockyTestStream *stream; test_t *test = (test_t *) user_data; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); server = test_sasl_auth_server_new (stream->stream0, test->mech, test->username, test->password, test->servername, test->problem, TRUE); authenticated = FALSE; run_done = FALSE; current_test = test; xmpp_connection = stream->stream1; conn = wocky_xmpp_connection_new (xmpp_connection); wocky_xmpp_connection_send_open_async (conn, test->servername, NULL, "1.0", NULL, NULL, NULL, stream_open_sent, test); if (!run_done) { g_main_loop_run (mainloop); } if (sasl != NULL) { g_object_unref (sasl); sasl = NULL; } test_sasl_auth_server_stop (server); g_object_unref (server); g_object_unref (stream); g_object_unref (conn); if (test->domain == 0) { g_assert (authenticated); g_assert_no_error (error); } else { g_assert (!authenticated); g_assert_error (error, test->domain, test->code); } if (error != NULL) g_error_free (error); error = NULL; } #define SUCCESS(desc, mech, allow_plain) \ { desc, mech, allow_plain, 0, 0, SERVER_PROBLEM_NO_PROBLEM, FALSE, FALSE, \ "test", "test123", NULL } #define FAIL(desc, mech, allow_plain, domain, code, problem) \ { desc, mech, allow_plain, domain, code, problem, FALSE, FALSE, \ "test", "test123", NULL } int main (int argc, char **argv) { int result; test_t tests[] = { SUCCESS("/xmpp-sasl/normal-auth", NULL, TRUE), SUCCESS("/xmpp-sasl/no-plain", NULL, FALSE), SUCCESS("/xmpp-sasl/only-plain", "PLAIN", TRUE), SUCCESS("/xmpp-sasl/only-digest-md5", "DIGEST-MD5", TRUE), { "/xmpp-sasl/digest-md5-final-data-in-success", "DIGEST-MD5", TRUE, 0, 0, SERVER_PROBLEM_FINAL_DATA_IN_SUCCESS, FALSE, FALSE, "test", "test123", NULL }, FAIL("/xmpp-sasl/no-supported-mechs", "NONSENSE", TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, SERVER_PROBLEM_NO_PROBLEM), FAIL("/xmpp-sasl/refuse-plain-only", "PLAIN", FALSE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, SERVER_PROBLEM_NO_PROBLEM), FAIL("/xmpp-sasl/no-sasl-support", NULL, TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, SERVER_PROBLEM_NO_SASL), { "/xmpp-sasl/wrong-username-plain", "PLAIN", TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, SERVER_PROBLEM_INVALID_USERNAME, TRUE, FALSE, "test", "test123" }, { "/xmpp-sasl/wrong-username-md5", "DIGEST-MD5", TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, SERVER_PROBLEM_INVALID_USERNAME, TRUE, FALSE, "test", "test123" }, { "/xmpp-sasl/wrong-password-plain", "PLAIN", TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, SERVER_PROBLEM_INVALID_PASSWORD, FALSE, TRUE, "test", "test123" }, { "/xmpp-sasl/wrong-password-md5", "DIGEST-MD5", TRUE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, SERVER_PROBLEM_INVALID_PASSWORD, FALSE, TRUE, "test", "test123" }, /* Redo the MD5-DIGEST test with a username, password and realm that * happens to generate a \0 byte in the md5 hash of * 'username:realm:password'. This used to trigger a bug in the sasl helper * when calculating the A! part of the response MD5-DIGEST hash */ { "/xmpp-sasl/digest-md5-A1-null-byte", "DIGEST-MD5", TRUE, 0, 0, SERVER_PROBLEM_NO_PROBLEM, FALSE, FALSE, "moose", "something", "cass-x200s" }, /* Redo the MD5-DIGEST test with extra whitespace in the challenge */ { "/xmpp-sasl/digest-md5-spaced-challenge", "DIGEST-MD5", FALSE, 0, 0, SERVER_PROBLEM_SPACE_CHALLENGE, FALSE, FALSE, "moose", "something", "cass-x200s" }, /* Redo the MD5-DIGEST test with extra \ escapes in the challenge */ { "/xmpp-sasl/digest-md5-slash-challenge", "DIGEST-MD5", FALSE, 0, 0, SERVER_PROBLEM_SLASH_CHALLENGE, FALSE, FALSE, "moose", "something", "cass-x200s" }, { "/xmpp-sasl/external-handler-fail", "X-TEST", FALSE, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, SERVER_PROBLEM_INVALID_PASSWORD, FALSE, FALSE, "dave", "daisy daisy", "hal" }, { "/xmpp-sasl/external-handler-succeed", "X-TEST", FALSE, 0, 0, SERVER_PROBLEM_NO_PROBLEM, FALSE, FALSE, "ripley", "open sesame", "mother" }, }; test_init (argc, argv); mainloop = g_main_loop_new (NULL, FALSE); for (guint i = 0; i < G_N_ELEMENTS (tests); i++) g_test_add_data_func (tests[i].description, &tests[i], run_test); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-pep-service-test.c0000644000175000017500000001765413006434374026451 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" #define TEST_NODE1 "http://test.com/node1" #define TEST_NODE2 "http://test.com/node2" /* Test to instantiate a WockyPepService object */ static void test_instantiation (void) { WockyPepService *pep; pep = wocky_pep_service_new ("http://test.com/badger", FALSE); g_assert (pep != NULL); g_object_unref (pep); } /* Test that the 'changed' signal is properly fired */ gboolean event_received; static void test_changed_signal_cb (WockyPepService *pep, WockyBareContact *contact, WockyStanza *stanza, WockyNode *item, test_data_t *test) { const gchar *id = wocky_node_get_attribute ( wocky_stanza_get_top_node (stanza), "id"); g_assert_cmpstr (wocky_bare_contact_get_jid (contact), ==, "alice@example.org"); /* the id happens to hold the number of children; we expect to get the * first one if there is more than one. */ if (wocky_strdiff (id, "0")) { g_assert (item != NULL); g_assert_cmpstr (item->name, ==, "item"); g_assert_cmpstr (wocky_node_get_attribute (item, "id"), ==, "1"); } else { g_assert (item == NULL); } test->outstanding--; g_main_loop_quit (test->loop); event_received = TRUE; } static void send_pep_event (WockyPorter *porter, const gchar *node, guint n_items) { WockyStanza *stanza; WockyNode *items; gchar *n_items_str = g_strdup_printf ("%d", n_items); guint i; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, "alice@example.org", NULL, /* This is a hint for test_changed_signal_cb. */ '@', "id", n_items_str, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", node, '*', &items, ')', ')', NULL); for (i = 1; i <= n_items; i++) { gchar *i_str = g_strdup_printf ("%d", i); wocky_node_add_build (items, '(', "item", '@', "id", i_str, '(', "payload", ')', ')', NULL); g_free (i_str); } wocky_porter_send (porter, stanza); g_object_unref (stanza); g_free (n_items_str); } static void test_changed_signal (void) { test_data_t *test = setup_test (); WockyPepService *pep; pep = wocky_pep_service_new (TEST_NODE1, FALSE); test_open_both_connections (test); g_signal_connect (pep, "changed", G_CALLBACK (test_changed_signal_cb), test); wocky_pep_service_start (pep, test->session_out); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* send events on the right node */ event_received = FALSE; send_pep_event (test->sched_in, TEST_NODE1, 0); send_pep_event (test->sched_in, TEST_NODE1, 1); send_pep_event (test->sched_in, TEST_NODE1, 2); test->outstanding += 3; test_wait_pending (test); g_assert (event_received); event_received = FALSE; /* send event on the wrong node */ send_pep_event (test->sched_in, TEST_NODE2, 1); g_object_unref (pep); /* send event to the right node after the PEP service has been destroyed */ send_pep_event (test->sched_in, TEST_NODE1, 1); test_close_both_porters (test); teardown_test (test); g_assert (!event_received); } /* Test wocky_pep_service_get_async */ static void test_send_query_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyNode *item; WockyStanzaType type; WockyStanzaSubType sub_type; reply = wocky_pep_service_get_finish (WOCKY_PEP_SERVICE (source_object), res, &item, NULL); g_assert (reply != NULL); wocky_stanza_get_type_info (reply, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_RESULT); g_assert (item != NULL); g_assert_cmpstr (item->name, ==, "item"); g_assert_cmpstr (wocky_node_get_attribute (item, "id"), ==, "1"); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); } static gboolean test_send_query_stanza_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "items", '@', "node", "node1", '(', "item", '@', "id", "1", '(', "payload", ')', ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_send_query_failed_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_pep_service_get_finish (WOCKY_PEP_SERVICE (source_object), res, NULL, &error); g_assert (reply == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_clear_error (&error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_get (void) { test_data_t *test = setup_test (); WockyPepService *pep; WockyContactFactory *contact_factory; WockyBareContact *contact; guint handler_id; pep = wocky_pep_service_new (TEST_NODE1, FALSE); test_open_both_connections (test); wocky_pep_service_start (pep, test->session_in); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); handler_id = wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_send_query_stanza_received_cb, test, NULL); contact_factory = wocky_session_get_contact_factory (test->session_in); contact = wocky_contact_factory_ensure_bare_contact (contact_factory, "juliet@example.org"); wocky_pep_service_get_async (pep, contact, NULL, test_send_query_cb, test); test->outstanding += 2; test_wait_pending (test); /* Regression test for a bug where wocky_pep_service_get_async's callback * would crash if sending the IQ failed. */ wocky_porter_unregister_handler (test->sched_out, handler_id); wocky_pep_service_get_async (pep, contact, NULL, test_send_query_failed_cb, test); test->outstanding += 1; test_close_both_porters (test); g_object_unref (contact); g_object_unref (pep); teardown_test (test); } /* Test wocky_pep_service_make_publish_stanza */ static void test_make_publish_stanza (void) { WockyPepService *pep; WockyStanza *stanza; WockyNode *item = NULL, *n; WockyStanzaType type; WockyStanzaSubType sub_type; pep = wocky_pep_service_new (TEST_NODE1, FALSE); stanza = wocky_pep_service_make_publish_stanza (pep, &item); g_assert (stanza != NULL); wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_SET); n = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "pubsub", WOCKY_XMPP_NS_PUBSUB); g_assert (n != NULL); n = wocky_node_get_child (n, "publish"); g_assert (n != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (n, "node"), TEST_NODE1)); n = wocky_node_get_child (n, "item"); g_assert (n != NULL); g_assert (n == item); g_object_unref (stanza); g_object_unref (pep); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/pep-service/instantiation", test_instantiation); g_test_add_func ("/pep-service/changed-signal", test_changed_signal); g_test_add_func ("/pep-service/get", test_get); g_test_add_func ("/pep-service/make-publish-stanza", test_make_publish_stanza); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-sasl-auth-server.h0000644000175000017500000000656412735676345027455 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-sasl-auth-server.h - Header for TestSaslAuthServer * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TEST_SASL_AUTH_SERVER_H__ #define __TEST_SASL_AUTH_SERVER_H__ #include #include #include G_BEGIN_DECLS typedef enum { SERVER_PROBLEM_NO_PROBLEM, SERVER_PROBLEM_NO_SASL, SERVER_PROBLEM_NO_MECHANISMS, SERVER_PROBLEM_INVALID_USERNAME, SERVER_PROBLEM_INVALID_PASSWORD, SERVER_PROBLEM_REQUIRE_GOOGLE_JDD, SERVER_PROBLEM_DISLIKE_GOOGLE_JDD, SERVER_PROBLEM_SPACE_CHALLENGE, SERVER_PROBLEM_SLASH_CHALLENGE, /* Not actually a problem, but let the server choose to put * ``additional data with success'' in a success stanza. */ SERVER_PROBLEM_FINAL_DATA_IN_SUCCESS, } ServerProblem; typedef struct _TestSaslAuthServer TestSaslAuthServer; typedef struct _TestSaslAuthServerClass TestSaslAuthServerClass; typedef struct _TestSaslAuthServerPrivate TestSaslAuthServerPrivate; struct _TestSaslAuthServerClass { GObjectClass parent_class; }; struct _TestSaslAuthServer { GObject parent; TestSaslAuthServerPrivate *priv; }; GType test_sasl_auth_server_get_type (void); /* TYPE MACROS */ #define TEST_TYPE_SASL_AUTH_SERVER \ (test_sasl_auth_server_get_type ()) #define TEST_SASL_AUTH_SERVER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_SASL_AUTH_SERVER, \ TestSaslAuthServer)) #define TEST_SASL_AUTH_SERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TEST_TYPE_SASL_AUTH_SERVER, \ TestSaslAuthServerClass)) #define TEST_IS_SASL_AUTH_SERVER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TEST_TYPE_SASL_AUTH_SERVER)) #define TEST_IS_SASL_AUTH_SERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TEST_TYPE_SASL_AUTH_SERVER)) #define TEST_SASL_AUTH_SERVER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_SASL_AUTH_SERVER, \ TestSaslAuthServerClass)) void test_sasl_auth_server_auth_async (GObject *obj, WockyXmppConnection *conn, WockyStanza *auth, GAsyncReadyCallback cb, GCancellable *cancellable, gpointer data); gboolean test_sasl_auth_server_auth_finish (TestSaslAuthServer *self, GAsyncResult *res, GError **error); const gchar *test_sasl_auth_server_get_selected_mech (TestSaslAuthServer *self); TestSaslAuthServer * test_sasl_auth_server_new (GIOStream *stream, gchar *mech, const gchar *user, const gchar *password, const gchar *servername, ServerProblem problem, gboolean start); void test_sasl_auth_server_stop (TestSaslAuthServer *self); gint test_sasl_auth_server_set_mechs (GObject *obj, WockyStanza *feat); G_END_DECLS #endif /* #ifndef __TEST_SASL_AUTH_SERVER_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-http-proxy-test.c0000644000175000017500000002321313012550005026334 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-test-stream.h" #include "wocky-test-helper.h" #include #include typedef enum { DOMAIN_NONE = 0, DOMAIN_G_IO_ERROR } HttpErrorDomain; typedef struct { const gchar *path; const gchar *reply; HttpErrorDomain domain; gint code; const gchar *username; const gchar *password; } HttpTestCase; typedef struct { GMainLoop *mainloop; GMainLoop *thread_mainloop; GCancellable *cancellable; GCancellable *thread_cancellable; GThread *thread; GSocketListener *listener; guint16 port; const HttpTestCase *test_case; } HttpTestData; static HttpTestCase test_cases[] = { { "/http-proxy/close-by-peer", "", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_FAILED }, { "/http-proxy/bad-reply", "BAD REPLY", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_FAILED }, { "/http-proxy/very-short-reply", "HTTP/1.\r\n\r\n", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_FAILED }, { "/http-proxy/short-reply", "HTTP/1.0\r\n\r\n", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_FAILED }, { "/http-proxy/http-404", "HTTP/1.0 404 Not Found\r\n" "Content-Type: text/html; charset=UTF-8\r\n" "Content-Length: 27\r\n" "\r\n" "

Hello

", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_FAILED }, { "/http-proxy/need-authentication", "HTTP/1.0 407 Proxy Authentication Required\r\n" "Content-Type: text/html; charset=UTF-8\r\n" "Content-Length: 27\r\n" "\r\n" "

Hello

", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_NEED_AUTH }, { "/http-proxy/success", "HTTP/1.0 200 OK\r\n" "\r\n", DOMAIN_NONE, 0 }, { "/http-proxy/authentication-failed", "HTTP/1.0 407 Proxy Authentication Required\r\n" "Content-Type: text/html; charset=UTF-8\r\n" "Content-Length: 27\r\n" "\r\n" "

Hello

", DOMAIN_G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED, "username", "bad-password" }, { "/http-proxy/authenticated", "HTTP/1.0 200 OK\r\n" "\r\n", DOMAIN_NONE, 0, "Aladdin", "open sesame"}, }; static HttpTestData * tearup (const HttpTestCase *test_case) { HttpTestData *data; data = g_new0 (HttpTestData, 1); data->mainloop = g_main_loop_new (NULL, FALSE); data->cancellable = g_cancellable_new (); data->thread_cancellable = g_cancellable_new (); data->listener = g_socket_listener_new (); data->port = g_socket_listener_add_any_inet_port (data->listener, NULL, NULL); g_assert_cmpuint (data->port, !=, 0); data->test_case = test_case; return data; } static void run_in_thread (HttpTestData *data, GThreadFunc func) { data->thread = g_thread_new ("server_thread", func, data); g_assert (data->thread != NULL); } static gboolean tear_down_idle_cb (gpointer user_data) { HttpTestData *data = user_data; g_main_loop_quit (data->mainloop); return FALSE; } static void teardown (HttpTestData *data) { if (!g_cancellable_is_cancelled (data->cancellable)) g_cancellable_cancel (data->cancellable); if (!g_cancellable_is_cancelled (data->thread_cancellable)) g_cancellable_cancel (data->thread_cancellable); if (data->thread) g_thread_join (data->thread); if (g_main_loop_is_running (data->mainloop)) g_main_loop_quit (data->mainloop); g_idle_add_full (G_PRIORITY_LOW, tear_down_idle_cb, data, NULL); g_main_loop_run (data->mainloop); g_object_unref (data->cancellable); g_object_unref (data->thread_cancellable); g_object_unref (data->listener); g_main_loop_unref (data->mainloop); g_free (data); } static gboolean str_has_prefix_case (const gchar *str, const gchar *prefix) { return g_ascii_strncasecmp (prefix, str, strlen (prefix)) == 0; } static void test_http_proxy_instantiation (void) { GProxy *proxy; proxy = g_proxy_get_default_for_protocol ("http"); g_assert (G_IS_PROXY (proxy)); g_object_unref (proxy); } static gpointer server_thread (gpointer user_data) { HttpTestData *data = user_data; GSocketConnection *conn; GDataInputStream *data_in; GOutputStream *out; gchar *buffer; gint has_host = 0; gint has_user_agent = 0; gint has_cred = 0; conn = g_socket_listener_accept (data->listener, NULL, data->thread_cancellable, NULL); g_assert (conn != NULL); data_in = g_data_input_stream_new ( g_io_stream_get_input_stream (G_IO_STREAM (conn))); g_data_input_stream_set_newline_type (data_in, G_DATA_STREAM_NEWLINE_TYPE_CR_LF); buffer = g_data_input_stream_read_line (data_in, NULL, data->thread_cancellable, NULL); g_assert_cmpstr (buffer, ==, "CONNECT to:443 HTTP/1.0"); do { g_free (buffer); buffer = g_data_input_stream_read_line (data_in, NULL, data->thread_cancellable, NULL); g_assert (buffer != NULL); if (str_has_prefix_case (buffer, "Host:")) { has_host++; g_assert_cmpstr (buffer, ==, "Host: to:443"); } else if (str_has_prefix_case (buffer, "User-Agent:")) has_user_agent++; else if (str_has_prefix_case (buffer, "Proxy-Authorization:")) { gchar *cred; gchar *base64_cred; const gchar *received_cred; has_cred++; g_assert (data->test_case->username != NULL); g_assert (data->test_case->password != NULL); cred = g_strdup_printf ("%s:%s", data->test_case->username, data->test_case->password); base64_cred = g_base64_encode ((guchar *) cred, strlen (cred)); g_free (cred); received_cred = buffer + 20; while (*received_cred == ' ') received_cred++; g_assert (str_has_prefix_case (received_cred, "Basic")); received_cred += 5; while (*received_cred == ' ') received_cred++; g_assert_cmpstr (base64_cred, ==, received_cred); g_free (base64_cred); } } while (buffer[0] != '\0'); g_assert_cmpuint (has_host, ==, 1); g_assert_cmpuint (has_user_agent, ==, 1); if (data->test_case->username != NULL) g_assert_cmpuint (has_cred, ==, 1); else g_assert_cmpuint (has_cred, ==, 0); g_free (buffer); out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); g_assert (g_output_stream_write_all (out, data->test_case->reply, strlen (data->test_case->reply), NULL, data->thread_cancellable, NULL)); g_object_unref (data_in); g_object_unref (conn); return NULL; } static GQuark get_error_domain (HttpErrorDomain id) { GQuark domain = 0; switch (id) { case DOMAIN_G_IO_ERROR: domain = G_IO_ERROR; break; default: g_assert_not_reached (); } return domain; } static GSocketAddress * create_proxy_address (HttpTestData *data) { GSocketAddress *proxy_address; GInetAddress *inet_address; inet_address = g_inet_address_new_loopback (G_SOCKET_FAMILY_IPV4); proxy_address = g_proxy_address_new (inet_address, data->port, "http", "to", 443, data->test_case->username, data->test_case->password); g_object_unref (inet_address); return proxy_address; } static void check_result (const HttpTestCase *test_case, GSocketConnection *connection, GError *error) { if (test_case->domain != DOMAIN_NONE) { g_assert_error (error, get_error_domain (test_case->domain), test_case->code); g_error_free (error); } else { g_assert_no_error (error); g_object_unref (connection); } } static void test_http_proxy_with_data (gconstpointer user_data) { const HttpTestCase *test_case = user_data; HttpTestData *data; GSocketClient *client; GSocketAddress *proxy_address; GSocketConnection *connection; GError *error = NULL; data = tearup (test_case); run_in_thread (data, server_thread); client = g_socket_client_new (); proxy_address = create_proxy_address (data); connection = g_socket_client_connect (client, G_SOCKET_CONNECTABLE (proxy_address), data->cancellable, &error); g_object_unref (proxy_address); g_object_unref (client); check_result (test_case, connection, error); teardown (data); } static void connect_cb (GObject *source, GAsyncResult *result, gpointer user_data) { HttpTestData *data = user_data; GSocketConnection *connection; GError *error = NULL; connection = g_socket_client_connect_finish (G_SOCKET_CLIENT (source), result, &error); check_result (data->test_case, connection, error); g_main_loop_quit (data->mainloop); } static void test_http_proxy_with_data_async (gconstpointer user_data) { const HttpTestCase *test_case = user_data; HttpTestData *data; GSocketClient *client; GSocketAddress *proxy_address; data = tearup (test_case); run_in_thread (data, server_thread); client = g_socket_client_new (); proxy_address = create_proxy_address (data); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (proxy_address), data->cancellable, connect_cb, data); g_object_unref (client); g_object_unref (proxy_address); g_main_loop_run (data->mainloop); teardown (data); } int main (int argc, char **argv) { int result; guint i; test_init (argc, argv); g_test_add_func ("/http-proxy/instantiation", test_http_proxy_instantiation); for (i = 0; i < G_N_ELEMENTS (test_cases); i++) { gchar *async_path; g_test_add_data_func (test_cases[i].path, test_cases + i, test_http_proxy_with_data); async_path = g_strdup_printf ("%s-async", test_cases[i].path); g_test_add_data_func (async_path, test_cases + i, test_http_proxy_with_data_async); g_free (async_path); } result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-tls-test.c0000644000175000017500000002202213010442717025005 0ustar00gkiagiagkiagia00000000000000#include #include #include #include "config.h" #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" #define BUF_SIZE 8192 #define TEST_SSL_DATA_A "badgerbadgerbadger" #define TEST_SSL_DATA_B "mushroom, mushroom" #define TEST_SSL_DATA_LEN sizeof (TEST_SSL_DATA_A) static const gchar *test_data[] = { TEST_SSL_DATA_A, TEST_SSL_DATA_B, NULL }; typedef struct { test_data_t *test; char cli_buf[BUF_SIZE]; char srv_buf[BUF_SIZE]; char *cli_send; gsize cli_send_len; gsize cli_sent; WockyTLSConnection *client; WockyTLSConnection *server; GString *cli_data; GString *srv_data; guint read_op_count; guint write_op_count; gboolean in_read; } ssl_test_t; /* ************************************************************************ */ /* client callbacks */ static void client_write_cb (GObject *source, GAsyncResult *result, gpointer data) { GOutputStream *output = G_OUTPUT_STREAM (source); ssl_test_t *ssl_test = data; GError *error = NULL; gsize ret; ret = g_output_stream_write_finish (output, result, &error); g_assert_cmpint (ret, <=, ssl_test->cli_send_len - ssl_test->cli_sent); g_assert_no_error (error); ssl_test->cli_sent += ret; if (ssl_test->cli_sent == ssl_test->cli_send_len) { ssl_test->test->outstanding--; g_main_loop_quit (ssl_test->test->loop); return; } g_output_stream_write_async (output, ssl_test->cli_send + ssl_test->cli_sent, ssl_test->cli_send_len - ssl_test->cli_sent, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, client_write_cb, data); } static void client_read_cb (GObject *source, GAsyncResult *result, gpointer data) { GInputStream *input = G_INPUT_STREAM (source); ssl_test_t *ssl_test = data; GError *error = NULL; gssize count = g_input_stream_read_finish (input, result, &error); g_assert (!ssl_test->in_read); g_assert_no_error (error); g_assert_cmpint (count, ==, TEST_SSL_DATA_LEN); ssl_test->read_op_count++; g_string_append_len (ssl_test->cli_data, ssl_test->cli_buf, count); switch (ssl_test->read_op_count) { case 1: /* we've read at least one ssl record at this point, combine the others */ wocky_test_stream_set_mode (ssl_test->test->stream->stream0_input, WOCK_TEST_STREAM_READ_COMBINE); break; case 2: #ifdef USING_OPENSSL /* Our openssl backend should have read all ssl records by now and * thus shouldn't request more data from the input stream. The GnuTLS * backend requests more granularily what it needs so will still read * from the input stream */ wocky_test_input_stream_set_read_error ( ssl_test->test->stream->stream0_input); #endif /* USING_OPENSSL */ break; case 3: case 4: break; case 5: { GIOStream *io = G_IO_STREAM (ssl_test->client); GOutputStream *output = g_io_stream_get_output_stream (io); g_output_stream_write_async (output, ssl_test->cli_send, ssl_test->cli_send_len, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, client_write_cb, data); return; } default: g_error ("Read too many records: test broken?"); } ssl_test->in_read = TRUE; g_input_stream_read_async (input, ssl_test->cli_buf, BUF_SIZE, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, client_read_cb, data); ssl_test->in_read = FALSE; } static void client_handshake_cb (GObject *source, GAsyncResult *result, gpointer data) { GInputStream *input; WockyTLSSession *session = WOCKY_TLS_SESSION (source); ssl_test_t *ssl_test = data; ssl_test->client = wocky_tls_session_handshake_finish (session, result, NULL); input = g_io_stream_get_input_stream (G_IO_STREAM (ssl_test->client)); ssl_test->in_read = TRUE; g_input_stream_read_async (input, ssl_test->cli_buf, BUF_SIZE, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, client_read_cb, data); ssl_test->in_read = FALSE; } /* ************************************************************************ */ /* server callbacks */ static void server_read_cb (GObject *source, GAsyncResult *result, gpointer data) { GInputStream *input = G_INPUT_STREAM (source); ssl_test_t *ssl_test = data; gssize count = g_input_stream_read_finish (input, result, NULL); g_string_append_len (ssl_test->srv_data, ssl_test->srv_buf, count); if (ssl_test->srv_data->len < ssl_test->cli_send_len) { g_input_stream_read_async (input, ssl_test->srv_buf, BUF_SIZE, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, server_read_cb, data); } else { ssl_test->test->outstanding--; g_main_loop_quit (ssl_test->test->loop); } } static void server_write_cb (GObject *source, GAsyncResult *result, gpointer data) { ssl_test_t *ssl_test = data; gsize written; GOutputStream *output = G_OUTPUT_STREAM (source); GIOStream *io = G_IO_STREAM (ssl_test->server); GInputStream *input = g_io_stream_get_input_stream (io); written = g_output_stream_write_finish (output, result, NULL); g_assert_cmpint (written, ==, TEST_SSL_DATA_LEN); ssl_test->write_op_count++; if (ssl_test->write_op_count < 5) { const char *payload = test_data[ssl_test->write_op_count & 1]; g_output_stream_write_async (output, payload, TEST_SSL_DATA_LEN, G_PRIORITY_LOW, ssl_test->test->cancellable, server_write_cb, data); } else { wocky_test_stream_cork (ssl_test->test->stream->stream0_input, FALSE); g_input_stream_read_async (input, ssl_test->srv_buf, BUF_SIZE, G_PRIORITY_DEFAULT, ssl_test->test->cancellable, server_read_cb, data); } } static void server_handshake_cb (GObject *source, GAsyncResult *result, gpointer data) { GOutputStream *output; WockyTLSSession *session = WOCKY_TLS_SESSION (source); ssl_test_t *ssl_test = data; GError *error = NULL; ssl_test->server = wocky_tls_session_handshake_finish (session, result, &error); g_assert_no_error (error); g_assert (ssl_test->server != NULL); output = g_io_stream_get_output_stream (G_IO_STREAM (ssl_test->server)); /* cork the client reading stream */ wocky_test_stream_cork (ssl_test->test->stream->stream0_input, TRUE); g_output_stream_write_async (output, TEST_SSL_DATA_A, TEST_SSL_DATA_LEN, G_PRIORITY_LOW, ssl_test->test->cancellable, server_write_cb, data); } /* ************************************************************************ */ /* test(s) */ static void setup_ssl_test (ssl_test_t *ssl_test, test_data_t *test) { guint x; /* the tests currently rely on all the chunks being the same size */ /* note that we include the terminating \0 in the payload */ for (x = 0; test_data[x] != NULL; x++) g_assert (strlen (test_data[x]) == (TEST_SSL_DATA_LEN - 1)); ssl_test->test = test; ssl_test->cli_data = g_string_new (""); ssl_test->srv_data = g_string_new (""); } static void teardown_ssl_test (ssl_test_t *ssl_test) { g_free (ssl_test->cli_send); g_string_free (ssl_test->cli_data, TRUE); g_string_free (ssl_test->srv_data, TRUE); g_io_stream_close (G_IO_STREAM (ssl_test->server), NULL, NULL); g_io_stream_close (G_IO_STREAM (ssl_test->client), NULL, NULL); g_object_unref (ssl_test->server); g_object_unref (ssl_test->client); } static void test_tls_handshake_rw (void) { ssl_test_t ssl_test = { NULL, } ; test_data_t *test = setup_test (); WockyTLSSession *client = wocky_tls_session_new (test->stream->stream0); WockyTLSSession *server = wocky_tls_session_server_new ( test->stream->stream1, 1024, TLS_SERVER_KEY_FILE, TLS_SERVER_CRT_FILE); gsize expected = TEST_SSL_DATA_LEN * 5; gchar *target = TEST_SSL_DATA_A "\0" TEST_SSL_DATA_B "\0" TEST_SSL_DATA_A "\0" TEST_SSL_DATA_B "\0" TEST_SSL_DATA_A; ssl_test.cli_send = g_malloc0 (32 * 1024); while (ssl_test.cli_send_len + 4 < 32 * 1024) { guint32 r = g_random_int (); memcpy (ssl_test.cli_send + ssl_test.cli_send_len, &r, 4); ssl_test.cli_send_len += 4; } setup_ssl_test (&ssl_test, test); wocky_tls_session_handshake_async (client, G_PRIORITY_DEFAULT, test->cancellable, client_handshake_cb, &ssl_test); test->outstanding += 1; wocky_tls_session_handshake_async (server, G_PRIORITY_DEFAULT, test->cancellable, server_handshake_cb, &ssl_test); test->outstanding += 1; test_wait_pending (test); g_assert_cmpint (test->outstanding, ==, 0); g_assert_cmpint (ssl_test.cli_data->len, ==, expected); g_assert_cmpint (ssl_test.srv_data->len, ==, ssl_test.cli_send_len); g_assert (!memcmp (ssl_test.cli_data->str, target, expected)); g_assert (!memcmp (ssl_test.srv_data->str, ssl_test.cli_send, ssl_test.cli_send_len)); teardown_test (test); teardown_ssl_test (&ssl_test); g_object_unref (client); g_object_unref (server); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/tls/handshake+rw", test_tls_handshake_rw); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-helper.c0000644000175000017500000001645213012550005025464 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "wocky-test-helper.h" #include "wocky-test-stream.h" #define TIMEOUT 10 gboolean test_timeout_cb (gpointer data) { g_test_message ("Timeout reached :("); g_assert_not_reached (); return FALSE; } static test_data_t * setup_test_full (guint timeout, const gchar *in_jid, const gchar *out_jid) { test_data_t *data; data = g_new0 (test_data_t, 1); data->loop = g_main_loop_new (NULL, FALSE); data->stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); data->in = wocky_xmpp_connection_new (data->stream->stream0); data->out = wocky_xmpp_connection_new (data->stream->stream1); data->session_in = wocky_session_new_with_connection (data->in, in_jid); data->session_out = wocky_session_new_with_connection (data->out, out_jid); data->sched_in = wocky_session_get_porter (data->session_in); data->sched_out = wocky_session_get_porter (data->session_out); data->expected_stanzas = g_queue_new (); data->cancellable = g_cancellable_new (); data->timeout_id = g_timeout_add_seconds (timeout, test_timeout_cb, NULL); return data; } test_data_t * setup_test_with_jids (const gchar *in_jid, const gchar *out_jid) { return setup_test_full (TIMEOUT, in_jid, out_jid); } test_data_t * setup_test_with_timeout (guint timeout) { return setup_test_full (timeout, "example.com", "example.com"); } test_data_t * setup_test (void) { return setup_test_full (TIMEOUT, "example.com", "example.com"); } void teardown_test (test_data_t *data) { g_main_loop_unref (data->loop); g_object_unref (data->stream); g_object_unref (data->in); g_object_unref (data->out); if (data->session_in != NULL) g_object_unref (data->session_in); if (data->session_out != NULL) g_object_unref (data->session_out); g_object_unref (data->cancellable); g_source_remove (data->timeout_id); /* All the stanzas should have been received */ g_assert (g_queue_get_length (data->expected_stanzas) == 0); g_queue_free (data->expected_stanzas); g_free (data); } void test_wait_pending (test_data_t *test) { while (test->outstanding > 0) g_main_loop_run (test->loop); } static void send_received_open_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); test_data_t *d = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_recv_open_finish (conn, res, NULL, NULL, NULL, NULL, NULL, NULL)); d->outstanding--; g_main_loop_quit (d->loop); } static void send_open_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; WockyXmppConnection *conn; g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); /* The other connection has to receive the opening */ if (WOCKY_XMPP_CONNECTION (source) == data->in) conn = data->out; else conn = data->in; wocky_xmpp_connection_recv_open_async (conn, NULL, send_received_open_cb, user_data); } static void open_connection (test_data_t *test, WockyXmppConnection *connection) { wocky_xmpp_connection_send_open_async (connection, NULL, NULL, NULL, NULL, NULL, NULL, send_open_cb, test); test->outstanding++; test_wait_pending (test); } /* Open XMPP the 'in' connection */ void test_open_connection (test_data_t *test) { open_connection (test, test->in); } /* Open both XMPP connections */ void test_open_both_connections (test_data_t *test) { open_connection (test, test->in); open_connection (test, test->out); } static void wait_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; WockyStanza *s; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (WOCKY_XMPP_CONNECTION (source), res, &error); g_assert (s == NULL); /* connection has been disconnected */ g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); data->outstanding--; g_main_loop_quit (data->loop); } static void close_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } /* Close XMPP connections on both sides */ void test_close_connection (test_data_t *test) { wocky_xmpp_connection_recv_stanza_async (test->out, NULL, wait_close_cb, test); test->outstanding++; /* Close the connection */ wocky_xmpp_connection_send_close_async ( WOCKY_XMPP_CONNECTION (test->in), NULL, close_sent_cb, test); test->outstanding++; test_wait_pending (test); } static void sched_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; gboolean ret = wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error); g_assert_no_error (error); g_assert (ret); test->outstanding--; g_main_loop_quit (test->loop); } static void wait_sched_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); g_assert (s == NULL); /* connection has been disconnected */ g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); /* close on our side */ wocky_xmpp_connection_send_close_async (connection, NULL, close_sent_cb, test); /* Don't decrement test->outstanding as we are waiting for another * callback */ g_main_loop_quit (test->loop); } void test_close_porter (test_data_t *test) { /* close connections */ wocky_xmpp_connection_recv_stanza_async (test->in, NULL, wait_sched_close_cb, test); wocky_porter_close_async (test->sched_out, NULL, sched_close_cb, test); test->outstanding += 2; test_wait_pending (test); } void test_expected_stanza_received (test_data_t *test, WockyStanza *stanza) { WockyStanza *expected; expected = g_queue_pop_head (test->expected_stanzas); g_assert (expected != NULL); test_assert_nodes_equal (wocky_stanza_get_top_node (stanza), wocky_stanza_get_top_node (expected)); g_object_unref (expected); test->outstanding--; g_main_loop_quit (test->loop); } void test_close_both_porters (test_data_t *test) { wocky_porter_close_async (test->sched_out, NULL, sched_close_cb, test); wocky_porter_close_async (test->sched_in, NULL, sched_close_cb, test); test->outstanding += 2; test_wait_pending (test); } void test_init (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); wocky_init (); } void test_deinit (void) { wocky_deinit (); } static gboolean cancel_in_idle_cb (gpointer cancellable) { g_cancellable_cancel (cancellable); return FALSE; } void test_cancel_in_idle (GCancellable *cancellable) { g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, cancel_in_idle_cb, g_object_ref (cancellable), g_object_unref); } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-xmpp-readwrite-test.c0000644000175000017500000001276712735676345027215 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" #define TO "example.net" #define FROM "julliet@example.com" #define XMPP_VERSION "1.0" #define LANG "en" #define DUMMY_NS "urn:wocky:test:blah:blah:blah" static WockyStanza * create_stanza (void) { WockyStanza *stanza; WockyNode *html; WockyNode *head; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", '(', "html", ':', "http://www.w3.org/1999/xhtml", '(', "body", '$', "Art thou not Romeo, and a Montague?", ')', ')', NULL); html = wocky_node_get_child (wocky_stanza_get_top_node (stanza), "html"); head = wocky_node_add_child (html, "head"); wocky_node_set_attribute_ns (head, "rev", "0xbad1dea", DUMMY_NS); return stanza; } static void test_readwrite (void) { WockyXmppReader *reader; WockyXmppWriter *writer; WockyStanza *received = NULL, *sent; const guint8 *data; gsize length; gchar *to, *from, *version, *lang; int i; writer = wocky_xmpp_writer_new (); reader = wocky_xmpp_reader_new (); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_INITIAL); wocky_xmpp_writer_stream_open (writer, TO, FROM, XMPP_VERSION, LANG, NULL, &data, &length); wocky_xmpp_reader_push (reader, data, length); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); g_object_get (reader, "to", &to, "from", &from, "version", &version, "lang", &lang, NULL); g_assert (!wocky_strdiff (to, TO)); g_assert (!wocky_strdiff (from, FROM)); g_assert (!wocky_strdiff (version, XMPP_VERSION)); g_assert (!wocky_strdiff (lang, LANG)); g_free (to); g_free (from); g_free (version); g_free (lang); sent = create_stanza (); for (i = 0; i < 3 ; i++) { WockyNode *html; WockyNode *head; const gchar *attr_recv = NULL; const gchar *attr_send = NULL; const gchar *attr_none = NULL; g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_writer_write_stanza (writer, sent, &data, &length); wocky_xmpp_reader_push (reader, data, length); received = wocky_xmpp_reader_pop_stanza (reader); g_assert (received != NULL); test_assert_stanzas_equal (sent, received); html = wocky_node_get_child (wocky_stanza_get_top_node (received), "html"); head = wocky_node_get_child (html, "head"); attr_recv = wocky_node_get_attribute_ns (head, "rev", DUMMY_NS); attr_none = wocky_node_get_attribute_ns (head, "rev", DUMMY_NS ":x"); html = wocky_node_get_child (wocky_stanza_get_top_node (sent), "html"); head = wocky_node_get_child (html, "head"); attr_send = wocky_node_get_attribute_ns (head, "rev", DUMMY_NS); g_assert (attr_none == NULL); g_assert (attr_recv != NULL); g_assert (attr_send != NULL); g_assert (!strcmp (attr_send, attr_recv)); g_object_unref (received); /* No more stanzas in the queue */ received = wocky_xmpp_reader_pop_stanza (reader); g_assert (received == NULL); } wocky_xmpp_writer_write_stanza (writer, sent, &data, &length); wocky_xmpp_reader_push (reader, data, length); wocky_xmpp_writer_stream_close (writer, &data, &length); wocky_xmpp_reader_push (reader, data, length); /* Stream state should stay open until we popped the last stanza */ g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); received = wocky_xmpp_reader_pop_stanza (reader); g_assert (received != NULL); test_assert_stanzas_equal (sent, received); g_object_unref (received); /* Last stanza pop, stream should be closed */ g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); /* No more stanzas in the queue */ received = wocky_xmpp_reader_pop_stanza (reader); g_assert (received == NULL); g_object_unref (sent); g_object_unref (reader); g_object_unref (writer); } static void test_readwrite_nostream (void) { WockyXmppReader *reader; WockyXmppWriter *writer; WockyStanza *received = NULL, *sent; const guint8 *data; gsize length; int i; writer = wocky_xmpp_writer_new_no_stream (); reader = wocky_xmpp_reader_new_no_stream (); sent = create_stanza (); for (i = 0 ; i < 3 ; i++) { g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_writer_write_stanza (writer, sent, &data, &length); wocky_xmpp_reader_push (reader, data, length); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); received = wocky_xmpp_reader_pop_stanza (reader); g_assert (received != NULL); test_assert_stanzas_equal (sent, received); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); wocky_xmpp_reader_reset (reader); g_object_unref (received); } g_object_unref (sent); g_object_unref (reader); g_object_unref (writer); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-readwrite/readwrite", test_readwrite); g_test_add_func ("/xmpp-readwrite/readwrite-nostream", test_readwrite_nostream); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/0000755000175000017500000000000013012562226023052 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/tls-key.pem0000644000175000017500000000321312735676345025167 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAwt9AF1py3GpF66t6xyH8vtLu8zQJnUWMPPDCAO8KWWeC8TBz KruGJ58srKETSPcG5Qj5CdvV8gZoXy3PRpp55eqYc39OJ/cfd2fLfSR558Kqic3b cX7h7AFmv/th3t7jcVjC/nVMvzgeYmsz3gsCrasJoee6CxSx5Bfg4Ya8HlJKEAw5 yf9cU9Gx5nbJUPapzCMYYw1KGfU5AJPvD6bKB2z3JX6+srZwoxnyzqAPb1noT6JE w70D0Jl3OdryBTafAN4dOY3qdwwWM5BvliXCUTYcsQtHcxasqxSVtlzLQrNKdXD2 h4F1TwnuInFy2OPHoVWhbwUdNit41UO1pHrc8QIDAQABAoIBAC0rgHipT4yF2bU5 51i3KRW2YQrgmgXpdAtAJ0f+IKD+nFx5xYg3NW6Dt+A/6e90yxVV0hwV5+6Uy6ac QLp13iGMElBbRut+nb2YwpM8XEF7XvpYTDBvn8CLxpxjkZkOgxvn3jMLT4HXaTuY 68nhNXq59Z6gzv/4iQ989XRxPbOtKWI1m96ZTFstkG8TJjaO9AnDxR2sEGHQ+rhP IRMbHLagY1qA0OxMhHCHMTwq/oVBR7xtgraLzeHnSg+Q4Z+hY+TSNmlmJxZINHTK c4kxVhAv2iGJaLDC7XviyKs/AMmoVfcSuG+BGDDOxhpOjx/G4ZzKmp2VVwNOEYk1 E2z7JH0CgYEAy+zMzpdgNIYIcKRAYqQITInsNnfGY+y2tOhUeNA558ZVoqt7Gf1Z TWegqyxtP71ZYkLqidNlJasgX2cU6aAkAHfO1EnpZiaX6WKSXGIfukLhH9Jwc6MW Xnnv0dZ9i83IL5sLIkAVb0TqqIIBvbxZjEYFSQVwpfG8BCvxNwQJ2U8CgYEA9KKh /DkoULrC8SIQ1TroOFcqLZPUFcCPHEfxHC+urWkYpRCrQ43jiZMCegPnKuUEQ9Nu 7UZqOrP0WYyEqQ3P+jC4I4xBozJigGttMTBnC2rm40PCPZcUz28Ja/Tos4oiEN6q qVG5/IlfcjuZZGsFIKbTCxM2uXwykmJDeAC91b8CgYAvbIWAsfF8pYMG9xvGFNGd QyH81MP9bwpabgFfC0W8IgK+TtTVCXcgKi5SQIWzogxMbrVukgvew7pGlYlmf4h/ 11zxP7MYv3bqnrLc6zDnty/1n5HpQo8sL31XNmOCBLw+Xfcr4u1ZMBTGVV2kS04j 8hC+l5ZH8TzBV5rEKZtEvwKBgQCtltmqyEQ7RMsfoDShmfM+R1u+i69q4ACs6L/G aG9izbiXKITeoshazt5rBmn6nhewqU+FPvoSPa+d+4AHFa4Gspt3XgcVbqNGzPPm e5ojF/BOQ76JRbOWngvpdxfIjrQtlFM1YrC+6hu4S2JFR0uUJ8yJh1DFvcOE7AVE GgKasQKBgET77FdaEiiajroe0CE8Ulmge4mpok7QQ81ag6gV6X3R7Ru20pg9iqGo U9OS2VgpqhoWz9PSoI/ZZghRYq0oQz9XDNLtZeGswFJgl4A/TrVs6gWcRxbVfAtg 9EmaJucDIxXNHqoD2yXj7XJPqDkNuD7rV7IOnrsg4La1N7SQpQk2 -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/new-cert.cfg0000644000175000017500000000414612735676345025307 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 003 # In how many days, counting from today, this certificate will expire. expiration_days = 7 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-0-crl.cfg0000644000175000017500000000514413012550005025025 0ustar00gkiagiagkiagia00000000000000# Update crl with certtool from gnutls-bin: # certtool --generate-crl \ # --load-ca-privkey ca-0-key.pem \ # --load-ca-certificate ca-0-cert.pem \ # --load-certificate rev-cert.pem \ # --template ca-0-crl.cfg \ # --outfile=ca-0-crl.pem # # When expired the test ssl tests fail with the error: # assertion failed (error == (wocky_auth_error, 6)): \ # SSL Certificate Verification Error for weasel-juice.org (wocky-tls-cert-error, 12) # # X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Confused" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. #dns_name = "www.none.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. #ip_address = "192.168.1.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client #tls_www_client # Whether this certificate will be used for a TLS server #tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. #encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key crl_next_update=1825 telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/tls-cert.cfg0000644000175000017500000000415212735676345025315 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 002 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-1-cert.pem0000644000175000017500000000257712735676345025267 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID4jCCAsygAwIBAgIBATALBgkqhkiG9w0BAQUwajELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEPMA0G A1UECBMGRm9sZGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwHhcNMDkw OTE4MTI1NTAzWhcNMzcwOTExMTI1NTAzWjBqMQswCQYDVQQGEwJVSzESMBAGA1UE ChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMQ8wDQYDVQQI EwZGb2xkZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAR8wCwYJKoZI hvcNAQEBA4IBDgAwggEJAoIBANRkYbvqWdla+zNLsftXYnaAD0agDbNl70y4yxNj V1DriZnNgjgWM8ZIgUdvFx+sA8wMoRFBLnXWYfzI+fHYFak+JqysvQmqTifXjKOs Q8Qdhb3hc2z10X7pobRK+oxE7VXDKKp5ou4f3wx1mvSTjB1oTr5o2ZnA5K/dLCM7 OmJ2C/Vj8z6l6HV41esPEYEZv+wfP/9z3xmNhNHcRWIeipEdDZDfXc0n22SeEnGS ZrSJDP9CZaJWAcLUhD5OEh+B3P/gfO9KDAN8PicSFFXj2X0t8incmz5fs6JosgEF o40D/R4xUIU562HEY/4uOM6N2nHM+MKgiDHEUh9s3lLmSB8CAwEAAaOBmTCBljAP BgNVHRMBAf8EBTADAQH/MCUGA1UdEQQeMByBGnBvc3RtYXN0ZXJAY29sbGFib3Jh LmNvLnVrMA8GA1UdDwEB/wQFAwMHBgAwHQYDVR0OBBYEFJdQenuGG7TS4L2av7+3 HHWC+uO7MCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8vdG1wL3dvY2t5LXRlc3Rz L2NybDALBgkqhkiG9w0BAQUDggEBAI2E2XcrxGbK+e9CdIxnrVWsh8HgcvBB/F4M 9jRUSjc3+w3E1zxlyfqGgSrzCJIpZbq7TQ7tTd1AV8j9hP4bP1r3BX6lhiXRtRKC thobgl1gXQtHkFhRpZrWe4vECqucHlznel9nhtLeY50ykt8ajvqxhthe/uabKNlo wC87Aq1ykigR1imLAY8UdvdXfvnfS1d5bF/k3TSw2YOZE4u8KToQf1LVPIG12OPi uStuIX9UYzSe8qOurrbjX+qehoubmrgLPGRKyNfIHsp7Arr/yUnjK5WtojTjcF85 nuP8FceVT5cvKYYPcBP6+YpAeeBJBiK95kzZGqgVewoLpKJht+0= -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-2-cert.cfg0000644000175000017500000000415312735676345025236 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Spindled" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. #dns_name = "www.none.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. #ip_address = "192.168.1.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not ca # Whether this certificate will be used for a TLS client #tls_www_client # Whether this certificate will be used for a TLS server #tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. #encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/wild-cert.cfg0000644000175000017500000000415412735676345025454 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 002 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "*.weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/wild-cert.pem0000644000175000017500000000303212735676345025470 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEVTCCAz2gAwIBAgIBAjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJVSzES MBAGA1UEChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMREw DwYDVQQIEwhDb25mdXNlZDEbMBkGA1UEAxMSV29ja3kgWE1QUCBMaWJyYXJ5MB4X DTEyMDUwODE3MjMxNFoXDTQwMDUwMTE3MjMxNFowaTELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEOMAwG A1UECBMFRGF6ZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAVIwDQYJ KoZIhvcNAQEBBQADggE/ADCCAToCggExAOLThsSZX/OomslmhfbLQ4QL+rLXfAVN /17JZR4WRYWeX6JZUHNSMYJ2B98JZtU/aRHdNV46or6y+0UD1AFC543wp9KetcLb YaX2Lsxc70soBtfb6L02TQbaMf2q84/YWxwO5xCEG10KGLRrgAbxqtMvYIdGXstH 9TDCr6La6Iqeoq7R/4dBgF30hVTsOnai7W+YQuPT18QlX1O7HdaffXDGZPC/+0PY zPdr2vHlSzifNOnttPZuo4ALBE3hhf4xnxh531wdVQhsS6WTX5RhFU9ox4WsG7Q3 y5tQJQ72ARPWqVZiK1WJIDuEVlpWOutEd1McI3GVMuZt80PZaJC3uJs7f6l5Xux9 yUrE5ztzg378w5Hi6Rt3C0rLjHzn78MiC6DGlcG5KMOB+O4wgFzHCScCAwEAAaOB 1DCB0TAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD ATAjBgNVHREEHDAaghIqLndlYXNlbC1qdWljZS5vcmeHBH8AAAEwDwYDVR0PAQH/ BAUDAwcgADAdBgNVHQ4EFgQUdpNYWe7MfIU0lyUQvttyQMxXTewwHwYDVR0jBBgw FoAUSTAmCIya1mnNi8DMDlwCjkofpowwLAYDVR0fBCUwIzAhoB+gHYYbZmlsZTov Ly90bXAvd29ja3ktdGVzdHMvY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQBd0wScKbZR +VhPij0/MWoQCwo7SpXyOCc1oTH5Cj2FKg70Al2fyfNXeQ94QybK2IFUuhuj6QuC 2kr11a8yUaYj5GfbMP0JHjJn8EKeRlxsv7q37nGkFcN4hweR3UfrY4dhEh195ZlM f3odQaKfyE4ST/SmVzGrzxwVupcuHcxCD4VowYMjO2xl2XeMjTMmkRhuW/kTcVHb xdhkLekyD5AEI3XndFKDRufFXg5nGmV7t5A/i1gKxGi/Co2YeTYd1XDspK0GSyX7 hl6RoZrGPkYF3mUmv6E/SiL8inCMfvt56aSQttX9zqB7zXOTXFnFOho+EYb6ZxvL liKZJQZ39OX7 -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-0-cert.cfg0000644000175000017500000000415312735676345025234 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Confused" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. #dns_name = "www.none.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. #ip_address = "192.168.1.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not ca # Whether this certificate will be used for a TLS client #tls_www_client # Whether this certificate will be used for a TLS server #tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. #encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/rev-cert.cfg0000644000175000017500000000415212735676345025307 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 013 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ss-key.pem0000644000175000017500000000321312735676345025012 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAuEDq6imjA3Glai3qXE7nmiHpj18fQthP+JShwyyIcTFfGh7+ DWE5RH63nasAQYYwfYxSKfB1TNdFLTOlwvm6qkZxfpCuzQQpu159+bzHuwvpns1S Q7ZXVbCLzi0OfYkIyovXr8oIFGfsaIYlyd0YSP4/5dal5boZfsAI9mNMv8LtP85B wUUZmkVopQhGGtaFXZ0ew+kbpvPiTJy4HyKjkGT9d83l0snZHqba7phGxZtH19Gc TXGkz3wOq1pViIZNAE676B6F+0YdlpztcLb3uEIB4LEOQhuquzT8FKLd3ThwjV5I CKNj0P6tOHmNw0mpJqZsWZcKA2XuvMekq8mAeQIDAQABAoIBAFnOUnG1v52jG9Pn 803wq5QFqXhXDb6f/kKT91BQ+WPqg4cQyhUtaSNIfCieO260gBgBd963NAUy+6Wv gcDJxcDOuuzMilalC84mnVJHQDab9M+RFeKpEmJSvaHNdj2buCw5AvTMjSmdCa5c jDiaygZx3iUhfRS+o0STRwsIlVT1UZDaDD0+FP7zUYr6D/zXSUBM8i9euOo8Od0b T908CGTJTO2M2DlOqzUUv7wcs2mb7kBTOwH8v6k56/It1F/rSif8tyGBDshna50c 42CUSZdVDEBOJFV+JkhqG5Da63is9bqT5teAb18CrqeNqKhKG5kcvaWG8QdrHfOQ MQlpHS0CgYEAwzyFSud8B71QMcnaJw0R5wB7cKNZx2X+nn+YrSGqCYhvfJFfzmx9 zV28u5k1ZtipXmpKgHRQR1+uo8lymnG9+d9pmd8M5j/rjnOYZpZCLfWSMXGeHih2 UiM1zFwDQJsu5JlCmGP1NInHep4rhAbU5mE2BBassJAb2bfqX8GTjXcCgYEA8ZlW 4mNQ2o5saBn9v1cOb/bmXuM0DWA2bZnDWhg7SZXSd6cgigClFJRMpsB6PXlFrZt0 JwCWKOtcoZhYDfFNbNojVrxMcDxNQ2fXGx8oQil5BiBvTBtjnWI98DdjsF4C/N7R MrScTkxBlC7ES4SK2VyaBPJDV+7Jx1K62eEhHY8CgYBpwWLCjFnXJ2lFTv3ooV/N Lamv/gwnwswFt0BQqCefOlSJuYWYH5SVpe0SAY+3wi0cg58PrfG+d8n11q1Jk8tA ixB81SH7pyxF4b/v8fyvQJKMTetEks5k98WwiTcJzAW+tnYobhzo9KkldoBD6B9z G71SwaWRjr5HVSST8hunSQKBgDa0+i+ZPZ2/0lxgRk0lcWd5CQFDgW3l820t/EZS ZlprSpU9iui07KyUSCcaPpPc+iItqUeLonTxlrAgxw+hLF8Rph7l1Ik1nmk9AkBp 9bvFmFoCzjD1osDolg3m/PPa1eJcshJBQ4OXUOI1FM3k3WwKw/WKxiULNTWlTho4 GD+RAoGAdhDUfixx/mOlPKNz08EaiqvH5abdbvDNTvi4UgCBAxfZAYnyL/fFB53H thKpHO2vKS1WtPZIiGBKffYVg1fJjmEeRof2lFhC7aoyBzcfyjjp9OmXII7mdFQn x3b6EUM92+LliP8D/joXjFOHABuJQBMcCb1Cr2t59MQHtlLWUrc= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/rev-cert.pem0000644000175000017500000000271412735676345025333 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEHDCCAwagAwIBAgIBCzALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU0MTJaFw0zNzA5MTExMjU0MTJaMGkxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxDjAMBgNV BAgTBURhemVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsGCSqG SIb3DQEBAQOCAQ4AMIIBCQKCAQCnyZpKt7FMekFO9OTzIZzQPTzVH3FCBjhoViBh StC9oWcCFr6+RHNpi3UUG+ytgly7Clar3cz+D3tPKWWfeMo04895h6/B1wUBvtpj NZxVtc2yvomKcoCyWayWnuucTRb1wbAB0+shsuBKHBD4L2Ws7oHkn0wmVd0HYoay rXUBMmQui7Y5kYh0LaB+gcxmu/RohSwvBvpSukOl8OOkB6ngHfoJtX3SrjdTHICY 2/Ua2fOxv+nh6hOy5xy7fapYMFNtdvNClifqLvK7VrimVqNxtiSZKNGTVoTPBWag o+NV2abNYjSstGkUWhq4ZI4NmkyDcHTeAtfx/142VXPqGu0LAgMBAAGjgdIwgc8w DAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwIQYD VR0RBBowGIIQd2Vhc2VsLWp1aWNlLm9yZ4cEfwAAATAPBgNVHQ8BAf8EBQMDByAA MB0GA1UdDgQWBBR2DyOQu6Qw1sh+lkkmX7HGJ1scGjAfBgNVHSMEGDAWgBRJMCYI jJrWac2LwMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93 b2NreS10ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQDAvd60gplt/Yl/On9Ucht/ rhYfyUzW4pioSLVmiRKhKbDo8ujmhT3vgxdj2nW+uhPMxMbUsgMqj7tOBxIFqXaW Silo+A9iTr3Xxp/oPT+6u0FurGpu50/vPf/TMNhm+ucwYOfvpXVCJgu52c3WXp8R N4jvBOn8+MSlcetBUkmwRoUApNIEp+BglxDDdOB9IWhEZPvgbNokzAPrsoKflpXp pwkUFBuvn6/ffBBHb2I6rF4a4DC6yoK6DCYONzfHUjKMec7ex7CCWKubN31CogvH sb7ugiIFom/dMqjtGtWzG4ilVAQjjV5HJN+RscVp/6c/VY4WEYPfegUReGR0E47h -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ss-cert.pem0000644000175000017500000000266412735676345025170 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIECDCCAvCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJVSzES MBAGA1UEChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMREw DwYDVQQIEwhDb25mdXNlZDEbMBkGA1UEAxMSV29ja3kgWE1QUCBMaWJyYXJ5MB4X DTEyMDUwOTIxMTkwNFoXDTQwMDUwMjIxMTkwNFowbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALhA6uopowNxpWot6lxO55oh6Y9f H0LYT/iUocMsiHExXxoe/g1hOUR+t52rAEGGMH2MUinwdUzXRS0zpcL5uqpGcX6Q rs0EKbteffm8x7sL6Z7NUkO2V1Wwi84tDn2JCMqL16/KCBRn7GiGJcndGEj+P+XW peW6GX7ACPZjTL/C7T/OQcFFGZpFaKUIRhrWhV2dHsPpG6bz4kycuB8io5Bk/XfN 5dLJ2R6m2u6YRsWbR9fRnE1xpM98DqtaVYiGTQBOu+gehftGHZac7XC297hCAeCx DkIbqrs0/BSi3d04cI1eSAijY9D+rTh5jcNJqSambFmXCgNl7rzHpKvJgHkCAwEA AaOBtDCBsTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggr BgEFBQcDATAhBgNVHREEGjAYghB3ZWFzZWwtanVpY2Uub3JnhwR/AAABMA8GA1Ud DwEB/wQFAwMHpgAwHQYDVR0OBBYEFJSBitgIFe+DDoAc7lAGk5+gbReHMCwGA1Ud HwQlMCMwIaAfoB2GG2ZpbGU6Ly8vdG1wL3dvY2t5LXRlc3RzL2NybDANBgkqhkiG 9w0BAQsFAAOCAQEArMZFCHoZHZGpT7XrsWHJALVIixkwtWePte9iiznKbl4ywrlZ fRAOoPUl+ZrspDU0lA5299V67M2WMIMs9uAjW5jgCPswylkO1RaJBTHcHmiGm2Ev R/8h4PCDo/LJvQjQs3B7Wev5zQEE25h8DUxvqA499wRWPxVmiLt4n/yFuVMNUDAF eQvCDv2YQu8EZ/A++kQjbjujTHT3okSXoPEcOZj+C1Eqp8cWXRrrh8xkE9ptRWIS Q+MhjvgVPrniGBBK1Mh0DbQhlriLD++XYI3bDwlg/Hnc0o9bWv0sfyvtOI45g5QG SDeBQ8L0KFUfu03ZBwATpd9pHUngpWbVXGqLhg== -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/badwild-key.pem0000644000175000017500000001457112735676345026004 0ustar00gkiagiagkiagia00000000000000Public Key Info: Public Key Algorithm: RSA Key Security Level: Normal modulus: 00:aa:ae:81:ce:91:0e:8d:b7:5d:fe:24:ed:ce:99: 71:60:1c:7a:79:d8:a5:9e:7a:0c:de:28:9e:ca:af: 2f:b7:ee:e6:8a:a8:ac:c4:96:b9:99:c7:07:a6:15: ef:8a:be:16:ed:14:0c:b5:d2:f5:31:38:f9:5b:e7: dd:e2:6b:12:1e:15:91:c2:8b:aa:81:6c:81:f9:46: 85:04:b8:7a:e9:78:1b:52:44:44:f4:26:bb:1d:c9: 93:24:4d:ae:c2:44:09:39:dc:ca:a5:b9:03:cd:98: a4:58:7d:49:a1:d6:6a:27:f1:6f:a6:36:e0:6f:6e: fe:4c:5f:dc:6f:10:76:a2:a3:5c:d2:37:24:7f:1b: 4c:ac:c0:25:67:ec:fa:54:98:39:aa:f0:ce:41:8f: 9e:73:99:08:a5:39:ac:a5:e2:28:ec:8f:fb:4b:46: d4:a9:c7:1b:d1:47:ff:87:97:d4:97:e6:35:3e:15: ca:80:30:16:35:53:07:0d:76:db:cc:f6:6e:7c:ad: fc:c4:85:09:59:db:9d:87:0d:53:7f:35:ad:81:63: ab:a3:bd:6f:37:fd:09:f8:25:6f:9f:00:6f:02:67: 28:8a:1a:0a:7d:80:cd:ab:e9:31:76:26:12:3b:7d: be:99:59:dc:34:05:05:c0:b9:ff:2b:14:59:6d:b6: 0b:61:e3:a9:2c:f4:05:c4:34:6b:7f:aa:a6:a9:76: 81:da:fe:b4:a0:00:69:cb:58:ef:20:b5:1c:8d:3d: e5:e3:0b:47:13:0b:37:96:9e:74:89:9f:01:6f:28: fd:a5:4e:06:c5: public exponent: 01:00:01: private exponent: 30:f2:e9:01:3f:b2:87:cb:fd:a5:c4:1b:7b:33:a0: 43:2b:07:a8:e8:0b:df:5e:2b:50:8f:1f:b3:0a:f8: c9:6c:37:2b:ae:e2:15:63:10:89:5c:7e:02:10:aa: 69:04:c8:f8:66:d6:9a:52:8c:c4:f8:0c:f3:61:94: cd:b9:5d:31:c9:87:ca:de:59:20:d2:e8:97:7f:b4: e8:3c:ab:eb:46:e9:b6:f7:23:3b:4d:dc:3d:d7:b0: 5e:29:f5:23:7b:75:95:e5:8f:2c:65:da:04:5d:71: 4c:7b:69:e1:82:e7:60:db:29:e4:e6:3a:09:5b:30: 8c:e0:b5:0c:19:11:9c:e4:f2:da:ca:bb:a9:c4:3f: 82:0f:7c:ea:c8:18:a6:a8:1d:69:bb:b3:bb:33:a0: 02:90:79:e1:78:fc:56:ca:a6:fa:fc:42:59:2f:43: c2:d6:66:88:d7:9f:83:01:60:25:bb:31:f3:67:90: 51:6f:8f:9b:54:e6:54:a3:6a:b9:e7:15:21:8f:03: bb:31:b4:63:77:c8:b6:88:b6:f2:ee:88:c7:c8:e6: 7a:3e:05:25:5f:fe:6a:54:11:0f:44:57:18:4c:34: a4:fe:01:07:65:68:bb:6c:b2:f4:df:a3:74:94:65: ba:84:37:26:6a:75:4f:38:81:46:43:51:43:21:3e: 1e:1b:8c:cd:28:41:d9:23:8b:c3:7b:b1:31:21:8e: 51:cc:7d:a7:4b:bd:ec:f7:34:45:df:e3:b1:4b:5e: 86:4d:03:3e:ea:b5:21:4c:7b:e2:08:a2:6e:94:df: 6c:c8:0d:65: prime1: 00:c9:35:da:a7:66:35:95:86:65:2d:87:e9:c4:34: c8:af:6d:8b:d7:2a:ab:cd:f5:db:52:27:f6:3b:07: 15:2c:f1:ce:e9:01:87:69:c7:50:7d:48:fc:86:ac: ac:c6:27:f3:e4:94:fd:03:dd:1a:10:dd:c4:9c:28: d6:eb:52:42:3a:32:d2:83:14:73:1a:75:a8:a5:ac: 86:76:1b:4f:84:67:4f:a7:9a:4b:d2:11:fc:0d:8f: 45:46:e1:cc:ce:a7:01:b8:eb:c5:0b:f0:90:56:0d: b1:04:a6:3f:06:a0:d8:03:be:df:7c:51:6f:14:f1: dc:3e:08:0d:a5:6c:cc:6b:68:ec:c6:d3:d2:35:cf: 28:c5:d7:36:f6:7e:71:6c:7e:1e:12:a3:e3:64:8b: 1e:94:83: prime2: 00:d9:28:88:32:c2:21:fd:24:1e:10:5c:ae:c9:f4: 85:8f:f6:a1:a9:23:39:f9:8a:c6:17:f0:a1:db:fa: f0:51:a0:66:e7:db:3b:39:c7:2f:c1:62:7d:e3:bc: 8a:27:5d:99:0c:11:69:a0:f0:8e:62:22:56:a9:c5: d5:9e:ce:6f:c0:47:9c:c8:90:86:ad:b0:2e:56:64: 35:2c:b6:1d:f1:71:bf:0e:e5:bf:24:1d:40:02:34: ba:37:00:d3:f5:19:65:3c:78:89:20:f8:72:b7:50: 0f:c9:e7:bd:5c:10:fe:b5:d0:07:66:7b:3d:e6:e0: f3:81:b9:7a:19:48:ce:fe:5e:e7:d8:65:f3:d7:9b: f9:95:98:f7:bc:44:0d:a2:24:50:3b:8e:99:f3:5b: 7d:65:17: coefficient: 24:63:2a:2a:91:68:87:30:89:7f:df:a4:22:1f:b2: 22:db:e9:4f:c3:00:87:da:7c:62:d3:ff:19:cb:6d: 01:a9:71:9e:03:4f:66:a2:92:ea:5b:e4:d6:6e:d9: 71:a9:25:49:41:a9:aa:e3:1b:ef:7f:1b:57:83:c4: 78:cd:39:47:d0:af:79:3a:a5:e1:fb:48:4a:f4:d9: 02:db:96:f0:3a:d1:3b:7b:b6:f8:28:1e:2c:1d:a2: 4c:f9:19:29:52:6c:6f:70:19:49:37:59:9d:fd:6c: 36:3e:c8:e0:50:6b:49:ff:2b:d9:31:72:c7:38:67: cc:30:49:40:06:ba:70:63:36:bd:11:19:1a:f2:d1: 2b:f3:09:cc:ed:b6:23:11:4c:9d:9d:d5:56:25:06: bc:9b: exp1: 2d:cb:78:0c:89:92:c0:89:6a:15:c6:cd:49:be:c9: be:43:ac:84:38:4e:09:fe:5f:00:7f:df:e6:e7:61: c6:6c:f2:ae:cd:8e:48:60:f8:cc:cb:03:ce:93:16: 6f:b3:40:2b:52:4d:93:c7:8a:db:33:de:3f:bc:7b: cd:eb:56:ef:70:09:c1:93:b1:ee:df:c0:96:94:81: b5:f7:d9:4d:45:46:37:db:42:4e:79:91:68:74:a7: 4b:ce:b0:92:88:28:38:32:51:12:ba:99:df:3c:16: 81:fc:64:73:d9:bf:d0:7a:6c:db:1a:9d:b1:a2:aa: 81:e3:cb:57:4f:3f:e7:62:66:21:8a:ac:59:5a:e0: e8:c6:66:d8:0b:47:3d:6e:26:e2:0f:32:fd:fb:3b: e6:89: exp2: 77:5c:ef:18:2f:5b:2d:60:87:e1:e8:7f:ee:e4:27: f2:0c:d7:a9:37:82:ab:66:9b:22:17:93:70:6e:0b: 60:62:b1:8d:aa:14:70:da:ca:a6:1a:74:26:14:c1: 3f:88:14:12:ed:13:49:72:50:61:22:8c:ce:3e:be: ff:ce:6a:e0:9e:bc:50:06:18:f1:29:91:1e:cd:6f: e9:06:a5:88:cc:43:ff:75:4b:4e:17:81:d2:74:97: 12:9a:b2:e6:db:31:a9:3e:7b:e9:92:86:c3:ba:0f: 23:a4:ec:91:c9:89:a7:f8:13:c9:41:de:b1:a4:5e: 54:a4:d5:b7:46:2c:f8:e6:c3:bb:4f:b6:eb:81:81: 7b:b8:1c:1b:f0:b0:29:ba:9a:1b:52:73:ce:af:30: 4a:bb: Public Key ID: 03:AC:54:81:78:E7:4A:E9:85:69:30:7A:AC:51:F1:B9:D1:68:19:E6 -----BEGIN RSA PRIVATE KEY----- MIIFegIBAAKCATEAqq6BzpEOjbdd/iTtzplxYBx6edilnnoM3iieyq8vt+7miqis xJa5mccHphXvir4W7RQMtdL1MTj5W+fd4msSHhWRwouqgWyB+UaFBLh66XgbUkRE 9Ca7HcmTJE2uwkQJOdzKpbkDzZikWH1JodZqJ/Fvpjbgb27+TF/cbxB2oqNc0jck fxtMrMAlZ+z6VJg5qvDOQY+ec5kIpTmspeIo7I/7S0bUqccb0Uf/h5fUl+Y1PhXK gDAWNVMHDXbbzPZufK38xIUJWdudhw1TfzWtgWOro71vN/0J+CVvnwBvAmcoihoK fYDNq+kxdiYSO32+mVncNAUFwLn/KxRZbbYLYeOpLPQFxDRrf6qmqXaB2v60oABp y1jvILUcjT3l4wtHEws3lp50iZ8Bbyj9pU4GxQIDAQABAoIBMDDy6QE/sofL/aXE G3szoEMrB6joC99eK1CPH7MK+MlsNyuu4hVjEIlcfgIQqmkEyPhm1ppSjMT4DPNh lM25XTHJh8reWSDS6Jd/tOg8q+tG6bb3IztN3D3XsF4p9SN7dZXljyxl2gRdcUx7 aeGC52DbKeTmOglbMIzgtQwZEZzk8trKu6nEP4IPfOrIGKaoHWm7s7szoAKQeeF4 /FbKpvr8QlkvQ8LWZojXn4MBYCW7MfNnkFFvj5tU5lSjarnnFSGPA7sxtGN3yLaI tvLuiMfI5no+BSVf/mpUEQ9EVxhMNKT+AQdlaLtssvTfo3SUZbqENyZqdU84gUZD UUMhPh4bjM0oQdkji8N7sTEhjlHMfadLvez3NEXf47FLXoZNAz7qtSFMe+IIom6U 32zIDWUCgZkAyTXap2Y1lYZlLYfpxDTIr22L1yqrzfXbUif2OwcVLPHO6QGHacdQ fUj8hqysxifz5JT9A90aEN3EnCjW61JCOjLSgxRzGnWopayGdhtPhGdPp5pL0hH8 DY9FRuHMzqcBuOvFC/CQVg2xBKY/BqDYA77ffFFvFPHcPggNpWzMa2jsxtPSNc8o xdc29n5xbH4eEqPjZIselIMCgZkA2SiIMsIh/SQeEFyuyfSFj/ahqSM5+YrGF/Ch 2/rwUaBm59s7OccvwWJ947yKJ12ZDBFpoPCOYiJWqcXVns5vwEecyJCGrbAuVmQ1 LLYd8XG/DuW/JB1AAjS6NwDT9RllPHiJIPhyt1APyee9XBD+tdAHZns95uDzgbl6 GUjO/l7n2GXz15v5lZj3vEQNoiRQO46Z81t9ZRcCgZgty3gMiZLAiWoVxs1Jvsm+ Q6yEOE4J/l8Af9/m52HGbPKuzY5IYPjMywPOkxZvs0ArUk2Tx4rbM94/vHvN61bv cAnBk7Hu38CWlIG199lNRUY320JOeZFodKdLzrCSiCg4MlESupnfPBaB/GRz2b/Q emzbGp2xoqqB48tXTz/nYmYhiqxZWuDoxmbYC0c9bibiDzL9+zvmiQKBmHdc7xgv Wy1gh+Hof+7kJ/IM16k3gqtmmyIXk3BuC2BisY2qFHDayqYadCYUwT+IFBLtE0ly UGEijM4+vv/OauCevFAGGPEpkR7Nb+kGpYjMQ/91S04XgdJ0lxKasubbMak+e+mS hsO6DyOk7JHJiaf4E8lB3rGkXlSk1bdGLPjmw7tPtuuBgXu4HBvwsCm6mhtSc86v MEq7AoGYJGMqKpFohzCJf9+kIh+yItvpT8MAh9p8YtP/GcttAalxngNPZqKS6lvk 1m7ZcaklSUGpquMb738bV4PEeM05R9CveTql4ftISvTZAtuW8DrRO3u2+CgeLB2i TPkZKVJsb3AZSTdZnf1sNj7I4FBrSf8r2TFyxzhnzDBJQAa6cGM2vREZGvLRK/MJ zO22IxFMnZ3VViUGvJs= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-0-key.pem0000644000175000017500000000321312735676345025105 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEA35q0WVGuFFgy4JhzUVGlyBMIcEkEREkxdX1nfjT+cTDuuThN CQJs5OK3Tx/MYrm2t1p1VbwPp6Ked5Qu3pk0zFc1i1iyRFd39tcTXhwkVsZJswMA BfsfcvcxleJkYDFpNuoNAtHZmmDyC3E3ImEcI72sBHXe/M9PcAUhnWMdWGvjK/QQ ZdrU4Q+HJYleg1XZcIZ77u3mpq0Py3Xkv5+Gfl/DGFvhuPWvG76h76aezEvKSMBD H4JM37hviv/vgr8+Vnzn5w2B9d2oU5LO5NEQdeq7dalJ7xeuq82CW86iUnOJm4XD ibhVEV3omSmNn+/FtW+kUU7xDSEnZxiiT8DMWQIDAQABAoIBACYUQcXbPd7LlWB/ vdW5ppafvSZoHOCnKVPVlyAcVL+AgosK7j2MSvCgtnB0XRlsAJSRhF1lITJeZIe/ NcslQqNQ77arFHLEhZLFFlCG0N5xNsBUULb0COtKcwiQLSFfkMgwDCawh5L9kwLF VUsWyBTDGo4I58Bcaq4MRaj4pdj2dxNlpsdf1Nd/FlDVYksD/bBRHBXW//eUYrEc oCYGh65JQKOeCBXL3O8imgcq5nbC0On5O1t2YfqIdmk67iFubn3IkLLm2/hvnSNl m4JvcDzq+uJA4T760s6CSayTd4tHfHS23IXQyluhqsRPd2mZaDkM45oNKBXMNIaN /EU2500CgYEA7QVO6McEq9uWlx/QrWIpMWTdHH0EUqwFEd7wDoWskdyUPX/QDYJb E088O9c1TrNpVcAIQgWy/2EEOMYmUhjrM9q5jiX2m9P745g+ij+cta4GhW+B2sfd ODiY0b7y2Z2bzUuew7UtZ3H5BAuzWcMGz558xh2J8x8DLM0YHtjgNMUCgYEA8YJf cY8ZUPz8tlYXB/NPYRBlqGMwt6x//nxnElYfquXXOMIWf7WsXNjMHcRsksF1IA3i jTLi7s+N6lBR0QO4b/ohXzbSGcxPwJF/OIcQ1+WYpdywO84Y531whKrkn6jopYlK XXChkEZAqNjCoYx19ORi1vpv3KSixK/K2u6Z+oUCgYEAl64R9X2HS8PW9xdxH8P1 wJpftd97aLyU8f7NeT2qVh3m8ARfTIXjatQGI/VxM9A01J9zqWykRDH91adY1qkD u8d5f7Jjww1B4UCIpUhYLRwVKEdXvn6w30243mFoYEMwdYyzKWNEjzKsvR4PxJ2+ OheemdpFccSi74TArtzzflECgYA4dYsMiDCZ71rA4aVmtWnUPjoVwIKOHeSaQMjz z3B9ylejLDSITJdr6T7mopnjQRi5kqVo7wGAZMM/iOFnpKAEhYwxryY047+tPBZq x6CXaFRkShBlGsxVqcyZJz5lWN5yfIMHDyKmENZi4rG1hJm6032L1mY6Rb7LjnE0 91zF5QKBgBFQqqhH1I/2hrJ9knPTYjK+e4iN/zLsE3PliL9IxFrrnc6dZ/qkQ3qL l70zC2GKJf9lVoG6T3uoS2BKz504onusYvAKTKgF/J7giEmzJE2/Eol2+ffZ1uKR jsDx84YYvFZhiPNBfSbsB6IRiH+EEl7SSasTmL/l3TgE1gfaw5S7 -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/unknown-ca-cert.cfg0000644000175000017500000000416012735676345026572 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Lost-in-Space" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. #dns_name = "www.none.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. #ip_address = "192.168.1.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not ca # Whether this certificate will be used for a TLS client #tls_www_client # Whether this certificate will be used for a TLS server #tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. #encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/badwild-cert.pem0000644000175000017500000000303212735676345026137 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEUzCCAzugAwIBAgIBAjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJVSzES MBAGA1UEChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMREw DwYDVQQIEwhDb25mdXNlZDEbMBkGA1UEAxMSV29ja3kgWE1QUCBMaWJyYXJ5MB4X DTEyMDUwODE3MjMxNFoXDTQwMDUwMTE3MjMxNFowaTELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEOMAwG A1UECBMFRGF6ZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAVIwDQYJ KoZIhvcNAQEBBQADggE/ADCCAToCggExAKqugc6RDo23Xf4k7c6ZcWAcennYpZ56 DN4onsqvL7fu5oqorMSWuZnHB6YV74q+Fu0UDLXS9TE4+Vvn3eJrEh4VkcKLqoFs gflGhQS4eul4G1JERPQmux3JkyRNrsJECTncyqW5A82YpFh9SaHWaifxb6Y24G9u /kxf3G8QdqKjXNI3JH8bTKzAJWfs+lSYOarwzkGPnnOZCKU5rKXiKOyP+0tG1KnH G9FH/4eX1JfmNT4VyoAwFjVTBw1228z2bnyt/MSFCVnbnYcNU381rYFjq6O9bzf9 Cfglb58AbwJnKIoaCn2AzavpMXYmEjt9vplZ3DQFBcC5/ysUWW22C2HjqSz0BcQ0 a3+qpql2gdr+tKAAactY7yC1HI095eMLRxMLN5aedImfAW8o/aVOBsUCAwEAAaOB 0jCBzzAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD ATAhBgNVHREEGjAYghAqZWFzZWwtanVpY2Uub3JnhwR/AAABMA8GA1UdDwEB/wQF AwMHIAAwHQYDVR0OBBYEFAOsVIF450rphWkweqxR8bnRaBnmMB8GA1UdIwQYMBaA FEkwJgiMmtZpzYvAzA5cAo5KH6aMMCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8v dG1wL3dvY2t5LXRlc3RzL2NybDANBgkqhkiG9w0BAQsFAAOCAQEAeJIQ1SZS3UQZ 1aBh3901WZhYozH38i7I7JclEQO0Kla2et289IAc2IiocEoeMjwE3bO+1xO4EF2N zEgGzodaIsVGol9zlrRm9CXeYgRBPkgorebFWfEigIsLY3VjrhBhV3UnDTY7Hebr tqdOX7Xa0DLud1AqGzNia2aon28qY05qu5RPgxfvpRUYnJJlT5tidSkbXJIuvbb0 roFd+es4qgQU+ZiAc6DHpREcShxd+20JJVR9zvqeM7egP3tZPiFf8u6n3CsYKQ0p be3NygY35lwc1VYxX/PMecslbsHQoa+ZWgd2+lcZ/81QD2JrmRo7nG3clsCbXodj 1c8cuflfhw== -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/0000755000175000017500000000000013012562226023620 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/ca-1-cert.pem0000644000175000017500000000257712735676345026035 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID4jCCAsygAwIBAgIBATALBgkqhkiG9w0BAQUwajELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEPMA0G A1UECBMGRm9sZGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwHhcNMDkw OTE4MTI1NTAzWhcNMzcwOTExMTI1NTAzWjBqMQswCQYDVQQGEwJVSzESMBAGA1UE ChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMQ8wDQYDVQQI EwZGb2xkZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAR8wCwYJKoZI hvcNAQEBA4IBDgAwggEJAoIBANRkYbvqWdla+zNLsftXYnaAD0agDbNl70y4yxNj V1DriZnNgjgWM8ZIgUdvFx+sA8wMoRFBLnXWYfzI+fHYFak+JqysvQmqTifXjKOs Q8Qdhb3hc2z10X7pobRK+oxE7VXDKKp5ou4f3wx1mvSTjB1oTr5o2ZnA5K/dLCM7 OmJ2C/Vj8z6l6HV41esPEYEZv+wfP/9z3xmNhNHcRWIeipEdDZDfXc0n22SeEnGS ZrSJDP9CZaJWAcLUhD5OEh+B3P/gfO9KDAN8PicSFFXj2X0t8incmz5fs6JosgEF o40D/R4xUIU562HEY/4uOM6N2nHM+MKgiDHEUh9s3lLmSB8CAwEAAaOBmTCBljAP BgNVHRMBAf8EBTADAQH/MCUGA1UdEQQeMByBGnBvc3RtYXN0ZXJAY29sbGFib3Jh LmNvLnVrMA8GA1UdDwEB/wQFAwMHBgAwHQYDVR0OBBYEFJdQenuGG7TS4L2av7+3 HHWC+uO7MCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8vdG1wL3dvY2t5LXRlc3Rz L2NybDALBgkqhkiG9w0BAQUDggEBAI2E2XcrxGbK+e9CdIxnrVWsh8HgcvBB/F4M 9jRUSjc3+w3E1zxlyfqGgSrzCJIpZbq7TQ7tTd1AV8j9hP4bP1r3BX6lhiXRtRKC thobgl1gXQtHkFhRpZrWe4vECqucHlznel9nhtLeY50ykt8ajvqxhthe/uabKNlo wC87Aq1ykigR1imLAY8UdvdXfvnfS1d5bF/k3TSw2YOZE4u8KToQf1LVPIG12OPi uStuIX9UYzSe8qOurrbjX+qehoubmrgLPGRKyNfIHsp7Arr/yUnjK5WtojTjcF85 nuP8FceVT5cvKYYPcBP6+YpAeeBJBiK95kzZGqgVewoLpKJht+0= -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/e7df1717.00000644000175000017500000000260312735676345025072 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjE3MDZaFw0zNzA5MTExMjE3MDZaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCENvbmZ1c2VkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQDfmrRZUa4UWDLgmHNRUaXIEwhwSQRESTF1 fWd+NP5xMO65OE0JAmzk4rdPH8xiuba3WnVVvA+nop53lC7emTTMVzWLWLJEV3f2 1xNeHCRWxkmzAwAF+x9y9zGV4mRgMWk26g0C0dmaYPILcTciYRwjvawEdd78z09w BSGdYx1Ya+Mr9BBl2tThD4cliV6DVdlwhnvu7eamrQ/LdeS/n4Z+X8MYW+G49a8b vqHvpp7MS8pIwEMfgkzfuG+K/++Cvz5WfOfnDYH13ahTks7k0RB16rt1qUnvF66r zYJbzqJSc4mbhcOJuFURXeiZKY2f78W1b6RRTvENISdnGKJPwMxZAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRJMCYIjJrWac2L wMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQCL+FK+IzN9Z88ePw/MU2Y1Yd2oigeb /02d7DrzQQXpSN1y3t0LKpi3MM7QbGDVUmC6WI7Tpe9wf0G6ZTfZ6jMeS/4OpeG+ QNRWxAWtAv1+QDEtHf9rVFKjl9SUbKhbsLHePggS52LV/YTwD1PxbCsl75jpaCvU W22tTJL0K1lFBYLM0IxiOkn+vrWNsOYfVpXZbjB4ExLeNp1li2tetXJLluMgeGr5 bKYmWfYyze6FOcp1zQh13e6I0DqIh7F6hb/nKaWcJKSNsq8JsgLWTba8iDF24X5C 2l+SJE0iNtg08tC6XdZ9v1DQUHKIKSX7L5MEVgHbLiOKroriqVeQu8zK -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/c5d5c0da.00000644000175000017500000000260312735676345025215 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjE3MDZaFw0zNzA5MTExMjE3MDZaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCENvbmZ1c2VkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQDfmrRZUa4UWDLgmHNRUaXIEwhwSQRESTF1 fWd+NP5xMO65OE0JAmzk4rdPH8xiuba3WnVVvA+nop53lC7emTTMVzWLWLJEV3f2 1xNeHCRWxkmzAwAF+x9y9zGV4mRgMWk26g0C0dmaYPILcTciYRwjvawEdd78z09w BSGdYx1Ya+Mr9BBl2tThD4cliV6DVdlwhnvu7eamrQ/LdeS/n4Z+X8MYW+G49a8b vqHvpp7MS8pIwEMfgkzfuG+K/++Cvz5WfOfnDYH13ahTks7k0RB16rt1qUnvF66r zYJbzqJSc4mbhcOJuFURXeiZKY2f78W1b6RRTvENISdnGKJPwMxZAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRJMCYIjJrWac2L wMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQCL+FK+IzN9Z88ePw/MU2Y1Yd2oigeb /02d7DrzQQXpSN1y3t0LKpi3MM7QbGDVUmC6WI7Tpe9wf0G6ZTfZ6jMeS/4OpeG+ QNRWxAWtAv1+QDEtHf9rVFKjl9SUbKhbsLHePggS52LV/YTwD1PxbCsl75jpaCvU W22tTJL0K1lFBYLM0IxiOkn+vrWNsOYfVpXZbjB4ExLeNp1li2tetXJLluMgeGr5 bKYmWfYyze6FOcp1zQh13e6I0DqIh7F6hb/nKaWcJKSNsq8JsgLWTba8iDF24X5C 2l+SJE0iNtg08tC6XdZ9v1DQUHKIKSX7L5MEVgHbLiOKroriqVeQu8zK -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/bb7d74ae.00000644000175000017500000000257712735676345025236 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID4jCCAsygAwIBAgIBATALBgkqhkiG9w0BAQUwajELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEPMA0G A1UECBMGRm9sZGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwHhcNMDkw OTE4MTI1NTAzWhcNMzcwOTExMTI1NTAzWjBqMQswCQYDVQQGEwJVSzESMBAGA1UE ChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMQ8wDQYDVQQI EwZGb2xkZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAR8wCwYJKoZI hvcNAQEBA4IBDgAwggEJAoIBANRkYbvqWdla+zNLsftXYnaAD0agDbNl70y4yxNj V1DriZnNgjgWM8ZIgUdvFx+sA8wMoRFBLnXWYfzI+fHYFak+JqysvQmqTifXjKOs Q8Qdhb3hc2z10X7pobRK+oxE7VXDKKp5ou4f3wx1mvSTjB1oTr5o2ZnA5K/dLCM7 OmJ2C/Vj8z6l6HV41esPEYEZv+wfP/9z3xmNhNHcRWIeipEdDZDfXc0n22SeEnGS ZrSJDP9CZaJWAcLUhD5OEh+B3P/gfO9KDAN8PicSFFXj2X0t8incmz5fs6JosgEF o40D/R4xUIU562HEY/4uOM6N2nHM+MKgiDHEUh9s3lLmSB8CAwEAAaOBmTCBljAP BgNVHRMBAf8EBTADAQH/MCUGA1UdEQQeMByBGnBvc3RtYXN0ZXJAY29sbGFib3Jh LmNvLnVrMA8GA1UdDwEB/wQFAwMHBgAwHQYDVR0OBBYEFJdQenuGG7TS4L2av7+3 HHWC+uO7MCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8vdG1wL3dvY2t5LXRlc3Rz L2NybDALBgkqhkiG9w0BAQUDggEBAI2E2XcrxGbK+e9CdIxnrVWsh8HgcvBB/F4M 9jRUSjc3+w3E1zxlyfqGgSrzCJIpZbq7TQ7tTd1AV8j9hP4bP1r3BX6lhiXRtRKC thobgl1gXQtHkFhRpZrWe4vECqucHlznel9nhtLeY50ykt8ajvqxhthe/uabKNlo wC87Aq1ykigR1imLAY8UdvdXfvnfS1d5bF/k3TSw2YOZE4u8KToQf1LVPIG12OPi uStuIX9UYzSe8qOurrbjX+qehoubmrgLPGRKyNfIHsp7Arr/yUnjK5WtojTjcF85 nuP8FceVT5cvKYYPcBP6+YpAeeBJBiK95kzZGqgVewoLpKJht+0= -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/ca-2-cert.pem0000644000175000017500000000260312735676345026024 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIU3BpbmRsZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU1MDVaFw0zNzA5MTExMjU1MDVaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCFNwaW5kbGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQC+YAQjeUbAlnnvhQ4imQbL4aU8sJjM/M7g gm51NdXev3WwvOdDDU8LgvaKIoMQyQaS5XAt4Q/hAeHZJW0Nx3zZW9XWiqmHlqsU LdQKvxIz9xnvLRR74gHddMXqsPCHieSNvXm4cnnNPIwmWNiBIo5NdI/Te+tNmGqz pO4t1G9jYlhGNhc2vUIpDo4bO2vWqeRyqnQlrAykfZsScjryZtMBDSc9xZdjJlJt 2nbLlQJVUgi1bEwazP3SWEijfZTKhnXn0bvhFGUSEssHb5CUVr6ILRzWJtAVp/us YAaQLZLhMhcA94YvFB0dlVltsdtvwBPidEC4NMPJcitN/3s1fQbPAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBTeKryla1ofuyCr Gg3ugeTEymWLhzAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQC2RqDYK3xPnMGnlzJBVJI4cPH/iRLi 9ZUWmBzpjHpo0d/in6lAF0UirmjpgllXpCUhJMfP5fxOsZYk1eE/leqTyTory7Xj K6zdHmkFGPU3b5ibFPX65iGFpqZdjCAplFZ9HI7au1b0SpbsMKesE7ZXzBF0+ki3 GrKgQF+e7cMktJf07I4xoVVYimSpADFOHo9Pk1sceK/zSKGzob7TziD4Tpnc8Rhq dOj7J8EbzhqjBVciPYzXvlLjyAqdYRg5RHV1xSIvYKeK0PwVzmNY9Xu30+VShJHc 3Hf/VLl2T1ll8tXUj3hc1Jd2+ZMthTF1PIX3bunTnNUm2PENoxa8pDG3 -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/a7481a9e.00000644000175000017500000000260312735676345025070 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIU3BpbmRsZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU1MDVaFw0zNzA5MTExMjU1MDVaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCFNwaW5kbGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQC+YAQjeUbAlnnvhQ4imQbL4aU8sJjM/M7g gm51NdXev3WwvOdDDU8LgvaKIoMQyQaS5XAt4Q/hAeHZJW0Nx3zZW9XWiqmHlqsU LdQKvxIz9xnvLRR74gHddMXqsPCHieSNvXm4cnnNPIwmWNiBIo5NdI/Te+tNmGqz pO4t1G9jYlhGNhc2vUIpDo4bO2vWqeRyqnQlrAykfZsScjryZtMBDSc9xZdjJlJt 2nbLlQJVUgi1bEwazP3SWEijfZTKhnXn0bvhFGUSEssHb5CUVr6ILRzWJtAVp/us YAaQLZLhMhcA94YvFB0dlVltsdtvwBPidEC4NMPJcitN/3s1fQbPAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBTeKryla1ofuyCr Gg3ugeTEymWLhzAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQC2RqDYK3xPnMGnlzJBVJI4cPH/iRLi 9ZUWmBzpjHpo0d/in6lAF0UirmjpgllXpCUhJMfP5fxOsZYk1eE/leqTyTory7Xj K6zdHmkFGPU3b5ibFPX65iGFpqZdjCAplFZ9HI7au1b0SpbsMKesE7ZXzBF0+ki3 GrKgQF+e7cMktJf07I4xoVVYimSpADFOHo9Pk1sceK/zSKGzob7TziD4Tpnc8Rhq dOj7J8EbzhqjBVciPYzXvlLjyAqdYRg5RHV1xSIvYKeK0PwVzmNY9Xu30+VShJHc 3Hf/VLl2T1ll8tXUj3hc1Jd2+ZMthTF1PIX3bunTnNUm2PENoxa8pDG3 -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/ae5bb84e.00000644000175000017500000000260312735676345025224 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIU3BpbmRsZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU1MDVaFw0zNzA5MTExMjU1MDVaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCFNwaW5kbGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQC+YAQjeUbAlnnvhQ4imQbL4aU8sJjM/M7g gm51NdXev3WwvOdDDU8LgvaKIoMQyQaS5XAt4Q/hAeHZJW0Nx3zZW9XWiqmHlqsU LdQKvxIz9xnvLRR74gHddMXqsPCHieSNvXm4cnnNPIwmWNiBIo5NdI/Te+tNmGqz pO4t1G9jYlhGNhc2vUIpDo4bO2vWqeRyqnQlrAykfZsScjryZtMBDSc9xZdjJlJt 2nbLlQJVUgi1bEwazP3SWEijfZTKhnXn0bvhFGUSEssHb5CUVr6ILRzWJtAVp/us YAaQLZLhMhcA94YvFB0dlVltsdtvwBPidEC4NMPJcitN/3s1fQbPAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBTeKryla1ofuyCr Gg3ugeTEymWLhzAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQC2RqDYK3xPnMGnlzJBVJI4cPH/iRLi 9ZUWmBzpjHpo0d/in6lAF0UirmjpgllXpCUhJMfP5fxOsZYk1eE/leqTyTory7Xj K6zdHmkFGPU3b5ibFPX65iGFpqZdjCAplFZ9HI7au1b0SpbsMKesE7ZXzBF0+ki3 GrKgQF+e7cMktJf07I4xoVVYimSpADFOHo9Pk1sceK/zSKGzob7TziD4Tpnc8Rhq dOj7J8EbzhqjBVciPYzXvlLjyAqdYRg5RHV1xSIvYKeK0PwVzmNY9Xu30+VShJHc 3Hf/VLl2T1ll8tXUj3hc1Jd2+ZMthTF1PIX3bunTnNUm2PENoxa8pDG3 -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/8a76ade9.00000644000175000017500000000257712735676345025167 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID4jCCAsygAwIBAgIBATALBgkqhkiG9w0BAQUwajELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEPMA0G A1UECBMGRm9sZGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwHhcNMDkw OTE4MTI1NTAzWhcNMzcwOTExMTI1NTAzWjBqMQswCQYDVQQGEwJVSzESMBAGA1UE ChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMQ8wDQYDVQQI EwZGb2xkZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAR8wCwYJKoZI hvcNAQEBA4IBDgAwggEJAoIBANRkYbvqWdla+zNLsftXYnaAD0agDbNl70y4yxNj V1DriZnNgjgWM8ZIgUdvFx+sA8wMoRFBLnXWYfzI+fHYFak+JqysvQmqTifXjKOs Q8Qdhb3hc2z10X7pobRK+oxE7VXDKKp5ou4f3wx1mvSTjB1oTr5o2ZnA5K/dLCM7 OmJ2C/Vj8z6l6HV41esPEYEZv+wfP/9z3xmNhNHcRWIeipEdDZDfXc0n22SeEnGS ZrSJDP9CZaJWAcLUhD5OEh+B3P/gfO9KDAN8PicSFFXj2X0t8incmz5fs6JosgEF o40D/R4xUIU562HEY/4uOM6N2nHM+MKgiDHEUh9s3lLmSB8CAwEAAaOBmTCBljAP BgNVHRMBAf8EBTADAQH/MCUGA1UdEQQeMByBGnBvc3RtYXN0ZXJAY29sbGFib3Jh LmNvLnVrMA8GA1UdDwEB/wQFAwMHBgAwHQYDVR0OBBYEFJdQenuGG7TS4L2av7+3 HHWC+uO7MCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8vdG1wL3dvY2t5LXRlc3Rz L2NybDALBgkqhkiG9w0BAQUDggEBAI2E2XcrxGbK+e9CdIxnrVWsh8HgcvBB/F4M 9jRUSjc3+w3E1zxlyfqGgSrzCJIpZbq7TQ7tTd1AV8j9hP4bP1r3BX6lhiXRtRKC thobgl1gXQtHkFhRpZrWe4vECqucHlznel9nhtLeY50ykt8ajvqxhthe/uabKNlo wC87Aq1ykigR1imLAY8UdvdXfvnfS1d5bF/k3TSw2YOZE4u8KToQf1LVPIG12OPi uStuIX9UYzSe8qOurrbjX+qehoubmrgLPGRKyNfIHsp7Arr/yUnjK5WtojTjcF85 nuP8FceVT5cvKYYPcBP6+YpAeeBJBiK95kzZGqgVewoLpKJht+0= -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/cas/ca-0-cert.pem0000644000175000017500000000260312735676345026022 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjE3MDZaFw0zNzA5MTExMjE3MDZaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCENvbmZ1c2VkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQDfmrRZUa4UWDLgmHNRUaXIEwhwSQRESTF1 fWd+NP5xMO65OE0JAmzk4rdPH8xiuba3WnVVvA+nop53lC7emTTMVzWLWLJEV3f2 1xNeHCRWxkmzAwAF+x9y9zGV4mRgMWk26g0C0dmaYPILcTciYRwjvawEdd78z09w BSGdYx1Ya+Mr9BBl2tThD4cliV6DVdlwhnvu7eamrQ/LdeS/n4Z+X8MYW+G49a8b vqHvpp7MS8pIwEMfgkzfuG+K/++Cvz5WfOfnDYH13ahTks7k0RB16rt1qUnvF66r zYJbzqJSc4mbhcOJuFURXeiZKY2f78W1b6RRTvENISdnGKJPwMxZAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRJMCYIjJrWac2L wMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQCL+FK+IzN9Z88ePw/MU2Y1Yd2oigeb /02d7DrzQQXpSN1y3t0LKpi3MM7QbGDVUmC6WI7Tpe9wf0G6ZTfZ6jMeS/4OpeG+ QNRWxAWtAv1+QDEtHf9rVFKjl9SUbKhbsLHePggS52LV/YTwD1PxbCsl75jpaCvU W22tTJL0K1lFBYLM0IxiOkn+vrWNsOYfVpXZbjB4ExLeNp1li2tetXJLluMgeGr5 bKYmWfYyze6FOcp1zQh13e6I0DqIh7F6hb/nKaWcJKSNsq8JsgLWTba8iDF24X5C 2l+SJE0iNtg08tC6XdZ9v1DQUHKIKSX7L5MEVgHbLiOKroriqVeQu8zK -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/badwild-cert.cfg0000644000175000017500000000415212735676345026121 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 002 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "*easel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/exp-cert.pem0000644000175000017500000000271412735676345025333 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEHDCCAwagAwIBAgIBAjALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTExMjU0MDBaFw0wOTA5MTIxMjU0MDBaMGkxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxDjAMBgNV BAgTBURhemVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsGCSqG SIb3DQEBAQOCAQ4AMIIBCQKCAQCeUF/jv6V1BGXNb+epimCBLHRqVXpOQud/uC3R YgG/hcagM4kUqavAyQSIa83Oc9L01SY38QNENbs4YdLBH0Gvxo4Sc3A/X8IZp23l g6mSwxZzWoRO/D0g5bxDAkCXY+hh+ed4HnfHo+a1J/bVnyNwd6ssagQfyCXX0hCm D4sNk4DFmWr30oEVMRo5jaTcRoyXf5ATuBa8D0bluwOaqccaosFLS6m6B0c8o6OO uT7SM+9VvzG1BU+TzttZrKJmLh2vrKV09+InixDFMfemWGUCHf183xn9Sb1blNyj M++ZgTs98dbJXStzxYLMNkeJFZtroMi6wzgt1Kbfe9XrcaChAgMBAAGjgdIwgc8w DAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwIQYD VR0RBBowGIIQd2Vhc2VsLWp1aWNlLm9yZ4cEfwAAATAPBgNVHQ8BAf8EBQMDByAA MB0GA1UdDgQWBBSp54s9nx3wWAR/8iKl1XGPyKC/VTAfBgNVHSMEGDAWgBRJMCYI jJrWac2LwMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93 b2NreS10ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQCzzxwwXOB5xnaKoDerB6fq QbUmyi5Xj/c1kNgN5WnICUJc8bgXWlhLtvXyEE+/2Gshv6rOwpeH7pO4wtACaiHH NmR78Z1OPKlf4+Bxo5/wQhx228gCOsRpFK+qab5s5/OhmJe4r4AyWoF4CPYfyE0v Z5PkOeFiYc5VSJdI7y360zPV8FBYcASU90aCjREDAi+FK0r+Bp2OdxiTRL9N+mEM blgInz/adg74oDjPmrwENkEZbaKyVwL9WBUD7OABIA42exK8nvCwPRiu1//8ALSR wXTAhJ3lOIG4FOoOKBu9sIY/iRL/mJa39YJHG+gVFx+taJKB95tHthGuPraGJjch -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/new-key.pem0000644000175000017500000000321312735676345025156 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAuZZqCSGB8MHUsUeeN/B/VEJSH2kqfE/4q8UBtbQw6o5L9+x+ SVCMBiGF8UbjOJNbQ2I/pxCAo+3S8xRmOjQh6zj0iC78UX72EOCM+1UlE5x40pK5 UOiC82VnaK5NiiqQBOjtHwCfpocuH8LY5yIVw1GqSMqDp4nnuEmXxOy2cfGYyDuo Yb+CQkXijc9bG+847lZeV4Ia/tS2DuzpopgXo5uC8TSD7baZJGYduksq/lLRNVIT eTo4optqynXpGH90uVoopbTsP91hQ9SiZoMi8uVy4Q/OzOfsCfuwKpb+KGwIGCiT 4N63MuVF/9YkY0+/wBm1pQYtO3ucymvlQNcWRwIDAQABAoIBAEy55UuyGS0GjZ7f S4e3+4RDyPzodyKe02F8WMkc3m5SdxDgKpO347PzLxOBqZXtwfjZSRSSK4TaYXCS mfLtM6qySNJ2jmVI9oUiuNZ9rI7vjToNY+URw3XKEhcCnNcG4rTM8Z90HAz2bTi/ Tvo7qsCt5hci9owQ5QZZEpBdBs6TDXYdbHlFEBVOFs8tHQHZ7AhsP46k8QJ+XwC3 nBh01M6aV4jjJw6nJLCJ+Ow2y2xXlySMHwi7XG/r/L8vHTsBDDtTtumtj4u4fpg9 NkM0SrkjiaSigAdGbO7DYSxZtPaw0+PmVXSosHy65lnlxjf8su9pAwi+PyHUerz2 Q3mDRlkCgYEAzSbdglm8Pfo1ONtb43wkzcn8mtheyiGlG4tpOa9PQl60vKOUEe2V Ou3h095kFArZV+l9f1YFQFqMWYCKD8rFm8fcNKgXyeOZaz/xZlPk6tNohGWOv2jv uC6ihAMiiWPRxxP3T2ls9nW+BNq23WKkrxBwdWoqGMRRJavV2FT+sokCgYEA55Ys J/sGi/VaIL/RCbOiDlYgfzzTBGAAFmjwjvN9A6De8zWZACAXqUiZd61kDZTo8kIZ ys/pI9huaiKhoeM3UyjjeCMemVY94ffaKNFRzk5gxcvDJ6pkyow6pmU/p8pVwcb1 u/+eQ1JIjfxzRwE+z4w8HOGJVi7mDa4ztRAGjk8CgYBdRvyUVgS3EVq9nU9sYXfC ccJ/DT4cHawamAqiBcm93Z3D34RlmmatwpdZY9aRHlWwGSPMj+oXVpRV5ZHgmEu9 BuRitMMMMoYBM7Oo2SBOfQ0alaqP8UB9uAaAi4Raf55ULAnYe5Dlhqd9QYy/oChM yOa5HCpD1I8o17aFhC/CMQKBgCy0XYO+Pm5IB4To4kZYKcFQuOc265kdmwa4bS97 KzfHFyKlxwoyJ78i55UloHnKtAkH34i6B8xGnFHaq47fmK9x5i8rwF1jO4DiYnec qIkFskKcaei/SMOcvDmgs+AE+/bzHD6VQozGVoEqKWqcf+56qKP+mY9McFZVuV+L X2ibAoGALs+PgMHw1LkzwfA4n9jB4L48FN5TdpdL5P6VckujqCZaZyjoJ6cVq9gw lFf5lCpHmqIOzxDTzR2Mj8b7mT1q+a7az1BqDwpXG8rwNmhyx22RdyJSY4hiUHAx 0QL3ZcIXOyqneMXU+a2Qoj3aMAr2ZUS2OEpWEtmPfXcxf5DHaB4= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/unknown-key.pem0000644000175000017500000000321712735676345026070 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAvpcNcJNSz2GrNEEWNMaXDqNFZaEcBJ0Tx4QTVA66HaKPXSm7 sS3oYikt9bzeLp1lJqtJqJ8bJiRD6rH3vKMJjunw1BphOPsIAOtNcu0slWR5WKGK DfZfj0+KF7QSbKJ5cx03tV3IFMOg8SCW/HnIDT+yt0OWTo2qtF0BpnFbBUGUgCgO 15Mwo1tqRA02NUJ/Hr87oppVF1/o8qxDf1r5u/icW7C+czLvLOaYCrYwJFjno7IS 5RlkqjhSvNt3whaZfGCS8qriWb+mdTzKEguBawbn0lyFp/R7RfkyDRHKjrl5b2jE L430TvQx8epfGzoQpyoQWQk2IcMZTukCkJIZKQIDAQABAoIBABKIZDNr8/u7+tam NJdVr0cqW7tt7uhI8O0v++Qq2XC7x7aOshRgyy3OZMx2POGqBvW7Zrp5nD15fcwy 2YzziqClwXgSh50vld/nAZ05EGKHhmA2txK0ACdSm/JBnaAILYii0PG3KJdSTZJc 8amj2u7k4Ic/EHzbfDu1Jo2tjKUGSEhECOKsl3I+yrnjlRl8rla7ck8KFY7OJmkp +N4+byV+o+9fz5rxWw9A3yZYa5V3vOMc0tAIQGh0TcDqkRsMONJesFf418W9fqE+ ZZos8qw7Si6sXS1Xge7I/+3SbdzxpI8Wf3HmyEpKIuqAFFtCFd7mvF8UjgNNW8hF Ga8Qkr0CgYEA2Sq4lADOwJt6p1g03Gy4AbS+4hcEKjJ4fEoJuQs6OauDgc1Sp2OM Ee1560XaJK95ccZyFrO6uNO0A9cwCtTTqUkmYFzwtUXzMGa4eQcUjS2aYWIS/yw+ HwCEkQKuzWy0mDeDgWvAjEczgj9ZzVDJoucA51PlmBBuv4Hn0OWz2lUCgYEA4Ku4 XTblxlWzJfnNXUkWSsguUuroH2O8V6WOds0igxuLDMwFLBxROsL1EcpZod8XoBcM MATwJJ0smK65DXnOibMzqUYXOPRfyy360TnIMOaqgKKo6t9ZZMQJiNWq+liZ6gli n43QOxDibojbeWIjLLRGooPFcVfOAWER3eoL/4UCgYEAmKIsJOoEZt9gb6nRTXOk SJ6u4t1mcfoTMNggyUwY2luwDFUxWLDgy+DrJe9siQhEBTGDEm20OR+ikGh4PcSk F4FwVZ49GEtXx5cK5RWS3j9FGFkEHRENgGCuy/Tkw0E6FRo/dYE0TePlUhAQn/u+ HJ7bxbrzzdMO4878DZjEthkCgYEAuCusPyVQaCw6ZggHU9Ak6Pp+FtSfoZOlggeh 6Dsybl02uC/KkaVI5S2JraK9pRb3C/G4uOhjXvBE7YhVA/n02CZBVCKzyKlymWDA uaBvPb7ox/gPFjIu2o5k7nmQ5hWZXiOBaB/dMX4ez9N6bl+HTA8f0/rG8Km0oqbK +anxWe0CgYEAvTT09MGFC8jELxU7vD95euAvdeC4wCOhmNTk99kx2QLvOLqFo6GN wtzu2j1bTO29uX7DQ8iVcqQTuVO9nz6APhSwnkXvtN7tHHUiAKSJewXrBIgsVvY7 E0Ilhz/ILcmuigxe9tB682x9V6NuUhMZnhPvyZFxSM+JCTAfkwmPbj8= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-1-cert.cfg0000644000175000017500000000415112735676345025233 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Folded" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. #dns_name = "www.none.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. #ip_address = "192.168.1.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not ca # Whether this certificate will be used for a TLS client #tls_www_client # Whether this certificate will be used for a TLS server #tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. #encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/new-cert.pem0000644000175000017500000000271412735676345025330 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEHDCCAwagAwIBAgIBAzALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0z NzA5MTExMjU0MDBaFw0zNzA5MTgxMjU0MDBaMGkxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxDjAMBgNV BAgTBURhemVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsGCSqG SIb3DQEBAQOCAQ4AMIIBCQKCAQC5lmoJIYHwwdSxR5438H9UQlIfaSp8T/irxQG1 tDDqjkv37H5JUIwGIYXxRuM4k1tDYj+nEICj7dLzFGY6NCHrOPSILvxRfvYQ4Iz7 VSUTnHjSkrlQ6ILzZWdork2KKpAE6O0fAJ+mhy4fwtjnIhXDUapIyoOniee4SZfE 7LZx8ZjIO6hhv4JCReKNz1sb7zjuVl5Xghr+1LYO7OmimBejm4LxNIPttpkkZh26 Syr+UtE1UhN5Ojiim2rKdekYf3S5WiiltOw/3WFD1KJmgyLy5XLhD87M5+wJ+7Aq lv4obAgYKJPg3rcy5UX/1iRjT7/AGbWlBi07e5zKa+VA1xZHAgMBAAGjgdIwgc8w DAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwIQYD VR0RBBowGIIQd2Vhc2VsLWp1aWNlLm9yZ4cEfwAAATAPBgNVHQ8BAf8EBQMDByAA MB0GA1UdDgQWBBTQlqg773FSODizSAmYG7bIV06GuzAfBgNVHSMEGDAWgBRJMCYI jJrWac2LwMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93 b2NreS10ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQBTok7jC9jwZeiPmGgiktNe kkAwKJuJpa9O9lgeiZywlaR3vWIEuQpi7P/VpkWca7pjmu0kVJk7AupW6s6RfeW6 OALA7Zn9SC0w1zj2aSDmjI0DWosvkvoO+jkNS6HIozkMkWa6IX7veL7sTUP6cZ7f twMPExDhdNrmyOOLjxiW7Bvz6HVfAvcgCah6JjNSxL4QAdFiz0VJOInWXtp7/2rc YMeBsg4YFkV51YBVts7gCL4lDLxE79Rkj7YwhP6f84tTy+NjFmjBYKS9tyKJViOd 9L82PfXhHFUcYP/8wqhk+nE5PF4mLhroUq9DZpGU8ICEIzGburysoQi64IoPDCGM -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-2-cert.pem0000644000175000017500000000260312735676345025256 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIU3BpbmRsZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU1MDVaFw0zNzA5MTExMjU1MDVaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCFNwaW5kbGVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQC+YAQjeUbAlnnvhQ4imQbL4aU8sJjM/M7g gm51NdXev3WwvOdDDU8LgvaKIoMQyQaS5XAt4Q/hAeHZJW0Nx3zZW9XWiqmHlqsU LdQKvxIz9xnvLRR74gHddMXqsPCHieSNvXm4cnnNPIwmWNiBIo5NdI/Te+tNmGqz pO4t1G9jYlhGNhc2vUIpDo4bO2vWqeRyqnQlrAykfZsScjryZtMBDSc9xZdjJlJt 2nbLlQJVUgi1bEwazP3SWEijfZTKhnXn0bvhFGUSEssHb5CUVr6ILRzWJtAVp/us YAaQLZLhMhcA94YvFB0dlVltsdtvwBPidEC4NMPJcitN/3s1fQbPAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBTeKryla1ofuyCr Gg3ugeTEymWLhzAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQC2RqDYK3xPnMGnlzJBVJI4cPH/iRLi 9ZUWmBzpjHpo0d/in6lAF0UirmjpgllXpCUhJMfP5fxOsZYk1eE/leqTyTory7Xj K6zdHmkFGPU3b5ibFPX65iGFpqZdjCAplFZ9HI7au1b0SpbsMKesE7ZXzBF0+ki3 GrKgQF+e7cMktJf07I4xoVVYimSpADFOHo9Pk1sceK/zSKGzob7TziD4Tpnc8Rhq dOj7J8EbzhqjBVciPYzXvlLjyAqdYRg5RHV1xSIvYKeK0PwVzmNY9Xu30+VShJHc 3Hf/VLl2T1ll8tXUj3hc1Jd2+ZMthTF1PIX3bunTnNUm2PENoxa8pDG3 -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-1-key.pem0000644000175000017500000000321312735676345025106 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEA1GRhu+pZ2Vr7M0ux+1didoAPRqANs2XvTLjLE2NXUOuJmc2C OBYzxkiBR28XH6wDzAyhEUEuddZh/Mj58dgVqT4mrKy9CapOJ9eMo6xDxB2FveFz bPXRfumhtEr6jETtVcMoqnmi7h/fDHWa9JOMHWhOvmjZmcDkr90sIzs6YnYL9WPz PqXodXjV6w8RgRm/7B8//3PfGY2E0dxFYh6KkR0NkN9dzSfbZJ4ScZJmtIkM/0Jl olYBwtSEPk4SH4Hc/+B870oMA3w+JxIUVePZfS3yKdybPl+zomiyAQWjjQP9HjFQ hTnrYcRj/i44zo3accz4wqCIMcRSH2zeUuZIHwIDAQABAoIBADF4hC9CAdWX1IT5 L6asjvmtEGHR6/8KUjfbnymP7QmjIzTY4mjv+vVHdB1QaeFtrqC7nFSpiwnVepNn uJg1Ta5TFK0JuypiKbwr/80r1cj7W2iD99+8TiSyhIC7Kiq771AXmgRDOskeUVTU m9g1+d/rqNO/FlgyztGLwbkfFZVTHpQ6QP3j5zaUcQzu0JS4RDCusuBZKcIMaXll u0xs9kwk8+yD7BNEoZqXsOHA36AzftdRTgxSmXGYN66pHNEU/f+QjcksOdO7L2ya sphrEweSALSH15okw8f+O1cMwPV/BVPkzhhS5ERvRbqVq/YWPS12gy8YXjSwNE17 HQlRfckCgYEA1I39mbambVPX4TaYzZygbDzLbfMCdmtLMht+LaHNbe7FQnALsxR8 jt0LIHfAo8pztDlJfe/Zppfsz+JBlpRFRUUB+S/NXEk59EX8HN+tAL93L1nZVmjU qOSdwPHxkGlfuuQG7gP0zjSTwQBGbMmdC+S0PXa1SubbOSCw1AXiDEUCgYEA/83i 7uthjW/AQXCgxP+tlb6KP3Dp6009URa+V9hT4jRO523FnsLJXtKEFCV+Wxq7dO8X QNrXWy5dj+tnzl6dJ76maWxORBiPArFFeUvTAUfzogR6Z0wrtBwPEvsNkVUMK8Xp NxndLY5DxNqHrTugIwdTDFZxAwO66YGwAddhUxMCgYB+t9QL8t9PaF/YbXM1iX3+ aVQiTXEXZinjSo6z57WQJ3xEeoYPElSb214J0jrvqv/F3y1YPkj0z7gny0ys1+Jg RJ7Dj2MP9LvvTFXcZOFAA+WrPhabNE4sDneaEuOf46JlyhHzjjpBQQkhU+eobZ4J /CQUTJQSfoUNjta84HD+PQKBgCzXClCXMiJ41FqkQ4pEx0jYfaNhR5/XikgMlJER eqLMSIiI1Xte6a2VeVGOwPd3WCTHRGw58EYrensf6LJkI2g0IzeXpKCLLYZrTKJW iEZRNoPQBSTWVVLdGEdbeqVfIyMJLjhacErsBTUcmWvkZ828GvKutGCy5rDH6vJn rsfBAoGAOGcl22yaS2ngXM1/l0tNTuZSdjiF7mtD73Gmv/VAae0sDqLgwr64F1at f0ppTACSM8uVA0d2EgvcmpBGNMi/ApvqVnpcDd2HZ6BFJAW+hk6QBB8GGpKPUSt+ F0Q3LJmmMz6Ct9spGu4Kach6k0DapGKBFUkaor3xOj1Lgi34yV0= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/unknown-cert.pem0000644000175000017500000000272512735676345026240 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEITCCAwugAwIBAgIBAjALBgkqhkiG9w0BAQUwcTELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEWMBQG A1UECBMNTG9zdC1pbi1TcGFjZTEbMBkGA1UEAxMSV29ja3kgWE1QUCBMaWJyYXJ5 MB4XDTA5MDkxODEyNTQxM1oXDTM3MDkxMTEyNTQxM1owaTELMAkGA1UEBhMCVUsx EjAQBgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTEO MAwGA1UECBMFRGF6ZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTCCAR8w CwYJKoZIhvcNAQEBA4IBDgAwggEJAoIBAL6XDXCTUs9hqzRBFjTGlw6jRWWhHASd E8eEE1QOuh2ij10pu7Et6GIpLfW83i6dZSarSaifGyYkQ+qx97yjCY7p8NQaYTj7 CADrTXLtLJVkeVihig32X49Pihe0EmyieXMdN7VdyBTDoPEglvx5yA0/srdDlk6N qrRdAaZxWwVBlIAoDteTMKNbakQNNjVCfx6/O6KaVRdf6PKsQ39a+bv4nFuwvnMy 7yzmmAq2MCRY56OyEuUZZKo4Urzbd8IWmXxgkvKq4lm/pnU8yhILgWsG59Jchaf0 e0X5Mg0Ryo65eW9oxC+N9E70MfHqXxs6EKcqEFkJNiHDGU7pApCSGSkCAwEAAaOB 0jCBzzAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD ATAhBgNVHREEGjAYghB3ZWFzZWwtanVpY2Uub3JnhwR/AAABMA8GA1UdDwEB/wQF AwMHIAAwHQYDVR0OBBYEFKH0v7AWPAzbSGYbG+h0kTcRaf+RMB8GA1UdIwQYMBaA FK5MjvmEOvzqUkos/bUV40sy5ngKMCwGA1UdHwQlMCMwIaAfoB2GG2ZpbGU6Ly8v dG1wL3dvY2t5LXRlc3RzL2NybDALBgkqhkiG9w0BAQUDggEBAAH4rfEh9rrTpzz7 I4rLAmKyKpp9FHiPkA/ZSH/U4ffbILrych0SvpHxusNWRo3rjcUOBAq5Xt+2Oqvl 0gVqcFF8GuGhiXYSV3k40bQHxv3MO5HanPbCIw0BDjERC0Ii+8BkDEMXRdQdyYmP q+D1PKjev0bQtjai2L8/R6WOWTJtZeQAMwvtEqdwSLXDxyQSEJc4NIvWWijqq3hP Ld+wozE/+Ajx4A4qeab9Vyj1Ul/zGYF/JDPgPLwOoBXeBJxJ+cB5HP4OOt/dpTWu L1ratvrGEubystJ05fPewqHhwyBDuqnCI/gIyRXEcbHA6sIJ5RpaKFWbOF1SQO4P 30nZOag= -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/wild-key.pem0000644000175000017500000001460312735676345025331 0ustar00gkiagiagkiagia00000000000000Public Key Info: Public Key Algorithm: RSA Key Security Level: Normal modulus: 00:e2:d3:86:c4:99:5f:f3:a8:9a:c9:66:85:f6:cb: 43:84:0b:fa:b2:d7:7c:05:4d:ff:5e:c9:65:1e:16: 45:85:9e:5f:a2:59:50:73:52:31:82:76:07:df:09: 66:d5:3f:69:11:dd:35:5e:3a:a2:be:b2:fb:45:03: d4:01:42:e7:8d:f0:a7:d2:9e:b5:c2:db:61:a5:f6: 2e:cc:5c:ef:4b:28:06:d7:db:e8:bd:36:4d:06:da: 31:fd:aa:f3:8f:d8:5b:1c:0e:e7:10:84:1b:5d:0a: 18:b4:6b:80:06:f1:aa:d3:2f:60:87:46:5e:cb:47: f5:30:c2:af:a2:da:e8:8a:9e:a2:ae:d1:ff:87:41: 80:5d:f4:85:54:ec:3a:76:a2:ed:6f:98:42:e3:d3: d7:c4:25:5f:53:bb:1d:d6:9f:7d:70:c6:64:f0:bf: fb:43:d8:cc:f7:6b:da:f1:e5:4b:38:9f:34:e9:ed: b4:f6:6e:a3:80:0b:04:4d:e1:85:fe:31:9f:18:79: df:5c:1d:55:08:6c:4b:a5:93:5f:94:61:15:4f:68: c7:85:ac:1b:b4:37:cb:9b:50:25:0e:f6:01:13:d6: a9:56:62:2b:55:89:20:3b:84:56:5a:56:3a:eb:44: 77:53:1c:23:71:95:32:e6:6d:f3:43:d9:68:90:b7: b8:9b:3b:7f:a9:79:5e:ec:7d:c9:4a:c4:e7:3b:73: 83:7e:fc:c3:91:e2:e9:1b:77:0b:4a:cb:8c:7c:e7: ef:c3:22:0b:a0:c6:95:c1:b9:28:c3:81:f8:ee:30: 80:5c:c7:09:27: public exponent: 01:00:01: private exponent: 55:09:ac:8a:e4:5d:7e:c2:05:55:e0:63:f5:04:7b: 89:73:dc:47:54:56:20:be:ff:30:90:1c:a2:cd:02: bf:77:82:af:21:00:f2:5b:2c:48:96:eb:98:88:b3: ce:da:f9:0f:43:79:90:9c:37:0b:7b:9a:8c:63:45: 06:3c:09:07:c3:e3:87:29:0d:47:c2:6b:b7:86:b6: 40:d3:ce:ba:c4:84:dc:44:8b:da:f4:12:a8:b1:00: f0:f3:38:61:03:62:15:00:d9:4b:ed:db:3c:64:5e: a2:b5:72:c8:27:ae:3d:82:93:93:e3:a4:02:5e:35: e4:53:f8:f8:fb:4d:17:3b:26:0e:98:98:4e:23:16: 77:23:07:21:b1:76:b1:a7:9f:90:a8:ea:da:f3:3e: ff:3f:b6:be:19:7e:15:b0:3c:7d:75:f6:7d:58:bc: cd:da:ba:4a:ac:b5:ab:91:a9:71:b7:bf:db:0c:ca: ff:7a:72:0e:98:64:78:af:26:fc:07:df:8a:2e:9f: 51:3f:b3:d7:14:9f:1e:5a:0d:73:58:3c:37:67:5e: 4e:6c:f4:bd:e4:58:ae:aa:bd:eb:68:e3:ed:9c:78: af:de:80:9b:6a:93:01:ce:8e:b9:1b:ea:c4:cc:a8: df:55:8c:fb:27:6b:c1:64:9b:ed:48:c8:80:86:e3: 2d:a9:67:0a:7e:be:83:c4:aa:33:24:a1:c4:b4:2d: 17:72:6e:45:9f:81:b3:61:34:03:38:a2:6e:48:84: c3:aa:4b:9b:ba:0f:af:c2:2d:e0:b8:55:bb:01:3b: 6e:bb:77:81: prime1: 00:e6:06:0c:d6:72:1a:a9:3e:91:2f:5c:ca:a4:36: 2a:0e:1c:b8:e8:86:e8:c8:8d:f3:01:da:58:1c:5a: fb:71:23:84:66:0f:ec:00:f7:0a:ce:f4:0b:bb:93: 29:fe:50:ce:39:03:ed:0f:67:3e:a2:2d:3e:fa:c3: 1b:bd:cd:59:22:b8:57:35:f3:14:e9:4a:a6:62:22: 99:9b:a3:1a:b4:2b:d3:be:d0:7b:0b:8a:fb:5c:3c: 6e:05:45:58:c4:13:e0:96:33:b7:da:b0:14:dc:fa: 07:57:68:33:ab:a8:ab:1f:26:f6:96:ea:f2:5c:02: ee:99:28:ec:2a:65:f6:6f:6f:4e:5e:65:87:95:b3: 65:70:05:f2:15:37:6f:f7:94:67:19:98:b9:94:f1: 68:d5:47: prime2: 00:fc:71:0a:87:55:5d:b1:46:2a:95:0b:c4:38:ea: 38:71:bc:ce:68:8c:4b:0a:34:cc:50:df:50:d9:84: 1d:e3:9a:29:45:90:36:54:a0:f8:ce:69:82:06:5c: c9:db:e3:2f:90:86:ec:2f:bc:b6:ed:95:72:1c:b8: 1c:58:de:f5:ee:24:99:3c:e5:ab:8b:89:c0:94:c2: 63:a2:c9:2c:b1:7d:ad:f5:f5:fa:e7:04:84:e5:08: a6:c7:8a:46:92:5d:45:0f:b0:e9:b5:9f:a0:6c:43: 72:14:eb:00:e1:9a:af:9d:5e:2f:be:a3:d6:82:b2: c2:db:c9:3d:5a:42:31:a8:8b:26:6e:ee:50:96:48: 57:fc:96:2a:6c:ce:dd:d6:1c:59:22:06:0f:63:c8: 51:9d:21: coefficient: 00:8b:25:6f:8d:58:ca:17:d7:66:73:7d:c1:22:b3: fa:f6:09:b7:2c:b6:95:47:66:d5:17:97:51:cd:21: df:aa:d6:29:41:6d:c2:22:7e:dc:28:8a:a8:ab:fa: ba:c8:84:d3:45:be:9b:1f:8d:b6:c2:c6:17:88:65: 39:19:f4:1f:fc:98:a3:27:ae:4b:c1:3b:b3:b4:d8: 76:89:ec:51:c2:56:bc:53:e7:6c:1f:39:ab:37:97: 03:32:67:c8:15:0c:67:9f:6f:7c:92:3f:b3:12:b1: ec:ef:98:11:65:fd:96:20:5a:27:5d:fc:3b:cb:f0: 7a:c8:be:dd:02:c0:52:36:da:7e:9a:99:32:3f:44: 8e:fe:84:29:5b:44:8c:ea:42:22:18:4b:a9:00:e7: 63:e1:3a: exp1: 00:ae:50:cd:6f:c1:de:e4:7d:2e:c7:46:b9:a6:82: 09:92:d2:3f:6a:af:ba:3f:2a:1b:8b:3e:ed:60:e7: ad:ff:0a:5c:6e:80:08:68:9e:ce:89:11:36:c6:fa: 7a:6b:68:cf:2f:34:03:75:95:d7:48:4d:a3:99:a3: 3c:25:b5:35:a4:73:30:5c:09:0f:c2:cf:b8:91:4c: 09:3e:81:f7:5d:ac:8c:f5:e0:c6:2e:74:2f:92:b1: 94:ea:d7:a7:b2:48:21:fd:91:c9:f5:a7:54:d8:35: 7e:54:c5:f9:ca:4f:b3:06:93:9f:71:b5:30:df:7b: b5:57:4a:44:d6:c8:98:5d:d0:6b:02:6c:4c:b8:ac: cf:e5:7a:0b:ff:fa:18:16:f6:56:bf:76:16:c5:81: c0:e1:47: exp2: 39:1a:b5:20:02:0e:8c:b0:6b:a7:85:9e:e0:a5:13: 19:9f:75:2d:af:36:b6:5b:55:30:a2:23:9e:e0:c5: 06:1c:74:63:99:08:c1:42:1c:a6:4c:b5:ae:0c:c5: 58:e9:5e:74:1a:21:49:77:2e:06:36:7d:36:c3:eb: 1d:ab:6a:04:71:e0:fc:26:94:14:9f:97:a1:cf:0b: 4c:e2:a7:2a:8b:5c:93:bc:0e:02:be:41:f5:b1:6c: 50:cd:15:c3:bc:37:88:22:23:ec:02:ec:fe:30:8f: 98:ed:c4:28:44:9e:9f:41:94:19:52:e4:8e:72:33: a4:16:34:bb:bb:27:92:91:cf:a2:de:63:fa:6a:e9: 04:69:4f:b5:87:62:25:32:0a:73:a8:dd:48:5c:23: 22:21: Public Key ID: 76:93:58:59:EE:CC:7C:85:34:97:25:10:BE:DB:72:40:CC:57:4D:EC -----BEGIN RSA PRIVATE KEY----- MIIFfAIBAAKCATEA4tOGxJlf86iayWaF9stDhAv6std8BU3/XsllHhZFhZ5follQ c1IxgnYH3wlm1T9pEd01XjqivrL7RQPUAULnjfCn0p61wtthpfYuzFzvSygG19vo vTZNBtox/arzj9hbHA7nEIQbXQoYtGuABvGq0y9gh0Zey0f1MMKvotroip6irtH/ h0GAXfSFVOw6dqLtb5hC49PXxCVfU7sd1p99cMZk8L/7Q9jM92va8eVLOJ806e20 9m6jgAsETeGF/jGfGHnfXB1VCGxLpZNflGEVT2jHhawbtDfLm1AlDvYBE9apVmIr VYkgO4RWWlY660R3UxwjcZUy5m3zQ9lokLe4mzt/qXle7H3JSsTnO3ODfvzDkeLp G3cLSsuMfOfvwyILoMaVwbkow4H47jCAXMcJJwIDAQABAoIBMFUJrIrkXX7CBVXg Y/UEe4lz3EdUViC+/zCQHKLNAr93gq8hAPJbLEiW65iIs87a+Q9DeZCcNwt7moxj RQY8CQfD44cpDUfCa7eGtkDTzrrEhNxEi9r0EqixAPDzOGEDYhUA2Uvt2zxkXqK1 csgnrj2Ck5PjpAJeNeRT+Pj7TRc7Jg6YmE4jFncjByGxdrGnn5Co6trzPv8/tr4Z fhWwPH119n1YvM3aukqstauRqXG3v9sMyv96cg6YZHivJvwH34oun1E/s9cUnx5a DXNYPDdnXk5s9L3kWK6qveto4+2ceK/egJtqkwHOjrkb6sTMqN9VjPsna8Fkm+1I yICG4y2pZwp+voPEqjMkocS0LRdybkWfgbNhNAM4om5IhMOqS5u6D6/CLeC4VbsB O267d4ECgZkA5gYM1nIaqT6RL1zKpDYqDhy46IboyI3zAdpYHFr7cSOEZg/sAPcK zvQLu5Mp/lDOOQPtD2c+oi0++sMbvc1ZIrhXNfMU6UqmYiKZm6MatCvTvtB7C4r7 XDxuBUVYxBPgljO32rAU3PoHV2gzq6irHyb2luryXALumSjsKmX2b29OXmWHlbNl cAXyFTdv95RnGZi5lPFo1UcCgZkA/HEKh1VdsUYqlQvEOOo4cbzOaIxLCjTMUN9Q 2YQd45opRZA2VKD4zmmCBlzJ2+MvkIbsL7y27ZVyHLgcWN717iSZPOWri4nAlMJj oskssX2t9fX65wSE5Qimx4pGkl1FD7DptZ+gbENyFOsA4ZqvnV4vvqPWgrLC28k9 WkIxqIsmbu5QlkhX/JYqbM7d1hxZIgYPY8hRnSECgZkArlDNb8He5H0ux0a5poIJ ktI/aq+6Pyobiz7tYOet/wpcboAIaJ7OiRE2xvp6a2jPLzQDdZXXSE2jmaM8JbU1 pHMwXAkPws+4kUwJPoH3XayM9eDGLnQvkrGU6tenskgh/ZHJ9adU2DV+VMX5yk+z BpOfcbUw33u1V0pE1siYXdBrAmxMuKzP5XoL//oYFvZWv3YWxYHA4UcCgZg5GrUg Ag6MsGunhZ7gpRMZn3Utrza2W1UwoiOe4MUGHHRjmQjBQhymTLWuDMVY6V50GiFJ dy4GNn02w+sdq2oEceD8JpQUn5ehzwtM4qcqi1yTvA4CvkH1sWxQzRXDvDeIIiPs Auz+MI+Y7cQoRJ6fQZQZUuSOcjOkFjS7uyeSkc+i3mP6aukEaU+1h2IlMgpzqN1I XCMiIQKBmQCLJW+NWMoX12ZzfcEis/r2CbcstpVHZtUXl1HNId+q1ilBbcIiftwo iqir+rrIhNNFvpsfjbbCxheIZTkZ9B/8mKMnrkvBO7O02HaJ7FHCVrxT52wfOas3 lwMyZ8gVDGefb3ySP7MSsezvmBFl/ZYgWidd/DvL8HrIvt0CwFI22n6amTI/RI7+ hClbRIzqQiIYS6kA52PhOg== -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-2-key.pem0000644000175000017500000000321712735676345025113 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAvmAEI3lGwJZ574UOIpkGy+GlPLCYzPzO4IJudTXV3r91sLzn Qw1PC4L2iiKDEMkGkuVwLeEP4QHh2SVtDcd82VvV1oqph5arFC3UCr8SM/cZ7y0U e+IB3XTF6rDwh4nkjb15uHJ5zTyMJljYgSKOTXSP03vrTZhqs6TuLdRvY2JYRjYX Nr1CKQ6OGztr1qnkcqp0JawMpH2bEnI68mbTAQ0nPcWXYyZSbdp2y5UCVVIItWxM Gsz90lhIo32UyoZ159G74RRlEhLLB2+QlFa+iC0c1ibQFaf7rGAGkC2S4TIXAPeG LxQdHZVZbbHbb8AT4nRAuDTDyXIrTf97NX0GzwIDAQABAoIBACH44mQuLSkK8UGD 3ezgn+zcHG+DGBFkf8pinDGAZOT2B5t9akt14YgtW690zyy8otat6OHXCs1dV583 ZYmS8r2a/MLnRa9zfJ4CO5ebVzU8wD0FL2WYBDsvrm3eG14khkug50q56vBsAJqL Oj95GinKRiw4LdpP+6KJKRO2mBYE1Mkm+Ma2YD36/40zuDGKyp47oFNbZOHgwI/l U5Oi10/HWFXZ7J8qFWX06prQVymWW/eZdgEtjrVqzRXCdea85UdlbPYZ2DoIjO2e TFJ2ApjVY8uCZtd1PdTAmIK+RWHPbRY3e1fGji+1W5PT6FkVzS9DoYUTsA8GFche /bqvDUECgYEAz5N9iaAGISlGjSU+iW2WHD/+WIru1u6hjXjKyI1kAW42h6C9rLnS U+fRl34p+chR9pI+RM8lQjqa1Pfl+kQEu4hQertgSbbdy8FJ6UK1nV+ianl+rdYB HXup2a7EDZGYsWMKLE0hSZ/Y6aVrO4mrrvGX//aDHsB5qSGEIAnzP6ECgYEA6slF yXbGYxOK2qvioUhrDYAMCcPEOy1Gn9pcyurV4Vetk+uFjZs80pcO1fu6GXkc7mR3 pveFUx0f7C7D5NYq9PckK/JPj3CkVDlm/uIHSZeRDYjkPDaAB38Lphkl7DDTlP54 XD22XhziV+WIIvly4t7vziBtkJMR1s+sq+JucG8CgYEAxpJLl6qT8okvyrqEVqeU 4DV/tWhDDy19Mn8JTk2kC5JJa/mjOWcSA95SLGAu+5pcfkpscxrOg8rYbz8uq/kB pfzDMIWrmRjsmIyxjgmY/5GLJ9xOCTIeIvw4AdwkBO7xaVBbXQH0BCB8OxdZu7z5 lgPb6qsByBtMxzUe1h9uqcECgYEAxiI4nH15id7SDRuE02qTvP7UKeFlVjMtKHVU XYG0IMinGO9m80uQFn+X64jVUe3dNmjeeK7lenBXoi8M7a627acqhVOlRH1gkBsp CeuhDr+zj2J4iT/M54aVRARw9lN2GoRs+hqyLdXeRSLUsf8krsRIRwEitSEHquny 49LgNE0CgYEAhATwToe64ujjjADzacdQ17Jxlxjp6Ko8afuKMRixY+gIwhLhRv/i FUHq3uOxVuPK4P2m2Euc0UUQyWhXsgOzSFcwwlnfLbTBoe1TNsBYPgf/Lm/MqgYi GG/QIM1GkaheDwCrn4QIAgzvHLFNJC8ouwA3Uj9dkaYvXjoW65ftwcE= -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/unknown-cert.cfg0000644000175000017500000000415212735676345026212 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 002 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ss-cert.cfg0000644000175000017500000000415012735676345025136 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Confused" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 001 # In how many days, counting from today, this certificate will expire. expiration_days = 10220 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. cert_signing_key # Whether this key will be used to sign CRLs. crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. #time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-0-crl.pem0000644000175000017500000000136713012550005025052 0ustar00gkiagiagkiagia00000000000000-----BEGIN X509 CRL----- MIICBzCB8AIBATANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJVSzESMBAGA1UE ChMJQ29sbGFib3JhMRkwFwYDVQQLExBXb2NreSBUZXN0IFN1aXRlMREwDwYDVQQI EwhDb25mdXNlZDEbMBkGA1UEAxMSV29ja3kgWE1QUCBMaWJyYXJ5Fw0xNjA3MDkw NzQ2MDVaFw0yMTA3MDgwNzQ2MDVaMBQwEgIBCxcNMTYwNzA5MDc0NjA1WqA6MDgw HwYDVR0jBBgwFoAUSTAmCIya1mnNi8DMDlwCjkofpowwFQYDVR0UBA4CDFeAq70t sGE/P6rkCDANBgkqhkiG9w0BAQsFAAOCAQEAWObLL6v2KJh8h6ZMCn2uVDre0avT SWtqokxDU1xVeWT5hj0AHCrOCS8hXLgTxclYYONrVcG0l5oxIKkf2Smo+syT0dXS 3N7p7fsgxrom5eQiP8wJM2n5iOC/QYX8IpTshZOPzoELxc4RvuLfThCdF73EpVHy RkdbyiK4CsLdpT8Vptk3vaLO3w/UdIfSLAOq5Oicw7SNQ9WdFoCA9gmuGLePDO63 gJ2pbvKuGM7qZWOa5eBHFNX12aZoeVr1NbJU53CYT0POkYTsLBEHPRP4YTX9W2Ik w7H546f3mOnYKKGa4SToN+TwiuevwHoXWuAdUKLR/wl9GPrUUR0f/7HYYA== -----END X509 CRL----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/tls-cert.pem0000644000175000017500000000271412735676345025341 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIIEHDCCAwagAwIBAgIBAjALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjU0MDdaFw0zNzA5MTExMjU0MDdaMGkxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxDjAMBgNV BAgTBURhemVkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsGCSqG SIb3DQEBAQOCAQ4AMIIBCQKCAQDC30AXWnLcakXrq3rHIfy+0u7zNAmdRYw88MIA 7wpZZ4LxMHMqu4YnnyysoRNI9wblCPkJ29XyBmhfLc9Gmnnl6phzf04n9x93Z8t9 JHnnwqqJzdtxfuHsAWa/+2He3uNxWML+dUy/OB5iazPeCwKtqwmh57oLFLHkF+Dh hrweUkoQDDnJ/1xT0bHmdslQ9qnMIxhjDUoZ9TkAk+8PpsoHbPclfr6ytnCjGfLO oA9vWehPokTDvQPQmXc52vIFNp8A3h05jep3DBYzkG+WJcJRNhyxC0dzFqyrFJW2 XMtCs0p1cPaHgXVPCe4icXLY48ehVaFvBR02K3jVQ7WketzxAgMBAAGjgdIwgc8w DAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwIQYD VR0RBBowGIIQd2Vhc2VsLWp1aWNlLm9yZ4cEfwAAATAPBgNVHQ8BAf8EBQMDByAA MB0GA1UdDgQWBBRDAfw/7QRZO5a0qmJ75Oeo3hA01zAfBgNVHSMEGDAWgBRJMCYI jJrWac2LwMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93 b2NreS10ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQAIcwQ8FN7lnnQPm4al6y5v zrGzVSxkUuN+I8457E9ZAoFpItMGqWWKjjbOgjS3d95yJWmEW2eBVC3/LMEAvv4z Q6HkTRhafkiLWmXNa8DtbUq1cZ2hNrR1lNTOL4zXwg9JQbtFw0EAM7LfSgqHhTzs xO0AbXaO0TlbYkn9/amPCNQcFjg6Dgdm3x0T3g/tLQjtzjro/hdgYZqPng0MYBpG AUj99FwahI5D8cAPoUjtpxZOlsexz4r8UVGNRvL0Wqg57w8KKF7GVr15b2ZAeQwo pNJkMSXAyPpKW24Q06zwYFnC+Cp32udf2wIB9FEC3zNQugUbtFitHzPjzhum13iR -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/exp-cert.cfg0000644000175000017500000000414612735676345025312 0ustar00gkiagiagkiagia00000000000000# X.509 Certificate options # # DN options # The organization of the subject. organization = "Collabora" # The organizational unit of the subject. unit = "Wocky Test Suite" # The locality of the subject. # locality = # The state of the certificate owner. state = "Dazed" # The country of the subject. Two letter code. country = UK # The common name of the certificate owner. cn = "Wocky XMPP Library" # A user id of the certificate owner. #uid = "clauper" # If the supported DN OIDs are not adequate you can set # any OID here. # For example set the X.520 Title and the X.520 Pseudonym # by using OID and string pairs. #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal" # This is deprecated and should not be used in new # certificates. # pkcs9_email = "none@none.org" # The serial number of the certificate serial = 002 # In how many days, counting from today, this certificate will expire. expiration_days = 1 # X.509 v3 extensions # A dnsname in case of a WWW server. dns_name = "weasel-juice.org" #dns_name = "www.morethanone.org" # An IP address in case of a server. ip_address = "127.0.0.1" # An email in case of a person #email = "postmaster@collabora.co.uk" # An URL that has CRLs (certificate revocation lists) # available. Needed in CA certificates. #crl_dist_points = "file:///tmp/wocky-tests/crl" # Whether this is a CA certificate or not #ca # Whether this certificate will be used for a TLS client tls_www_client # Whether this certificate will be used for a TLS server tls_www_server # Whether this certificate will be used to sign data (needed # in TLS DHE ciphersuites). #signing_key # Whether this certificate will be used to encrypt data (needed # in TLS RSA ciphersuites). Note that it is prefered to use different # keys for encryption and signing. encryption_key # Whether this key will be used to sign other certificates. #cert_signing_key # Whether this key will be used to sign CRLs. #crl_signing_key # Whether this key will be used to sign code. #code_signing_key # Whether this key will be used to sign OCSP data. #ocsp_signing_key # Whether this key will be used for time stamping. time_stamping_key telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/unknown-ca-key.pem0000644000175000017500000000321312735676345026445 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEA3OnZj1DlQPIDzJ15thqOY8IAIUCAL7zKbCwC1b60WGQasDF4 5DVD/WGBFfRLQlWRIlfj57bCdmc+1SrXjJCJGFGzr0QLZsqoOEi8V8goW57Eqdzu HW7e37oY9zd5zScnnftUnt6+2fl/lKR6Vit3AhNsCSZg8v5glccBuq27XlzSDc9K tSBeleUV71tF1K+n9RC8oKrixlB9KLgY6ppfBn7N4m5Awoqozhk+85snrlWZZELb S6ov5MEVJ8BoVsCejZWCPxHIG8fX8zccgZ/Ktll6Qx2RUTsPlsETXteYBEh7zWoc DZi6Qnr7qqHZoq8nlgi8Q+LeT9z00uItD4RH0QIDAQABAoIBAArnr83Jb2Gw+LNK cEJHJhGCV32MuK8ylXb4xrSMrwwgd+lL7eTtBLPOsv+1kRv/i5QrjMRo0wljgBhn fp+xmFTnHpS3qgzrUtnBbGu0ZZqdOCXO8kGpcg7O+dHFTynLhaMAr70Ob5Mkw/Gf W2sixuOHOCls97LzD+tA2ULg9dt658QqtSO4UhJjQz7aV4oz625NBlV6C0GYSo+5 vtxIey2jO4mzg0uTdDMbk+x0D0+Y5KfVGTZfKv4c3Ekk56m0IZfDA6hi3/16DY7X Th2f6Y6gmrxcyz6BvaV05LMXeYgcxSnp6np3PoH7cD9PSmlBYWuW0yx7KfQjFdr/ pdJl2EkCgYEA5OHifkfJa6toFbSF82E5u/l8u0JsjLYlVGJMdpD62tFPMRlpE4mQ HN45JF6uHbkCd00xqZ+z0WBw6gpk84BKW8Qk5luU0PPc2giLn6WlD0GBCi7TV5Cw lhf5CL/Dz9tsfnoJ2SRfr948h2Gc7c/XmeTub8BnN2F7cqwkmfLKcwkCgYEA9xZD zI+5s5qv/ZRkqs697kKVEqX51FsVHmNDp/dVq4vkMjrqfWfD5PwRwZ2kPyvwXfb/ s9NR58IJkkqxwSvSTAOfZtlJmWMVxP/6GStOcuPI6MHcwjXQmkKCgx6z00VLB1TG OIjNqU8hSTpd9Mqecj7Y5U/aTGQTbRNxLXbc+IkCgYAeQFTFSAuxNWh+ZevGbTVK SQFZZsAeIPzyGEPu796YCU4kOS2QLYBksGJxEiqFNyzCQ+uqdbc4lzyVUmZhYLVz R4tw/u2+aFzqXHLH2Qbl60x44hOA4VjVnbmGlIH2+RNv7AVdM9eJ0R/C7P3m2K+w YXe6QX3i7fl5AJOd3V8wsQKBgFGdAhH8WztO2dipfkLI/QVI6tJ5DjctSqF56iv9 z0dVcq+AtFltv8/PztGkD09qZP+0iStNnp0tg1nV4DbNEa5X9/vRw7StfNBQOLy9 iDD8uizfc9qWSevaEh/bMUyUc77dKogb78p/v5/fbo9fqcxUo/HCWXmoCJ6bsGNz AnP5AoGBAKVK8otu7a2z4uxhVySOhaJ6GvWZZ6TkM8SZUFxW8H2EPLyxaIeSnMZF G217tfER+hiP+nviCwGYxU88mo5Pn2OXlhWTAEJv/TccM6G4eWo06SDz3cqWYfNh B7rT3jiBfNwbpjokwcbIbzvyx7jjFjsas1b9Fdk+XdFV2pyXB9JA -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/rev-key.pem0000644000175000017500000000321312735676345025161 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAp8maSrexTHpBTvTk8yGc0D081R9xQgY4aFYgYUrQvaFnAha+ vkRzaYt1FBvsrYJcuwpWq93M/g97Tylln3jKNOPPeYevwdcFAb7aYzWcVbXNsr6J inKAslmslp7rnE0W9cGwAdPrIbLgShwQ+C9lrO6B5J9MJlXdB2KGsq11ATJkLou2 OZGIdC2gfoHMZrv0aIUsLwb6UrpDpfDjpAep4B36CbV90q43UxyAmNv1Gtnzsb/p 4eoTsuccu32qWDBTbXbzQpYn6i7yu1a4plajcbYkmSjRk1aEzwVmoKPjVdmmzWI0 rLRpFFoauGSODZpMg3B03gLX8f9eNlVz6hrtCwIDAQABAoIBAAH0S9hu8fZiviao nOS6vCmDbRVLu8qkaT0d3lwDvmasXezHowpy9afXDf1hTeJqJaEFankEqQHp4D/N yvc5NZxkGDiMJ18/R+RQpW6JDfxu6lRt+mAjG/NNLsDFB8LW9bDVxAe2wNha+Fh5 9zX3fLGvnX0Hi0rZroIK2GggXmqDIj+Ce3k6wcJLhZ7h6bext18lPKXigvTAFqVZ eJ7sucBrn+ww0qhBACpZ4RT2aBk991/Vrberw9OnJg+ipvjKnn+c+MoyftMj9Ih4 YMh87gRkdObukX5AiEYyYf0VGi7ejDMIygmQzpuup3jUYjNbpwwZZdoz4mwKqmvm Tvr7xdECgYEAzGxPHANCPkl4typwmEYEDRFKPtcoYKr9DJAQL9zqtqb3wEzbbSmN x5HzQqeX/hHND93OdCLKCzcHoF6KgglAmMIwu0ihagHT5Vul1VCoGItGWorL4XIW GTm8kKZXcDCgb6UWSG48fDj5eO5y+ZAxYjof97OmX6D9eleptKfZPe8CgYEA0h8A Wl1b7Qcsx26bLOGih5UuedKsda7EWUIbg5M86zy2UfJC3Rl6n17+gS55ffjuRrek eYrB2bomAnjhvPPaR6us7j/z87BsJ2PbZSsS/AkoCGqn6yjYR1eUWA65zbSEbWd2 RHB9rhcY7DDW2hwzkSkxbWzaXCuHNme0ZStsHqUCgYBNIbDXyQL9rYs20XSagBCX Pabd/yDlGJ9SVilFZf3J3UYt8NH6ZmtwmclHpSTcYKsXCYIUn+vMP39JK2LnncYZ 3Wu1vrno3beuGt5/lmdWm3Z4Q1aaQgnEitxzV9A2LKLcfVXjDnUUCgtXbeFD+Pwp K/VT6R0liAEcYGdQGuUFUQKBgHhCYAxYJJXLpnhaOJv+Y+xfmKMGzcfpB93iNScg LRyhueO62UP8Ii92ygkblVNhFtcIoi0iGoLHxJtjnidsFcExY59UoQYXMj91KouD lLEFeJEgogy4atiiKngfrX4rVCPdtFXFYFk0RQJhjYZ135m0TuLHC073ZsLfpeLF cHM1AoGBAKru0XcmVES6ieGAPtKm4IBgT4kXoBdAfYcans9DCRqJqqqcnALgHyo2 P2iP+/5u20XOb56bu15ko0fGkq7ibsdrsl9tZbXVyo3/Q0WesN4lOfVEB3tCmS2r D7alla/Fs5HrQEiCYUQGHisEuLqxt6LoHMv8vOqR8jGHiwX98cbe -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/ca-0-cert.pem0000644000175000017500000000260312735676345025254 0ustar00gkiagiagkiagia00000000000000-----BEGIN CERTIFICATE----- MIID5jCCAtCgAwIBAgIBATALBgkqhkiG9w0BAQUwbDELMAkGA1UEBhMCVUsxEjAQ BgNVBAoTCUNvbGxhYm9yYTEZMBcGA1UECxMQV29ja3kgVGVzdCBTdWl0ZTERMA8G A1UECBMIQ29uZnVzZWQxGzAZBgNVBAMTEldvY2t5IFhNUFAgTGlicmFyeTAeFw0w OTA5MTgxMjE3MDZaFw0zNzA5MTExMjE3MDZaMGwxCzAJBgNVBAYTAlVLMRIwEAYD VQQKEwlDb2xsYWJvcmExGTAXBgNVBAsTEFdvY2t5IFRlc3QgU3VpdGUxETAPBgNV BAgTCENvbmZ1c2VkMRswGQYDVQQDExJXb2NreSBYTVBQIExpYnJhcnkwggEfMAsG CSqGSIb3DQEBAQOCAQ4AMIIBCQKCAQDfmrRZUa4UWDLgmHNRUaXIEwhwSQRESTF1 fWd+NP5xMO65OE0JAmzk4rdPH8xiuba3WnVVvA+nop53lC7emTTMVzWLWLJEV3f2 1xNeHCRWxkmzAwAF+x9y9zGV4mRgMWk26g0C0dmaYPILcTciYRwjvawEdd78z09w BSGdYx1Ya+Mr9BBl2tThD4cliV6DVdlwhnvu7eamrQ/LdeS/n4Z+X8MYW+G49a8b vqHvpp7MS8pIwEMfgkzfuG+K/++Cvz5WfOfnDYH13ahTks7k0RB16rt1qUnvF66r zYJbzqJSc4mbhcOJuFURXeiZKY2f78W1b6RRTvENISdnGKJPwMxZAgMBAAGjgZkw gZYwDwYDVR0TAQH/BAUwAwEB/zAlBgNVHREEHjAcgRpwb3N0bWFzdGVyQGNvbGxh Ym9yYS5jby51azAPBgNVHQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRJMCYIjJrWac2L wMwOXAKOSh+mjDAsBgNVHR8EJTAjMCGgH6AdhhtmaWxlOi8vL3RtcC93b2NreS10 ZXN0cy9jcmwwCwYJKoZIhvcNAQEFA4IBAQCL+FK+IzN9Z88ePw/MU2Y1Yd2oigeb /02d7DrzQQXpSN1y3t0LKpi3MM7QbGDVUmC6WI7Tpe9wf0G6ZTfZ6jMeS/4OpeG+ QNRWxAWtAv1+QDEtHf9rVFKjl9SUbKhbsLHePggS52LV/YTwD1PxbCsl75jpaCvU W22tTJL0K1lFBYLM0IxiOkn+vrWNsOYfVpXZbjB4ExLeNp1li2tetXJLluMgeGr5 bKYmWfYyze6FOcp1zQh13e6I0DqIh7F6hb/nKaWcJKSNsq8JsgLWTba8iDF24X5C 2l+SJE0iNtg08tC6XdZ9v1DQUHKIKSX7L5MEVgHbLiOKroriqVeQu8zK -----END CERTIFICATE----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/certs/exp-key.pem0000644000175000017500000000321712735676345025165 0ustar00gkiagiagkiagia00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAnlBf47+ldQRlzW/nqYpggSx0alV6TkLnf7gt0WIBv4XGoDOJ FKmrwMkEiGvNznPS9NUmN/EDRDW7OGHSwR9Br8aOEnNwP1/CGadt5YOpksMWc1qE Tvw9IOW8QwJAl2PoYfnneB53x6PmtSf21Z8jcHerLGoEH8gl19IQpg+LDZOAxZlq 99KBFTEaOY2k3EaMl3+QE7gWvA9G5bsDmqnHGqLBS0upugdHPKOjjrk+0jPvVb8x tQVPk87bWayiZi4dr6yldPfiJ4sQxTH3plhlAh39fN8Z/Um9W5TcozPvmYE7PfHW yV0rc8WCzDZHiRWba6DIusM4LdSm33vV63GgoQIDAQABAoIBAEe1Vkm9w/8l98q/ FmrIAABil3SWtSh/y4Yhcbd2sh4DRT3JOh0+4UoYg1IbqoQKGJLHfWE3bOhXgi7+ uEy7kLBCupWG7l/2St/945xjL8sHTMMBTA7O2A1vof+kJIeuPFMss/jHrC+kgNqr eHW4eH/35HPgrW+L5ABG6T2eqriB0fxRLHH1QwsOqIoIG2YRe04PdEsjcNgtSA7d pqcUQU21zbfk2ELUTE8SrlMeDv+ybQTrUJeM44i50R7S6nX5z/KceLO69Hgbgy0Z CXLsmwCgQl1s7Sg0Ur5TSgSKmqVbyyVtJxln3LBMYpO4JxM6LTMT2klxtpZcGbkW rRbLtRUCgYEAwX1LrXcQWm1m6mkni5NVxXxM70hySKuchcDustLxjlnuGuE/IkXI 937fFmXoI8XMGdsBna/WA+CfngKOZK+w0LhOp5aZHGl74r0v/fkS2fz+qzctekQ1 XZ0/QY1hzquZWiczlxkT/lbe0hD4t0GnQom9tJdmLfqxU/ovqKItQO8CgYEA0XXc vljS32koN2oUWWkeBijO7tXHYze2MyiqA447zTaVqSaP69j3LjVa8tHMbADCe2Qx 4CCPuizbGzf8T++hA0e4jGKcnwd96HUHbfP4Q9qNdzg88kUIT0QrDXccMF3MAKRI zd/YzmMDPr+mTWxkDiMQ3kvyixDaJAyTbzzTF28CgYEAgF220lt2bve72nJu+OuD cOR5Shp/L3Ui/52y/tJxzWYeUJj1QLCZlpEGQh7Ttr/oG5MvbEUWsDXaz4KUo3nn zWEpVYfVBoN43EF1UIJpHlP5RO/zbPVJjlTffYblx64SrDvrvye1GvzZEPaPe0zE QaGOSPxUntZ9xN/rtG37peMCgYAfBwKH/8hc58rZSpFxHS0hZHIi1vAONnZ65Y8p r6wUHf3VbKztFtqmsaijR4ishwBIHvN0a95eib57LbPmc2y6e6lOwlzJAecYxB0x oG4qPvmtq1r72FX+x+5ItFgsofhSMAPI21vWVrxoUyNjXKcFoRQimcV37CskI+jD FZN/aQKBgQCQ0pGix/pOA5SJ6ZgwsovK97h/F2VvVx2NhzR2hKkp1ifFzZYmYCLf sm7bzuzcb322ahb+bCoVTUpD6U1QXpeuJnqCx+VBI6J3WfBMerKSzxQQ6ksGfANS 3OOYYAtZOMN72utKg6UPd7zVtTx8gC1peRogQEfELDT8INPOv/RG9g== -----END RSA PRIVATE KEY----- telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-pubsub-node-test.c0000644000175000017500000010727412735676345026466 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-pubsub-test-helpers.h" #include "wocky-test-helper.h" #include "wocky-test-stream.h" /* Test instantiating a WockyPubsubNode object */ static void test_instantiation (void) { WockyPubsubService *pubsub; WockyXmppConnection *connection; WockyTestStream *stream; WockySession *session; WockyPubsubNode *node; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); session = wocky_session_new_with_connection (connection, "example.com"); pubsub = wocky_pubsub_service_new (session, "pubsub.localhost"); g_assert (pubsub != NULL); node = wocky_pubsub_service_ensure_node (pubsub, "node1"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_pubsub_node_get_name (node), "node1")); g_object_unref (node); g_object_unref (pubsub); g_object_unref (session); g_object_unref (connection); g_object_unref (stream); } /* test wocky_pubsub_node_make_publish_stanza() */ static void test_make_publish_stanza (void) { WockyPubsubService *pubsub; WockyXmppConnection *connection; WockyTestStream *stream; WockySession *session; WockyPubsubNode *node; WockyStanza *stanza, *expected; WockyNode *pubsub_node, *publish, *item; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); session = wocky_session_new_with_connection (connection, "example.com"); pubsub = wocky_pubsub_service_new (session, "pubsub.localhost"); node = wocky_pubsub_service_ensure_node (pubsub, "track1"); stanza = wocky_pubsub_node_make_publish_stanza (node, &pubsub_node, &publish, &item); g_assert (stanza != NULL); g_assert (pubsub_node != NULL); g_assert (publish != NULL); g_assert (item != NULL); /* I've embraced and extended pubsub, and want to put stuff on the * and nodes... */ wocky_node_set_attribute (pubsub_node, "gig", "tomorrow"); wocky_node_set_attribute (publish, "kaki", "king"); /* Oh, and I should probably publish something. */ wocky_node_add_child_with_content_ns (item, "castle", "bone chaos", "urn:example:songs"); expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '@', "gig", "tomorrow", '(', "publish", '@', "kaki", "king", '@', "node", "track1", '(', "item", '(', "castle", ':', "urn:example:songs", '$', "bone chaos", ')', ')', ')', ')', NULL); test_assert_stanzas_equal (stanza, expected); g_object_unref (expected); g_object_unref (stanza); g_object_unref (node); g_object_unref (pubsub); g_object_unref (session); g_object_unref (connection); g_object_unref (stream); } /* Test subscribing to a node. */ static gboolean test_subscribe_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "subscription", '@', "node", "node1", '@', "jid", "mighty@pirate.lit", '@', "subscription", "subscribed", ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_subscribe_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyPubsubNode *node = WOCKY_PUBSUB_NODE (source); test_data_t *test = (test_data_t *) user_data; WockyPubsubSubscription *sub; sub = wocky_pubsub_node_subscribe_finish (WOCKY_PUBSUB_NODE (source), res, NULL); g_assert (sub != NULL); /* the node name should be the same. */ g_assert_cmpstr (wocky_pubsub_node_get_name (sub->node), ==, wocky_pubsub_node_get_name (node)); /* in fact, they should be the same node. */ g_assert (sub->node == node); wocky_pubsub_subscription_free (sub); test->outstanding--; g_main_loop_quit (test->loop); } static void test_subscribe (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_subscribe_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "subscribe", '@', "node", "node1", '@', "jid", "mighty@pirate.lit", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "node1"); g_assert (node != NULL); wocky_pubsub_node_subscribe_async (node, "mighty@pirate.lit", NULL, test_subscribe_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Test unsubscribing from a node. */ typedef struct { test_data_t *test; gboolean expect_subid; } TestUnsubscribeCtx; #define EXPECTED_SUBID "⚞♥⚟" static gboolean test_unsubscribe_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { TestUnsubscribeCtx *ctx = user_data; test_data_t *test = ctx->test; WockyNode *unsubscribe; const gchar *subid; WockyStanza *reply; unsubscribe = wocky_node_get_child ( wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "pubsub", WOCKY_XMPP_NS_PUBSUB), "unsubscribe"); g_assert (unsubscribe != NULL); subid = wocky_node_get_attribute (unsubscribe, "subid"); if (ctx->expect_subid) g_assert_cmpstr (EXPECTED_SUBID, ==, subid); else g_assert_cmpstr (NULL, ==, subid); reply = wocky_stanza_build_iq_result (stanza, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_unsubscribe_cb (GObject *source, GAsyncResult *res, gpointer user_data) { TestUnsubscribeCtx *ctx = user_data; test_data_t *test = ctx->test; gboolean ret; ret = wocky_pubsub_node_unsubscribe_finish (WOCKY_PUBSUB_NODE (source), res, NULL); g_assert (ret); test->outstanding--; g_main_loop_quit (test->loop); } static void test_unsubscribe (void) { test_data_t *test = setup_test (); TestUnsubscribeCtx ctx = { test, }; WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_unsubscribe_iq_cb, &ctx, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "unsubscribe", '@', "node", "node1", '@', "jid", "mighty@pirate.lit", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "node1"); g_assert (node != NULL); /* first, test unsubscribing with no subid */ ctx.expect_subid = FALSE; wocky_pubsub_node_unsubscribe_async (node, "mighty@pirate.lit", NULL, NULL, test_unsubscribe_cb, &ctx); test->outstanding += 2; test_wait_pending (test); /* then test unsubscribing with a subid */ ctx.expect_subid = TRUE; wocky_pubsub_node_unsubscribe_async (node, "mighty@pirate.lit", EXPECTED_SUBID, NULL, test_unsubscribe_cb, &ctx); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* test wocky_pubsub_node_delete_async */ static gboolean test_delete_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_result (stanza, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_delete_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_pubsub_node_delete_finish (WOCKY_PUBSUB_NODE (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void test_delete (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_delete_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "delete", '@', "node", "node1", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "node1"); g_assert (node != NULL); wocky_pubsub_node_delete_async (node, NULL, test_delete_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Test retrieving a list of subscribers. See XEP-0060 §8.8.1 Retrieve * Subscriptions List * */ static CannedSubscriptions example_183[] = { { "princely_musings", "hamlet@denmark.lit", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, NULL }, { "princely_musings", "polonius@denmark.lit", "unconfigured", WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED, NULL }, { "princely_musings", "bernardo@denmark.lit", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, "123-abc" }, { "princely_musings", "bernardo@denmark.lit", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, "004-yyy" }, { NULL, } }; static gboolean test_list_subscribers_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *expected, *reply; WockyNode *subscriptions; expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "subscriptions", '@', "node", "princely_musings", ')', ')', NULL); test_assert_stanzas_equal_no_id (stanza, expected); g_object_unref (expected); reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "subscriptions", '@', "node", "princely_musings", '*', &subscriptions, ')', ')', NULL); test_pubsub_add_subscription_nodes (subscriptions, example_183, FALSE); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_list_subscribers_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GList *subscribers; g_assert (wocky_pubsub_node_list_subscribers_finish ( WOCKY_PUBSUB_NODE (source), res, &subscribers, NULL)); test_pubsub_check_and_free_subscriptions (subscribers, example_183); test->outstanding--; g_main_loop_quit (test->loop); } static void test_list_subscribers (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_list_subscribers_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "subscriptions", '@', "node", "princely_musings", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "princely_musings"); g_assert (node != NULL); wocky_pubsub_node_list_subscribers_async (node, NULL, test_list_subscribers_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Test retrieving a list of entities affiliated to a node you own. See * XEP-0060 §8.9.1 Retrieve Affiliations List * */ static gboolean test_list_affiliates_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *expected, *reply; expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "affiliations", '@', "node", "princely_musings", ')', ')', NULL); test_assert_stanzas_equal_no_id (stanza, expected); g_object_unref (expected); reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "affiliations", '@', "node", "princely_musings", '(', "affiliation", '@', "jid", "hamlet@denmark.lit", '@', "affiliation", "owner", ')', '(', "affiliation", '@', "jid", "polonius@denmark.lit", '@', "affiliation", "outcast", ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_list_affiliates_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GList *affiliates; WockyPubsubAffiliation *aff; g_assert (wocky_pubsub_node_list_affiliates_finish ( WOCKY_PUBSUB_NODE (source), res, &affiliates, NULL)); g_assert_cmpuint (2, ==, g_list_length (affiliates)); aff = affiliates->data; g_assert_cmpstr ("princely_musings", ==, wocky_pubsub_node_get_name (aff->node)); g_assert_cmpstr ("hamlet@denmark.lit", ==, aff->jid); g_assert_cmpuint (WOCKY_PUBSUB_AFFILIATION_OWNER, ==, aff->state); aff = affiliates->next->data; g_assert_cmpstr ("princely_musings", ==, wocky_pubsub_node_get_name (aff->node)); g_assert_cmpstr ("polonius@denmark.lit", ==, aff->jid); g_assert_cmpuint (WOCKY_PUBSUB_AFFILIATION_OUTCAST, ==, aff->state); wocky_pubsub_affiliation_list_free (affiliates); test->outstanding--; g_main_loop_quit (test->loop); } static void test_list_affiliates (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_list_affiliates_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "affiliations", '@', "node", "princely_musings", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "princely_musings"); g_assert (node != NULL); wocky_pubsub_node_list_affiliates_async (node, NULL, test_list_affiliates_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Test modifying the entities affiliated to a node that you own. See §8.9.2 * Modify Affiliation. */ static gboolean test_modify_affiliates_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *expected, *reply; expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "affiliations", '@', "node", "princely_musings", '(', "affiliation", '@', "jid", "hamlet@denmark.lit", '@', "affiliation", "none", ')', '(', "affiliation", '@', "jid", "polonius@denmark.lit", '@', "affiliation", "none", ')', '(', "affiliation", '@', "jid", "bard@shakespeare.lit", '@', "affiliation", "publisher", ')', ')', ')', NULL); test_assert_stanzas_equal_no_id (stanza, expected); g_object_unref (expected); reply = wocky_stanza_build_iq_result (stanza, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_modify_affiliates_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_pubsub_node_modify_affiliates_finish ( WOCKY_PUBSUB_NODE (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void test_modify_affiliates (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; GList *snakes = NULL; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_modify_affiliates_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "affiliations", '@', "node", "princely_musings", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "princely_musings"); g_assert (node != NULL); snakes = g_list_append (snakes, wocky_pubsub_affiliation_new (node, "hamlet@denmark.lit", WOCKY_PUBSUB_AFFILIATION_NONE)); snakes = g_list_append (snakes, wocky_pubsub_affiliation_new (node, "polonius@denmark.lit", WOCKY_PUBSUB_AFFILIATION_NONE)); snakes = g_list_append (snakes, wocky_pubsub_affiliation_new (node, "bard@shakespeare.lit", WOCKY_PUBSUB_AFFILIATION_PUBLISHER)); wocky_pubsub_node_modify_affiliates_async (node, snakes, NULL, test_modify_affiliates_cb, test); wocky_pubsub_affiliation_list_free (snakes); snakes = NULL; test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Tests retrieving a node's current configuration. * * Since data forms are reasonably exhaustively tested elsewhere, this test * uses a very simple configuration form. */ static gboolean test_get_configuration_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *expected, *reply; expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "configure", '@', "node", "princely_musings", ')', ')', NULL); test_assert_stanzas_equal_no_id (stanza, expected); g_object_unref (expected); reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "configure", '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "form", '(', "field", '@', "type", "hidden", '@', "var", "FORM_TYPE", '(', "value", '$', WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG, ')', ')', '(', "field", '@', "var", "pubsub#title", '@', "type", "text-single", '(', "value", '$', "Hello thar", ')', ')', '(', "field", '@', "var", "pubsub#deliver_notifications", '@', "type", "boolean", '@', "label", "Deliver event notifications", '(', "value", '$', "1", ')', ')', ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_get_configuration_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyDataForm *form; GError *error = NULL; form = wocky_pubsub_node_get_configuration_finish ( WOCKY_PUBSUB_NODE (source), res, &error); g_assert_no_error (error); g_assert (form != NULL); /* Don't bother testing too much, it's tested elsewhere. */ g_assert_cmpuint (3, ==, g_hash_table_size (form->fields)); g_object_unref (form); test->outstanding--; g_main_loop_quit (test->loop); } static void test_get_configuration (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_get_configuration_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "configure", '@', "node", "princely_musings", ')', ')', NULL); node = wocky_pubsub_service_ensure_node (pubsub, "princely_musings"); g_assert (node != NULL); wocky_pubsub_node_get_configuration_async (node, NULL, test_get_configuration_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (node); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } /* Test that the 'event-received' signals are fired when we expect them to be. */ gboolean service_event_received; gboolean node_event_received; WockyPubsubNode *expected_node; static void service_event_received_cb (WockyPubsubService *service, WockyPubsubNode *node, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node, GList *items, test_data_t *test) { WockyNode *item; /* Check that we're not winding up with multiple nodes for the same thing. */ if (expected_node != NULL) g_assert (node == expected_node); g_assert_cmpstr ("event", ==, event_node->name); g_assert_cmpstr ("items", ==, items_node->name); g_assert_cmpuint (2, ==, g_list_length (items)); item = g_list_nth_data (items, 0); g_assert_cmpstr ("item", ==, item->name); g_assert_cmpstr ("1", ==, wocky_node_get_attribute (item, "id")); item = g_list_nth_data (items, 1); g_assert_cmpstr ("item", ==, item->name); g_assert_cmpstr ("snakes", ==, wocky_node_get_attribute (item, "id")); test->outstanding--; g_main_loop_quit (test->loop); service_event_received = TRUE; } static void node_event_received_cb (WockyPubsubNode *node, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node, GList *items, test_data_t *test) { WockyNode *item; g_assert_cmpstr ("event", ==, event_node->name); g_assert_cmpstr ("items", ==, items_node->name); g_assert_cmpuint (2, ==, g_list_length (items)); item = g_list_nth_data (items, 0); g_assert_cmpstr ("item", ==, item->name); g_assert_cmpstr ("1", ==, wocky_node_get_attribute (item, "id")); item = g_list_nth_data (items, 1); g_assert_cmpstr ("item", ==, item->name); g_assert_cmpstr ("snakes", ==, wocky_node_get_attribute (item, "id")); test->outstanding--; g_main_loop_quit (test->loop); node_event_received = TRUE; } static void send_pubsub_event (WockyPorter *porter, const gchar *service, const gchar *node) { WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, service, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", node, '(', "item", '@', "id", "1", '(', "payload", ')', ')', '(', "item", '@', "id", "snakes", '(', "payload", ')', ')', ')', ')', NULL); wocky_porter_send (porter, stanza); g_object_unref (stanza); } static void test_receive_event (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); pubsub = wocky_pubsub_service_new (test->session_out, "pubsub.localhost"); node = wocky_pubsub_service_ensure_node (pubsub, "lol"); g_signal_connect (pubsub, "event-received", (GCallback) service_event_received_cb, test); g_signal_connect (node, "event-received", (GCallback) node_event_received_cb, test); /* send event from the right service for that node */ node_event_received = FALSE; service_event_received = FALSE; expected_node = node; send_pubsub_event (test->sched_in, "pubsub.localhost", "lol"); test->outstanding += 2; test_wait_pending (test); g_assert (node_event_received); g_assert (service_event_received); node_event_received = FALSE; service_event_received = FALSE; /* send event from the right service on a different node */ expected_node = NULL; send_pubsub_event (test->sched_in, "pubsub.localhost", "whut"); test->outstanding += 1; test_wait_pending (test); g_assert (!node_event_received); g_assert (service_event_received); service_event_received = FALSE; /* send event from a different service, on a node with the same name */ send_pubsub_event (test->sched_in, "pubsub.elsewhere", "lol"); g_object_unref (node); g_object_unref (pubsub); /* send event from the right service and node, after we dropped our ref to * the node and service. nothing else should be keeping it hanging around, so * our signal handlers should have been disconnected. */ send_pubsub_event (test->sched_in, "pubsub.localhost", "lol"); test_close_both_porters (test); teardown_test (test); /* None of the subsequent events should have triggered event-received. */ g_assert (!node_event_received); g_assert (!service_event_received); } /* /pubsub-node/subscription-state-changed */ typedef struct { test_data_t *test; const gchar *expecting_service_ssc_received_for; gboolean expecting_node_ssc_received; WockyPubsubSubscriptionState expected_state; } TestSSCCtx; static void send_subscription_state_change (WockyPorter *porter, const gchar *service, const gchar *node, const gchar *state) { WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, service, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "subscription", '@', "node", node, '@', "jid", "mighty@pirate.lit", '@', "subscription", state, ')', ')', NULL); wocky_porter_send (porter, stanza); g_object_unref (stanza); } static void service_subscription_state_changed_cb ( WockyPubsubService *service, WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *subscription_node, WockyPubsubSubscription *subscription, TestSSCCtx *ctx) { g_assert (ctx->expecting_service_ssc_received_for != NULL); g_assert_cmpstr (wocky_pubsub_node_get_name (node), ==, ctx->expecting_service_ssc_received_for); g_assert_cmpstr (event_node->name, ==, "event"); g_assert_cmpstr (wocky_node_get_ns (event_node), ==, WOCKY_XMPP_NS_PUBSUB_EVENT); g_assert_cmpstr (subscription_node->name, ==, "subscription"); g_assert (subscription->node == node); g_assert_cmpstr (subscription->jid, ==, "mighty@pirate.lit"); g_assert_cmpuint (subscription->state, ==, ctx->expected_state); g_assert (subscription->subid == NULL); ctx->expecting_service_ssc_received_for = NULL; ctx->test->outstanding--; g_main_loop_quit (ctx->test->loop); } static void node_subscription_state_changed_cb ( WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *subscription_node, WockyPubsubSubscription *subscription, TestSSCCtx *ctx) { g_assert (ctx->expecting_node_ssc_received); ctx->expecting_node_ssc_received = FALSE; g_assert_cmpstr (wocky_pubsub_node_get_name (node), ==, "dairy-farmer"); g_assert_cmpstr (event_node->name, ==, "event"); g_assert_cmpstr (wocky_node_get_ns (event_node), ==, WOCKY_XMPP_NS_PUBSUB_EVENT); g_assert_cmpstr (subscription_node->name, ==, "subscription"); g_assert (subscription->node == node); g_assert_cmpstr (subscription->jid, ==, "mighty@pirate.lit"); g_assert_cmpuint (subscription->state, ==, ctx->expected_state); g_assert (subscription->subid == NULL); ctx->test->outstanding--; g_main_loop_quit (ctx->test->loop); } static void test_subscription_state_changed (void) { test_data_t *test = setup_test (); TestSSCCtx ctx = { test, FALSE, FALSE, WOCKY_PUBSUB_SUBSCRIPTION_NONE }; WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); pubsub = wocky_pubsub_service_new (test->session_out, "pubsub.localhost"); g_signal_connect (pubsub, "subscription-state-changed", (GCallback) service_subscription_state_changed_cb, &ctx); node = wocky_pubsub_service_ensure_node (pubsub, "dairy-farmer"); g_signal_connect (node, "subscription-state-changed", (GCallback) node_subscription_state_changed_cb, &ctx); /* Send a subscription change notification for a different node. */ send_subscription_state_change (test->sched_in, "pubsub.localhost", "cow", "pending"); ctx.expecting_service_ssc_received_for = "cow"; ctx.expecting_node_ssc_received = FALSE; ctx.expected_state = WOCKY_PUBSUB_SUBSCRIPTION_PENDING; test->outstanding += 1; test_wait_pending (test); /* Send a subscription change notification for @node. */ send_subscription_state_change (test->sched_in, "pubsub.localhost", "dairy-farmer", "unconfigured"); ctx.expecting_service_ssc_received_for = "dairy-farmer"; ctx.expecting_node_ssc_received = TRUE; ctx.expected_state = WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED; test->outstanding += 2; test_wait_pending (test); g_assert (!ctx.expecting_node_ssc_received); test_close_both_porters (test); teardown_test (test); g_object_unref (node); g_object_unref (pubsub); } /* /pubsub-node/deleted */ typedef struct { test_data_t *test; const gchar *expecting_service_node_deleted_for; gboolean expecting_node_deleted; } TestDeletedCtx; static void send_deleted (WockyPorter *porter, const gchar *service, const gchar *node) { WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, service, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "delete", '@', "node", node, ')', ')', NULL); wocky_porter_send (porter, stanza); g_object_unref (stanza); } static void service_node_deleted_cb ( WockyPubsubService *service, WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *delete_node, TestDeletedCtx *ctx) { g_assert (ctx->expecting_service_node_deleted_for != NULL); g_assert_cmpstr (wocky_pubsub_node_get_name (node), ==, ctx->expecting_service_node_deleted_for); g_assert_cmpstr (event_node->name, ==, "event"); g_assert_cmpstr (wocky_node_get_ns (event_node), ==, WOCKY_XMPP_NS_PUBSUB_EVENT); g_assert_cmpstr (delete_node->name, ==, "delete"); ctx->expecting_service_node_deleted_for = NULL; ctx->test->outstanding--; g_main_loop_quit (ctx->test->loop); } static void node_deleted_cb ( WockyPubsubNode *node, WockyStanza *stanza, WockyNode *event_node, WockyNode *delete_node, TestDeletedCtx *ctx) { g_assert (ctx->expecting_node_deleted); ctx->expecting_node_deleted = FALSE; g_assert_cmpstr (wocky_pubsub_node_get_name (node), ==, "dairy-farmer"); g_assert_cmpstr (event_node->name, ==, "event"); g_assert_cmpstr (wocky_node_get_ns (event_node), ==, WOCKY_XMPP_NS_PUBSUB_EVENT); g_assert_cmpstr (delete_node->name, ==, "delete"); ctx->test->outstanding--; g_main_loop_quit (ctx->test->loop); } static void test_deleted (void) { test_data_t *test = setup_test (); TestDeletedCtx ctx = { test, FALSE, FALSE }; WockyPubsubService *pubsub; WockyPubsubNode *node; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); pubsub = wocky_pubsub_service_new (test->session_out, "pubsub.localhost"); g_signal_connect (pubsub, "node-deleted", (GCallback) service_node_deleted_cb, &ctx); node = wocky_pubsub_service_ensure_node (pubsub, "dairy-farmer"); g_signal_connect (node, "deleted", (GCallback) node_deleted_cb, &ctx); /* Send a deletion notification for a different node. */ send_deleted (test->sched_in, "pubsub.localhost", "cow"); ctx.expecting_service_node_deleted_for = "cow"; ctx.expecting_node_deleted = FALSE; test->outstanding += 1; test_wait_pending (test); g_assert (ctx.expecting_service_node_deleted_for == NULL); /* Send a subscription change notification for @node. */ send_deleted (test->sched_in, "pubsub.localhost", "dairy-farmer"); ctx.expecting_service_node_deleted_for = "dairy-farmer"; ctx.expecting_node_deleted = TRUE; test->outstanding += 2; test_wait_pending (test); g_assert (ctx.expecting_service_node_deleted_for == NULL); g_assert (!ctx.expecting_node_deleted); test_close_both_porters (test); teardown_test (test); g_object_unref (node); g_object_unref (pubsub); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/pubsub-node/instantiation", test_instantiation); g_test_add_func ("/pubsub-node/make-publish-stanza", test_make_publish_stanza); g_test_add_func ("/pubsub-node/subscribe", test_subscribe); g_test_add_func ("/pubsub-node/unsubscribe", test_unsubscribe); g_test_add_func ("/pubsub-node/delete", test_delete); g_test_add_func ("/pubsub-node/list-subscribers", test_list_subscribers); g_test_add_func ("/pubsub-node/list-affiliates", test_list_affiliates); g_test_add_func ("/pubsub-node/modify-affiliates", test_modify_affiliates); g_test_add_func ("/pubsub-node/get-configuration", test_get_configuration); g_test_add_func ("/pubsub-node/receive-event", test_receive_event); g_test_add_func ("/pubsub-node/subscription-state-changed", test_subscription_state_changed); g_test_add_func ("/pubsub-node/deleted", test_deleted); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-sasl-auth-server.c0000644000175000017500000007251113012550005027410 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-sasl-auth-server.c - Source for TestSaslAuthServer * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-sasl-auth-server.h" #include "wocky-test-helper.h" #ifdef HAVE_LIBSASL2 #include #include #define CHECK_SASL_RETURN(x) \ G_STMT_START { \ if (x < SASL_OK) { \ fprintf (stderr, "sasl error (%d): %s\n", \ ret, sasl_errdetail (priv->sasl_conn)); \ g_assert_not_reached (); \ } \ } G_STMT_END /* Apparently, we're allowed to typedef the same thing *again* if it's * the same signature, so this allows for backwards compatiblity with * older libsasl2s and also works with newer ones too. This'll only * break if libsasl2 change the type of sasl_callback_ft. I sure hope * they don't! */ typedef int (*sasl_callback_ft)(void); #else #define SASL_OK 0 #define SASL_BADAUTH -13 #define SASL_NOUSER -20 #define CHECK_SASL_RETURN(x) \ G_STMT_START { \ if (x < SASL_OK) { \ fprintf (stderr, "sasl error (%d): ???\n", ret); \ g_assert_not_reached (); \ } \ } G_STMT_END #endif G_DEFINE_TYPE(TestSaslAuthServer, test_sasl_auth_server, G_TYPE_OBJECT) #if 0 /* signal enum */ enum { LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; #endif typedef enum { AUTH_STATE_STARTED, AUTH_STATE_CHALLENGE, AUTH_STATE_FINAL_CHALLENGE, AUTH_STATE_AUTHENTICATED, } AuthState; /* private structure */ struct _TestSaslAuthServerPrivate { gboolean dispose_has_run; WockyXmppConnection *conn; GIOStream *stream; #ifdef HAVE_LIBSASL2 sasl_conn_t *sasl_conn; #endif gchar *username; gchar *password; gchar *mech; gchar *selected_mech; AuthState state; ServerProblem problem; GSimpleAsyncResult *result; GCancellable *cancellable; }; static void received_stanza (GObject *source, GAsyncResult *result, gpointer user_data); static void test_sasl_auth_server_init (TestSaslAuthServer *self) { TestSaslAuthServerPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TEST_TYPE_SASL_AUTH_SERVER, TestSaslAuthServerPrivate); priv = self->priv; priv->username = NULL; priv->password = NULL; priv->mech = NULL; priv->state = AUTH_STATE_STARTED; } static void test_sasl_auth_server_dispose (GObject *object); static void test_sasl_auth_server_finalize (GObject *object); static void test_sasl_auth_server_class_init ( TestSaslAuthServerClass *test_sasl_auth_server_class) { GObjectClass *object_class = G_OBJECT_CLASS (test_sasl_auth_server_class); g_type_class_add_private (test_sasl_auth_server_class, sizeof (TestSaslAuthServerPrivate)); object_class->dispose = test_sasl_auth_server_dispose; object_class->finalize = test_sasl_auth_server_finalize; } void test_sasl_auth_server_dispose (GObject *object) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER (object); TestSaslAuthServerPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (priv->conn != NULL) g_object_unref (priv->conn); priv->conn = NULL; if (priv->stream != NULL) g_object_unref (priv->stream); priv->stream = NULL; #ifdef HAVE_LIBSASL2 if (&priv->sasl_conn != NULL) sasl_dispose (&priv->sasl_conn); priv->sasl_conn = NULL; #endif g_warn_if_fail (priv->result == NULL); g_warn_if_fail (priv->cancellable == NULL); if (G_OBJECT_CLASS (test_sasl_auth_server_parent_class)->dispose) G_OBJECT_CLASS (test_sasl_auth_server_parent_class)->dispose (object); } void test_sasl_auth_server_finalize (GObject *object) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER (object); TestSaslAuthServerPrivate *priv = self->priv; /* free any data held directly by the object here */ g_free (priv->username); g_free (priv->password); g_free (priv->mech); g_free (priv->selected_mech); G_OBJECT_CLASS (test_sasl_auth_server_parent_class)->finalize (object); } static void features_sent (GObject *source, GAsyncResult *res, gpointer user_data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER (user_data); TestSaslAuthServerPrivate *priv = self->priv; g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), priv->cancellable, received_stanza, user_data); } static void stream_open_sent (GObject *source, GAsyncResult *res, gpointer user_data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER(user_data); TestSaslAuthServerPrivate * priv = self->priv; WockyStanza *stanza; g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); /* Send stream features */ stanza = wocky_stanza_new ("features", WOCKY_XMPP_NS_STREAM); test_sasl_auth_server_set_mechs (G_OBJECT (self), stanza); wocky_xmpp_connection_send_stanza_async (priv->conn, stanza, priv->cancellable, features_sent, user_data); g_object_unref (stanza); } static void stream_open_received (GObject *source, GAsyncResult *res, gpointer user_data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER(user_data); TestSaslAuthServerPrivate * priv = self->priv; g_assert (wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL, NULL, NULL, NULL, NULL, NULL)); wocky_xmpp_connection_send_open_async (priv->conn, NULL, "testserver", "1.0", NULL, "0-HA2", NULL, stream_open_sent, self); } static void post_auth_close_sent (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); } static void post_auth_recv_stanza (GObject *source, GAsyncResult *result, gpointer user_data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER(user_data); TestSaslAuthServerPrivate * priv = self->priv; WockyStanza *stanza; GError *error = NULL; /* ignore all stanza until close */ stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error); if (stanza != NULL) { g_object_unref (stanza); wocky_xmpp_connection_recv_stanza_async ( WOCKY_XMPP_CONNECTION (source), priv->cancellable, post_auth_recv_stanza, user_data); } else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { GSimpleAsyncResult *r = priv->result; priv->result = NULL; if (priv->cancellable != NULL) g_object_unref (priv->cancellable); priv->cancellable = NULL; g_simple_async_result_set_from_error (r, error); g_simple_async_result_complete (r); g_object_unref (r); g_error_free (error); } else { g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); wocky_xmpp_connection_send_close_async (WOCKY_XMPP_CONNECTION (source), priv->cancellable, post_auth_close_sent, user_data); g_error_free (error); } } static void post_auth_features_sent (GObject *source, GAsyncResult *result, gpointer user_data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER(user_data); TestSaslAuthServerPrivate * priv = self->priv; g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), priv->cancellable, post_auth_recv_stanza, user_data); } static void post_auth_open_sent (GObject *source, GAsyncResult *result, gpointer user_data) { TestSaslAuthServer *tsas = TEST_SASL_AUTH_SERVER (user_data); TestSaslAuthServerPrivate *priv = tsas->priv; g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); /* if our caller wanted control back, hand it back here: */ if (priv->result != NULL) { GSimpleAsyncResult *r = priv->result; priv->result = NULL; if (priv->cancellable != NULL) g_object_unref (priv->cancellable); priv->cancellable = NULL; g_simple_async_result_complete (r); g_object_unref (r); } else { WockyStanza *s = wocky_stanza_new ("features", WOCKY_XMPP_NS_STREAM); wocky_xmpp_connection_send_stanza_async (WOCKY_XMPP_CONNECTION (source), s, NULL, post_auth_features_sent, user_data); g_object_unref (s); } } static void post_auth_open_received (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL, NULL, NULL, NULL, NULL, user_data)); wocky_xmpp_connection_send_open_async ( WOCKY_XMPP_CONNECTION (source), NULL, "testserver", "1.0", NULL, "0-HA1", NULL, post_auth_open_sent, user_data); } static void success_sent (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); wocky_xmpp_connection_reset (WOCKY_XMPP_CONNECTION (source)); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (source), NULL, post_auth_open_received, user_data); } static void auth_succeeded (TestSaslAuthServer *self, const gchar *challenge) { TestSaslAuthServerPrivate *priv = self->priv; WockyStanza *s; g_assert (priv->state < AUTH_STATE_AUTHENTICATED); priv->state = AUTH_STATE_AUTHENTICATED; s = wocky_stanza_new ("success", WOCKY_XMPP_NS_SASL_AUTH); wocky_node_set_content (wocky_stanza_get_top_node (s), challenge); wocky_xmpp_connection_send_stanza_async (priv->conn, s, NULL, success_sent, self); g_object_unref (s); } static void failure_sent (GObject *source, GAsyncResult *result, gpointer user_data) { TestSaslAuthServer *tsas = TEST_SASL_AUTH_SERVER (user_data); TestSaslAuthServerPrivate *priv = tsas->priv; GSimpleAsyncResult *r = priv->result; priv->result = NULL; g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); if (r != NULL) { if (priv->cancellable != NULL) g_object_unref (priv->cancellable); priv->cancellable = NULL; g_simple_async_result_complete (r); g_object_unref (r); } } static void not_authorized (TestSaslAuthServer *self) { TestSaslAuthServerPrivate *priv = self->priv; WockyStanza *s; g_assert (priv->state < AUTH_STATE_AUTHENTICATED); priv->state = AUTH_STATE_AUTHENTICATED; s = wocky_stanza_build (WOCKY_STANZA_TYPE_FAILURE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "not-authorized", ')', NULL); wocky_xmpp_connection_send_stanza_async (priv->conn, s, NULL, failure_sent, self); g_object_unref (s); } /* check if the return of the sasl function was as expected, if not FALSE is * returned and the call function should stop processing */ static gboolean check_sasl_return (TestSaslAuthServer *self, int ret) { TestSaslAuthServerPrivate * priv = self->priv; switch (ret) { case SASL_BADAUTH: /* Bad password provided */ g_assert (priv->problem == SERVER_PROBLEM_INVALID_PASSWORD); not_authorized (self); return FALSE; case SASL_NOUSER: /* Unknown user */ g_assert (priv->problem == SERVER_PROBLEM_INVALID_USERNAME); not_authorized (self); return FALSE; default: /* sasl auth should be ok */ CHECK_SASL_RETURN (ret); break; } return TRUE; } enum { BEFORE_KEY, INSIDE_KEY, AFTER_KEY, AFTER_EQ, INSIDE_VALUE, AFTER_VALUE, }; /* insert space, CRLF, TAB etc at strategic locations in the challenge * * to make sure our challenge parser is sufficently robust */ static gchar * space_challenge (const gchar *challenge, unsigned *len) { GString *spaced = g_string_new_len (challenge, (gssize) *len); gchar *c = spaced->str; gchar q = '\0'; gsize pos; gulong state = BEFORE_KEY; gchar spc[] = { ' ', '\t', '\r', '\n' }; for (pos = 0; pos < spaced->len; pos++) { c = spaced->str + pos; switch (state) { case BEFORE_KEY: if (!g_ascii_isspace (*c) && *c != '\0' && *c != '=') state = INSIDE_KEY; break; case INSIDE_KEY: if (*c != '=') break; g_string_insert_c (spaced, pos++, spc [rand () % sizeof (spc)]); state = AFTER_EQ; break; case AFTER_KEY: if (*c != '=') break; state = AFTER_EQ; break; case AFTER_EQ: if (g_ascii_isspace (*c)) break; q = *c; g_string_insert_c (spaced, pos++, spc [rand () % sizeof (spc)]); state = INSIDE_VALUE; break; case INSIDE_VALUE: if (q == '"' && *c != '"') break; if (q != '"' && !g_ascii_isspace (*c) && *c != ',') break; if (q != '"') { g_string_insert_c (spaced, pos++, spc [rand () % sizeof (spc)]); g_string_insert_c (spaced, ++pos, spc [rand () % sizeof (spc)]); } state = AFTER_VALUE; break; case AFTER_VALUE: if (*c == ',') { g_string_insert_c (spaced, pos++, spc [rand () % sizeof (spc)]); g_string_insert_c (spaced, ++pos, spc [rand () % sizeof (spc)]); } state = BEFORE_KEY; break; default: g_assert_not_reached (); } } *len = spaced->len; return g_string_free (spaced, FALSE); } /* insert a bogus parameter with a \" and a \\ sequence in it * scatter some \ characters through the " quoted challenge values */ static gchar * slash_challenge (const gchar *challenge, unsigned *len) { GString *slashed = g_string_new_len (challenge, (gssize) *len); gchar *c = slashed->str; gchar q = '\0'; gsize pos; gulong state = BEFORE_KEY; for (pos = 0; pos < slashed->len; pos++) { c = slashed->str + pos; switch (state) { case BEFORE_KEY: if (!g_ascii_isspace (*c) && *c != '\0' && *c != '=') state = INSIDE_KEY; break; case INSIDE_KEY: if (*c != '=') break; state = AFTER_EQ; break; case AFTER_EQ: if (g_ascii_isspace (*c)) break; q = *c; state = INSIDE_VALUE; break; case INSIDE_VALUE: if (q == '"' && *c != '"') { if ((rand () % 3) == 0) g_string_insert_c (slashed, pos++, '\\'); break; } if (q != '"' && !g_ascii_isspace (*c) && *c != ',') break; state = AFTER_VALUE; break; case AFTER_VALUE: state = BEFORE_KEY; break; default: g_assert_not_reached (); } } g_string_prepend (slashed, "ignore-me = \"(a slash \\\\ a quote \\\")\", "); *len = slashed->len; return g_string_free (slashed, FALSE); } static void handle_auth (TestSaslAuthServer *self, WockyStanza *stanza) { TestSaslAuthServerPrivate *priv = self->priv; guchar *response = NULL; const gchar *challenge; unsigned challenge_len; gsize response_len = 0; int ret; WockyNode *auth = wocky_stanza_get_top_node (stanza); const gchar *gjdd = NULL; g_free (priv->selected_mech); priv->selected_mech = g_strdup (wocky_node_get_attribute ( wocky_stanza_get_top_node (stanza), "mechanism")); if (wocky_stanza_get_top_node (stanza)->content != NULL) { response = g_base64_decode (wocky_stanza_get_top_node (stanza)->content, &response_len); } g_assert (priv->state == AUTH_STATE_STARTED); gjdd = wocky_node_get_attribute_ns (auth, "client-uses-full-bind-result", WOCKY_GOOGLE_NS_AUTH); switch (priv->problem) { case SERVER_PROBLEM_REQUIRE_GOOGLE_JDD: if ((gjdd == NULL) || wocky_strdiff ("true", gjdd)) { not_authorized (self); goto out; } break; case SERVER_PROBLEM_DISLIKE_GOOGLE_JDD: if (gjdd && !wocky_strdiff ("true", gjdd)) { not_authorized (self); goto out; } break; default: break; } priv->state = AUTH_STATE_CHALLENGE; if (!wocky_strdiff ("X-TEST", priv->selected_mech)) { challenge = ""; challenge_len = 0; ret = wocky_strdiff ((gchar *) response, priv->password) ? SASL_BADAUTH : SASL_OK; } else { #if HAVE_LIBSASL2 ret = sasl_server_start (priv->sasl_conn, priv->selected_mech, (gchar *) response, (unsigned) response_len, &challenge, &challenge_len); #else challenge = ""; challenge_len = 0; g_assert (!wocky_strdiff ("PLAIN", priv->selected_mech)); /* response format: ^@ u s e r ^@ p a s s */ /* require at least 1 char user and password */ if (response_len >= 4) { const gchar *user = ((gchar *) response) + 1; int ulen = strlen (user); gchar *pass = g_strndup (user + ulen + 1, response_len - ulen - 2); ret = ( wocky_strdiff (user, priv->username) ? SASL_NOUSER : wocky_strdiff (pass, priv->password) ? SASL_BADAUTH : SASL_OK ); g_free (pass); } else ret = SASL_BADAUTH; #endif } if (!check_sasl_return (self, ret)) goto out; if (challenge_len > 0) { WockyStanza *c; gchar *challenge64; if (ret == SASL_OK) { priv->state = AUTH_STATE_FINAL_CHALLENGE; } if (priv->problem == SERVER_PROBLEM_SPACE_CHALLENGE) { unsigned slen = challenge_len; gchar *spaced = space_challenge (challenge, &slen); challenge64 = g_base64_encode ((guchar *) spaced, slen); g_free (spaced); } else if (priv->problem == SERVER_PROBLEM_SLASH_CHALLENGE) { unsigned slen = challenge_len; gchar *slashc = slash_challenge (challenge, &slen); challenge64 = g_base64_encode ((guchar *) slashc, slen); g_free (slashc); } else { challenge64 = g_base64_encode ((guchar *) challenge, challenge_len); } c = wocky_stanza_new ("challenge", WOCKY_XMPP_NS_SASL_AUTH); wocky_node_set_content (wocky_stanza_get_top_node (c), challenge64); wocky_xmpp_connection_send_stanza_async (priv->conn, c, NULL, NULL, NULL); g_object_unref (c); g_free (challenge64); } else if (ret == SASL_OK) { auth_succeeded (self, NULL); } else { g_assert_not_reached (); } out: g_free (response); } static void handle_response (TestSaslAuthServer *self, WockyStanza *stanza) { TestSaslAuthServerPrivate * priv = self->priv; guchar *response = NULL; const gchar *challenge; unsigned challenge_len; gsize response_len = 0; int ret; if (priv->state == AUTH_STATE_FINAL_CHALLENGE) { g_assert (wocky_stanza_get_top_node (stanza)->content == NULL); auth_succeeded (self, NULL); return; } g_assert (priv->state == AUTH_STATE_CHALLENGE); if (wocky_stanza_get_top_node (stanza)->content != NULL) { response = g_base64_decode (wocky_stanza_get_top_node (stanza)->content, &response_len); } #ifdef HAVE_LIBSASL2 ret = sasl_server_step (priv->sasl_conn, (gchar *) response, (unsigned) response_len, &challenge, &challenge_len); #else ret = SASL_OK; challenge_len = 0; challenge = ""; #endif if (!check_sasl_return (self, ret)) goto out; if (challenge_len > 0) { WockyStanza *c; gchar *challenge64; if (ret == SASL_OK) { priv->state = AUTH_STATE_FINAL_CHALLENGE; } if (priv->problem == SERVER_PROBLEM_SPACE_CHALLENGE) { unsigned slen = challenge_len; gchar *spaced = space_challenge (challenge, &slen); challenge64 = g_base64_encode ((guchar *) spaced, slen); g_free (spaced); } else if (priv->problem == SERVER_PROBLEM_SLASH_CHALLENGE) { unsigned slen = challenge_len; gchar *slashc = slash_challenge (challenge, &slen); challenge64 = g_base64_encode ((guchar *) slashc, slen); g_free (slashc); } else { challenge64 = g_base64_encode ((guchar *) challenge, challenge_len); } if (priv->state == AUTH_STATE_FINAL_CHALLENGE && priv->problem == SERVER_PROBLEM_FINAL_DATA_IN_SUCCESS) { auth_succeeded (self, challenge64); } else { c = wocky_stanza_new ("challenge", WOCKY_XMPP_NS_SASL_AUTH); wocky_node_set_content (wocky_stanza_get_top_node (c), challenge64); wocky_xmpp_connection_send_stanza_async (priv->conn, c, NULL, NULL, NULL); g_object_unref (c); } g_free (challenge64); } else if (ret == SASL_OK) { auth_succeeded (self, NULL); } else { g_assert_not_reached (); } out: g_free (response); } #define HANDLE(x) { #x, handle_##x } static void received_stanza (GObject *source, GAsyncResult *result, gpointer user_data) { TestSaslAuthServer *self; TestSaslAuthServerPrivate *priv; int i; WockyStanza *stanza; GError *error = NULL; struct { const gchar *name; void (*func)(TestSaslAuthServer *self, WockyStanza *stanza); } handlers[] = { HANDLE(auth), HANDLE(response) }; stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error); if (stanza == NULL && (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || g_error_matches (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_EOS))) { g_error_free (error); return; } self = TEST_SASL_AUTH_SERVER (user_data); priv = self->priv; g_assert (stanza != NULL); if (wocky_strdiff (wocky_node_get_ns ( wocky_stanza_get_top_node (stanza)), WOCKY_XMPP_NS_SASL_AUTH)) { g_assert_not_reached (); } for (i = 0 ; handlers[i].name != NULL; i++) { if (!wocky_strdiff (wocky_stanza_get_top_node (stanza)->name, handlers[i].name)) { handlers[i].func (self, stanza); if (priv->state < AUTH_STATE_AUTHENTICATED) { wocky_xmpp_connection_recv_stanza_async (priv->conn, NULL, received_stanza, user_data); } g_object_unref (stanza); return; } } g_assert_not_reached (); } #ifdef HAVE_LIBSASL2 static int test_sasl_server_auth_log (void *context, int level, const gchar *message) { return SASL_OK; } static int test_sasl_server_auth_getopt (void *context, const char *plugin_name, const gchar *option, const gchar **result, guint *len) { int i; static const struct { const gchar *name; const gchar *value; } options[] = { { "auxprop_plugin", "sasldb"}, { "sasldb_path", "./sasl-test.db"}, { NULL, NULL }, }; for (i = 0; options[i].name != NULL; i++) { if (!wocky_strdiff (option, options[i].name)) { *result = options[i].value; if (len != NULL) *len = strlen (options[i].value); } } return SASL_OK; } #endif TestSaslAuthServer * test_sasl_auth_server_new (GIOStream *stream, gchar *mech, const gchar *user, const gchar *password, const gchar *servername, ServerProblem problem, gboolean start) { TestSaslAuthServer *server; TestSaslAuthServerPrivate *priv; #ifdef HAVE_LIBSASL2 static gboolean sasl_initialized = FALSE; int ret; static sasl_callback_t callbacks[] = { { SASL_CB_LOG, (sasl_callback_ft) test_sasl_server_auth_log, NULL }, { SASL_CB_GETOPT, (sasl_callback_ft) test_sasl_server_auth_getopt, NULL }, { SASL_CB_LIST_END, NULL, NULL }, }; if (!sasl_initialized) { sasl_server_init (NULL, NULL); sasl_initialized = TRUE; } #endif server = g_object_new (TEST_TYPE_SASL_AUTH_SERVER, NULL); priv = server->priv; priv->state = AUTH_STATE_STARTED; #ifdef HAVE_LIBSASL2 ret = sasl_server_new ("xmpp", servername, NULL, NULL, NULL, callbacks, SASL_SUCCESS_DATA, &(priv->sasl_conn)); CHECK_SASL_RETURN (ret); ret = sasl_setpass (priv->sasl_conn, user, password, strlen (password), NULL, 0, SASL_SET_CREATE); CHECK_SASL_RETURN (ret); #endif priv->username = g_strdup (user); priv->password = g_strdup (password); priv->mech = g_strdup (mech); priv->problem = problem; if (start) { priv->stream = g_object_ref (stream); priv->conn = wocky_xmpp_connection_new (stream); priv->cancellable = g_cancellable_new (); wocky_xmpp_connection_recv_open_async (priv->conn, priv->cancellable, stream_open_received, server); } return server; } void test_sasl_auth_server_stop (TestSaslAuthServer *self) { TestSaslAuthServerPrivate *priv = self->priv; if (priv->cancellable != NULL) { test_cancel_in_idle (priv->cancellable); g_object_unref (priv->cancellable); priv->cancellable = NULL; } if (priv->conn != NULL) g_object_unref (priv->conn); priv->conn = NULL; } gboolean test_sasl_auth_server_auth_finish (TestSaslAuthServer *self, GAsyncResult *res, GError **error) { gboolean ok = FALSE; TestSaslAuthServerPrivate *priv = self->priv; if (g_simple_async_result_propagate_error ( G_SIMPLE_ASYNC_RESULT (res), error)) return FALSE; ok = g_simple_async_result_is_valid (G_ASYNC_RESULT (res), G_OBJECT (self), test_sasl_auth_server_auth_async); g_return_val_if_fail (ok, FALSE); return (priv->state == AUTH_STATE_AUTHENTICATED); } void test_sasl_auth_server_auth_async (GObject *obj, WockyXmppConnection *conn, WockyStanza *auth, GAsyncReadyCallback cb, GCancellable *cancellable, gpointer data) { TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER (obj); TestSaslAuthServerPrivate *priv = self->priv; /* We expect the server to not be started but just in case */ test_sasl_auth_server_stop (TEST_SASL_AUTH_SERVER (obj)); priv->state = AUTH_STATE_STARTED; priv->conn = g_object_ref (conn); /* save the details of the point ot which we will hand back control */ if (cb != NULL) { if (cancellable != NULL) priv->cancellable = g_object_ref (cancellable); priv->result = g_simple_async_result_new (obj, cb, data, test_sasl_auth_server_auth_async); } handle_auth (self, auth); if (priv->state < AUTH_STATE_AUTHENTICATED) { wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, received_stanza, self); } g_object_unref (auth); } gint test_sasl_auth_server_set_mechs (GObject *obj, WockyStanza *feat) { int ret = 0; TestSaslAuthServer *self = TEST_SASL_AUTH_SERVER (obj); TestSaslAuthServerPrivate *priv = self->priv; WockyNode *mechnode = NULL; if (priv->problem != SERVER_PROBLEM_NO_SASL) { mechnode = wocky_node_add_child_ns ( wocky_stanza_get_top_node (feat), "mechanisms", WOCKY_XMPP_NS_SASL_AUTH); if (priv->problem == SERVER_PROBLEM_NO_MECHANISMS) { /* lalala */ } else if (priv->mech != NULL) { wocky_node_add_child_with_content (mechnode, "mechanism", priv->mech); } else { const gchar *mechs; gchar **mechlist; gchar **tmp; #ifdef HAVE_LIBSASL2 ret = sasl_listmech (priv->sasl_conn, NULL, "","\n","", &mechs, NULL,NULL); CHECK_SASL_RETURN (ret); #else mechs = "PLAIN"; #endif mechlist = g_strsplit (mechs, "\n", -1); for (tmp = mechlist; *tmp != NULL; tmp++) { wocky_node_add_child_with_content (mechnode, "mechanism", *tmp); } g_strfreev (mechlist); } } return ret; } const gchar * test_sasl_auth_server_get_selected_mech (TestSaslAuthServer *self) { TestSaslAuthServerPrivate *priv = self->priv; return priv->selected_mech; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-sasl-handler.h0000644000175000017500000000222312735676345026611 0ustar00gkiagiagkiagia00000000000000#ifndef _WOCKY_TEST_SASL_HANDLER_H #define _WOCKY_TEST_SASL_HANDLER_H #include G_BEGIN_DECLS #define WOCKY_TYPE_TEST_SASL_HANDLER wocky_test_sasl_handler_get_type() #define WOCKY_TEST_SASL_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_TEST_SASL_HANDLER, \ WockyTestSaslHandler)) #define WOCKY_TEST_SASL_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_TEST_SASL_HANDLER, \ WockyTestSaslHandlerClass)) #define WOCKY_IS_TEST_SASL_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_TEST_SASL_HANDLER)) #define WOCKY_IS_TEST_SASL_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_TEST_SASL_HANDLER)) #define WOCKY_TEST_SASL_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_TEST_SASL_HANDLER, \ WockyTestSaslHandlerClass)) typedef struct { GObject parent; } WockyTestSaslHandler; typedef struct { GObjectClass parent_class; } WockyTestSaslHandlerClass; GType wocky_test_sasl_handler_get_type (void); WockyTestSaslHandler* wocky_test_sasl_handler_new (void); G_END_DECLS #endif /* _WOCKY_TEST_SASL_HANDLER_H */ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-caps-hash-test.c0000644000175000017500000005624612735676345026114 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "wocky-test-helper.h" static gboolean check_hash (WockyStanza *stanza, const gchar *expected) { gchar *hash; hash = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_assert_cmpstr (hash, ==, expected); g_object_unref (stanza); g_free (hash); return TRUE; } static void test_simple (void) { /* Simple example from XEP-0115 */ WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "identity", '@', "category", "client", '@', "name", "Exodus 0.9.1", '@', "type", "pc", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#items", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/muc", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/caps", ')', NULL); check_hash (stanza, "QgayPKawpkPSDYmwT/WM94uAlu0="); } static void test_complex (void) { /* Complex example from XEP-0115 */ WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#items", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/muc", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/caps", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', '(', "field", '@', "var", "os", '(', "value", '$', "Mac", ')', ')', '(', "field", '@', "var", "os_version", '(', "value", '$', "10.5.1", ')', ')', '(', "field", '@', "var", "software", '(', "value", '$', "Psi", ')', ')', '(', "field", '@', "var", "software_version", '(', "value", '$', "0.11", ')', ')', ')', NULL); check_hash (stanza, "q07IKJEyjvHSyhy//CH0CxmKi8w="); } static void test_sorting_simple (void) { WockyStanza *stanza; gchar *one, *two; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', NULL); one = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', NULL); two = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert_cmpstr (one, ==, two); g_free (one); g_free (two); } static void test_sorting_complex (void) { WockyStanza *stanza; gchar *one, *two; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#items", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/muc", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/caps", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', '(', "field", '@', "var", "os", '(', "value", '$', "Mac", ')', ')', '(', "field", '@', "var", "os_version", '(', "value", '$', "10.5.1", ')', ')', '(', "field", '@', "var", "software", '(', "value", '$', "Psi", ')', ')', '(', "field", '@', "var", "software_version", '(', "value", '$', "0.11", ')', ')', ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:somethingelse", ')', ')', '(', "field", '@', "var", "foo", '(', "value", '$', "bananas", ')', '(', "value", '$', "cheese", ')', ')', '(', "field", '@', "var", "wheeeeee", '(', "value", '$', "I'm on a rollercoster", ')', ')', '(', "field", '@', "var", "loldongz", '@', "type", "boolean", '(', "value", '$', "1", ')', ')', ')', NULL); one = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "feature", '@', "var", "http://jabber.org/protocol/disco#items", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:somethingelse", ')', ')', '(', "field", '@', "var", "wheeeeee", '(', "value", '$', "I'm on a rollercoster", ')', ')', '(', "field", '@', "var", "loldongz", '@', "type", "boolean", '(', "value", '$', "1", ')', ')', '(', "field", '@', "var", "foo", '(', "value", '$', "cheese", ')', '(', "value", '$', "bananas", ')', ')', ')', '(', "feature", '@', "var", "http://jabber.org/protocol/muc", ')', '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "software", '(', "value", '$', "Psi", ')', ')', '(', "field", '@', "var", "os", '(', "value", '$', "Mac", ')', ')', '(', "field", '@', "var", "os_version", '(', "value", '$', "10.5.1", ')', ')', '(', "field", '@', "var", "software_version", '(', "value", '$', "0.11", ')', ')', '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', ')', '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/caps", ')', NULL); two = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert_cmpstr (one, ==, two); g_free (one); g_free (two); } static void test_dataforms_invalid (void) { gchar *out; /* this stanza has a bad data form type */ WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "lol", ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); /* should be NULL because of type="lol" */ g_assert (out == NULL); /* now with no FORM_TYPE field but fine otherwise */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', ')', NULL); /* should just be ignoring the invalid data form as XEP-0115 section * "5.4 Processing Method", bullet point 3.6 tells us */ check_hash (stanza, "9LXnSGAOqGkjoewMq7WHTF4wK/U="); /* now with a FORM_TYPE but not type="hidden" */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', ')', NULL); /* should just be ignoring the invalid data form as XEP-0115 section * "5.4 Processing Method", bullet point 3.6 tells us */ check_hash (stanza, "9LXnSGAOqGkjoewMq7WHTF4wK/U="); /* now with but fine otherwise; * this will fail because we have everything about the field but the * actual value */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "lol_version", '(', "value", ')', ')', ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert (out == NULL); /* now with but fine otherwise; this will fail * because we have everything about the field but the actual * value */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "lol_version", ')', ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert (out == NULL); /* now with but fine otherwise; the data form parser will * ignore fields with no var='' attribute so this will succeed */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", ')', ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert_cmpstr (out, ==, "wMFSetHbIiscGZgVgx4CZMaYIBQ="); g_free (out); } static void test_dataforms_fixed_and_no_var (void) { WockyStanza *stanza; gchar *out; g_test_bug ("61433"); /* with no var='' attribute is legal in data forms in * general, but the hashing algorithm doesn't specify what to do in this * case. We choose to make it fail; previously, we crashed. */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "type", "fixed", '(', "value", '$', "trolololol", ')', ')', ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert_cmpstr (out, ==, NULL); g_free (out); } static void test_dataforms_form_type_wrong_type (void) { WockyStanza *stanza; /* 6. If the response includes an extended service discovery information * form where the FORM_TYPE field is not of type "hidden" or the form * does not include a FORM_TYPE field, ignore the form but continue * processing. * * This form's FORM_TYPE is of type boolean. This used to crash the hashing * code. */ g_test_bug ("61433"); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "boolean", '(', "value", '$', "true", ')', ')', ')', NULL); check_hash (stanza, "9LXnSGAOqGkjoewMq7WHTF4wK/U="); } static void test_dataforms_form_type_without_value (void) { WockyStanza *stanza; /* XEP-0115 says: * * 5. If the response includes more than one extended service discovery * information form with the same FORM_TYPE or the FORM_TYPE field * contains more than one element with different XML * character data, consider the entire response to be ill-formed. * 6. If the response includes an extended service discovery information * form where the FORM_TYPE field is not of type "hidden" or the form * does not include a FORM_TYPE field, ignore the form but continue * processing. * * Neither item covers the case where there is a FORM_TYPE field of type * "hidden" with no . I choose to treat it as 5 above. */ g_test_bug ("61433"); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", ')', ')', NULL); check_hash (stanza, NULL); } static void test_dataforms_form_type_two_both_with_no_value (void) { WockyStanza *stanza; /* This ought to be equivalent to test_dataforms_form_type_without_value but * there was a crash in the form-sorting code, which of course doesn't * trigger if there's only one form. */ g_test_bug ("61433"); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", ')', ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", ')', ')', NULL); check_hash (stanza, NULL); } static void test_dataforms_same_type (void) { gchar *out; /* stanza has two data forms both with the same FORM_TYPE value */ WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Psi 0.11", '@', "type", "pc", '#', "en", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/caps", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', '(', "field", '@', "var", "os", '(', "value", '$', "Mac", ')', ')', '(', "field", '@', "var", "os_version", '(', "value", '$', "10.5.1", ')', ')', '(', "field", '@', "var", "software", '(', "value", '$', "Psi", ')', ')', '(', "field", '@', "var", "software_version", '(', "value", '$', "0.11", ')', ')', ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "ip_version", '(', "value", '$', "ipv4", ')', '(', "value", '$', "ipv6", ')', ')', '(', "field", '@', "var", "os", '(', "value", '$', "Mac", ')', ')', '(', "field", '@', "var", "os_version", '(', "value", '$', "10.5.1", ')', ')', '(', "field", '@', "var", "software", '(', "value", '$', "Psi", ')', ')', '(', "field", '@', "var", "software_version", '(', "value", '$', "0.11", ')', ')', ')', NULL); out = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert (out == NULL); } static void test_dataforms_boolean_values (void) { WockyStanza *stanza; gchar *one, *two; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "software", '@', "type", "boolean", '(', "value", '$', "1", ')', ')', ')', NULL); one = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, NULL, "badger", '(', "identity", '@', "category", "client", '@', "name", "Ψ 0.11", '@', "type", "pc", '#', "el", ')', '(', "feature", '@', "var", "http://jabber.org/protocol/disco#info", ')', '(', "x", ':', "jabber:x:data", '@', "type", "result", '(', "field", '@', "var", "FORM_TYPE", '@', "type", "hidden", '(', "value", '$', "urn:xmpp:dataforms:softwareinfo", ')', ')', '(', "field", '@', "var", "software", '@', "type", "boolean", '(', "value", '$', "true", ')', ')', ')', NULL); two = wocky_caps_hash_compute_from_node ( wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_assert (one != NULL); g_assert (two != NULL); g_assert_cmpstr (one, !=, two); g_free (one); g_free (two); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/caps-hash/simple", test_simple); g_test_add_func ("/caps-hash/complex", test_complex); g_test_add_func ("/caps-hash/sorting/simple", test_sorting_simple); g_test_add_func ("/caps-hash/sorting/complex", test_sorting_complex); g_test_add_func ("/caps-hash/dataforms/invalid", test_dataforms_invalid); g_test_add_func ("/caps-hash/dataforms/invalid/fixed-and-no-var", test_dataforms_fixed_and_no_var); g_test_add_func ("/caps-hash/dataforms/invalid/form_type/wrong-type", test_dataforms_form_type_wrong_type); g_test_add_func ("/caps-hash/dataforms/invalid/form_type/no-value", test_dataforms_form_type_without_value); g_test_add_func ("/caps-hash/dataforms/invalid/form_type/two-both-with-no-value", test_dataforms_form_type_two_both_with_no_value); g_test_add_func ("/caps-hash/dataforms/same-type", test_dataforms_same_type); g_test_add_func ("/caps-hash/dataforms/boolean-values", test_dataforms_boolean_values); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/test-resolver.c0000644000175000017500000002367013011303251024712 0ustar00gkiagiagkiagia00000000000000/* * test-resolver.c - Source for TestResolver * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* this code largely culled from gunixresolver.c in glib and modified to * make a dummy resolver we can insert duff records in on the fly */ /* examples: * GResolver *original; * GResolver *kludged; * original = g_resolver_get_default (); * kludged = g_object_new (TEST_TYPE_RESOLVER, "real-resolver", original, NULL); * g_resolver_set_default (kludged); * test_resolver_add_SRV (TEST_RESOLVER (kludged), * "xmpp-client", "tcp", "jabber.earth.li", "localhost", 1337); * test_resolver_add_A (TEST_RESOLVER (kludged), "localhost", "127.0.1.1"); */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef G_OS_WIN32 #include #include #else #include #include #include #endif #include "test-resolver.h" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif #define G_LOG_DOMAIN "test-resolver" enum { PROP_REAL_RESOLVER = 1, }; typedef struct _fake_host { char *key; char *addr; } fake_host; typedef struct _fake_serv { char *key; GSrvTarget *srv; } fake_serv; G_DEFINE_TYPE (TestResolver, test_resolver, G_TYPE_RESOLVER); /* ************************************************************************* */ static gchar * _service_rrname (const char *service, const char *protocol, const char *domain) { gchar *rrname, *ascii_domain = NULL; if (g_hostname_is_non_ascii (domain)) domain = ascii_domain = g_hostname_to_ascii (domain); rrname = g_strdup_printf ("_%s._%s.%s", service, protocol, domain); g_free (ascii_domain); return rrname; } static GList * find_fake_services (TestResolver *tr, const char *name) { GList *fake = NULL; GList *rval = NULL; for (fake = tr->fake_SRV; fake; fake = fake->next) { fake_serv *entry = fake->data; if (entry && !g_strcmp0 (entry->key, name)) rval = g_list_append (rval, g_srv_target_copy (entry->srv)); } return rval; } static GList * find_fake_hosts (TestResolver *tr, const char *name) { GList *fake = NULL; GList *rval = NULL; for (fake = tr->fake_A; fake; fake = fake->next) { fake_host *entry = fake->data; if (entry && !g_strcmp0 (entry->key, name)) rval = g_list_append (rval, g_inet_address_new_from_string (entry->addr)); } return rval; } static GList * srv_target_list_copy (GList *addr) { GList *copy = NULL; GList *l; for (l = addr; l != NULL; l = l->next) copy = g_list_prepend (copy, g_srv_target_copy (l->data)); return g_list_reverse (copy); } static void srv_target_list_free (GList *addr) { g_list_foreach (addr, (GFunc) g_srv_target_free, NULL); g_list_free (addr); } static GList * object_list_copy (GList *objs) { g_list_foreach (objs, (GFunc) g_object_ref, NULL); return g_list_copy (objs); } static void object_list_free (GList *objs) { g_list_foreach (objs, (GFunc) g_object_unref, NULL); g_list_free (objs); } static void lookup_service_async (GResolver *resolver, const char *rr, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer data) { TestResolver *tr = TEST_RESOLVER (resolver); GList *addr = find_fake_services (tr, rr); GObject *source = G_OBJECT (resolver); GSimpleAsyncResult *res = NULL; #ifdef DEBUG_FAKEDNS GList *x; #endif if (addr != NULL) { #ifdef DEBUG_FAKEDNS for (x = addr; x; x = x->next) g_debug ("FAKE SRV: addr: %s; port: %d; prio: %d; weight: %d;\n", g_srv_target_get_hostname ((GSrvTarget *) x->data), g_srv_target_get_port ((GSrvTarget *) x->data), g_srv_target_get_priority ((GSrvTarget *) x->data), g_srv_target_get_weight ((GSrvTarget *) x->data)); #endif res = g_simple_async_result_new (source, cb, data, lookup_service_async); } else { res = g_simple_async_result_new_error (source, cb, data, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, "No fake SRV record registered"); } g_simple_async_result_set_op_res_gpointer (res, addr, (GDestroyNotify) srv_target_list_free); g_simple_async_result_complete (res); g_object_unref (res); } static GList * lookup_service_finish (GResolver *resolver, GAsyncResult *result, GError **error) { GList *res = NULL; GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) return NULL; res = g_simple_async_result_get_op_res_gpointer (simple); return srv_target_list_copy (res); } static void lookup_by_name_async (GResolver *resolver, const gchar *hostname, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer data) { TestResolver *tr = TEST_RESOLVER (resolver); GList *addr = find_fake_hosts (tr, hostname); GObject *source = G_OBJECT (resolver); GSimpleAsyncResult *res = NULL; #ifdef DEBUG_FAKEDNS GList *x; char a[32]; #endif if (addr != NULL) { #ifdef DEBUG_FAKEDNS for (x = addr; x; x = x->next) g_debug ("FAKE HOST: addr: %s;\n", inet_ntop (AF_INET, g_inet_address_to_bytes (x->data), a, sizeof (a))); #endif res = g_simple_async_result_new (source, cb, data, lookup_by_name_async); } else { res = g_simple_async_result_new_error (source, cb, data, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, "No fake hostname record registered"); } g_simple_async_result_set_op_res_gpointer (res, addr, (GDestroyNotify) object_list_free); g_simple_async_result_complete_in_idle (res); g_object_unref (res); } static GList * lookup_by_name_finish (GResolver *resolver, GAsyncResult *result, GError **error) { GList *res = NULL; GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) return NULL; res = g_simple_async_result_get_op_res_gpointer (simple); return object_list_copy (res); } /* ************************************************************************* */ static void test_resolver_init (TestResolver *tr) { } static void test_resolver_set_property (GObject *object, guint propid, const GValue *value, GParamSpec *pspec) { TestResolver *resolver = TEST_RESOLVER (object); switch (propid) { case PROP_REAL_RESOLVER: if (resolver->real_resolver != NULL) g_object_unref (resolver->real_resolver); resolver->real_resolver = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); break; } } static void test_resolver_get_property (GObject *object, guint propid, GValue *value, GParamSpec *pspec) { TestResolver *resolver = TEST_RESOLVER (object); switch (propid) { case PROP_REAL_RESOLVER: g_value_set_object (value, resolver->real_resolver); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); break; } } static void test_resolver_class_init (TestResolverClass *klass) { GResolverClass *resolver_class = G_RESOLVER_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *spec; object_class->set_property = test_resolver_set_property; object_class->get_property = test_resolver_get_property; spec = g_param_spec_object ("real-resolver", "real-resolver", "The real resolver to use when we don't have a kludge entry", G_TYPE_RESOLVER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_REAL_RESOLVER, spec); resolver_class->lookup_by_name_async = lookup_by_name_async; resolver_class->lookup_by_name_finish = lookup_by_name_finish; resolver_class->lookup_service_async = lookup_service_async; resolver_class->lookup_service_finish = lookup_service_finish; } void test_resolver_reset (TestResolver *tr) { GList *fake = NULL; for (fake = tr->fake_A; fake; fake = fake->next) { fake_host *entry = fake->data; g_free (entry->key); g_free (entry->addr); g_free (entry); } g_list_free (tr->fake_A); tr->fake_A = NULL; for (fake = tr->fake_SRV; fake; fake = fake->next) { fake_serv *entry = fake->data; g_free (entry->key); g_srv_target_free (entry->srv); g_free (entry); } g_list_free (tr->fake_SRV); tr->fake_SRV = NULL; } gboolean test_resolver_add_A (TestResolver *tr, const char *hostname, const char *addr) { fake_host *entry = g_new0( fake_host, 1 ); entry->key = g_strdup (hostname); entry->addr = g_strdup (addr); tr->fake_A = g_list_append (tr->fake_A, entry); return TRUE; } gboolean test_resolver_add_SRV (TestResolver *tr, const char *service, const char *protocol, const char *domain, const char *addr, guint16 port) { char *key = _service_rrname (service, protocol, domain); fake_serv *entry = g_new0 (fake_serv, 1); GSrvTarget *serv = g_srv_target_new (addr, port, 0, 0); entry->key = key; entry->srv = serv; tr->fake_SRV = g_list_append (tr->fake_SRV, entry); return TRUE; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-roster-test.c0000644000175000017500000016733212735676345025562 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" /* Test to instantiate a WockyRoster object */ static void test_instantiation (void) { WockyRoster *roster; WockyXmppConnection *connection; WockyTestStream *stream; WockySession *session; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); session = wocky_session_new_with_connection (connection, "example.com"); roster = wocky_roster_new (session); g_assert (roster != NULL); g_object_unref (roster); g_object_unref (session); g_object_unref (connection); g_object_unref (stream); } /* Test if the Roster sends the right IQ query when fetching the roster */ static gboolean fetch_roster_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaType type; WockyStanzaSubType sub_type; WockyNode *node; WockyStanza *reply; const char *id; /* Make sure stanza is as expected. */ wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_GET); node = wocky_node_get_child (wocky_stanza_get_top_node (stanza), "query"); g_assert (wocky_stanza_get_top_node (stanza) != NULL); g_assert (!wocky_strdiff (wocky_node_get_ns (node), "jabber:iq:roster")); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); g_assert (id != NULL); reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', "jabber:iq:roster", '(', "item", '@', "jid", "romeo@example.net", '@', "name", "Romeo", '@', "subscription", "both", '(', "group", '$', "Friends", ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void fetch_roster_fetched_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_return_if_fail (wocky_roster_fetch_roster_finish ( WOCKY_ROSTER (source_object), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void test_fetch_roster_send_iq (void) { WockyRoster *roster; test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, fetch_roster_send_iq_cb, test, NULL); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); roster = wocky_roster_new (test->session_in); wocky_roster_fetch_roster_async (roster, NULL, fetch_roster_fetched_cb, test); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } /* Test if the Roster object is properly populated when receiving its fetch * reply */ static WockyBareContact * create_romeo (void) { const gchar *groups[] = { "Friends", NULL }; return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); } static WockyBareContact * create_juliet (void) { const gchar *groups[] = { "Friends", "Girlz", NULL }; return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "juliet@example.net", "name", "Juliet", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO, "groups", groups, NULL); } static int find_contact (gconstpointer a, gconstpointer b) { if (wocky_bare_contact_equal (WOCKY_BARE_CONTACT (a), WOCKY_BARE_CONTACT (b))) return 0; return 1; } static void fetch_roster_reply_roster_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyBareContact *contact; WockyRoster *roster = WOCKY_ROSTER (source_object); WockyBareContact *romeo, *juliet; GSList *contacts; g_return_if_fail (wocky_roster_fetch_roster_finish (roster, res, NULL)); contacts = wocky_roster_get_all_contacts (roster); g_assert_cmpuint (g_slist_length (contacts), ==, 2); contact = wocky_roster_get_contact (roster, "romeo@example.net"); romeo = create_romeo (); g_assert (wocky_bare_contact_equal (contact, romeo)); g_assert (g_slist_find_custom (contacts, romeo, find_contact) != NULL); g_object_unref (romeo); contact = wocky_roster_get_contact (roster, "juliet@example.net"); juliet = create_juliet (); g_assert (wocky_bare_contact_equal (contact, juliet)); g_assert (g_slist_find_custom (contacts, juliet, find_contact) != NULL); g_object_unref (juliet); g_slist_foreach (contacts, (GFunc) g_object_unref, NULL); g_slist_free (contacts); test->outstanding--; g_main_loop_quit (test->loop); } static gboolean fetch_roster_reply_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyStanza *reply; /* We're acting like the server here. The client doesn't need to send a * "from" attribute, and in fact it doesn't when fetch_roster is called. It * is left up to the server to know which client is the user and then throw * in a correct to attribute. Here we're just adding a from attribute so the * IQ result builder doesn't complain. */ if (wocky_stanza_get_from (stanza) == NULL) wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "from", "juliet@example.com/balcony"); reply = wocky_stanza_build_iq_result (stanza, '(', "query", ':', "jabber:iq:roster", /* Romeo */ '(', "item", '@', "jid", "romeo@example.net", '@', "name", "Romeo", '@', "subscription", "both", '(', "group", '$', "Friends", ')', /* Juliet */ ')', '(', "item", '@', "jid", "juliet@example.net", '@', "name", "Juliet", '@', "subscription", "to", '(', "group", '$', "Friends", ')', '(', "group", '$', "Girlz", ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); return TRUE; } static WockyRoster * create_initial_roster (test_data_t *test) { WockyRoster *roster; wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, fetch_roster_reply_cb, test, NULL); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); roster = wocky_roster_new (test->session_in); wocky_roster_fetch_roster_async (roster, NULL, fetch_roster_reply_roster_cb, test); test->outstanding++; test_wait_pending (test); return roster; } static void test_fetch_roster_reply (void) { WockyRoster *roster; test_data_t *test = setup_test (); test_open_both_connections (test); roster = create_initial_roster (test); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } /* Test if roster is properly upgraded when a contact is added to it */ static WockyBareContact * create_nurse (void) { const gchar *groups[] = { NULL }; return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "nurse@example.net", "name", "Nurse", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE, "groups", groups, NULL); } static void roster_added_cb (WockyRoster *roster, WockyBareContact *contact, test_data_t *test) { WockyBareContact *nurse; GSList *contacts; /* Is that the right contact? */ nurse = create_nurse (); g_assert (wocky_bare_contact_equal (contact, nurse)); /* Check if the contact has been added to the roster */ g_assert (wocky_roster_get_contact (roster, "nurse@example.net") == contact); contacts = wocky_roster_get_all_contacts (roster); g_assert (g_slist_find_custom (contacts, nurse, (GCompareFunc) find_contact)); g_object_unref (nurse); g_slist_foreach (contacts, (GFunc) g_object_unref, NULL); g_slist_free (contacts); test->outstanding--; g_main_loop_quit (test->loop); } static void roster_update_reply_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyStanzaType type; WockyStanzaSubType sub_type; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, NULL); g_assert (reply != NULL); wocky_stanza_get_type_info (reply, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_RESULT); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); } static void send_roster_update (test_data_t *test, const gchar *jid, const gchar *name, const gchar *subscription, const gchar **groups) { WockyStanza *iq; WockyNode *item; guint i; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, '(', "item", '*', &item, ')', ')', NULL); if (jid != NULL) wocky_node_set_attribute (item, "jid", jid); if (name != NULL) wocky_node_set_attribute (item, "name", name); if (subscription != NULL) wocky_node_set_attribute (item, "subscription", subscription); for (i = 0; groups != NULL && groups[i] != NULL; i++) { WockyNode *node; node = wocky_node_add_child (item, "group"); wocky_node_set_content (node, groups[i]); } wocky_porter_send_iq_async (test->sched_out, iq, NULL, roster_update_reply_cb, test); g_object_unref (iq); test->outstanding++; } static void test_roster_upgrade_add (void) { WockyRoster *roster; test_data_t *test = setup_test (); const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); g_signal_connect (roster, "added", G_CALLBACK (roster_added_cb), test); test->outstanding++; send_roster_update (test, "nurse@example.net", "Nurse", "none", no_group); test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } /* Test if roster is properly upgraded when a contact is removed from it */ static void roster_removed_cb (WockyRoster *roster, WockyBareContact *contact, test_data_t *test) { WockyBareContact *romeo; GSList *contacts; /* Is that the right contact? */ romeo = create_romeo (); g_assert (wocky_bare_contact_equal (contact, romeo)); /* Check if the contact has been removed from the roster */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); contacts = wocky_roster_get_all_contacts (roster); g_assert (g_slist_find_custom (contacts, romeo, (GCompareFunc) find_contact) == NULL); g_object_unref (romeo); g_slist_foreach (contacts, (GFunc) g_object_unref, NULL); g_slist_free (contacts); test->outstanding--; g_main_loop_quit (test->loop); } static void test_roster_upgrade_remove (void) { WockyRoster *roster; test_data_t *test = setup_test (); const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); g_signal_connect (roster, "removed", G_CALLBACK (roster_removed_cb), test); test->outstanding++; send_roster_update (test, "romeo@example.net", NULL, "remove", no_group); test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } /* Test if WockyBareContact objects are properly upgraded */ static void contact_notify_cb (WockyBareContact *contact, GParamSpec *pspec, test_data_t *test) { test->outstanding--; g_main_loop_quit (test->loop); } static void test_roster_upgrade_change (void) { WockyRoster *roster; test_data_t *test = setup_test (); GSList *contacts, *l; WockyBareContact *romeo, *contact; const gchar *groups_init[] = { "Friends", NULL }; const gchar *groups[] = { "Badger", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); romeo = create_romeo (); contacts = wocky_roster_get_all_contacts (roster); for (l = contacts; l != NULL; l = g_slist_next (l)) { g_signal_connect (l->data, "notify", G_CALLBACK (contact_notify_cb), test); } g_slist_foreach (contacts, (GFunc) g_object_unref, NULL); g_slist_free (contacts); /* change name */ test->outstanding++; send_roster_update (test, "romeo@example.net", "Romeooo", "both", groups_init); test_wait_pending (test); /* Name has been changed */ wocky_bare_contact_set_name (romeo, "Romeooo"); g_assert (wocky_bare_contact_equal (contact, romeo)); /* change subscription */ test->outstanding++; send_roster_update (test, "romeo@example.net", "Romeooo", "to", groups_init); test_wait_pending (test); /* Subscription has been changed */ wocky_bare_contact_set_subscription (romeo, WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO); g_assert (wocky_bare_contact_equal (contact, romeo)); /* change groups */ test->outstanding++; send_roster_update (test, "romeo@example.net", "Romeooo", "to", groups); test_wait_pending (test); /* Groups have been changed */ wocky_bare_contact_set_groups (romeo, (gchar **) groups); g_assert (wocky_bare_contact_equal (contact, romeo)); g_object_unref (romeo); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } static void ack_iq (WockyPorter *porter, WockyStanza *stanza) { WockyStanza *reply; const gchar *id; id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); g_assert (id != NULL); reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); } /* Test adding a contact to the roster */ static void check_edit_roster_stanza (WockyStanza *stanza, const gchar *jid, const gchar *name, const gchar *subscription, const gchar **groups) { WockyStanzaType type; WockyStanzaSubType sub_type; WockyNode *node; GSList *l; guint i; GHashTable *expected_groups; wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_SET); node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "query", WOCKY_XMPP_NS_ROSTER); g_assert (node != NULL); node = wocky_node_get_child (node, "item"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "jid"), jid)); if (name != NULL) g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "name"), name)); else g_assert (wocky_node_get_attribute (node, "name") == NULL); if (subscription != NULL) g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "subscription"), subscription)); else g_assert (wocky_node_get_attribute (node, "subscription") == NULL); if (groups == NULL) { /* No group children */ g_assert_cmpuint (g_slist_length (node->children), == , 0); return; } expected_groups = g_hash_table_new (g_str_hash, g_str_equal); for (i = 0; groups[i] != NULL; i++) { g_hash_table_insert (expected_groups, (gchar *) groups[i], GUINT_TO_POINTER (TRUE)); } for (l = node->children; l != NULL; l = g_slist_next (l)) { WockyNode *group = (WockyNode *) l->data; g_assert (!wocky_strdiff (group->name, "group")); g_assert (g_hash_table_remove (expected_groups, group->content)); } g_assert (g_hash_table_size (expected_groups) == 0); g_hash_table_unref (expected_groups); } static void check_add_contact_stanza (WockyStanza *stanza, const gchar *jid, const gchar *name, const gchar **groups) { check_edit_roster_stanza (stanza, jid, name, NULL, groups); } static gboolean first_add = TRUE; static gboolean add_contact_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; const gchar *groups[] = { "Friends", "Badger", NULL }; if (first_add) { check_add_contact_stanza (stanza, "mercutio@example.net", "Mercutio", groups); send_roster_update (test, "mercutio@example.net", "Mercutio", "none", groups); first_add = FALSE; } else { /* the second time the name is changed */ check_add_contact_stanza (stanza, "mercutio@example.net", "Badger", groups); send_roster_update (test, "mercutio@example.net", "Badger", "none", groups); } /* Ack the IQ */ ack_iq (porter, stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void contact_added_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); g_assert (wocky_roster_add_contact_finish (roster, res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static WockyBareContact * create_mercutio (void) { const gchar *groups[] = { "Friends", "Badger", NULL }; return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "mercutio@example.net", "name", "Mercutio", "groups", groups, NULL); } static void test_roster_add_contact (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *mercutio, *contact; const gchar *groups[] = { "Friends", "Badger", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, add_contact_send_iq_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); mercutio = create_mercutio (); /* Add the Mercutio to our roster */ wocky_roster_add_contact_async (roster, "mercutio@example.net", "Mercutio", groups, NULL, contact_added_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the contact has been actually added */ contact = wocky_roster_get_contact (roster, "mercutio@example.net"); g_assert (wocky_bare_contact_equal (contact, mercutio)); /* try to re-add the same contact. Operation succeeds immediately */ wocky_roster_add_contact_async (roster, "mercutio@example.net", "Mercutio", groups, NULL, contact_added_cb, test); test->outstanding += 1; test_wait_pending (test); /* try to re-add the same contact but with a different name. The name is * changed */ wocky_roster_add_contact_async (roster, "mercutio@example.net", "Badger", groups, NULL, contact_added_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the contact has been updated */ contact = wocky_roster_get_contact (roster, "mercutio@example.net"); wocky_bare_contact_set_name (mercutio, "Badger"); g_assert (wocky_bare_contact_equal (contact, mercutio)); test_close_both_porters (test); g_object_unref (mercutio); g_object_unref (roster); teardown_test (test); } static void check_remove_contact_stanza (WockyStanza *stanza, const gchar *jid) { check_edit_roster_stanza (stanza, jid, NULL, "remove", NULL); } /* Test removing a contact from the roster */ static gboolean remove_contact_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; const gchar *no_group[] = { NULL }; check_remove_contact_stanza (stanza, "romeo@example.net"); send_roster_update (test, "romeo@example.net", NULL, "remove", no_group); /* Ack the IQ */ ack_iq (porter, stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void contact_removed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); g_assert (wocky_roster_remove_contact_finish (roster, res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void test_roster_remove_contact (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, remove_contact_send_iq_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Keep a ref on the contact as the roster will release its ref when * removing it */ g_object_ref (contact); wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the contact has actually been removed */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); /* try to re-remove the same contact. Operation succeeds immediately */ wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); test->outstanding += 1; test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); g_object_unref (contact); teardown_test (test); } /* test changing the name of a roster item */ static gboolean change_name_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaType type; WockyStanzaSubType sub_type; WockyNode *node; const gchar *group[] = { "Friends", NULL }; /* Make sure stanza is as expected. */ wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_SET); node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "query", WOCKY_XMPP_NS_ROSTER); g_assert (node != NULL); node = wocky_node_get_child (node, "item"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "jid"), "romeo@example.net")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "name"), "Badger")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "subscription"), "both")); g_assert_cmpuint (g_slist_length (node->children), ==, 1); node = wocky_node_get_child (node, "group"); g_assert (node != NULL); g_assert (!wocky_strdiff (node->content, "Friends")); send_roster_update (test, "romeo@example.net", "Badger", "both", group); /* Ack the IQ */ ack_iq (porter, stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void contact_name_changed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); g_assert (wocky_roster_change_contact_name_finish (roster, res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void contact_name_changed_not_in_roster_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); GError *error = NULL; g_assert (!wocky_roster_change_contact_name_finish (roster, res, &error)); g_assert_error (error, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_roster_change_name (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo, *mercutio; test_open_both_connections (test); roster = create_initial_roster (test); romeo = create_romeo (); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); g_assert (wocky_bare_contact_equal (contact, romeo)); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, change_name_send_iq_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the contact name has actually been change */ wocky_bare_contact_set_name (romeo, "Badger"); g_assert (wocky_bare_contact_equal (contact, romeo)); /* Retry to do the same change; operation succeeds immediately */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 1; test_wait_pending (test); /* try to change name of a contact which is not in the roster */ mercutio = create_mercutio (); wocky_roster_change_contact_name_async (roster, mercutio, "Badger", NULL, contact_name_changed_not_in_roster_cb, test); test->outstanding += 1; test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); g_object_unref (mercutio); teardown_test (test); } /* test adding a group to a contact */ static gboolean add_group_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaType type; WockyStanzaSubType sub_type; WockyNode *node; const gchar *groups[] = { "Friends", "Badger", NULL }; GSList *l; gboolean group_friend = FALSE, group_badger = FALSE; /* Make sure stanza is as expected. */ wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_SET); node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "query", WOCKY_XMPP_NS_ROSTER); g_assert (node != NULL); node = wocky_node_get_child (node, "item"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "jid"), "romeo@example.net")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "name"), "Romeo")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "subscription"), "both")); g_assert_cmpuint (g_slist_length (node->children), ==, 2); for (l = node->children; l != NULL; l = g_slist_next (l)) { WockyNode *group = (WockyNode *) l->data; g_assert (!wocky_strdiff (group->name, "group")); if (!wocky_strdiff (group->content, "Friends")) group_friend = TRUE; else if (!wocky_strdiff (group->content, "Badger")) group_badger = TRUE; else g_assert_not_reached (); } g_assert (group_friend && group_badger); send_roster_update (test, "romeo@example.net", "Romeo", "both", groups); /* Ack the IQ */ ack_iq (porter, stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void contact_group_added_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); g_assert (wocky_roster_contact_add_group_finish (roster, res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void contact_group_added_not_in_roster_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); GError *error = NULL; g_assert (!wocky_roster_contact_add_group_finish (roster, res, &error)); g_assert_error (error, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_contact_add_group (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo, *mercutio; test_open_both_connections (test); roster = create_initial_roster (test); romeo = create_romeo (); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); g_assert (wocky_bare_contact_equal (contact, romeo)); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, add_group_send_iq_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); wocky_roster_contact_add_group_async (roster, contact, "Badger", NULL, contact_group_added_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the group has actually been added */ wocky_bare_contact_add_group (romeo, "Badger"); g_assert (wocky_bare_contact_equal (contact, romeo)); /* Retry to do the same change; operation succeeds immediately */ wocky_roster_contact_add_group_async (roster, contact, "Badger", NULL, contact_group_added_cb, test); test->outstanding += 1; test_wait_pending (test); /* try to add a group to a contact which is not in the roster */ mercutio = create_mercutio (); wocky_roster_contact_add_group_async (roster, mercutio, "Badger", NULL, contact_group_added_not_in_roster_cb, test); test->outstanding += 1; test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); g_object_unref (mercutio); teardown_test (test); } /* test removing a group from a contact */ static gboolean remove_group_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaType type; WockyStanzaSubType sub_type; WockyNode *node; const gchar *groups[] = { NULL }; /* Make sure stanza is as expected. */ wocky_stanza_get_type_info (stanza, &type, &sub_type); g_assert (type == WOCKY_STANZA_TYPE_IQ); g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_SET); node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "query", WOCKY_XMPP_NS_ROSTER); g_assert (node != NULL); node = wocky_node_get_child (node, "item"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "jid"), "romeo@example.net")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "name"), "Romeo")); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "subscription"), "both")); g_assert_cmpuint (g_slist_length (node->children), ==, 0); send_roster_update (test, "romeo@example.net", "Romeo", "both", groups); /* Ack the IQ */ ack_iq (porter, stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void contact_group_removed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); g_assert (wocky_roster_contact_remove_group_finish (roster, res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void contact_group_removed_not_in_roster_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyRoster *roster = WOCKY_ROSTER (source); GError *error = NULL; g_assert (!wocky_roster_contact_remove_group_finish (roster, res, &error)); g_assert_error (error, WOCKY_ROSTER_ERROR, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_contact_remove_group (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo, *mercutio; test_open_both_connections (test); roster = create_initial_roster (test); romeo = create_romeo (); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); g_assert (wocky_bare_contact_equal (contact, romeo)); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, remove_group_send_iq_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); wocky_roster_contact_remove_group_async (roster, contact, "Friends", NULL, contact_group_removed_cb, test); test->outstanding += 2; test_wait_pending (test); /* check if the group has actually been added */ wocky_bare_contact_remove_group (romeo, "Friends"); g_assert (wocky_bare_contact_equal (contact, romeo)); /* Retry to do the same change; operation succeeds immediately */ wocky_roster_contact_remove_group_async (roster, contact, "Friends", NULL, contact_group_removed_cb, test); test->outstanding += 1; test_wait_pending (test); /* try to remove a group from a contact which is not in the roster */ mercutio = create_mercutio (); wocky_roster_contact_remove_group_async (roster, mercutio, "Friends", NULL, contact_group_removed_not_in_roster_cb, test); test->outstanding += 1; test_wait_pending (test); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); g_object_unref (mercutio); teardown_test (test); } /* Remove a contact and re-add it before the remove operation is completed */ static WockyStanza *received_iq = NULL; static gboolean iq_set_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (received_iq == NULL); received_iq = g_object_ref (stanza); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_remove_contact_re_add (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo; const gchar *groups[] = { "Friends", NULL }; const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet. * Now try to re-add the contact */ check_remove_contact_stanza (received_iq, "romeo@example.net"); wocky_roster_add_contact_async (roster, "romeo@example.net", "Romeo", groups, NULL, contact_added_cb, test); /* Now the server send the roster upgrade and reply to the remove IQ */ send_roster_update (test, "romeo@example.net", NULL, "remove", no_group); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for: * - completion of the remove_contact operation * - server receives the "add contact" IQ */ test->outstanding += 2; test_wait_pending (test); /* At this point, the contact has been removed */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); check_add_contact_stanza (received_iq, "romeo@example.net", "Romeo", groups); /* Now the server send the roster upgrade and reply to the add IQ */ send_roster_update (test, "romeo@example.net", "Romeo", "none", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of the add_contact operation */ test->outstanding += 1; test_wait_pending (test); /* Check that the contact is back */ contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); romeo = create_romeo (); wocky_bare_contact_set_subscription (romeo, WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE); g_assert (wocky_bare_contact_equal (contact, romeo)); test_close_both_porters (test); g_object_unref (romeo); g_object_unref (roster); teardown_test (test); } /* Remove a contact and then try to edit it before the remove operation is * completed */ static void test_remove_contact_edit (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact; const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Keep a ref on the contact as the roster will release its ref when * removing it */ g_object_ref (contact); wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet. * Now try to re-add the contact */ check_remove_contact_stanza (received_iq, "romeo@example.net"); /* Try to change the name of the contact we are removing */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_not_in_roster_cb, test); /* Now the server send the roster upgrade and reply to the remove IQ */ send_roster_update (test, "romeo@example.net", NULL, "remove", no_group); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for: * - completion of the remove_contact operation * - completion (with an error) for the change_name operation */ test->outstanding += 2; test_wait_pending (test); /* At this point, the contact has been removed */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); test_close_both_porters (test); g_object_unref (contact); g_object_unref (roster); teardown_test (test); } /* Queue some edit operations on the same contact */ static void test_multi_contact_edit (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *juliet; const gchar *groups[] = { "Friends", "Girlz", NULL }; const gchar *groups_changed[] = { "Friends", "School", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "juliet@example.net"); g_assert (contact != NULL); juliet = create_juliet (); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Change's Romeo's name */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ g_assert (wocky_bare_contact_equal (contact, juliet)); check_edit_roster_stanza (received_iq, "juliet@example.net", "Badger", "to", groups); /* Try to re-change the name of the contact */ wocky_roster_change_contact_name_async (roster, contact, "Snake", NULL, contact_name_changed_cb, test); /* Add two groups */ wocky_roster_contact_add_group_async (roster, contact, "Hacker", NULL, contact_group_added_cb, test); wocky_roster_contact_add_group_async (roster, contact, "School", NULL, contact_group_added_cb, test); /* Remove a group we just added */ wocky_roster_contact_remove_group_async (roster, contact, "Hacker", NULL, contact_group_removed_cb, test); /* Remove the 2 default groups */ wocky_roster_contact_remove_group_async (roster, contact, "Friends", NULL, contact_group_removed_cb, test); wocky_roster_contact_remove_group_async (roster, contact, "Girlz", NULL, contact_group_removed_cb, test); /* Re-add a removed group */ wocky_roster_contact_add_group_async (roster, contact, "Friends", NULL, contact_group_added_cb, test); /* Now the server sends the roster upgrade and reply to the remove IQ */ send_roster_update (test, "juliet@example.net", "Badger", "to", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for: * - completion of the first change_name operation * - server receives the second edit IQ */ test->outstanding += 2; test_wait_pending (test); /* At this point, the contact has still his initial name */ wocky_bare_contact_set_name (juliet, "Badger"); g_assert (wocky_bare_contact_equal (contact, juliet)); check_edit_roster_stanza (received_iq, "juliet@example.net", "Snake", "to", groups_changed); /* Now the server send the roster upgrade and reply to the add IQ */ send_roster_update (test, "juliet@example.net", "Snake", "to", groups_changed); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of: * - the second change_name (Snake) * - the first add_group (Hacker) * - the second add_group (School) * - the first remove_group (Hacker) * - the second remove_group (Friends) * - the third remove_group (Girlz) * - the third add_group (Friends) */ test->outstanding += 7; test_wait_pending (test); /* Check that the contact is back */ wocky_bare_contact_set_name (juliet, "Snake"); wocky_bare_contact_set_groups (juliet, (gchar **) groups_changed); g_assert (wocky_bare_contact_equal (contact, juliet)); test_close_both_porters (test); g_object_unref (roster); g_object_unref (juliet); teardown_test (test); } /* test editing a contact and then remove it from the roster */ static void test_edit_contact_remove (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact; const gchar *groups[] = { "Friends", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* change contact's name */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet. * Now try to re-add the contact */ check_edit_roster_stanza (received_iq, "romeo@example.net", "Badger", "both", groups); /* remove the contact */ wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); /* Now the server send the roster upgrade and reply to the change name IQ */ send_roster_update (test, "romeo@example.net", "Badger", "both", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for: * - completion of the change name operation * - server receives the "remove contact" IQ */ test->outstanding += 2; test_wait_pending (test); /* At this point, the contact has not been removed yet */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") != NULL); check_remove_contact_stanza (received_iq, "romeo@example.net"); /* Now the server send the roster upgrade and reply to the remove IQ */ send_roster_update (test, "romeo@example.net", NULL, "remove", NULL); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of the remove_contact operation */ test->outstanding += 1; test_wait_pending (test); /* Contact is now removed */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); test_close_both_porters (test); g_object_unref (roster); teardown_test (test); } /* Change twice to the same name */ static void test_change_name_twice (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo; const gchar *groups[] = { "Friends", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); romeo = create_romeo (); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Change's Romeo's name */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ g_assert (wocky_bare_contact_equal (contact, romeo)); check_edit_roster_stanza (received_iq, "romeo@example.net", "Badger", "both", groups); /* Try to reset the same name */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); /* Now the server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "romeo@example.net", "Badger", "both", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of the 2 change_name operations. * No IQ has been sent for the second as no change was needed. */ test->outstanding += 2; test_wait_pending (test); g_assert (received_iq == NULL); /* Name has been changed */ wocky_bare_contact_set_name (romeo, "Badger"); g_assert (wocky_bare_contact_equal (contact, romeo)); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); teardown_test (test); } /* Remove twice the same contact */ static void test_remove_contact_twice (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact; const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Keep a ref on the contact as the roster will release its ref when * removing it */ g_object_ref (contact); wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ check_remove_contact_stanza (received_iq, "romeo@example.net"); /* Re-ask to remove the contact */ wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); /* Now the server send the roster upgrade and reply to the remove IQ */ send_roster_update (test, "romeo@example.net", NULL, "remove", no_group); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of the 2 remove operations. No IQ has been sent for * the second as no change was needed. */ test->outstanding += 2; test_wait_pending (test); g_assert (received_iq == NULL); /* At this point, the contact has been removed */ g_assert (wocky_roster_get_contact (roster, "romeo@example.net") == NULL); test_close_both_porters (test); g_object_unref (contact); g_object_unref (roster); teardown_test (test); } /* Change name of a contact and try to remove and re-add it while change * operation is running */ static void test_change_name_remove_add (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo; const gchar *groups[] = { "Friends", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); romeo = create_romeo (); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Change's Romeo's name */ wocky_roster_change_contact_name_async (roster, contact, "Badger", NULL, contact_name_changed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ g_assert (wocky_bare_contact_equal (contact, romeo)); check_edit_roster_stanza (received_iq, "romeo@example.net", "Badger", "both", groups); /* Remove the contact */ wocky_roster_remove_contact_async (roster, contact, NULL, contact_removed_cb, test); /* Change our mind and re-add it */ wocky_roster_add_contact_async (roster, "romeo@example.net", "Badger", groups, NULL, contact_added_cb, test); /* Now the server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "romeo@example.net", "Badger", "both", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait for completion of: * - the change name operation * - the remove operation * - the add operation * No IQ has been sent for the add and remove as no change was needed. */ test->outstanding += 3; test_wait_pending (test); g_assert (received_iq == NULL); /* Name has been changed */ wocky_bare_contact_set_name (romeo, "Badger"); g_assert (wocky_bare_contact_equal (contact, romeo)); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); teardown_test (test); } /* add 2 groups to the same contact */ static void test_add_two_groups (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *romeo; const gchar *groups2[] = { "Friends", "School", NULL }; const gchar *groups3[] = { "Friends", "School", "Hackers", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "romeo@example.net"); g_assert (contact != NULL); romeo = create_romeo (); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Add a group to Romeo */ wocky_roster_contact_add_group_async (roster, contact, "School", NULL, contact_group_added_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ g_assert (wocky_bare_contact_equal (contact, romeo)); check_edit_roster_stanza (received_iq, "romeo@example.net", "Romeo", "both", groups2); /* Add another group */ wocky_roster_contact_add_group_async (roster, contact, "Hackers", NULL, contact_group_added_cb, test); /* Now the server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "romeo@example.net", "Romeo", "both", groups2); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait that: * - the first add_group operation is completed * - the server receives the IQ for the second add_group */ test->outstanding += 2; test_wait_pending (test); wocky_bare_contact_set_groups (romeo, (gchar **) groups2); g_assert (wocky_bare_contact_equal (contact, romeo)); check_edit_roster_stanza (received_iq, "romeo@example.net", "Romeo", "both", groups3); /* Server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "romeo@example.net", "Romeo", "both", groups3); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait second add_group operation is completed */ test->outstanding += 1; test_wait_pending (test); wocky_bare_contact_set_groups (romeo, (gchar **) groups3); g_assert (wocky_bare_contact_equal (contact, romeo)); test_close_both_porters (test); g_object_unref (roster); g_object_unref (romeo); teardown_test (test); } /* remove 2 groups from the same contact */ static void test_remove_two_groups (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *contact, *juliet; const gchar *groups[] = { "Friends", NULL }; const gchar *no_group[] = { NULL }; test_open_both_connections (test); roster = create_initial_roster (test); contact = wocky_roster_get_contact (roster, "juliet@example.net"); g_assert (contact != NULL); juliet = create_juliet (); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); /* Remove a group from Juliet */ wocky_roster_contact_remove_group_async (roster, contact, "Girlz", NULL, contact_group_removed_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ g_assert (wocky_bare_contact_equal (contact, juliet)); check_edit_roster_stanza (received_iq, "juliet@example.net", "Juliet", "to", groups); /* remove another group */ wocky_roster_contact_remove_group_async (roster, contact, "Friends", NULL, contact_group_removed_cb, test); /* Now the server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "juliet@example.net", "Juliet", "to", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait that: * - the first remove_group operation is completed * - the server receives the IQ for the second remove_group */ test->outstanding += 2; test_wait_pending (test); wocky_bare_contact_set_groups (juliet, (gchar **) groups); g_assert (wocky_bare_contact_equal (contact, juliet)); check_edit_roster_stanza (received_iq, "juliet@example.net", "Juliet", "to", no_group); /* Server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "juliet@example.net", "Juliet", "to", no_group); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait second remove_group operation is completed */ test->outstanding += 1; test_wait_pending (test); wocky_bare_contact_set_groups (juliet, (gchar **) no_group); g_assert (wocky_bare_contact_equal (contact, juliet)); test_close_both_porters (test); g_object_unref (roster); g_object_unref (juliet); teardown_test (test); } /* Try to add twice the same contact */ static void test_add_contact_twice (void) { WockyRoster *roster; test_data_t *test = setup_test (); WockyBareContact *mercutio, *contact; const gchar *groups[] = { "Friends", "Badger", NULL }; test_open_both_connections (test); roster = create_initial_roster (test); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_set_cb, test, '(', "query", ':', WOCKY_XMPP_NS_ROSTER, ')', NULL); mercutio = create_mercutio (); /* Add the Mercutio to our roster */ wocky_roster_add_contact_async (roster, "mercutio@example.net", "Mercutio", groups, NULL, contact_added_cb, test); test->outstanding += 1; test_wait_pending (test); g_assert (received_iq != NULL); /* The IQ has been sent but the server didn't send the upgrade and the reply * yet */ /* contact is not added yet */ g_assert (wocky_roster_get_contact (roster, "mercutio@example.net") == NULL); check_add_contact_stanza (received_iq, "mercutio@example.net", "Mercutio", groups); /* Try to re-add the same contact */ wocky_roster_add_contact_async (roster, "mercutio@example.net", "Mercutio", groups, NULL, contact_added_cb, test); /* Now the server sends the roster upgrade and reply to the first IQ */ send_roster_update (test, "mercutio@example.net", "Mercutio", "none", groups); ack_iq (test->sched_out, received_iq); g_object_unref (received_iq); received_iq = NULL; /* Wait that the 2 add_contact operation are completed. No IQ is sent for * the second as nothing has changed. */ test->outstanding += 2; test_wait_pending (test); /* check if the contact has been actually added */ contact = wocky_roster_get_contact (roster, "mercutio@example.net"); g_assert (wocky_bare_contact_equal (contact, mercutio)); test_close_both_porters (test); g_object_unref (mercutio); g_object_unref (roster); teardown_test (test); } int main (int argc, char **argv) { int result; test_init (argc, argv); /* basic */ g_test_add_func ("/xmpp-roster/instantiation", test_instantiation); /* roster fetching */ g_test_add_func ("/xmpp-roster/fetch-roster-send-iq", test_fetch_roster_send_iq); g_test_add_func ("/xmpp-roster/fetch-roster-reply", test_fetch_roster_reply); /* receive upgrade from server */ g_test_add_func ("/xmpp-roster/roster-upgrade-add", test_roster_upgrade_add); g_test_add_func ("/xmpp-roster/roster-upgrade-remove", test_roster_upgrade_remove); g_test_add_func ("/xmpp-roster/roster-upgrade-change", test_roster_upgrade_change); /* edit roster */ g_test_add_func ("/xmpp-roster/roster-add-contact", test_roster_add_contact); g_test_add_func ("/xmpp-roster/roster-remove-contact", test_roster_remove_contact); g_test_add_func ("/xmpp-roster/roster-change-name", test_roster_change_name); g_test_add_func ("/xmpp-roster/contact-add-group", test_contact_add_group); g_test_add_func ("/xmpp-roster/contact-remove-group", test_contact_remove_group); /* start a edit operation while another edit operation is running */ g_test_add_func ("/xmpp-roster/remove-contact-re-add", test_remove_contact_re_add); g_test_add_func ("/xmpp-roster/remove-contact-edit", test_remove_contact_edit); g_test_add_func ("/xmpp-roster/multi-contact-edit", test_multi_contact_edit); g_test_add_func ("/xmpp-roster/edit-contact-remove", test_edit_contact_remove); g_test_add_func ("/xmpp-roster/change-name-twice", test_change_name_twice); g_test_add_func ("/xmpp-roster/remove-contact-twice", test_remove_contact_twice); g_test_add_func ("/xmpp-roster/change-name-add-remove", test_change_name_remove_add); g_test_add_func ("/xmpp-roster/add-two-groups", test_add_two_groups); g_test_add_func ("/xmpp-roster/remove-two-groups", test_remove_two_groups); g_test_add_func ("/xmpp-roster/add-contact-twice", test_add_contact_twice); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-bare-contact-test.c0000644000175000017500000002511212735676345026573 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_instantiation (void) { WockyBareContact *a, *b; a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", NULL); g_assert (WOCKY_IS_BARE_CONTACT (a)); /* WockyBareContact is a sub-class of WockyContact */ g_assert (WOCKY_IS_CONTACT (a)); b = wocky_bare_contact_new ("romeo@example.net"); g_assert (wocky_bare_contact_equal (a, b)); g_object_unref (a); g_object_unref (b); } static void test_contact_equal (void) { WockyBareContact *a, *b, *c, *d, *e, *f, *g, *h, *i; const gchar *groups[] = { "Friends", "Badger", NULL }; const gchar *groups2[] = { "Friends", "Snake", NULL }; const gchar *groups3[] = { "Badger", "Friends", NULL }; const gchar *groups4[] = { "aa", "bb", NULL }; const gchar *groups5[] = { "ab", "ba", NULL }; a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); g_assert (wocky_bare_contact_equal (a, a)); g_assert (!wocky_bare_contact_equal (a, NULL)); g_assert (!wocky_bare_contact_equal (NULL, a)); /* Different jid */ b = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.org", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); g_assert (!wocky_bare_contact_equal (a, b)); /* Different name */ c = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Juliet", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); g_assert (!wocky_bare_contact_equal (a, c)); /* Different subscription */ d = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO, "groups", groups, NULL); g_assert (!wocky_bare_contact_equal (a, d)); /* Different groups */ e = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups2, NULL); g_assert (!wocky_bare_contact_equal (a, e)); /* Same groups but in a different order */ f = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups3, NULL); g_assert (wocky_bare_contact_equal (a, f)); /* No group defined */ g = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, NULL); g_assert (wocky_bare_contact_equal (g, g)); g_assert (!wocky_bare_contact_equal (a, g)); /* regression test: used to fail with old group comparison algorithm */ h = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "groups", groups4, NULL); i = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "groups", groups5, NULL); g_assert (!wocky_bare_contact_equal (h, i)); g_object_unref (a); g_object_unref (b); g_object_unref (c); g_object_unref (d); g_object_unref (e); g_object_unref (f); g_object_unref (g); g_object_unref (h); g_object_unref (i); } /* test wocky_bare_contact_add_group */ static void test_add_group (void) { WockyBareContact *a, *b, *c, *d; const gchar *groups[] = { "Friends", "Badger", NULL }; const gchar *groups2[] = { "Friends", "Badger", "Snake", NULL }; const gchar *groups3[] = { "Friends", NULL }; a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); /* same as 'a' but with one more group */ b = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups2, NULL); g_assert (!wocky_bare_contact_equal (a, b)); wocky_bare_contact_add_group (a, "Snake"); g_assert (wocky_bare_contact_equal (a, b)); /* try to add an already present group is no-op */ wocky_bare_contact_add_group (a, "Snake"); g_assert (wocky_bare_contact_equal (a, b)); /* No group */ c = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, NULL); d = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups3, NULL); g_assert (!wocky_bare_contact_equal (c, d)); wocky_bare_contact_add_group (c, "Friends"); g_assert (wocky_bare_contact_equal (c, d)); g_object_unref (a); g_object_unref (b); g_object_unref (c); g_object_unref (d); } /* test wocky_bare_contact_in_group */ static void test_in_group (void) { WockyBareContact *a, *b; const gchar *groups[] = { "Friends", "Badger", NULL }; a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); g_assert (wocky_bare_contact_in_group (a, "Friends")); g_assert (wocky_bare_contact_in_group (a, "Badger")); g_assert (!wocky_bare_contact_in_group (a, "Snake")); /* no group defined */ b = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, NULL); g_assert (!wocky_bare_contact_in_group (b, "Snake")); g_object_unref (a); g_object_unref (b); } /* test wocky_bare_contact_remove_group */ static void test_remove_group (void) { WockyBareContact *a, *b, *c; const gchar *groups[] = { "Friends", "Badger", NULL }; const gchar *groups2[] = { "Badger", NULL }; a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); /* same as 'a' but with one more group */ b = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups2, NULL); g_assert (!wocky_bare_contact_equal (a, b)); wocky_bare_contact_remove_group (a, "Friends"); g_assert (wocky_bare_contact_equal (a, b)); /* try to remove an already not present group is no-op */ wocky_bare_contact_remove_group (a, "Friends"); g_assert (wocky_bare_contact_equal (a, b)); /* no group defined */ c = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, NULL); g_assert (wocky_bare_contact_equal (c, c)); wocky_bare_contact_remove_group (c, "Misc"); g_assert (wocky_bare_contact_equal (c, c)); g_object_unref (a); g_object_unref (b); g_object_unref (c); } static void test_contact_copy (void) { WockyBareContact *a, *copy; const gchar *groups[] = { "Friends", "Badger", NULL }; /* Full contact */ a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "name", "Romeo", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); copy = wocky_bare_contact_copy (a); g_assert (wocky_bare_contact_equal (a, copy)); g_object_unref (copy); g_object_unref (a); /* No name */ a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, "groups", groups, NULL); copy = wocky_bare_contact_copy (a); g_assert (wocky_bare_contact_equal (a, copy)); g_object_unref (copy); g_object_unref (a); /* No subscription */ a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "groups", groups, NULL); copy = wocky_bare_contact_copy (a); g_assert (wocky_bare_contact_equal (a, copy)); g_object_unref (copy); g_object_unref (a); /* No group */ a = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "romeo@example.net", "subscription", WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH, NULL); copy = wocky_bare_contact_copy (a); g_assert (wocky_bare_contact_equal (a, copy)); g_object_unref (copy); g_object_unref (a); } static void test_add_get_resource (void) { WockyBareContact *bare; WockyResourceContact *resource_1, *resource_2; GSList *resources; bare = wocky_bare_contact_new ("juliet@example.org"); resources = wocky_bare_contact_get_resources (bare); g_assert_cmpuint (g_slist_length (resources), ==, 0); /* add a ressource */ resource_1 = wocky_resource_contact_new (bare, "Resource1"); wocky_bare_contact_add_resource (bare, resource_1); resources = wocky_bare_contact_get_resources (bare); g_assert_cmpuint (g_slist_length (resources), ==, 1); g_assert (g_slist_find (resources, resource_1) != NULL); g_slist_free (resources); /* add another resource */ resource_2 = wocky_resource_contact_new (bare, "Resource2"); wocky_bare_contact_add_resource (bare, resource_2); resources = wocky_bare_contact_get_resources (bare); g_assert_cmpuint (g_slist_length (resources), ==, 2); g_assert (g_slist_find (resources, resource_1) != NULL); g_assert (g_slist_find (resources, resource_2) != NULL); g_slist_free (resources); /* first resource is disposed and so automatically removed */ g_object_unref (resource_1); resources = wocky_bare_contact_get_resources (bare); g_assert_cmpuint (g_slist_length (resources), ==, 1); g_assert (g_slist_find (resources, resource_2) != NULL); g_slist_free (resources); g_object_unref (bare); g_object_unref (resource_2); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/bare-contact/instantiation", test_instantiation); g_test_add_func ("/bare-contact/contact-equal", test_contact_equal); g_test_add_func ("/bare-contact/add-group", test_add_group); g_test_add_func ("/bare-contact/in-group", test_in_group); g_test_add_func ("/bare-contact/remove-group", test_remove_group); g_test_add_func ("/bare-contact/contact-copy", test_contact_copy); g_test_add_func ("/bare-contact/add-get-resource", test_add_get_resource); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/gabble.supp0000644000175000017500000000702212735676345024103 0ustar00gkiagiagkiagia00000000000000# Gabble leaks { we leak one default resource hash per process Memcheck:Leak ... fun:g_compute_checksum_for_data fun:sha1_hex fun:gabble_connection_constructed } { Test resolver leaks the records that were added Memcheck:Leak ... fun:test_resolver_add_A } # Glib type registration one-time leaks { g_type_init_with_debug_flags leaks one-time per registered type Memcheck:Leak ... fun:g_type_init_with_debug_flags } { g_type_register_fundamental, same story Memcheck:Leak ... fun:g_type_register_fundamental } { Various mixins set type qdata, types stay alive Memcheck:Leak ... fun:g_type_set_qdata } { Information about static interface lives forever Memcheck:Leak ... fun:g_type_add_interface_static } { Type prerequisites Memcheck:Leak ... fun:g_type_interface_add_prerequisite } { Various memory is never freed when first initializing a type class Memcheck:Leak ... fun:g_type_class_ref } # Glib mainloop one time leaks { Default main context stays alive an keeps an array around for pending fds Memcheck:Leak fun:malloc fun:g_malloc fun:g_main_context_iterate } { Default main context stays alive an keeps an array for pending dispatches Memcheck:Leak ... fun:g_ptr_array_add fun:g_main_context_check fun:g_main_context_iterate } { Global hashtable of signal handlers, memory allocated when resized Memcheck:Leak fun:calloc fun:g_malloc0 fun:g_hash_table_remove_internal fun:g_signal_handlers_destroy } { g_main_loop_run constructs a GStaticPrivate GMainDispatch Memcheck:Leak ... fun:get_dispatch } # glib one-time initialisaton of various bits { Random seed initialization Memcheck:Leak ... fun:g_rand_new fun:g_random_int_range } { GDataSet has a global hashtable that leaks per process Memcheck:Leak ... fun:g_data_initialize } { GIO has a static mapping to various connection factories Memcheck:Leak ... fun:g_socket_connection_factory_register_type } { GLib has a static copy of the userdir Memcheck:Leak ... fun:g_init_user_config_dir } { Caching of the tmp location Memcheck:Leak ... fun:g_get_any_init_do } { thread init causes g_get_language_name to cache stuff Memcheck:Leak ... fun:g_get_language_names } { Thread initialisation Memcheck:Leak ... fun:g_private_new_posix_impl } { Thread initialisation Memcheck:Leak ... fun:g_thread_init_glib } # telepathy-glib leaks the dbus connection, which causes dbus to have some # stuff around on exit... { the subtree that stores objects is reallocated in _register_g_object Memcheck:Leak ... fun:dbus_g_connection_register_g_object } { As we leak a connection, the corresponding dataslots bookkeeping is leaked Memcheck:Leak ... fun:dbus_realloc fun:_dbus_data_slot_allocator_alloc fun:tp_dbus_daemon_constructor } { As we leak a connection, the corresponding dataslots bookkeeping is leaked Memcheck:Leak ... fun:dbus_realloc fun:_dbus_data_slot_list_set fun:dbus_connection_set_data fun:tp_dbus_daemon_constructor } # dbus-glib type registration one-time leaks { dbus-glib specialized GTypes are permanent Memcheck:Leak ... fun:lookup_or_register_specialized } { dbus-glib object type information leaks Memcheck:Leak ... fun:dbus_g_object_type_install_info } # misc library one-time leaks { global gnutls data Memcheck:Leak ... fun:gnutls_global_init } { selinux, we just don't know Memcheck:Leak fun:malloc fun:getdelim obj:/lib/libselinux.so.1 } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-sasl-handler.c0000644000175000017500000000216012735676345026604 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-test-sasl-handler.h" #include static void auth_handler_iface_init (gpointer g_iface); G_DEFINE_TYPE_WITH_CODE (WockyTestSaslHandler, wocky_test_sasl_handler, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_AUTH_HANDLER, auth_handler_iface_init)) static void wocky_test_sasl_handler_class_init (WockyTestSaslHandlerClass *klass) { } static void wocky_test_sasl_handler_init (WockyTestSaslHandler *self) { } static gboolean test_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error); static void auth_handler_iface_init (gpointer g_iface) { WockyAuthHandlerIface *iface = g_iface; iface->mechanism = "X-TEST"; iface->plain = FALSE; iface->initial_response_func = test_initial_response; } WockyTestSaslHandler * wocky_test_sasl_handler_new (void) { return g_object_new (WOCKY_TYPE_TEST_SASL_HANDLER, NULL); } static gboolean test_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error) { *initial_data = g_string_new ("open sesame"); return TRUE; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-porter-test.c0000644000175000017500000030662413012550005025523 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" static void test_instantiation (void) { WockyPorter *porter; WockyXmppConnection *connection; WockyTestStream *stream;; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); porter = wocky_c2s_porter_new (connection, "juliet@example.com/Balcony"); g_assert (porter != NULL); g_assert_cmpstr (wocky_porter_get_full_jid (porter), ==, "juliet@example.com/Balcony"); g_assert_cmpstr (wocky_porter_get_bare_jid (porter), ==, "juliet@example.com"); g_assert_cmpstr (wocky_porter_get_resource (porter), ==, "Balcony"); g_object_unref (porter); g_object_unref (connection); g_object_unref (stream); } /* send testing */ static void send_stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; test_data_t *data = (test_data_t *) user_data; GError *error = NULL; WockyStanza *expected; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); g_assert (s != NULL); expected = g_queue_pop_head (data->expected_stanzas); g_assert (expected != NULL); test_assert_stanzas_equal (s, expected); if (g_queue_get_length (data->expected_stanzas) > 0) { /* We need to receive more stanzas */ wocky_xmpp_connection_recv_stanza_async ( WOCKY_XMPP_CONNECTION (source), NULL, send_stanza_received_cb, user_data); data->outstanding++; } g_object_unref (s); g_object_unref (expected); data->outstanding--; g_main_loop_quit (data->loop); } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_porter_send_finish ( WOCKY_PORTER (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } static void send_stanza_cancelled_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_finish ( WOCKY_PORTER (source), res, &error)); g_assert (error->domain == G_IO_ERROR); g_assert (error->code == G_IO_ERROR_CANCELLED); g_error_free (error); data->outstanding--; g_main_loop_quit (data->loop); } static void test_send (void) { test_data_t *test = setup_test (); WockyStanza *s; test_open_connection (test); /* Send a stanza */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_async (test->sched_in, s, NULL, send_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, s); test->outstanding++; /* Send a stanza */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "tybalt@example.net", NULL); wocky_porter_send_async (test->sched_in, s, NULL, send_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, s); test->outstanding++; /* Send two stanzas and cancel them immediately */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "peter@example.net", NULL); wocky_porter_send_async (test->sched_in, s, test->cancellable, send_stanza_cancelled_cb, test); g_object_unref (s); test->outstanding++; s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "samson@example.net", NULL); wocky_porter_send_async (test->sched_in, s, test->cancellable, send_stanza_cancelled_cb, test); g_object_unref (s); test->outstanding++; /* the stanza are not added to expected_stanzas as it was cancelled */ g_cancellable_cancel (test->cancellable); /* ... and a second (using the simple send method) */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "nurse@example.net", NULL); wocky_porter_send (test->sched_in, s); g_queue_push_tail (test->expected_stanzas, s); test->outstanding++; /* Send a last stanza using the full method so we are sure that all async * sending operation have been finished. This is important because * test_close_connection() will have to use this function to close the * connection. If there is still a pending sending operation, it will fail. */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "tybalt@example.net", NULL); wocky_porter_send_async (test->sched_in, s, NULL, send_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, s); test->outstanding++; wocky_xmpp_connection_recv_stanza_async (test->out, NULL, send_stanza_received_cb, test); test_wait_pending (test); test_close_connection (test); teardown_test (test); } /* receive testing */ static gboolean test_receive_stanza_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void sched_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_porter_close_finish ( WOCKY_PORTER (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void close_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void wait_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); g_assert (s == NULL); /* connection has been disconnected */ g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); /* close on our side */ wocky_xmpp_connection_send_close_async (connection, NULL, close_sent_cb, test); /* Don't decrement test->outstanding as we are waiting for another * callback */ g_main_loop_quit (test->loop); } static void test_receive (void) { test_data_t *test = setup_test (); WockyStanza *s; test_open_both_connections (test); /* Send a stanza */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_async (test->sched_in, s, NULL, send_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, s); /* We are waiting for the stanza to be sent and received on the other * side */ test->outstanding += 2; wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_receive_stanza_received_cb, test, NULL); wocky_porter_start (test->sched_out); test_wait_pending (test); test_close_porter (test); teardown_test (test); } /* filter testing */ static gboolean test_filter_iq_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static gboolean test_filter_presence_received_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { /* We didn't send any presence stanza so this callback shouldn't be * called */ g_assert_not_reached (); return TRUE; } static void test_filter (void) { test_data_t *test = setup_test (); WockyStanza *msg, *iq; test_open_both_connections (test); /* register an IQ filter */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_filter_iq_received_cb, test, NULL); /* register a presence filter */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_PRESENCE, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_filter_presence_received_cb, test, NULL); wocky_porter_start (test->sched_out); /* Send a message */ msg = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send (test->sched_in, msg); /* We don't expect this stanza as we didn't register any message filter */ /* Send an IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send (test->sched_in, iq); /* We expect to receive this stanza */ g_queue_push_tail (test->expected_stanzas, iq); test->outstanding++; test_wait_pending (test); g_object_unref (msg); test_close_porter (test); teardown_test (test); } /* test if the send queue is flushed before closing the connection */ static void test_close_stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; test_data_t *test = (test_data_t *) user_data; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); if (g_queue_get_length (test->expected_stanzas) > 0) { WockyStanza *expected; g_assert (s != NULL); expected = g_queue_pop_head (test->expected_stanzas); g_assert (expected != NULL); test_assert_stanzas_equal (s, expected); wocky_xmpp_connection_recv_stanza_async (connection, NULL, test_close_stanza_received_cb, user_data); test->outstanding++; g_object_unref (s); g_object_unref (expected); } else { g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); /* close on our side */ wocky_xmpp_connection_send_close_async (connection, NULL, close_sent_cb, test); } test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_sched_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_porter_close_finish ( WOCKY_PORTER (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void closing_cb (WockyPorter *porter, test_data_t *test) { test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_flush (void) { test_data_t *test = setup_test (); WockyStanza *s; test_open_both_connections (test); wocky_porter_start (test->sched_in); s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send (test->sched_in, s); g_queue_push_tail (test->expected_stanzas, s); test->outstanding++; wocky_xmpp_connection_recv_stanza_async (test->out, NULL, test_close_stanza_received_cb, test); g_signal_connect (test->sched_in, "closing", G_CALLBACK (closing_cb), test); wocky_porter_close_async (test->sched_in, NULL, test_close_sched_close_cb, test); test->outstanding += 3; test_wait_pending (test); teardown_test (test); } /* test if the right error is raised when trying to close a not started * porter */ static void test_close_not_started_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_not_started (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_close_async (test->sched_in, NULL, test_close_not_started_cb, test); test->outstanding++; test_wait_pending (test); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, wait_close_cb, test); wocky_porter_start (test->sched_in); wocky_porter_close_async (test->sched_in, NULL, sched_close_cb, test); test->outstanding += 2; test_wait_pending (test); teardown_test (test); } /* test if the right error is raised when trying to close the porter * twice */ static void test_close_twice_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_twice_cb2 (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_twice (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, wait_close_cb, test); wocky_porter_start (test->sched_in); wocky_porter_close_async (test->sched_in, NULL, sched_close_cb, test); wocky_porter_close_async (test->sched_in, NULL, test_close_twice_cb, test); test->outstanding += 3; test_wait_pending (test); /* Retry now that the porter has been closed */ wocky_porter_close_async (test->sched_in, NULL, test_close_twice_cb2, test); test->outstanding++; test_wait_pending (test); teardown_test (test); } /* Test if the remote-closed signal is emitted when the other side closes his * XMPP connection */ static void remote_closed_cb (WockyPorter *porter, test_data_t *test) { test->outstanding--; g_main_loop_quit (test->loop); } static void test_remote_close_in_close_send_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } static void test_remote_close (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_start (test->sched_out); g_signal_connect (test->sched_out, "remote-closed", G_CALLBACK (remote_closed_cb), test); test->outstanding++; wocky_xmpp_connection_send_close_async ( WOCKY_XMPP_CONNECTION (test->in), NULL, test_remote_close_in_close_send_cb, test); test->outstanding++; test_wait_pending (test); wocky_porter_close_async (test->sched_out, NULL, sched_close_cb, test); test->outstanding++; test_wait_pending (test); teardown_test (test); } /* Test cancelling a close operation */ static void sched_close_cancelled_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_cancel_force_closed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; wocky_porter_force_close_finish ( WOCKY_PORTER (source), res, &error); g_assert_no_error (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_cancel (void) { test_data_t *test = setup_test (); wocky_test_stream_set_write_mode (test->stream->stream0_output, WOCKY_TEST_STREAM_WRITE_COMPLETE); test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_xmpp_connection_recv_stanza_async (test->in, NULL, wait_close_cb, test); wocky_porter_close_async (test->sched_out, test->cancellable, sched_close_cancelled_cb, test); g_cancellable_cancel (test->cancellable); test->outstanding += 2; test_wait_pending (test); wocky_porter_force_close_async (test->sched_out, NULL, test_close_cancel_force_closed_cb, test); test->outstanding++; test_wait_pending (test); teardown_test (test); } /* Test if the remote-error signal is fired when porter got a read error */ static void remote_error_cb (WockyPorter *porter, GQuark domain, guint code, const gchar *message, test_data_t *test) { GError *err = g_error_new_literal (domain, code, message); g_assert_error (err, G_IO_ERROR, G_IO_ERROR_FAILED); g_error_free (err); test->outstanding--; g_main_loop_quit (test->loop); } static void test_reading_error (void) { test_data_t *test = setup_test (); test_open_both_connections (test); g_signal_connect (test->sched_out, "remote-error", G_CALLBACK (remote_error_cb), test); test->outstanding++; wocky_test_input_stream_set_read_error (test->stream->stream1_input); wocky_porter_start (test->sched_out); test_wait_pending (test); test_close_porter (test); teardown_test (test); } /* Test if the right error is raised when trying to send a stanza through a * closed porter */ static void test_send_closing_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING); g_error_free (error); data->outstanding--; g_main_loop_quit (data->loop); } static void test_send_closed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); data->outstanding--; g_main_loop_quit (data->loop); } static void test_send_closed (void) { test_data_t *test = setup_test (); WockyStanza *s; test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, wait_close_cb, test); wocky_porter_close_async (test->sched_in, NULL, sched_close_cb, test); s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); /* try to send a stanza while closing */ wocky_porter_send_async (test->sched_in, s, NULL, test_send_closing_cb, test); test->outstanding += 3; test_wait_pending (test); /* try to send a stanza after the closing */ wocky_porter_send_async (test->sched_in, s, NULL, test_send_closed_cb, test); g_object_unref (s); test->outstanding++; test_wait_pending (test); teardown_test (test); } /* test if the handler with the higher priority is called */ static void send_stanza (test_data_t *test, WockyStanza *stanza, gboolean expected) { wocky_porter_send (test->sched_in, stanza); if (expected) { g_queue_push_tail (test->expected_stanzas, stanza); test->outstanding++; } else { g_object_unref (stanza); } test_wait_pending (test); } static gboolean test_handler_priority_5 (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { /* This handler has the lowest priority and is not supposed to be called */ g_assert_not_reached (); return TRUE; } static gboolean test_handler_priority_10 (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaSubType sub_type; test_expected_stanza_received (test, stanza); wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* This handler is supposed to only handle the get stanza */ g_assert (sub_type == WOCKY_STANZA_SUB_TYPE_GET); return TRUE; } static gboolean test_handler_priority_15 (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_handler_priority (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* register an IQ handler with a priority of 10 */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 10, test_handler_priority_10, test, NULL); /* register an IQ handler with a priority of 5 */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 5, test_handler_priority_5, test, NULL); wocky_porter_start (test->sched_out); /* Send a 'get' IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); /* register an IQ handler with a priority of 15 */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 15, test_handler_priority_15, test, NULL); /* Send a 'set' IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } /* Test unregistering a handler */ static gboolean test_unregister_handler_10 (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { /* this handler is unregistred so shouldn't called */ g_assert_not_reached (); return TRUE; } static gboolean test_unregister_handler_5 (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_unregister_handler (void) { test_data_t *test = setup_test (); WockyStanza *iq; guint id; test_open_both_connections (test); /* register an IQ handler with a priority of 10 */ id = wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 10, test_unregister_handler_10, test, NULL); /* register an IQ handler with a priority of 5 */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 5, test_unregister_handler_5, test, NULL); wocky_porter_start (test->sched_out); /* unregister the first handler */ wocky_porter_unregister_handler (test->sched_out, id); /* Send a 'get' IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } /* test registering a handler using a bare JID as filter criteria */ static gboolean test_handler_bare_jid_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_handler_bare_jid (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* register an IQ handler for all IQ from a bare jid */ wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", 0, test_handler_bare_jid_cb, test, NULL); wocky_porter_start (test->sched_out); /* Send a 'get' IQ from the bare jid */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); /* Send a 'get' IQ from another contact */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "samson@example.com/House", "romeo@example.net", NULL); send_stanza (test, iq, FALSE); /* Send a 'get' IQ from the bare jid + resource */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com/Pub", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } /* test registering a handler using a full JID as filter criteria */ static gboolean test_handler_full_jid_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_handler_full_jid (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* register an IQ handler for all IQ from a bare jid */ wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com/Pub", 0, test_handler_full_jid_cb, test, NULL); wocky_porter_start (test->sched_out); /* Send a 'get' IQ from the bare jid */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, FALSE); /* Send a 'get' IQ from another contact */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "samson@example.com/House", "romeo@example.net", NULL); send_stanza (test, iq, FALSE); /* Send a 'get' IQ from the bare jid + resource */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com/Pub", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } /* test registering a handler using a stanza as filter criteria */ static gboolean test_handler_stanza_jingle_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; const gchar *id; test_expected_stanza_received (test, stanza); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); g_assert (!wocky_strdiff (id, "3") || !wocky_strdiff (id, "4")); return TRUE; } static gboolean test_handler_stanza_terminate_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; const gchar *id; test_expected_stanza_received (test, stanza); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); g_assert (!wocky_strdiff (id, "5")); return TRUE; } static void test_handler_stanza (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* register an IQ handler for all the jingle stanzas related to one jingle * session */ wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", 0, test_handler_stanza_jingle_cb, test, '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "my_sid", ')', NULL); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* Send a not jingle IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", '@', "id", "1", NULL); send_stanza (test, iq, FALSE); /* Send a jingle IQ but related to another session */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", '@', "id", "2", '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "another_sid", ')', NULL); send_stanza (test, iq, FALSE); /* Send a jingle IQ with the right sid but from the wrong contact */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "tybalt@example.com", "romeo@example.net", '@', "id", "2", '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "my_sid", ')', NULL); send_stanza (test, iq, FALSE); /* Send a jingle IQ related to the right session */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", '@', "id", "3", '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "my_sid", ')', NULL); send_stanza (test, iq, TRUE); /* register a new IQ handler,with higher priority, handling session-terminate * with a specific test message */ wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", 10, test_handler_stanza_terminate_cb, test, '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "action", "session-terminate", '(', "reason", '(', "success", ')', '(', "test", '$', "Sorry, gotta go!", ')', ')', ')', NULL); /* Send a session-terminate with the wrong message */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", '@', "id", "4", '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "my_sid", '@', "action", "session-terminate", '(', "reason", '(', "success", ')', '(', "test", '$', "Bye Bye", ')', ')', ')', NULL); send_stanza (test, iq, TRUE); /* Send a session-terminate with the right message */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", '@', "id", "5", '(', "jingle", ':', "urn:xmpp:jingle:1", '@', "sid", "my_sid", '@', "action", "session-terminate", '(', "reason", '(', "success", ')', '(', "test", '$', "Sorry, gotta go!", ')', ')', ')', NULL); send_stanza (test, iq, TRUE); test_close_both_porters (test); teardown_test (test); } /* Cancel the sending of a stanza after it has been received */ static gboolean test_cancel_sent_stanza_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); test_cancel_in_idle (test->cancellable); return TRUE; } static void test_cancel_sent_stanza_cancelled (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; /* Stanza has already be sent to _finish success */ g_assert (wocky_porter_send_finish ( WOCKY_PORTER (source), res, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void test_cancel_sent_stanza (void) { test_data_t *test = setup_test (); WockyStanza *stanza; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register a message handler */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_cancel_sent_stanza_cb, test, NULL); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_async (test->sched_in, stanza, test->cancellable, test_cancel_sent_stanza_cancelled, test); g_queue_push_tail (test->expected_stanzas, stanza); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } /* Test if the error is correctly propagated when a writing error occurs */ static void test_writing_error_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_writing_error (void) { test_data_t *test = setup_test (); WockyStanza *s; test_open_connection (test); wocky_test_output_stream_set_write_error (test->stream->stream0_output); s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); test->outstanding++; wocky_porter_send_async (test->sched_in, s, NULL, test_writing_error_cb, test); test_wait_pending (test); g_object_unref (s); teardown_test (test); } /* Test send with reply */ static void test_send_iq_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_porter_send_finish ( WOCKY_PORTER (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } static gboolean test_send_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; const gchar *id; gboolean cancelled; WockyStanzaSubType sub_type; test_expected_stanza_received (test, stanza); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* Reply of the "set" IQ is not expected as we are going to cancel it */ cancelled = (sub_type == WOCKY_STANZA_SUB_TYPE_SET); if (cancelled) g_cancellable_cancel (test->cancellable); /* Send a spoofed reply; should be ignored */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "oscar@example.net", "juliet@example.com", '@', "id", id, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); /* Send a reply without 'id' attribute; should be ignored */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", NULL); wocky_porter_send (porter, reply); g_object_unref (reply); /* Send reply */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '@', "id", id, NULL); wocky_porter_send_async (porter, reply, NULL, test_send_iq_sent_cb, test); if (!cancelled) g_queue_push_tail (test->expected_stanzas, reply); else g_object_unref (reply); test->outstanding++; return TRUE; } static gboolean test_send_iq_abnormal_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; const gchar *id; WockyStanzaSubType sub_type; test_expected_stanza_received (test, stanza); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* Send a spoofed reply; should be ignored */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "oscar@example.net", "juliet@example.com", '@', "id", id, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); /* Send a reply without 'id' attribute; should be ignored */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "rOmeO@examplE.neT", "juLiet@Example.cOm", NULL); wocky_porter_send (porter, reply); g_object_unref (reply); /* Send reply */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "roMeo@eXampLe.net", "JulieT@ExamplE.com", '@', "id", id, NULL); wocky_porter_send_async (porter, reply, NULL, test_send_iq_sent_cb, test); g_queue_push_tail (test->expected_stanzas, reply); test->outstanding++; return TRUE; } static void test_send_iq_reply_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, NULL); g_assert (reply != NULL); test_expected_stanza_received (test, reply); g_object_unref (reply); } static void test_send_iq_cancelled_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); g_assert (reply == NULL); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_send_iq (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register an IQ handler */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_send_iq_cb, test, NULL); /* Send an IQ query. We are going to cancel it after it has been received * but before we receive the reply so the callback won't be called.*/ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_iq_cancelled_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); /* Send an IQ query */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "1", NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_send_iq_reply_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } static gboolean test_acknowledge_iq_acknowledge_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; wocky_porter_acknowledge_iq (porter, stanza, '(', "sup-dawg", '@', "lions", "tigers", ')', NULL); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_iq_reply_no_id_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); test_data_t *test = user_data; WockyStanza *reply; WockyStanza *expected_reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (porter, result, &error); g_assert_no_error (error); g_assert (reply != NULL); expected_reply = g_queue_pop_head (test->expected_stanzas); g_assert (expected_reply != NULL); /* If we got the reply dispatched to us, the ID was correct — this is tested * elsewhere. So we don't need to test it again here. */ test_assert_stanzas_equal_no_id (reply, expected_reply); g_object_unref (reply); g_object_unref (expected_reply); test->outstanding--; g_main_loop_quit (test->loop); } /* Tests wocky_porter_acknowledge_iq(). */ static void test_acknowledge_iq (void) { test_data_t *test = setup_test (); WockyStanza *iq, *expected_reply; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, 0, test_acknowledge_iq_acknowledge_cb, test, NULL); /* We re-construct expected_reply for every test because… * test_assert_stanzas_equal_no_id() modifies the stanzas it's comparing to * add an id='' to the one which doesn't have one. */ /* Send a legal IQ (with a single child element). */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '(', "sup-dawg", ')', NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", '@', "lions", "tigers", ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Send an illegal IQ with two child elements. We expect that * wocky_porter_acknowledge_iq() should cope. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '(', "sup-dawg", ')', '(', "i-heard-you-like-stanzas", ')', NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", '@', "lions", "tigers", ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Send another illegal IQ, with no child element at all. Obviously in real * life it should be nacked, but wocky_porter_acknowledge_iq() should still * cope. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", '@', "lions", "tigers", ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Finally, send an IQ that doesn't have an id='' attribute. This is really * illegal, but wocky_porter_acknowledge_iq() needs to deal because it * happens in practice. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send (test->sched_in, iq); /* In this case, we only expect the recipient's callback to fire. There's no * way for it to send us an IQ back, so we don't need to wait for a reply * there. */ test->outstanding += 1; g_object_unref (iq); /* Off we go! */ test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } static gboolean test_send_iq_error_nak_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; wocky_porter_send_iq_error (porter, stanza, WOCKY_XMPP_ERROR_BAD_REQUEST, "bye bye beautiful"); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } /* Tests wocky_porter_send_iq_error(). */ static void test_send_iq_error (void) { test_data_t *test = setup_test (); WockyStanza *iq, *expected_reply; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, 0, test_send_iq_error_nak_cb, test, NULL); /* Send a legal IQ (with a single child element). */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '(', "sup-dawg", ')', NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", ')', '(', "error", '@', "code", "400", '@', "type", "modify", '(', "bad-request", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', "bye bye beautiful", ')', ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Send an illegal IQ with two child elements. We expect that * wocky_porter_send_iq_error() should cope by just picking the first one. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '(', "sup-dawg", ')', '(', "i-heard-you-like-stanzas", ')', NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", ')', '(', "error", '@', "code", "400", '@', "type", "modify", '(', "bad-request", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', "bye bye beautiful", ')', ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Send another illegal IQ, with no child element at all. * wocky_porter_send_iq_error() should not blow up. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '(', "error", '@', "code", "400", '@', "type", "modify", '(', "bad-request", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', "bye bye beautiful", ')', ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); g_object_unref (iq); /* Finally, send an IQ that doesn't have an id='' attribute. This is really * illegal, but wocky_porter_send_iq_error() needs to deal because it * happens in practice. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send (test->sched_in, iq); /* In this case, we only expect the recipient's callback to fire. There's no * way for it to send us an IQ back, so we don't need to wait for a reply * there. */ test->outstanding += 1; g_object_unref (iq); test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } typedef struct { test_data_t *test; GError error; } TestSendIqGErrorCtx; static gboolean test_send_iq_gerror_nak_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { TestSendIqGErrorCtx *ctx = user_data; wocky_porter_send_iq_gerror (porter, stanza, &ctx->error); ctx->test->outstanding--; g_main_loop_quit (ctx->test->loop); return TRUE; } /* Tests wocky_porter_send_iq_gerror(). */ static void test_send_iq_gerror (void) { test_data_t *test = setup_test (); TestSendIqGErrorCtx ctx = { test, }; WockyStanza *iq, *expected_reply; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, 0, test_send_iq_gerror_nak_cb, &ctx, NULL); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '(', "sup-dawg", ')', NULL); /* Test responding with a simple error */ ctx.error.domain = WOCKY_XMPP_ERROR; ctx.error.code = WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST; ctx.error.message = "i'm twelve years old and what is this?"; expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", ')', '(', "error", '@', "code", "400", '@', "type", "wait", '(', "unexpected-request", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', ctx.error.message, ')', ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); test_wait_pending (test); /* Test responding with an application-specific error */ ctx.error.domain = WOCKY_JINGLE_ERROR; ctx.error.code = WOCKY_JINGLE_ERROR_OUT_OF_ORDER; ctx.error.message = "i'm twelve years old and what is this?"; expected_reply = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '(', "sup-dawg", ')', '(', "error", '@', "code", "400", '@', "type", "wait", '(', "unexpected-request", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "out-of-order", ':', WOCKY_XMPP_NS_JINGLE_ERRORS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', ctx.error.message, ')', ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_iq_reply_no_id_cb, test); test->outstanding += 2; g_queue_push_tail (test->expected_stanzas, expected_reply); test_wait_pending (test); g_object_unref (iq); test_close_both_porters (test); teardown_test (test); } static void test_send_iq_abnormal (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register an IQ handler (to send both the good and spoofed reply) */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_send_iq_abnormal_cb, test, NULL); /* Send an IQ query */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "julIet@exampLe.com", "RoMeO@eXample.net", '@', "id", "1", NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_send_iq_reply_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } /* Test if the error is correctly propagated when a writing error occurs while * sending an IQ */ static void test_send_iq_error_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_iq_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_error_while_sending_iq (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_connection (test); wocky_test_output_stream_set_write_error (test->stream->stream0_output); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", NULL); test->outstanding++; wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_send_iq_error_cb, test); test_wait_pending (test); g_object_unref (iq); teardown_test (test); } /* Test implementing a filter using handlers */ static gboolean test_handler_filter_get_filter (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanzaSubType sub_type; gboolean result; wocky_stanza_get_type_info (stanza, NULL, &sub_type); if (sub_type == WOCKY_STANZA_SUB_TYPE_GET) { /* We filter 'get' IQ. Return TRUE to say that we handled this stanza so * the handling process will be stopped */ result = TRUE; } else { /* We don't handle this stanza so the other callback will be called */ g_queue_push_tail (test->expected_stanzas, stanza); g_object_ref (stanza); test->outstanding++; result = FALSE; } test_expected_stanza_received (test, stanza); return result; } static gboolean test_handler_filter_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_handler_filter (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* register an IQ handler which will act as a filter */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 10, test_handler_filter_get_filter, test, NULL); /* register another handler with a smaller priority which will be called * after the filter */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 5, test_handler_filter_cb, test, NULL); wocky_porter_start (test->sched_out); /* Send a 'get' IQ that will be filtered */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); /* Send a 'set' IQ that won't be filtered */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } static void unhandled_iq_reply_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); test_data_t *test = user_data; GError *error = NULL; WockyStanza *reply = wocky_porter_send_iq_finish (porter, result, &error); gboolean is_error; WockyXmppErrorType type; GError *core = NULL; GError *specialized = NULL; WockyNode *specialized_node; g_assert_no_error (error); g_assert (reply != NULL); is_error = wocky_stanza_extract_errors (reply, &type, &core, &specialized, &specialized_node); /* The reply should have type='error'. */ g_assert (is_error); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE); /* There should be no non-XMPP Core error condition. */ g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_clear_error (&core); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); } static void test_unhandled_iq (void) { test_data_t *test = setup_test (); WockyStanza *iq = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '(', "framed-photograph", ':', "http://kimjongillookingatthings.tumblr.com", ')', NULL); test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_porter_send_iq_async (test->sched_out, iq, NULL, unhandled_iq_reply_cb, test); test->outstanding++; test_wait_pending (test); g_object_unref (iq); test_close_both_porters (test); teardown_test (test); } static gboolean test_handler_filter_from_juliet_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; const gchar *from; from = wocky_stanza_get_from (stanza); g_assert (!wocky_strdiff (from, "juliet@example.com")); test_expected_stanza_received (test, stanza); return TRUE; } static gboolean test_handler_filter_from_anyone_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void test_handler_filter_from (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); /* Register a handler for IQs with from=juliet@example.com */ wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", 10, test_handler_filter_from_juliet_cb, test, NULL); /* Register another handler, at a lower priority, for IQs from anyone */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 5, test_handler_filter_from_anyone_cb, test, NULL); wocky_porter_start (test->sched_out); /* Send an IQ that will be filtered by from_juliet only */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", NULL); send_stanza (test, iq, TRUE); /* Send an IQ that will be filtered by from_null only */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "romeo@example.com", "juliet@example.net", NULL); send_stanza (test, iq, TRUE); /* Send an IQ that will be filtered by from_null only */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, "romeo@example.net", NULL); send_stanza (test, iq, TRUE); test_close_porter (test); teardown_test (test); } /* test if the right error is raised when trying to send an invalid IQ */ static void test_send_invalid_iq_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); g_assert (reply == NULL); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_IQ); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_send_invalid_iq (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); wocky_porter_start (test->sched_out); /* Try to send a message as an IQ */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_invalid_iq_cb, test); g_object_unref (iq); test->outstanding++; /* Try to send an IQ reply */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_invalid_iq_cb, test); g_object_unref (iq); test->outstanding++; test_wait_pending (test); test_close_porter (test); teardown_test (test); } /* Test sending IQ's to the server (no 'to' attribute). The JID we believe we * have matters, here. */ static gboolean test_send_iq_server_received_cb (WockyPorter *porter, WockyStanza *iq, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyNode *node; const gchar *id; const gchar *from; test_expected_stanza_received (test, iq); node = wocky_stanza_get_top_node (iq); id = wocky_node_get_attribute (node, "id"); if (wocky_node_get_child (node, "first") != NULL) /* No from attribute */ from = NULL; else if (wocky_node_get_child (node, "second") != NULL) /* bare JID */ from = "juliet@example.com"; else if (wocky_node_get_child (node, "third") != NULL) /* full JID */ from = "juliet@example.com/Balcony"; else g_assert_not_reached (); /* Send reply */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, from, "juliet@example.com/Balcony", '@', "id", id, NULL); wocky_porter_send_async (porter, reply, NULL, test_send_iq_sent_cb, test); g_queue_push_tail (test->expected_stanzas, reply); test->outstanding++; return TRUE; } static void test_send_iq_server (void) { /* In this test "in" is Juliet, and "out" is her server */ test_data_t *test = setup_test_with_jids ("juliet@example.com/Balcony", "example.com"); WockyStanza *iq; const gchar *node[] = { "first", "second", "third", NULL }; guint i; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register an IQ handler */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, test_send_iq_server_received_cb, test, NULL); /* From XMPP RFC: * "When a server generates a stanza from the server itself for delivery to * a connected client (e.g., in the context of data storage services * provided by the server on behalf of the client), the stanza MUST either * (1) not include a 'from' attribute or (2) include a 'from' attribute * whose value is the account's bare JID () or client's full * JID ()". * * Each reply will test one of these 3 options. */ for (i = 0; node[i] != NULL; i++) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", NULL, '(', node[i], ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_iq_reply_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); } /* The same, but sending to our own bare JID. For instance, when we query * disco#info on our own bare JID on Prosody 0.6.1, the reply has no 'from' * attribute. */ for (i = 0; node[i] != NULL; i++) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "JULIET@EXAMPLE.COM", '(', node[i], ')', NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_iq_reply_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); } test_close_both_porters (test); teardown_test (test); } /* Unref the porter in the async close callback */ static void test_unref_when_closed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_porter_close_finish ( WOCKY_PORTER (source), res, NULL)); /* Porter has been closed, unref it */ g_object_unref (test->session_in); test->session_in = NULL; test->outstanding--; g_main_loop_quit (test->loop); } static void test_unref_when_closed (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, test_close_stanza_received_cb, test); wocky_porter_close_async (test->sched_in, NULL, test_unref_when_closed_cb, test); test->outstanding += 3; test_wait_pending (test); teardown_test (test); } /* Both sides try to close the connection at the same time */ static void test_close_simultanously_recv_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *s; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (WOCKY_XMPP_CONNECTION (source), res, &error); g_assert (s == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_simultanously (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_start (test->sched_in); /* Sent close from one side */ wocky_xmpp_connection_send_close_async (test->out, NULL, close_sent_cb, test); /* .. and from the other */ wocky_porter_close_async (test->sched_in, NULL, test_unref_when_closed_cb, test); /* Wait that the 'in' side received the close */ test->outstanding += 2; test_wait_pending (test); /* Now read the close on the 'out' side */ wocky_xmpp_connection_recv_stanza_async (test->out, NULL, test_close_simultanously_recv_stanza_cb, test); test->outstanding++; test_wait_pending (test); teardown_test (test); } /* We sent our close stanza but a reading error occurs (as a disconnection for * example) before the other side sends his close */ static void test_close_error_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_error (void) { test_data_t *test = setup_test (); wocky_test_stream_set_write_mode (test->stream->stream0_output, WOCKY_TEST_STREAM_WRITE_COMPLETE); test_open_both_connections (test); wocky_porter_start (test->sched_in); /* Sent close */ wocky_porter_close_async (test->sched_in, NULL, test_close_error_cb, test); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, test_close_simultanously_recv_stanza_cb, test); /* Wait that the 'out' side received the close */ test->outstanding += 1; test_wait_pending (test); /* Something goes wrong */ wocky_test_input_stream_set_read_error (test->stream->stream0_input); /* The close operation is completed with an error */ test->outstanding += 1; test_wait_pending (test); teardown_test (test); } /* Try to send an IQ using a closing porter and cancel it immediately */ static void test_cancel_iq_closing (void) { test_data_t *test = setup_test (); WockyStanza *iq; test_open_both_connections (test); wocky_porter_start (test->sched_in); /* Start to close the porter */ wocky_porter_close_async (test->sched_in, NULL, test_close_sched_close_cb, test); /* Try to send a stanza using the closing porter */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.net", NULL); wocky_porter_send_iq_async (test->sched_in, iq, test->cancellable, test_send_closing_cb, test); /* Cancel the sending */ g_cancellable_cancel (test->cancellable); test->outstanding += 1; test_wait_pending (test); /* Make the call to wocky_porter_close_async() finish... */ wocky_xmpp_connection_send_close_async (test->out, NULL, close_sent_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (iq); teardown_test (test); } /* test stream errors */ static void test_stream_error_force_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; wocky_porter_force_close_finish ( WOCKY_PORTER (source), res, &error); g_assert_no_error (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_stream_error_cb (WockyPorter *porter, GQuark domain, guint code, const gchar *message, test_data_t *test) { GError *err = g_error_new_literal (domain, code, message); g_assert_error (err, WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_CONFLICT); g_error_free (err); /* force closing of the porter */ wocky_porter_force_close_async (porter, NULL, test_stream_error_force_close_cb, test); } static void test_stream_error (void) { test_data_t *test = setup_test (); WockyStanza *error; test_open_both_connections (test); wocky_porter_start (test->sched_out); g_signal_connect (test->sched_out, "remote-error", G_CALLBACK (test_stream_error_cb), test); test->outstanding++; /* Try to send a stanza using the closing porter */ error = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "conflict", ':', WOCKY_XMPP_NS_STREAMS, ')', NULL); wocky_porter_send_async (test->sched_in, error, NULL, send_stanza_cb, test); test->outstanding++; test_wait_pending (test); g_object_unref (error); teardown_test (test); } /* test wocky_porter_close_force */ static void test_close_force_stanza_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_send_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED); data->outstanding--; g_error_free (error); g_main_loop_quit (data->loop); } static void test_close_force_closed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_porter_close_finish ( WOCKY_PORTER (source), res, &error)); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED); test->outstanding--; g_error_free (error); g_main_loop_quit (test->loop); } static void test_close_force_force_closed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; wocky_porter_force_close_finish ( WOCKY_PORTER (source), res, &error); g_assert_no_error (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_force_closing_cb (WockyPorter *porter, test_data_t *test) { static gboolean fired = FALSE; g_assert (!fired); fired = TRUE; test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_force (void) { test_data_t *test = setup_test (); WockyStanza *s; wocky_test_stream_set_write_mode (test->stream->stream0_output, WOCKY_TEST_STREAM_WRITE_COMPLETE); test_open_both_connections (test); wocky_porter_start (test->sched_in); /* Try to send a stanza; it will never reach the other side */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", NULL); g_signal_connect (test->sched_in, "closing", G_CALLBACK (test_close_force_closing_cb), test); wocky_porter_send_async (test->sched_in, s, NULL, test_close_force_stanza_sent_cb, test); /* Try to properly close the connection; we'll give up before it has been * done */ wocky_porter_close_async (test->sched_in, NULL, test_close_force_closed_cb, test); /* force closing */ wocky_porter_force_close_async (test->sched_in, NULL, test_close_force_force_closed_cb, test); test->outstanding += 4; test_wait_pending (test); g_object_unref (s); teardown_test (test); } /* call force_close after an error appeared on the connection */ static void test_close_force_after_error_error_cb (WockyPorter *porter, GQuark domain, guint code, const gchar *message, test_data_t *test) { GError *err = g_error_new_literal (domain, code, message); g_assert_error (err, WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_CONFLICT); g_error_free (err); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_force_after_error (void) { test_data_t *test = setup_test (); WockyStanza *error; test_open_both_connections (test); wocky_porter_start (test->sched_out); g_signal_connect (test->sched_out, "remote-error", G_CALLBACK (test_close_force_after_error_error_cb), test); test->outstanding++; error = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "conflict", ':', WOCKY_XMPP_NS_STREAMS, ')', NULL); wocky_porter_send_async (test->sched_in, error, NULL, send_stanza_cb, test); test->outstanding++; test_wait_pending (test); /* Stream error has been handled, now force closing */ wocky_porter_force_close_async (test->sched_out, NULL, test_close_force_force_closed_cb, test); test->outstanding++; test_wait_pending (test); g_object_unref (error); teardown_test (test); } /* Test calling force_close after close has been called and the close stream * stanza has been sent */ static void test_close_force_after_close_sent_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); g_assert (s == NULL); /* connection has been disconnected */ g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_close_force_after_close_sent (void) { test_data_t *test = setup_test (); test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, test_close_force_after_close_sent_stanza_cb, test); /* Try to properly close the connection; we'll give up before it has been * done */ wocky_porter_close_async (test->sched_in, NULL, test_close_force_closed_cb, test); /* Wait for the close stanza */ test->outstanding++; test_wait_pending (test); /* force closing */ wocky_porter_force_close_async (test->sched_in, NULL, test_close_force_force_closed_cb, test); test->outstanding += 2; test_wait_pending (test); teardown_test (test); } /* The remote connection is closed while we are waiting for an IQ reply */ static void open_connections_and_send_one_iq (test_data_t *test, GAsyncReadyCallback send_iq_callback) { WockyStanza *iq; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register an IQ handler */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_receive_stanza_received_cb, test, NULL); /* Send an IQ query */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "1", NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, send_iq_callback, test); g_queue_push_tail (test->expected_stanzas, iq); /* wait that the IQ has been received */ test->outstanding += 1; test_wait_pending (test); } static void test_wait_iq_reply_close_reply_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); g_assert (reply == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_wait_iq_reply_close (void) { test_data_t *test = setup_test (); open_connections_and_send_one_iq (test, test_wait_iq_reply_close_reply_cb); /* the other side closes the connection (and so won't send the IQ reply) */ wocky_porter_close_async (test->sched_out, NULL, test_close_sched_close_cb, test); /* the send IQ operation is finished (with an error) */ test->outstanding += 1; test_wait_pending (test); wocky_porter_close_async (test->sched_in, NULL, test_close_sched_close_cb, test); /* the 2 close operations are completed */ test->outstanding += 2; test_wait_pending (test); teardown_test (test); } /* Send an IQ and then force the closing of the connection before we received * the reply */ static void test_wait_iq_reply_force_close_reply_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; GError *error = NULL; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); g_assert (reply == NULL); g_assert_error (error, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_wait_iq_reply_force_close (void) { test_data_t *test = setup_test (); open_connections_and_send_one_iq (test, test_wait_iq_reply_force_close_reply_cb); /* force closing of our connection */ wocky_porter_force_close_async (test->sched_in, NULL, test_close_force_force_closed_cb, test); /* the send IQ operation is finished (with an error) and the force close * operation is completed */ test->outstanding += 2; test_wait_pending (test); wocky_porter_force_close_async (test->sched_out, NULL, test_close_force_force_closed_cb, test); test->outstanding += 1; test_wait_pending (test); teardown_test (test); } /* this tries to catch the case where we receive a remote-error, which * * results in a wocky_porter_force_close_async in the connected signal * * handler but the internal stanza_received_cb _also_ attempts to force * * a shutdown: when correctly functioning, only one of these will result * * in a force close operation and the other will noop. * * Typical failure cases are the shutdown not happening at all or being * * attempted twice and failing because the porter can only support one * * force close attempt (both indicate broken logic in the porter) */ static void test_remote_error (void) { test_data_t *test = setup_test (); WockyStanza *error = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "conflict", ':', WOCKY_XMPP_NS_STREAMS, ')', NULL); test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* this callback will force_close_async the OUT porter, * * and decrement test->outstanding when it has done so */ g_signal_connect (test->sched_out, "remote-error", G_CALLBACK (test_stream_error_cb), test); /* this pumps a stream error through the IN (server) porter * * which triggers the remote-error signal from the OUT porter */ wocky_porter_send_async (test->sched_in, error, NULL, send_stanza_cb, test); test->outstanding++; test_wait_pending (test); test->outstanding++; /* this is for the signal connect above */ /* this closes the IN (server) porter so that the test doesn't fail (we * * don't really care about the IN porter for the purposes of this test) */ wocky_porter_force_close_async (test->sched_in, NULL, test_close_force_force_closed_cb, test); test->outstanding++; /* now wait for the IN porter to shutdown and the remote-error callback * * to shut down the OUT porter */ test_wait_pending (test); g_object_unref (error); teardown_test (test); } /* Herein lies a regression test for a bug where, if a stanza had been passed * by the porter to the XmppConnection but not actually sent when the porter * was unreffed, the subsequent callback from the XmppConnection would crash * us. */ static gboolean idle_main_loop_quit (gpointer user_data) { g_main_loop_quit (user_data); return FALSE; } static void send_and_disconnect (void) { test_data_t *test = setup_test (); WockyStanza *lions = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '(', "dummy", ':', "xmpp:stanza", '(', "nothing-to-see-here", ')', ')', NULL); GMainLoop *loop = g_main_loop_ref (test->loop); /* We try to send any old stanza. */ wocky_porter_send_async (test->sched_in, lions, NULL, NULL, NULL); /* Without giving the mainloop a chance to spin to call any callbacks at all, * we tear everything down, including the porters. This will make sched_in * add an idle to dispatch the (non-existent) callback for the stanza sent * above, saying that sending it failed. */ teardown_test (test); /* Now we spin the main loop until all (higher-priority) idles have fired. * * The bug we're testing for occured because the porter didn't keep itself * alive for the duration of the wocky_xmpp_connection_send_stanza_async() * call. So, when it'd finished calling the callback above, it'd die, and * then the send_stanza() operations would finish, and the porter's callback * would try to use the newly-freed porter and choke. */ g_idle_add_full (G_PRIORITY_LOW, idle_main_loop_quit, loop, NULL); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (lions); } static gboolean got_stanza_for_example_com ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; g_assert_cmpstr (wocky_stanza_get_from (stanza), ==, "example.com"); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } /* This is a regression test for a bug where registering a handler for a JID * with no node part was equivalent to registering a handler with from=NULL; * that is, we'd erroneously pass stanzas from *any* server to the handler * function even if it explicitly specified a JID which was just a domain, as * opposed to a JID with an '@' sign in it. */ static void handler_for_domain (void) { test_data_t *test = setup_test (); WockyStanza *irrelevant, *relevant; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_porter_register_handler_from (test->sched_in, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "example.com", WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, got_stanza_for_example_com, test, NULL); /* Send a stanza from some other random jid (at example.com, for the sake of * argument). The porter should ignore this stanza. */ irrelevant = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "lol@example.com", NULL, '(', "this-is-bullshit", ')', NULL); wocky_porter_send (test->sched_out, irrelevant); g_object_unref (irrelevant); relevant = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "example.com", NULL, '(', "i-am-a-fan-of-cocaine", ')', NULL); wocky_porter_send (test->sched_out, relevant); g_object_unref (relevant); test->outstanding += 1; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } static gboolean got_stanza_from_anyone ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; WockyNode *top = wocky_stanza_get_top_node (stanza); WockyNode *query = wocky_node_get_first_child (top); g_assert_cmpstr (query->name, ==, "anyone"); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static gboolean got_stanza_from_ourself ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; WockyNode *top = wocky_stanza_get_top_node (stanza); WockyNode *query = wocky_node_get_first_child (top); g_assert_cmpstr (query->name, ==, "ourself"); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static gboolean got_stanza_from_server ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; WockyNode *top = wocky_stanza_get_top_node (stanza); WockyNode *query = wocky_node_get_first_child (top); g_assert_cmpstr (query->name, ==, "server"); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void send_query_from ( test_data_t *test, const gchar *from, const gchar *query) { WockyStanza *s = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, from, NULL, '(', query, ')', NULL); wocky_porter_send (test->sched_out, s); g_object_unref (s); test->outstanding += 1; test_wait_pending (test); } static void handler_from_anyone (void) { test_data_t *test = setup_test_with_jids ("juliet@capulet.lit/Balcony", "capulet.lit"); test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); wocky_c2s_porter_register_handler_from_server ( WOCKY_C2S_PORTER (test->sched_in), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL + 10, got_stanza_from_server, test, NULL); /* A catch-all IQ get handler. */ wocky_porter_register_handler_from_anyone (test->sched_in, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, got_stanza_from_anyone, test, NULL); /* And, for completeness, a handler for IQs sent by any incarnation * of ourself, at a lower priority to the handler for stanzas from the * server, but a higher priority to the catch-all handler. */ wocky_porter_register_handler_from (test->sched_in, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@capulet.lit", WOCKY_PORTER_HANDLER_PRIORITY_NORMAL + 5, got_stanza_from_ourself, test, NULL); /* All of the handlers assert on the name of the first child node, and then * return TRUE to prevent the stanza being handed to a lower-priority * handler. */ /* A stanza from a contact on a completely different server should be picked * up only by the general handler. */ send_query_from (test, "romeo@montague.lit/Garden", "anyone"); /* A stanza from a contact on our server should be picked up only by the * general handler (irrespective of whether they have a resource). */ send_query_from (test, "tybalt@capulet.lit", "anyone"); send_query_from (test, "tybalt@capulet.lit/FIXME", "anyone"); /* A stanza from our server's domain should be matched by * got_stanza_from_server(). See fd.o#39057. */ send_query_from (test, "capulet.lit", "server"); /* On the other hand, a stanza with no sender should be picked up by * got_stanza_from_server(). */ send_query_from (test, NULL, "server"); /* Similarly, stanzas from our bare JID should be handed to * got_stanza_from_server(). Because that function returns TRUE, the stanza * should not be handed to got_stanza_from_ourself(). */ send_query_from (test, "juliet@capulet.lit", "server"); send_query_from (test, "jULIet@cAPUlet.lIT", "server"); /* Similarly, stanzas from our own full JID go to got_stanza_from_server. */ send_query_from (test, "juliet@capulet.lit/Balcony", "server"); send_query_from (test, "JUlIet@CAPulet.LIt/Balcony", "server"); /* But stanzas from our other resources should go to * got_stanza_from_ourself(). */ send_query_from (test, "juliet@capulet.lit/FIXME", "ourself"); /* Heh, heh, resources are case-sensitive */ send_query_from (test, "juliet@capulet.lit/balcony", "ourself"); /* Meanwhile, back in communist russia: */ /* КАПУЛЭТ капулэт */ test_close_both_porters (test); teardown_test (test); } static void closed_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); test_data_t *test = user_data; gboolean ret; GError *error = NULL; ret = wocky_porter_close_finish (porter, result, &error); g_assert_no_error (error); g_assert (ret); test->outstanding--; g_main_loop_quit (test->loop); } static void sent_stanza_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); test_data_t *test = user_data; gboolean ret; GError *error = NULL; ret = wocky_porter_send_finish (porter, result, &error); g_assert_no_error (error); g_assert (ret); /* Close up both porters. There's no reason why either of these operations * should fail. */ wocky_porter_close_async (test->sched_out, NULL, closed_cb, test); wocky_porter_close_async (test->sched_in, NULL, closed_cb, test); } static void close_from_send_callback (void) { test_data_t *test = setup_test (); WockyStanza *stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "body", '$', "I am made of chalk.", ')', NULL); /* Fire up porters in both directions. */ test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_porter_start (test->sched_out); /* Send a stanza. Once it's been safely sent, we should be able to close up * the connection in both directions without any trouble. */ wocky_porter_send_async (test->sched_in, stanza, NULL, sent_stanza_cb, test); g_object_unref (stanza); /* The two outstanding events are both porters ultimately closing * successfully. */ test->outstanding += 2; test_wait_pending (test); teardown_test (test); } /* Callbacks used in send_from_send_callback() */ static gboolean message_received_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; test_expected_stanza_received (test, stanza); return TRUE; } static void sent_second_or_third_stanza_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = user_data; GError *error = NULL; wocky_porter_send_finish (WOCKY_PORTER (source), result, &error); g_assert_no_error (error); test->outstanding--; g_main_loop_quit (test->loop); } static void sent_first_stanza_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = user_data; WockyStanza *third_stanza; GError *error = NULL; wocky_porter_send_finish (WOCKY_PORTER (source), result, &error); g_assert_no_error (error); third_stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "body", '$', "I am made of dur butter.", ')', NULL); wocky_porter_send_async (test->sched_in, third_stanza, NULL, sent_second_or_third_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, third_stanza); /* One for the callback; one for the receiving end. */ test->outstanding += 2; test->outstanding--; g_main_loop_quit (test->loop); } static void send_from_send_callback (void) { test_data_t *test = setup_test (); WockyStanza *stanza; test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_porter_start (test->sched_out); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, message_received_cb, test, '(', "body", ')', NULL); /* Send a stanza; in the callback for this stanza, we'll send another stanza. */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "body", '$', "I am made of chalk.", ')', NULL); wocky_porter_send_async (test->sched_in, stanza, NULL, sent_first_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, stanza); /* One for the callback; one for the receiving end. */ test->outstanding += 2; /* But before we've had a chance to send that one, send a second. */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "body", '$', "I am made of jelly.", ')', NULL); wocky_porter_send_async (test->sched_in, stanza, NULL, sent_second_or_third_stanza_cb, test); g_queue_push_tail (test->expected_stanzas, stanza); /* One for the callback; one for the receiving end. */ test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } static gboolean test_reply_from_domain_handler_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; const gchar *id; test_expected_stanza_received (test, stanza); id = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "id"); /* Reply with from="domain" */ reply = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "example.com", "juliet@example.com", '@', "id", id, NULL); wocky_porter_send_async (porter, reply, NULL, test_send_iq_sent_cb, test); g_queue_push_tail (test->expected_stanzas, reply); test->outstanding++; return TRUE; } static void test_reply_from_domain (void) { test_data_t *test = setup_test (); WockyStanza *iq; g_test_bug ("39057"); /* Testing that when we send an iq to server, it can reply from the domain instead of full/bare jid. This happens with xmpp.messenger.live.com. ... ... */ test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_porter_start (test->sched_in); /* register an IQ handler */ wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE, 0, test_reply_from_domain_handler_cb, test, NULL); /* Send an IQ query */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '@', "id", "1", NULL); wocky_porter_send_iq_async (test->sched_in, iq, NULL, test_send_iq_reply_cb, test); g_queue_push_tail (test->expected_stanzas, iq); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } /* Callbacks used in wildcard_handlers() */ const gchar * const ROMEO = "romeo@montague.lit"; const gchar * const JULIET = "juliet@montague.lit"; static gboolean any_stanza_received_from_romeo_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; g_assert_cmpstr (wocky_stanza_get_from (stanza), ==, ROMEO); test->outstanding--; g_main_loop_quit (test->loop); return FALSE; } static gboolean any_stanza_received_from_server_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; g_assert_cmpstr (wocky_stanza_get_from (stanza), ==, NULL); test->outstanding--; g_main_loop_quit (test->loop); return FALSE; } static gboolean any_stanza_received_from_anyone_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = user_data; test->outstanding--; g_main_loop_quit (test->loop); return FALSE; } static void wildcard_handlers (void) { test_data_t *test = setup_test (); WockyStanza *stanza; test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_porter_start (test->sched_out); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_NONE, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, any_stanza_received_from_anyone_cb, test, NULL); wocky_porter_register_handler_from (test->sched_out, WOCKY_STANZA_TYPE_NONE, WOCKY_STANZA_SUB_TYPE_NONE, ROMEO, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, any_stanza_received_from_romeo_cb, test, NULL); wocky_c2s_porter_register_handler_from_server ( WOCKY_C2S_PORTER (test->sched_out), WOCKY_STANZA_TYPE_NONE, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, any_stanza_received_from_server_cb, test, NULL); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_HEADLINE, ROMEO, NULL, NULL); wocky_porter_send (test->sched_in, stanza); g_object_unref (stanza); test->outstanding += 2; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, JULIET, NULL, NULL); wocky_porter_send (test->sched_in, stanza); g_object_unref (stanza); test->outstanding += 1; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_FEATURES, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, NULL); wocky_porter_send (test->sched_in, stanza); g_object_unref (stanza); test->outstanding += 2; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-porter/initiation", test_instantiation); g_test_add_func ("/xmpp-porter/send", test_send); g_test_add_func ("/xmpp-porter/receive", test_receive); g_test_add_func ("/xmpp-porter/filter", test_filter); g_test_add_func ("/xmpp-porter/close-flush", test_close_flush); g_test_add_func ("/xmpp-porter/close-not-started", test_close_not_started); g_test_add_func ("/xmpp-porter/close-twice", test_close_twice); g_test_add_func ("/xmpp-porter/remote-close", test_remote_close); g_test_add_func ("/xmpp-porter/close-cancel", test_close_cancel); g_test_add_func ("/xmpp-porter/reading-error", test_reading_error); g_test_add_func ("/xmpp-porter/send-closed", test_send_closed); g_test_add_func ("/xmpp-porter/handler-priority", test_handler_priority); g_test_add_func ("/xmpp-porter/unregister-handler", test_unregister_handler); g_test_add_func ("/xmpp-porter/handler-bare-jid", test_handler_bare_jid); g_test_add_func ("/xmpp-porter/handler-full-jid", test_handler_full_jid); g_test_add_func ("/xmpp-porter/handler-stanza", test_handler_stanza); g_test_add_func ("/xmpp-porter/cancel-sent-stanza", test_cancel_sent_stanza); g_test_add_func ("/xmpp-porter/writing-error", test_writing_error); g_test_add_func ("/xmpp-porter/send-iq", test_send_iq); g_test_add_func ("/xmpp-porter/acknowledge-iq", test_acknowledge_iq); g_test_add_func ("/xmpp-porter/send-iq-error", test_send_iq_error); g_test_add_func ("/xmpp-porter/send-iq-gerror", test_send_iq_gerror); g_test_add_func ("/xmpp-porter/send-iq-denormalised", test_send_iq_abnormal); g_test_add_func ("/xmpp-porter/error-while-sending-iq", test_error_while_sending_iq); g_test_add_func ("/xmpp-porter/handler-filter", test_handler_filter); g_test_add_func ("/xmpp-porter/unhandled-iq", test_unhandled_iq); g_test_add_func ("/xmpp-porter/send-invalid-iq", test_send_invalid_iq); g_test_add_func ("/xmpp-porter/handler-filter-from", test_handler_filter_from); g_test_add_func ("/xmpp-porter/send-iq-server", test_send_iq_server); g_test_add_func ("/xmpp-porter/unref-when-closed", test_unref_when_closed); g_test_add_func ("/xmpp-porter/close-simultanously", test_close_simultanously); g_test_add_func ("/xmpp-porter/close-error", test_close_error); g_test_add_func ("/xmpp-porter/cancel-iq-closing", test_cancel_iq_closing); g_test_add_func ("/xmpp-porter/stream-error", test_stream_error); g_test_add_func ("/xmpp-porter/close-force", test_close_force); g_test_add_func ("/xmpp-porter/close-force-after-error", test_close_force_after_error); g_test_add_func ("/xmpp-porter/close-force-after-close-sent", test_close_force_after_close_sent); g_test_add_func ("/xmpp-porter/wait-iq-reply-close", test_wait_iq_reply_close); g_test_add_func ("/xmpp-porter/wait-iq-reply-force-close", test_wait_iq_reply_force_close); g_test_add_func ("/xmpp-porter/avoid-double-force-close", test_remote_error); g_test_add_func ("/xmpp-porter/send-and-disconnect", send_and_disconnect); g_test_add_func ("/xmpp-porter/handler-for-domain", handler_for_domain); g_test_add_func ("/xmpp-porter/handler-from-anyone", handler_from_anyone); g_test_add_func ("/xmpp-porter/close-from-send-callback", close_from_send_callback); g_test_add_func ("/xmpp-porter/send-from-send-callback", send_from_send_callback); g_test_add_func ("/xmpp-porter/reply-from-domain", test_reply_from_domain); g_test_add_func ("/xmpp-porter/wildcard-handlers", wildcard_handlers); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-stanza-test.c0000644000175000017500000006011612735676345025534 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_copy (void) { WockyStanza *iq, *copy, *expected; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* just to make sure */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); copy = wocky_stanza_copy (iq); g_assert (copy != NULL); test_assert_stanzas_equal (iq, copy); test_assert_stanzas_equal (expected, copy); g_object_unref (iq); g_object_unref (copy); g_object_unref (expected); } static void test_build_iq_result_simple_ack (void) { WockyStanza *iq, *reply, *expected; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* Send a simple ACK */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '@', "id", "one", NULL); reply = wocky_stanza_build_iq_result (iq, NULL); g_assert (reply != NULL); test_assert_stanzas_equal (reply, expected); g_object_unref (reply); g_object_unref (expected); g_object_unref (iq); } static void test_build_iq_result_complex_reply (void) { WockyStanza *iq, *reply, *expected; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* Send a more complex reply */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, "romeo@example.net", "juliet@example.com", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", '(', "item", '@', "jid", "streamhostproxy.example.net", '@', "name", "Bytestreams Proxy", ')', ')', NULL); reply = wocky_stanza_build_iq_result (iq, '(', "query", ':', "http://jabber.org/protocol/disco#items", '(', "item", '@', "jid", "streamhostproxy.example.net", '@', "name", "Bytestreams Proxy", ')', ')', NULL); g_assert (reply != NULL); test_assert_stanzas_equal (reply, expected); g_object_unref (reply); g_object_unref (expected); g_object_unref (iq); } static void test_build_iq_result_no_to_attr (void) { WockyStanza *iq, *reply, *expected; /* Send a reply to an IQ with no "to" attribute. */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", NULL, '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* Send a simple ACK */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, "juliet@example.com", '@', "id", "one", NULL); reply = wocky_stanza_build_iq_result (iq, NULL); g_assert (reply != NULL); test_assert_stanzas_equal (reply, expected); g_object_unref (reply); g_object_unref (expected); g_object_unref (iq); } static void test_build_iq_error_simple_error (void) { WockyStanza *iq, *reply, *expected; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* Send a simple error */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); reply = wocky_stanza_build_iq_error (iq, NULL); g_assert (reply != NULL); test_assert_stanzas_equal (reply, expected); g_object_unref (reply); g_object_unref (expected); g_object_unref (iq); } static void test_build_iq_error_complex (void) { WockyStanza *iq, *reply, *expected; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "juliet@example.com", "romeo@example.net", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', NULL); /* Send a more complex reply */ expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "romeo@example.net", "juliet@example.com", '@', "id", "one", '(', "query", ':', "http://jabber.org/protocol/disco#items", ')', '(', "error", '@', "code", "403", '@', "type", "auth", ')', NULL); reply = wocky_stanza_build_iq_error (iq, '(', "error", '@', "code", "403", '@', "type", "auth", ')', NULL); g_assert (reply != NULL); test_assert_stanzas_equal (reply, expected); g_object_unref (reply); g_object_unref (expected); g_object_unref (iq); } static void check_error (WockyStanza *stanza, GQuark domain, gint code, const gchar *msg) { GError *error = NULL; g_assert (wocky_stanza_extract_stream_error (stanza, &error)); g_assert_error (error, domain, code); g_assert_cmpstr (error->message, ==, msg); g_error_free (error); } static void test_extract_stanza_error (void) { WockyStanza *stanza; GError *error = NULL; /* Valid stream error without message */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "conflict", ':', WOCKY_XMPP_NS_STREAMS, ')', NULL); check_error (stanza, WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_CONFLICT, ""); g_object_unref (stanza); /* Valid stream error with message */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "system-shutdown", ':', WOCKY_XMPP_NS_STREAMS, ')', '(', "text", ':', WOCKY_XMPP_NS_STREAMS, '$', "bye bye", ')', NULL); check_error (stanza, WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN, "bye bye"); g_object_unref (stanza); /* Unknown stream error */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, '(', "badger", ':', WOCKY_XMPP_NS_STREAMS, ')', NULL); check_error (stanza, WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_UNKNOWN, ""); g_object_unref (stanza); /* Not an error */ stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ':', WOCKY_XMPP_NS_STREAM, NULL); g_assert (!wocky_stanza_extract_stream_error (stanza, &error)); g_assert_no_error (error); g_object_unref (stanza); } static void test_extract_errors_not_error (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; gboolean ret; /* As a prelude, check that it does the right thing for non-errors. */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "from", "to", '(', "hello-thar", ')', NULL); ret = wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert (!ret); g_assert_no_error (core); g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (stanza); } static void test_extract_errors_without_description (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; gboolean ret; /* Test a boring error with no description */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "modify", '(', "bad-request", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); ret = wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert (ret); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_MODIFY); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST); g_assert_cmpstr (core->message, ==, ""); g_clear_error (&core); g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (stanza); } static void test_extract_errors_with_text (void) { WockyStanza *stanza; const gchar *description = "I am a sentence."; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* Now a different error with some text */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "cancel", '(', "item-not-found", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', description, ')', ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_ITEM_NOT_FOUND); g_assert_cmpstr (core->message, ==, description); g_clear_error (&core); g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (stanza); } static void test_extract_errors_application_specific_unknown (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* Another error, with an application-specific element we don't understand */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "cancel", '(', "subscription-required", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "buy-a-private-cloud", ':', "http://example.com/angry-cloud", ')', ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED); g_assert_cmpstr (core->message, ==, ""); g_clear_error (&core); g_assert_no_error (specialized); /* The namespace is not registered, @specialized is not set. However we * assume that any other namespace element is a specialized error, and it * should get returned in @specialized_node */ g_assert (specialized_node); g_assert_cmpstr (specialized_node->name, ==, "buy-a-private-cloud"); g_assert_cmpstr (wocky_node_get_ns (specialized_node), ==, "http://example.com/angry-cloud"); g_object_unref (stanza); } static void test_extract_errors_jingle_error (void) { WockyStanza *stanza; const gchar *description = "I am a sentence."; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* A Jingle error! With the child nodes in an erratic order */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "cancel", '(', "tie-break", ':', WOCKY_XMPP_NS_JINGLE_ERRORS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', description, ')', '(', "conflict", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_CONFLICT); g_assert_cmpstr (core->message, ==, description); g_clear_error (&core); g_assert_error (specialized, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_TIE_BREAK); g_assert_cmpstr (specialized->message, ==, description); g_clear_error (&specialized); g_assert (specialized_node != NULL); g_assert_cmpstr (specialized_node->name, ==, "tie-break"); /* With the same stanza, let's try ignoring all out params: */ wocky_stanza_extract_errors (stanza, NULL, NULL, NULL, NULL); g_object_unref (stanza); } static void test_extract_errors_extra_application_specific (void) { WockyStanza *stanza; const gchar *description = "I am a sentence."; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* Jingle error! + Bogus extra app specific error, which should be ignored */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "cancel", '(', "tie-break", ':', WOCKY_XMPP_NS_JINGLE_ERRORS, ')', '(', "out-of-order", ':', WOCKY_XMPP_NS_JINGLE_ERRORS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', description, ')', '(', "conflict", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_CONFLICT); g_assert_cmpstr (core->message, ==, description); g_clear_error (&core); g_assert_error (specialized, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_TIE_BREAK); g_assert_cmpstr (specialized->message, ==, description); g_clear_error (&specialized); g_assert (specialized_node != NULL); g_assert_cmpstr (specialized_node->name, ==, "tie-break"); g_object_unref (stanza); } static void test_extract_errors_legacy_code (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* How about a legacy error code? */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "code", "408", ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); /* XEP-0086 §3 says that 408 maps to remote-server-timeout, type=wait */ g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_WAIT); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT); /* No assertion about the message. As an implementation detail, it's probably * the definition of r-s-t from XMPP Core. */ g_clear_error (&core); g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (stanza); } static void test_extract_errors_unrecognised_condition (void) { WockyNodeTree *error_tree; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; const gchar *text = "The room is currently overactive, please try again later"; /* I got a error back from prosody with type='wait', but * Wocky didn't know about policy-violation (which was introduced in * RFC6120). Not only did it ignore , it also ignored * type='wait' and returned the default, WOCKY_XMPP_ERROR_TYPE_CANCEL. */ g_test_bug ("43166#c9"); error_tree = wocky_node_tree_new ("error", WOCKY_XMPP_NS_JABBER_CLIENT, '@', "type", "wait", '(', "typo-violation", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', text, ')', NULL); wocky_xmpp_error_extract (wocky_node_tree_get_top_node (error_tree), &type, &core, &specialized, &specialized_node); g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_WAIT); /* Wocky should default to undefined-condition when the server returns an * unknown core error element. */ g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION); g_assert_cmpstr (core->message, ==, text); g_clear_error (&core); /* The unrecognised error element was in the :xmpp-stanzas namespace, so it * shouldn't be returned as a specialized error. */ g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (error_tree); } static void test_extract_errors_no_sense (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* An error that makes no sense */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "aoeu", "snth", '(', "hoobily-lala-whee", ')', '(', "møøse", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); /* 'cancel' is the most sensible default if we have no idea. */ g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION); g_clear_error (&core); g_assert_no_error (specialized); g_assert (specialized_node != NULL); g_assert_cmpstr (specialized_node->name, ==, "hoobily-lala-whee"); g_object_unref (stanza); } static void test_extract_errors_not_really (void) { WockyStanza *stanza; WockyXmppErrorType type; GError *core = NULL, *specialized = NULL; WockyNode *specialized_node = NULL; /* And finally, a stanza with type='error' but no at all... */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", NULL); wocky_stanza_extract_errors (stanza, &type, &core, &specialized, &specialized_node); /* 'cancel' is the most sensible default if we have no idea. */ g_assert_cmpuint (type, ==, WOCKY_XMPP_ERROR_TYPE_CANCEL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_UNDEFINED_CONDITION); g_clear_error (&core); g_assert_no_error (specialized); g_assert (specialized_node == NULL); g_object_unref (stanza); } #define assert_cmperr(e1, e2) \ G_STMT_START { \ g_assert_error (e1, e2->domain, e2->code); \ g_assert_cmpstr (e1->message, ==, e2->message); \ } G_STMT_END static void test_stanza_error_to_node_core (void) { GError *e = NULL; GError *core = NULL, *specialized = NULL; const gchar *description = "bzzzt"; WockyStanza *stanza, *expected; /* An XMPP Core stanza error */ g_set_error_literal (&e, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT, description); stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", NULL); wocky_stanza_error_to_node (e, wocky_stanza_get_top_node (stanza)); expected = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "wait", '@', "code", "504", /* Per XEP-0086 */ '(', "remote-server-timeout", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', description, ')', ')', NULL); test_assert_stanzas_equal (stanza, expected); /* Let's see how it roundtrips: */ wocky_stanza_extract_errors (stanza, NULL, &core, &specialized, NULL); assert_cmperr (e, core); g_assert_no_error (specialized); g_object_unref (stanza); g_object_unref (expected); g_clear_error (&e); g_clear_error (&core); } static void test_stanza_error_to_node_jingle (void) { GError *e = NULL; GError *core = NULL, *specialized = NULL; const gchar *description = "bzzzt"; WockyStanza *stanza, *expected; /* How about a nice game of Jingle? */ g_set_error_literal (&e, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_UNKNOWN_SESSION, description); stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", NULL); wocky_stanza_error_to_node (e, wocky_stanza_get_top_node (stanza)); expected = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, "from", "to", '(', "error", '@', "type", "cancel", '@', "code", "404", /* Per XEP-0086 */ '(', "item-not-found", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "unknown-session", ':', WOCKY_XMPP_NS_JINGLE_ERRORS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', description, ')', ')', NULL); test_assert_stanzas_equal (stanza, expected); /* Let's see how it roundtrips: */ wocky_stanza_extract_errors (stanza, NULL, &core, &specialized, NULL); g_assert_error (core, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_ITEM_NOT_FOUND); assert_cmperr (e, specialized); g_object_unref (stanza); g_object_unref (expected); g_clear_error (&e); g_clear_error (&core); g_clear_error (&specialized); } static void test_unknown ( gconstpointer name_null_ns) { const gchar *name = name_null_ns; const gchar *ns = name + strlen (name) + 1; WockyStanza *stanza = wocky_stanza_new (name, ns); WockyStanzaType type; wocky_stanza_get_type_info (stanza, &type, NULL); g_assert_cmpuint (type, ==, WOCKY_STANZA_TYPE_UNKNOWN); g_object_unref (stanza); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-stanza/copy", test_copy); g_test_add_func ("/xmpp-stanza/iq-result/build-simple-ack", test_build_iq_result_simple_ack); g_test_add_func ("/xmpp-stanza/iq-result/build-complex-reply", test_build_iq_result_complex_reply); g_test_add_func ("/xmpp-stanza/iq-result/build-no-to-attr", test_build_iq_result_no_to_attr); g_test_add_func ("/xmpp-stanza/errors/build-simple", test_build_iq_error_simple_error); g_test_add_func ("/xmpp-stanza/errors/build-complex", test_build_iq_error_complex); g_test_add_func ("/xmpp-stanza/errors/extract-stanza", test_extract_stanza_error); g_test_add_func ("/xmpp-stanza/errors/not-error", test_extract_errors_not_error); g_test_add_func ("/xmpp-stanza/errors/without-description", test_extract_errors_without_description); g_test_add_func ("/xmpp-stanza/errors/with-text", test_extract_errors_with_text); g_test_add_func ("/xmpp-stanza/errors/application-specific-unknown", test_extract_errors_application_specific_unknown); g_test_add_func ("/xmpp-stanza/errors/jingle-error", test_extract_errors_jingle_error); g_test_add_func ("/xmpp-stanza/errors/extra-application-specific", test_extract_errors_extra_application_specific); g_test_add_func ("/xmpp-stanza/errors/legacy-code", test_extract_errors_legacy_code); g_test_add_func ("/xmpp-stanza/errors/unrecognised-condition", test_extract_errors_unrecognised_condition); g_test_add_func ("/xmpp-stanza/errors/no-sense", test_extract_errors_no_sense); g_test_add_func ("/xmpp-stanza/errors/not-really", test_extract_errors_not_really); g_test_add_func ("/xmpp-stanza/errors/stanza-to-node", test_stanza_error_to_node_core); g_test_add_func ("/xmpp-stanza/errors/stanza-to-node-jingle", test_stanza_error_to_node_jingle); g_test_add_data_func ("/xmpp-stanza/types/unknown-stanza-type", "this-will-never-be-real\0" WOCKY_XMPP_NS_JABBER_CLIENT, test_unknown); g_test_add_data_func ("/xmpp-stanza/types/wrong-namespaces", "challenge\0this:is:not:the:sasl:namespace", test_unknown); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-connector-server.c0000644000175000017500000014141213012550005027476 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-connector-server.c - Source for TestConnectorServer * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include "wocky-test-connector-server.h" #include #define INITIAL_STREAM_ID "0-HAI" /* We're being a bit naughty here by including wocky-debug.h, but we're * internal *enough*. */ #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_CONNECTOR #define WOCKY_COMPILATION #include #undef WOCKY_COMPILATION G_DEFINE_TYPE (TestConnectorServer, test_connector_server, G_TYPE_OBJECT); typedef void (*stanza_func)(TestConnectorServer *self, WockyStanza *xml); typedef struct _stanza_handler stanza_handler; struct _stanza_handler { const gchar *ns; const gchar *name; stanza_func func; }; typedef struct _iq_handler iq_handler; struct _iq_handler { WockyStanzaSubType subtype; const gchar *payload; const gchar *ns; stanza_func func; }; static void xmpp_init (GObject *source, GAsyncResult *result, gpointer data); static void starttls (GObject *source, GAsyncResult *result, gpointer data); static void finished (GObject *source, GAsyncResult *, gpointer data); static void quit (GObject *source, GAsyncResult *result, gpointer data); static void server_enc_outstanding (TestConnectorServer *self); static gboolean server_dec_outstanding (TestConnectorServer *self); /* ************************************************************************* */ /* test connector server object definition */ typedef enum { SERVER_STATE_START, SERVER_STATE_CLIENT_OPENED, SERVER_STATE_SERVER_OPENED, SERVER_STATE_FEATURES_SENT } server_state; static struct { CertSet set; const gchar *key; const gchar *crt; } certs[] = { { CERT_STANDARD, TLS_SERVER_KEY_FILE, TLS_SERVER_CRT_FILE }, { CERT_EXPIRED, TLS_EXP_KEY_FILE, TLS_EXP_CRT_FILE }, { CERT_NOT_YET, TLS_NEW_KEY_FILE, TLS_NEW_CRT_FILE }, { CERT_UNKNOWN, TLS_UNKNOWN_KEY_FILE, TLS_UNKNOWN_CRT_FILE }, { CERT_SELFSIGN, TLS_SS_KEY_FILE, TLS_SS_CRT_FILE }, { CERT_REVOKED, TLS_REV_KEY_FILE, TLS_REV_CRT_FILE }, { CERT_WILDCARD, TLS_WILD_KEY_FILE, TLS_WILD_CRT_FILE }, { CERT_BADWILD, TLS_BADWILD_KEY_FILE, TLS_BADWILD_CRT_FILE }, { CERT_NONE, NULL, NULL } }; struct _TestConnectorServerPrivate { gboolean dispose_has_run; WockyXmppConnection *conn; GIOStream *stream; server_state state; gboolean tls_started; gboolean authed; TestSaslAuthServer *sasl; gchar *mech; gchar *user; gchar *pass; gchar *version; gchar *used_mech; CertSet cert; WockyTLSSession *tls_sess; GCancellable *cancellable; gint outstanding; GSimpleAsyncResult *teardown_result; struct { ServerProblem sasl; ConnectorProblem *connector; } problem; gchar *other_host; guint other_port; }; static void test_connector_server_dispose (GObject *object) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (object); TestConnectorServerPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (priv->conn != NULL) g_object_unref (priv->conn); priv->conn = NULL; if (priv->stream != NULL) g_object_unref (priv->stream); priv->stream = NULL; if (priv->sasl != NULL) g_object_unref (priv->sasl); priv->sasl = NULL; if (priv->tls_sess != NULL) g_object_unref (priv->tls_sess); priv->tls_sess = NULL; if (G_OBJECT_CLASS (test_connector_server_parent_class)->dispose) G_OBJECT_CLASS (test_connector_server_parent_class)->dispose (object); } static void test_connector_server_finalise (GObject *object) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (object); TestConnectorServerPrivate *priv = self->priv; /* free any data held directly by the object here */ g_free (priv->mech); g_free (priv->user); g_free (priv->pass); g_free (priv->version); g_free (priv->used_mech); G_OBJECT_CLASS (test_connector_server_parent_class)->finalize (object); } static void test_connector_server_init (TestConnectorServer *self) { TestConnectorServerPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TEST_TYPE_CONNECTOR_SERVER, TestConnectorServerPrivate); priv = self->priv; priv->tls_started = FALSE; priv->authed = FALSE; priv->cancellable = g_cancellable_new (); } static void test_connector_server_class_init (TestConnectorServerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (TestConnectorServerPrivate)); object_class->dispose = test_connector_server_dispose; object_class->finalize = test_connector_server_finalise; } /* ************************************************************************* */ /* xmpp stanza handling: */ static void xmpp_handler (GObject *source, GAsyncResult *result, gpointer user_data); static void handle_auth (TestConnectorServer *self, WockyStanza *xml); static void handle_starttls (TestConnectorServer *self, WockyStanza *xml); static void after_auth (GObject *source, GAsyncResult *res, gpointer data); static void xmpp_close (GObject *source, GAsyncResult *result, gpointer data); static void xmpp_closed (GObject *source, GAsyncResult *result, gpointer data); static void iq_get_query_JABBER_AUTH (TestConnectorServer *self, WockyStanza *xml); static void iq_set_query_JABBER_AUTH (TestConnectorServer *self, WockyStanza *xml); static void iq_set_bind_XMPP_BIND (TestConnectorServer *self, WockyStanza *xml); static void iq_set_session_XMPP_SESSION (TestConnectorServer *self, WockyStanza *xml); static void iq_get_query_XEP77_REGISTER (TestConnectorServer *self, WockyStanza *xml); static void iq_set_query_XEP77_REGISTER (TestConnectorServer *self, WockyStanza *xml); static void iq_sent (GObject *source, GAsyncResult *result, gpointer data); static void iq_sent_unregistered (GObject *source, GAsyncResult *result, gpointer data); #define HANDLER(ns,x) { WOCKY_XMPP_NS_##ns, #x, handle_##x } static stanza_handler handlers[] = { HANDLER (SASL_AUTH, auth), HANDLER (TLS, starttls), { NULL, NULL, NULL } }; #define IQH(S,s,name,nsp,ns) \ { WOCKY_STANZA_SUB_TYPE_##S, #name, WOCKY_##nsp##_NS_##ns, \ iq_##s##_##name##_##nsp##_##ns } static iq_handler iq_handlers[] = { IQH (SET, set, bind, XMPP, BIND), IQH (SET, set, session, XMPP, SESSION), IQH (GET, get, query, JABBER, AUTH), IQH (SET, set, query, JABBER, AUTH), IQH (GET, get, query, XEP77, REGISTER), IQH (SET, set, query, XEP77, REGISTER), { WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, NULL } }; /* ************************************************************************* */ /* error stanza */ static WockyStanza * error_stanza (const gchar *cond, const gchar *msg, gboolean extended) { WockyStanza *error = wocky_stanza_new ("error", WOCKY_XMPP_NS_STREAM); WockyNode *node = wocky_stanza_get_top_node (error); wocky_node_add_child_ns (node, cond, WOCKY_XMPP_NS_STREAMS); if ((msg != NULL) && (*msg != '\0')) wocky_node_add_child_with_content_ns (node, "text", msg, WOCKY_XMPP_NS_STREAMS); if (extended) wocky_node_add_child_with_content_ns (node, "something", "blah", "urn:ietf:a:namespace:I:made:up"); return error; } /* ************************************************************************* */ static void iq_set_query_XEP77_REGISTER (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; WockyNode *env = wocky_stanza_get_top_node (xml); WockyNode *query = wocky_node_get_child (env, "query"); const gchar *id = wocky_node_get_attribute (env, "id"); gpointer cb = iq_sent; DEBUG (""); if (priv->problem.connector->xep77 & XEP77_PROBLEM_ALREADY) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_XEP77_NS_REGISTER, '(', "registered", ')', '(', "username", '$', "foo", ')', '(', "password", '$', "bar", ')', ')', NULL); } else if (priv->problem.connector->xep77 & XEP77_PROBLEM_FAIL_CONFLICT) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", "cancel", '(', "conflict", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (priv->problem.connector->xep77 & XEP77_PROBLEM_FAIL_REJECTED) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", "modify", '(', "not-acceptable", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else { if (wocky_node_get_child (query, "remove") == NULL) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, NULL); } else { XEP77Problem problem = priv->problem.connector->xep77; XEP77Problem p = XEP77_PROBLEM_NONE; DEBUG ("handling CANCEL"); if ((p = problem & XEP77_PROBLEM_CANCEL_REJECTED) || (p = problem & XEP77_PROBLEM_CANCEL_DISABLED) || (p = problem & XEP77_PROBLEM_CANCEL_FAILED)) { const gchar *error = NULL; const gchar *etype = NULL; const gchar *ecode = NULL; switch (p) { case XEP77_PROBLEM_CANCEL_REJECTED: error = "bad-request"; etype = "modify"; ecode = "400"; break; case XEP77_PROBLEM_CANCEL_DISABLED: error = "not-allowed"; etype = "cancel"; ecode = "405"; break; default: error = "forbidden"; etype = "cancel"; ecode = "401"; } DEBUG ("error: %s/%s", error, etype); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", etype, '@', "code", ecode, '(', error, ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else { if (priv->problem.connector->xep77 & XEP77_PROBLEM_CANCEL_STREAM) { iq = error_stanza ("not-authorized", NULL, FALSE); cb = finished; } else { cb = iq_sent_unregistered; iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, NULL); } } } } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancellable, cb, self); g_object_unref (xml); g_object_unref (iq); } static void iq_get_query_XEP77_REGISTER (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; WockyNode *env = wocky_stanza_get_top_node (xml); WockyNode *query = NULL; const gchar *id = wocky_node_get_attribute (env, "id"); DEBUG (""); if (priv->problem.connector->xep77 & XEP77_PROBLEM_NOT_AVAILABLE) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", "cancel", '(', "service-unavailable", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (priv->problem.connector->xep77 & XEP77_PROBLEM_QUERY_NONSENSE) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '@', "id", id, '(', "plankton", ':', WOCKY_XEP77_NS_REGISTER, ')', NULL); } else if (priv->problem.connector->xep77 & XEP77_PROBLEM_QUERY_ALREADY) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_XEP77_NS_REGISTER, '(', "registered", ')', '(', "username", '$', "foo", ')', '(', "password", '$', "bar", ')', ')', NULL); } else { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_XEP77_NS_REGISTER, '*', &query, ')', NULL); if (!(priv->problem.connector->xep77 & XEP77_PROBLEM_NO_ARGS)) { wocky_node_add_child (query, "username"); wocky_node_add_child (query, "password"); if (priv->problem.connector->xep77 & XEP77_PROBLEM_EMAIL_ARG) wocky_node_add_child (query, "email"); if (priv->problem.connector->xep77 & XEP77_PROBLEM_STRANGE_ARG) wocky_node_add_child (query, "wildebeest"); } } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, NULL, iq_sent, self); g_object_unref (xml); g_object_unref (iq); } static void iq_get_query_JABBER_AUTH (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; WockyNode *env = wocky_stanza_get_top_node (xml); const gchar *id = wocky_node_get_attribute (env, "id"); WockyNode *query = wocky_node_get_child (env, "query"); WockyNode *user = (query != NULL) ? wocky_node_get_child (query, "username") : NULL; const gchar *name = (user != NULL) ? user->content : NULL; DEBUG (""); if (priv->problem.connector->jabber & JABBER_PROBLEM_AUTH_NIH) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", "cancel", '(', "service-unavailable", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (name == NULL || *name == '\0') { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", "modify", '(', "not-acceptable", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "text", ':', WOCKY_XMPP_NS_STANZAS, '$', "You must include the username in the initial IQ get to work " "around a bug in jabberd 1.4. See " "https://bugs.freedesktop.org/show_bug.cgi?id=24013", ')', ')', NULL); } else if (priv->mech != NULL) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_JABBER_NS_AUTH, '(', "username", ')', '(', priv->mech, ')', '(', "resource", ')', ')', NULL); } else { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_JABBER_NS_AUTH, '(', "username", ')', '(', "password", ')', '(', "resource", ')', '(', "digest", ')', ')', NULL); } DEBUG ("responding to iq get"); server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancellable, iq_sent, self); DEBUG ("sent iq get response"); g_object_unref (xml); g_object_unref (iq); } static void iq_set_query_JABBER_AUTH (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; WockyNode *env = wocky_stanza_get_top_node (xml); WockyNode *qry = wocky_node_get_child (env, "query"); JabberProblem problems = priv->problem.connector->jabber; JabberProblem jp = JABBER_PROBLEM_NONE; WockyNode *username = wocky_node_get_child (qry, "username"); WockyNode *password = wocky_node_get_child (qry, "password"); WockyNode *resource = wocky_node_get_child (qry, "resource"); WockyNode *sha1hash = wocky_node_get_child (qry, "digest"); const gchar *id = wocky_node_get_attribute (env, "id"); DEBUG (""); if (username == NULL || resource == NULL) problems |= JABBER_PROBLEM_AUTH_PARTIAL; else if (password != NULL) { if (wocky_strdiff (priv->user, username->content) || wocky_strdiff (priv->pass, password->content)) problems |= JABBER_PROBLEM_AUTH_REJECT; } else if (sha1hash != NULL) { gchar *hsrc = g_strconcat (INITIAL_STREAM_ID, priv->pass, NULL); gchar *sha1 = g_compute_checksum_for_string (G_CHECKSUM_SHA1, hsrc, -1); DEBUG ("checksum: %s vs %s", sha1, sha1hash->content); if (wocky_strdiff (priv->user, username->content) || wocky_strdiff (sha1, sha1hash->content)) problems |= JABBER_PROBLEM_AUTH_REJECT; g_free (hsrc); g_free (sha1); } else problems |= JABBER_PROBLEM_AUTH_PARTIAL; if ((jp = problems & JABBER_PROBLEM_AUTH_REJECT) || (jp = problems & JABBER_PROBLEM_AUTH_BIND) || (jp = problems & JABBER_PROBLEM_AUTH_PARTIAL) || (jp = problems & JABBER_PROBLEM_AUTH_FAILED)) { const gchar *error = NULL; const gchar *etype = NULL; const gchar *ecode = NULL; switch (jp) { case JABBER_PROBLEM_AUTH_REJECT: error = "not-authorized"; etype = "auth"; ecode = "401"; break; case JABBER_PROBLEM_AUTH_BIND: error = "conflict"; etype = "cancel"; ecode = "409"; break; case JABBER_PROBLEM_AUTH_PARTIAL: error = "not-acceptable"; etype = "modify"; ecode = "406"; break; default: error = "bad-request"; etype = "modify"; ecode = "500"; break; } DEBUG ("error: %s/%s", error, etype); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '@', "id", id, '(', "error", '@', "type", etype, '@', "code", ecode, '(', error, ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (problems & JABBER_PROBLEM_AUTH_STRANGE) { DEBUG ("auth WEIRD"); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '@', "id", id, '(', "surstromming", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else if (problems & JABBER_PROBLEM_AUTH_NONSENSE) { DEBUG ("auth NONSENSE"); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '@', "id", id, '(', "surstromming", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else { DEBUG ("auth OK"); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '@', "id", id, NULL); } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancellable, iq_sent, self); g_object_unref (iq); g_object_unref (xml); } static void iq_set_bind_XMPP_BIND (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; BindProblem problems = priv->problem.connector->bind; BindProblem bp = BIND_PROBLEM_NONE; DEBUG(""); if ((bp = problems & BIND_PROBLEM_INVALID) || (bp = problems & BIND_PROBLEM_DENIED) || (bp = problems & BIND_PROBLEM_CONFLICT) || (bp = problems & BIND_PROBLEM_REJECTED)) { const gchar *error = NULL; const gchar *etype = NULL; switch (bp) { case BIND_PROBLEM_INVALID: error = "bad-request"; etype = "modify"; break; case BIND_PROBLEM_DENIED: error = "not-allowed"; etype = "cancel"; break; case BIND_PROBLEM_CONFLICT: error = "conflict"; etype = "cancel"; break; default: error = "badger-badger-badger-mushroom"; etype = "moomins"; } iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '(', "bind", ':', WOCKY_XMPP_NS_BIND, ')', '(', "error", '@', "type", etype, '(', error, ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (problems & BIND_PROBLEM_FAILED) { /* deliberately nonsensical response */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '(', "bind", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else if (problems & BIND_PROBLEM_NONSENSE) { /* deliberately nonsensical response */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "bind", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else if (problems & BIND_PROBLEM_CLASH) { iq = error_stanza ("conflict", NULL, FALSE); } else { WockyNode *ciq = wocky_stanza_get_top_node (xml); WockyNode *bind = wocky_node_get_child_ns (ciq, "bind", WOCKY_XMPP_NS_BIND); WockyNode *res = wocky_node_get_child (bind, "resource"); const gchar *uniq = NULL; gchar *jid = NULL; if (res != NULL) uniq = res->content; if (uniq == NULL) uniq = "a-made-up-resource"; if (problems & BIND_PROBLEM_NO_JID) { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "bind", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else { jid = g_strdup_printf ("user@some.doma.in/%s", uniq); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "bind", ':', WOCKY_XMPP_NS_BIND, '(', "jid", '$', jid, ')', ')', NULL); g_free (jid); } } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancellable, iq_sent, self); g_object_unref (xml); g_object_unref (iq); } static void iq_set_session_XMPP_SESSION (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *iq = NULL; SessionProblem problems = priv->problem.connector->session; SessionProblem sp = SESSION_PROBLEM_NONE; DEBUG (""); if ((sp = problems & SESSION_PROBLEM_FAILED) || (sp = problems & SESSION_PROBLEM_DENIED) || (sp = problems & SESSION_PROBLEM_CONFLICT) || (sp = problems & SESSION_PROBLEM_REJECTED)) { const gchar *error = NULL; const gchar *etype = NULL; switch (sp) { case SESSION_PROBLEM_FAILED: error = "internal-server-error"; etype = "wait"; break; case SESSION_PROBLEM_DENIED: error = "forbidden"; etype = "auth"; break; case SESSION_PROBLEM_CONFLICT: error = "conflict"; etype = "cancel"; break; default: error = "snaaaaake"; etype = "mushroom"; break; } iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, NULL, NULL, '(', "session", ':', WOCKY_XMPP_NS_SESSION, ')', '(', "error", '@', "type", etype, '(', error, ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); } else if (problems & SESSION_PROBLEM_NO_SESSION) { iq = error_stanza ("resource-constraint", "Out of Cheese Error", FALSE); } else if (problems & SESSION_PROBLEM_NONSENSE) { /* deliberately nonsensical response */ iq = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "surstromming", ':', WOCKY_XMPP_NS_BIND, ')', NULL); } else { iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "session", ':', WOCKY_XMPP_NS_SESSION, ')', NULL); } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, iq, NULL, iq_sent, self); g_object_unref (xml); g_object_unref (iq); } static void iq_sent_unregistered (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; WockyStanza *es = NULL; DEBUG(""); if (!wocky_xmpp_connection_send_stanza_finish (conn, result, &error)) { DEBUG ("send iq response failed: %s", error->message); g_error_free (error); server_dec_outstanding (self); return; } if (server_dec_outstanding (self)) return; es = error_stanza ("not-authorized", NULL, FALSE); server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, es, priv->cancellable, finished, self); g_object_unref (es); } static void iq_sent (GObject *source, GAsyncResult *result, gpointer data) { GError *error = NULL; TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = priv->conn; DEBUG(""); if (!wocky_xmpp_connection_send_stanza_finish (conn, result, &error)) { DEBUG ("send iq response failed: %s", error->message); g_error_free (error); server_dec_outstanding (self); return; } if (server_dec_outstanding (self)) return; server_enc_outstanding (self); DEBUG ("waiting for next stanza from client"); wocky_xmpp_connection_recv_stanza_async (conn, priv->cancellable, xmpp_handler, data); } static void handle_auth (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; GObject *sasl = G_OBJECT (priv->sasl); DEBUG (""); /* after this the sasl auth server object is in charge: control should return to us after the auth stages, at the point when we need to send our final feature stanza: the stream does not return to us */ /* this will also unref *xml when it has finished with it */ server_enc_outstanding (self); test_sasl_auth_server_auth_async (sasl, priv->conn, xml, after_auth, priv->cancellable, self); } static void handle_starttls (TestConnectorServer *self, WockyStanza *xml) { TestConnectorServerPrivate *priv = self->priv; DEBUG (""); if (!priv->tls_started) { WockyXmppConnection *conn = priv->conn; ConnectorProblem *problem = priv->problem.connector; WockyStanza *reply = NULL; GAsyncReadyCallback cb = finished; if (problem->xmpp & XMPP_PROBLEM_TLS_LOAD) { reply = error_stanza ("resource-constraint", "Load Too High", FALSE); } else if (problem->xmpp & XMPP_PROBLEM_TLS_REFUSED) { reply = wocky_stanza_new ("failure", WOCKY_XMPP_NS_TLS); } else { reply = wocky_stanza_new ("proceed", WOCKY_XMPP_NS_TLS); cb = starttls; /* set up the tls server session */ /* gnutls_global_set_log_function ((gnutls_log_func)debug_gnutls); * gnutls_global_set_log_level (10); */ if (problem->death & SERVER_DEATH_TLS_NEG) priv->tls_sess = wocky_tls_session_server_new (priv->stream, 1024, NULL, NULL); else { int x; const gchar *key = TLS_SERVER_KEY_FILE; const gchar *crt = TLS_SERVER_CRT_FILE; for (x = 0; certs[x].set != CERT_NONE; x++) { if (certs[x].set == priv->cert) { key = certs[x].key; crt = certs[x].crt; break; } } DEBUG ("cert file: %s", crt); priv->tls_sess = wocky_tls_session_server_new (priv->stream, 1024, key, crt); } } server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, reply, NULL, cb, self); g_object_unref (reply); } g_object_unref (xml); } static void finished (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; DEBUG (""); if (server_dec_outstanding (self)) return; server_enc_outstanding (self); wocky_xmpp_connection_send_close_async (priv->conn, priv->cancellable, quit, data); } static void quit (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; DEBUG (""); wocky_xmpp_connection_send_close_finish (priv->conn, result, NULL); server_dec_outstanding (self); } static void handshake_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (user_data); TestConnectorServerPrivate *priv = self->priv; WockyTLSConnection *tls_conn; GError *error = NULL; DEBUG ("TLS/SSL handshake finished"); tls_conn = wocky_tls_session_handshake_finish ( WOCKY_TLS_SESSION (source), result, &error); if (server_dec_outstanding (self)) goto out; if (tls_conn == NULL) { DEBUG ("SSL or TLS Server Setup failed: %s", error->message); g_io_stream_close (priv->stream, NULL, NULL); goto out; } if (priv->conn != NULL) g_object_unref (priv->conn); priv->state = SERVER_STATE_START; priv->conn = wocky_xmpp_connection_new (G_IO_STREAM (tls_conn)); g_object_unref (tls_conn); priv->tls_started = TRUE; xmpp_init (NULL,NULL,self); out: if (error != NULL) g_error_free (error); } static void starttls (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); GError *error = NULL; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (conn, result, &error)) { DEBUG ("Sending starttls '' failed: %s", error->message); g_error_free (error); server_dec_outstanding (self); return; } if (server_dec_outstanding (self)) return; server_enc_outstanding (self); wocky_tls_session_handshake_async (priv->tls_sess, G_PRIORITY_DEFAULT, NULL, handshake_cb, self); } static void xmpp_handler (GObject *source, GAsyncResult *result, gpointer user_data) { TestConnectorServer *self; TestConnectorServerPrivate *priv; WockyStanza *xml = NULL; WockyXmppConnection *conn = NULL; const gchar *ns = NULL; const gchar *name = NULL; gboolean handled = FALSE; GError *error = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType subtype = WOCKY_STANZA_SUB_TYPE_NONE; int i; DEBUG (""); self = TEST_CONNECTOR_SERVER (user_data); priv = self->priv; conn = priv->conn; xml = wocky_xmpp_connection_recv_stanza_finish (conn, result, &error); /* A real XMPP server would need to do some error handling here, but if * we got this far, we can just exit: The client (ie the test) will * report any error that actually needs reporting - we don't need to */ if (error != NULL) { if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_free (error); server_dec_outstanding (self); return; } g_assert_not_reached (); } if (server_dec_outstanding (self)) return; ns = wocky_node_get_ns (wocky_stanza_get_top_node (xml)); name = wocky_stanza_get_top_node (xml)->name; wocky_stanza_get_type_info (xml, &type, &subtype); /* if we find a handler, the handler is responsible for listening for the next stanza and setting up the next callback in the chain: */ if (type == WOCKY_STANZA_TYPE_IQ) for (i = 0; iq_handlers[i].payload != NULL; i++) { iq_handler *iq = &iq_handlers[i]; WockyNode *payload = wocky_node_get_child_ns (wocky_stanza_get_top_node (xml), iq->payload, iq->ns); /* namespace, stanza subtype and payload tag name must match: */ if ((payload == NULL) || (subtype != iq->subtype)) continue; DEBUG ("test_connector_server:invoking iq handler %s", iq->payload); (iq->func) (self, xml); handled = TRUE; break; } else for (i = 0; handlers[i].ns != NULL; i++) { if (!strcmp (ns, handlers[i].ns) && !strcmp (name, handlers[i].name)) { DEBUG ("test_connector_server:invoking handler %s.%s", ns, name); (handlers[i].func) (self, xml); handled = TRUE; break; } } /* no handler found: just complain and sit waiting for the next stanza */ if (!handled) { DEBUG ("<%s xmlns=\"%s\"… not handled", name, ns); server_enc_outstanding (self); wocky_xmpp_connection_recv_stanza_async (conn, priv->cancellable, xmpp_handler, self); g_object_unref (xml); } } /* ************************************************************************* */ /* resume control after the sasl auth server is done: */ static void after_auth (GObject *source, GAsyncResult *res, gpointer data) { GError *error = NULL; WockyStanza *feat = NULL; WockyNode *node = NULL; TestSaslAuthServer *tsas = TEST_SASL_AUTH_SERVER (source); TestConnectorServer *tcs = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = tcs->priv; WockyXmppConnection *conn = priv->conn; DEBUG ("Auth finished: %d", priv->outstanding); if (!test_sasl_auth_server_auth_finish (tsas, res, &error)) { g_object_unref (priv->sasl); priv->sasl = NULL; if (server_dec_outstanding (tcs)) return; server_enc_outstanding (tcs); wocky_xmpp_connection_send_close_async (conn, priv->cancellable, xmpp_close, data); return; } priv->used_mech = g_strdup (test_sasl_auth_server_get_selected_mech (priv->sasl)); g_object_unref (priv->sasl); priv->sasl = NULL; if (server_dec_outstanding (tcs)) return; feat = wocky_stanza_build (WOCKY_STANZA_TYPE_STREAM_FEATURES, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, NULL); node = wocky_stanza_get_top_node (feat); if (!(priv->problem.connector->xmpp & XMPP_PROBLEM_NO_SESSION)) wocky_node_add_child_ns (node, "session", WOCKY_XMPP_NS_SESSION); if (!(priv->problem.connector->xmpp & XMPP_PROBLEM_CANNOT_BIND)) wocky_node_add_child_ns (node, "bind", WOCKY_XMPP_NS_BIND); priv->state = SERVER_STATE_FEATURES_SENT; server_enc_outstanding (tcs); wocky_xmpp_connection_send_stanza_async (conn, feat, priv->cancellable, xmpp_init, data); g_object_unref (feat); } /* ************************************************************************* */ /* initial XMPP stream setup, up to sending features stanza */ static WockyStanza * feature_stanza (TestConnectorServer *self) { TestConnectorServerPrivate *priv = self->priv; XmppProblem problem = priv->problem.connector->xmpp; const gchar *name = NULL; WockyStanza *feat = NULL; WockyNode *node = NULL; DEBUG (""); if (problem & XMPP_PROBLEM_OTHER_HOST) return error_stanza ("host-unknown", "some sort of DNS error", TRUE); name = (problem & XMPP_PROBLEM_FEATURES) ? "badger" : "features"; feat = wocky_stanza_new (name, WOCKY_XMPP_NS_STREAM); node = wocky_stanza_get_top_node (feat); DEBUG ("constructing <%s...>... stanza", name); if (priv->problem.sasl != SERVER_PROBLEM_NO_SASL) { if (priv->sasl == NULL) priv->sasl = test_sasl_auth_server_new (NULL, priv->mech, priv->user, priv->pass, NULL, priv->problem.sasl, FALSE); test_sasl_auth_server_set_mechs (G_OBJECT (priv->sasl), feat); } if (problem & XMPP_PROBLEM_OLD_AUTH_FEATURE) wocky_node_add_child_ns (node, "auth", WOCKY_JABBER_NS_AUTH_FEATURE); if (!(problem & XMPP_PROBLEM_NO_TLS) && !priv->tls_started) wocky_node_add_child_ns (node, "starttls", WOCKY_XMPP_NS_TLS); return feat; } static void xmpp_close (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; DEBUG ("Closing connection"); wocky_xmpp_connection_send_close_async (priv->conn, NULL, xmpp_closed, self); } static void xmpp_closed (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (data); TestConnectorServerPrivate *priv = self->priv; DEBUG ("Connection closed"); wocky_xmpp_connection_send_close_finish (priv->conn, result, NULL); } static void startssl (TestConnectorServer *self) { TestConnectorServerPrivate *priv = self->priv; ConnectorProblem *problem = priv->problem.connector; g_assert (!priv->tls_started); DEBUG ("creating SSL Session [server]"); if (problem->death & SERVER_DEATH_TLS_NEG) priv->tls_sess = wocky_tls_session_server_new (priv->stream, 1024, NULL, NULL); else { int x; const gchar *key = TLS_SERVER_KEY_FILE; const gchar *crt = TLS_SERVER_CRT_FILE; for (x = 0; certs[x].set != CERT_NONE; x++) { if (certs[x].set == priv->cert) { key = certs[x].key; crt = certs[x].crt; break; } } priv->tls_sess = wocky_tls_session_server_new (priv->stream, 1024, key, crt); } DEBUG ("starting server SSL handshake"); server_enc_outstanding (self); wocky_tls_session_handshake_async (priv->tls_sess, G_PRIORITY_DEFAULT, priv->cancellable, handshake_cb, self); } static void force_closed_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TestConnectorServer *self = TEST_CONNECTOR_SERVER (user_data); GError *error = NULL; gboolean success; DEBUG ("Connection force closed"); success = wocky_xmpp_connection_force_close_finish ( WOCKY_XMPP_CONNECTION (source), result, &error); g_assert_no_error (error); g_assert (success); server_dec_outstanding (self); } static void see_other_host_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TestConnectorServer *self = user_data; GError *error = NULL; gboolean success; success = wocky_xmpp_connection_send_stanza_finish (self->priv->conn, result, &error); g_assert_no_error (error); g_assert (success); if (server_dec_outstanding (self)) return; server_enc_outstanding (self); wocky_xmpp_connection_force_close_async (self->priv->conn, self->priv->cancellable, force_closed_cb, self); } static void xmpp_init (GObject *source, GAsyncResult *result, gpointer data) { TestConnectorServer *self; TestConnectorServerPrivate *priv; WockyStanza *xml; WockyXmppConnection *conn; self = TEST_CONNECTOR_SERVER (data); priv = self->priv; conn = priv->conn; DEBUG ("test_connector_server:xmpp_init %d", priv->state); DEBUG ("connection: %p", conn); switch (priv->state) { /* wait for state = SERVER_STATE_CLIENT_OPENED; server_enc_outstanding (self); if (priv->problem.connector->death & SERVER_DEATH_SERVER_START) { wocky_xmpp_connection_force_close_async (conn, priv->cancellable, force_closed_cb, self); } else { wocky_xmpp_connection_recv_open_async (conn, priv->cancellable, xmpp_init, self); } break; /* send our own state = SERVER_STATE_SERVER_OPENED; wocky_xmpp_connection_recv_open_finish (conn, result, NULL, NULL, NULL, NULL, NULL, NULL); if (server_dec_outstanding (self)) return; server_enc_outstanding (self); if (priv->problem.connector->death & SERVER_DEATH_CLIENT_OPEN) { wocky_xmpp_connection_force_close_async (conn, priv->cancellable, force_closed_cb, self); } else { wocky_xmpp_connection_send_open_async (conn, NULL, "testserver", priv->version, NULL, INITIAL_STREAM_ID, priv->cancellable, xmpp_init, self); } break; /* send our feature set */ case SERVER_STATE_SERVER_OPENED: DEBUG ("SERVER_STATE_SERVER_OPENED"); priv->state = SERVER_STATE_FEATURES_SENT; wocky_xmpp_connection_send_open_finish (conn, result, NULL); if (server_dec_outstanding (self)) return; if (priv->problem.connector->death & SERVER_DEATH_SERVER_OPEN) { server_enc_outstanding (self); wocky_xmpp_connection_force_close_async (conn, priv->cancellable, force_closed_cb, self); } else if (priv->problem.connector->xmpp & XMPP_PROBLEM_OLD_SERVER) { DEBUG ("diverting to old-jabber-auth"); server_enc_outstanding (self); wocky_xmpp_connection_recv_stanza_async (priv->conn, priv->cancellable, xmpp_handler, self); } else if (priv->problem.connector->xmpp & XMPP_PROBLEM_SEE_OTHER_HOST) { WockyStanza *stanza; WockyNode *node; gchar *host_and_port; host_and_port = g_strdup_printf ("%s:%u", self->priv->other_host, self->priv->other_port); DEBUG ("Redirect to another host: %s", host_and_port); stanza = wocky_stanza_new ("error", WOCKY_XMPP_NS_STREAM); node = wocky_stanza_get_top_node (stanza); wocky_node_add_child_with_content_ns (node, "see-other-host", host_and_port, WOCKY_XMPP_NS_STREAMS); server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (self->priv->conn, stanza, self->priv->cancellable, see_other_host_cb, self); g_object_unref (stanza); } else { xml = feature_stanza (self); server_enc_outstanding (self); wocky_xmpp_connection_send_stanza_async (conn, xml, priv->cancellable, xmpp_init, self); g_object_unref (xml); } break; /* ok, we're done with initial stream setup */ case SERVER_STATE_FEATURES_SENT: DEBUG ("SERVER_STATE_FEATURES_SENT"); wocky_xmpp_connection_send_stanza_finish (conn, result, NULL); if (server_dec_outstanding (self)) return; server_enc_outstanding (self); if (priv->problem.connector->death & SERVER_DEATH_FEATURES) { wocky_xmpp_connection_force_close_async (conn, priv->cancellable, force_closed_cb, self); } else { wocky_xmpp_connection_recv_stanza_async (conn, priv->cancellable, xmpp_handler, self); } break; default: DEBUG ("Unknown Server state. Broken code flow."); } } /* ************************************************************************* */ /* exposed methods */ TestConnectorServer * test_connector_server_new (GIOStream *stream, gchar *mech, const gchar *user, const gchar *pass, const gchar *version, ConnectorProblem *problem, ServerProblem sasl_problem, CertSet cert) { TestConnectorServer *self; TestConnectorServerPrivate *priv; DEBUG ("test_connector_server_new"); self = g_object_new (TEST_TYPE_CONNECTOR_SERVER, NULL); priv = self->priv; priv->stream = g_object_ref (stream); priv->mech = g_strdup (mech); priv->user = g_strdup (user); priv->pass = g_strdup (pass); priv->problem.sasl = sasl_problem; priv->problem.connector = problem; priv->conn = wocky_xmpp_connection_new (stream); priv->cert = cert; DEBUG ("connection: %p", priv->conn); if (problem->xmpp & XMPP_PROBLEM_OLD_SERVER) priv->version = g_strdup ((version == NULL) ? "0.9" : version); else priv->version = g_strdup ((version == NULL) ? "1.0" : version); return self; } static void server_enc_outstanding (TestConnectorServer *self) { TestConnectorServerPrivate *priv = self->priv; priv->outstanding++; DEBUG ("Upped outstanding to %d", priv->outstanding); } static gboolean server_dec_outstanding (TestConnectorServer *self) { TestConnectorServerPrivate *priv = self->priv; priv->outstanding--; g_assert (priv->outstanding >= 0); if (priv->teardown_result != NULL && priv->outstanding == 0) { GSimpleAsyncResult *r = priv->teardown_result; priv->teardown_result = NULL; DEBUG ("Tearing down, bye bye"); g_simple_async_result_complete (r); g_object_unref (r); DEBUG ("Unreffed!"); return TRUE; } DEBUG ("Outstanding: %d", priv->outstanding); return FALSE; } void test_connector_server_teardown (TestConnectorServer *self, GAsyncReadyCallback callback, gpointer user_data) { TestConnectorServerPrivate *priv = self->priv; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, test_connector_server_teardown); /* For now, we'll assert if this gets called twice */ g_assert (priv->cancellable != NULL); DEBUG ("Requested to stop: %d", priv->outstanding); g_cancellable_cancel (priv->cancellable); g_object_unref (priv->cancellable); priv->cancellable = NULL; if (priv->outstanding == 0) { g_simple_async_result_complete_in_idle (result); g_object_unref (result); } else { priv->teardown_result = result; } } gboolean test_connector_server_teardown_finish (TestConnectorServer *self, GAsyncResult *result, GError *error) { return TRUE; } void test_connector_server_start (TestConnectorServer *self) { TestConnectorServerPrivate *priv; DEBUG("test_connector_server_start"); priv = self->priv; priv->state = SERVER_STATE_START; DEBUG ("connection: %p", priv->conn); if (priv->problem.connector->xmpp & XMPP_PROBLEM_OLD_SSL) { startssl (self); } else { xmpp_init (NULL,NULL,self); } } const gchar * test_connector_server_get_used_mech (TestConnectorServer *self) { TestConnectorServerPrivate *priv = self->priv; return priv->used_mech; } void test_connector_server_set_other_host (TestConnectorServer *self, const gchar *host, guint port) { g_return_if_fail (TEST_IS_CONNECTOR_SERVER (self)); g_return_if_fail (self->priv->other_host == NULL); g_return_if_fail (self->priv->other_port == 0); self->priv->other_host = g_strdup (host); self->priv->other_port = port; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-xmpp-reader-test.c0000644000175000017500000003666013001732446026445 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" #define HEADER \ " " \ " " #define FOOTER " " #define BROKEN_HEADER \ " " \ " " #define HEADER_WITH_UNQUALIFIED_LANG \ " " \ " " #define BROKEN_MESSAGE \ " " \ " Art thou not Romeo, and a Montague? " \ " " #define MESSAGE_CHUNK0 \ " " \ " Art thou not Romeo, " #define MESSAGE_CHUNK1 \ " and a Montague? " \ " " #define VCARD_MESSAGE \ " " \ " " \ " Peter Saint-Andre " \ " " \ " Saint-Andre " \ " Peter " \ " " \ " " \ " stpeter " \ " http://www.xmpp.org/xsf/people/stpeter.shtml " \ " 1966-08-06 " \ " " \ " XMPP Standards Foundation " \ " " \ " " \ " Executive Director " \ " Patron Saint " \ " stpeter@jabber.org " \ " " \ " " #define VALID_NAMESPACE "http://garden.with.spaces" #define INVALID_NAMESPACE_MESSAGE \ " "\ " " \ " " \ " " \ " " #define WHITESPACE_PADDED_BODY " The Wench is Dead! " #define MESSAGE_WITH_WHITESPACE_PADDED_BODY \ " " \ " " WHITESPACE_PADDED_BODY "" \ " " #define WHITESPACE_ONLY_BODY " " #define MESSAGE_WITH_WHITESPACE_ONLY_BODY \ " " \ " " WHITESPACE_ONLY_BODY "" \ " " #define U_FDEF "\xe7\xb7\xaf" /* a non-character */ #define REPLACE "\xef\xbf\xbd" /* U+FFFD REPLACEMENT CHARACTER */ #define MONKEY "\xf0\x9f\x99\x88" /* U+1F648 SEE-NO-EVIL MONKEY */ #define NON_CHARACTER_CODEPOINTS U_FDEF MONKEY U_FDEF #define NON_CHARACTER_CODEPOINTS_REPLACEMENT REPLACE MONKEY REPLACE #define MESSAGE_WITH_NON_CHARACTER_CODEPOINTS \ " " \ " " NON_CHARACTER_CODEPOINTS "" \ " " static void test_stream_no_stanzas (void) { WockyXmppReader *reader; GError *error = NULL; reader = wocky_xmpp_reader_new (); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_INITIAL); wocky_xmpp_reader_push (reader, (guint8 *) HEADER FOOTER, strlen (HEADER FOOTER)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); g_assert (wocky_xmpp_reader_peek_stanza (reader) == NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); g_assert (wocky_xmpp_reader_pop_stanza (reader) == NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); error = wocky_xmpp_reader_get_error (reader); g_assert_no_error (error); g_object_unref (reader); } static void test_stream_open_error (void) { WockyXmppReader *reader; GError *error = NULL; reader = wocky_xmpp_reader_new (); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_INITIAL); wocky_xmpp_reader_push (reader, (guint8 *) BROKEN_HEADER, strlen (BROKEN_HEADER)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_ERROR); error = wocky_xmpp_reader_get_error (reader); g_assert_error (error, WOCKY_XMPP_READER_ERROR, WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START); g_error_free (error); g_object_unref (reader); } static void test_stream_open_unqualified_lang (void) { WockyXmppReader *reader = wocky_xmpp_reader_new (); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_INITIAL); wocky_xmpp_reader_push (reader, (guint8 *) HEADER_WITH_UNQUALIFIED_LANG, strlen (HEADER_WITH_UNQUALIFIED_LANG)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); g_object_unref (reader); } static void test_parse_error (void) { WockyXmppReader *reader; GError *error = NULL; reader = wocky_xmpp_reader_new (); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_INITIAL); wocky_xmpp_reader_push (reader, (guint8 *) HEADER, strlen (HEADER)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_reader_push (reader, (guint8 *) BROKEN_MESSAGE, strlen (BROKEN_MESSAGE)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_ERROR); g_assert (wocky_xmpp_reader_peek_stanza (reader) == NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_ERROR); g_assert (wocky_xmpp_reader_pop_stanza (reader) == NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_ERROR); error = wocky_xmpp_reader_get_error (reader); g_assert_error (error, WOCKY_XMPP_READER_ERROR, WOCKY_XMPP_READER_ERROR_PARSE_ERROR); g_error_free (error); g_object_unref (reader); } static void test_no_stream_parse_message (WockyXmppReader *reader) { WockyStanza *stanza; g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_reader_push (reader, (guint8 *) MESSAGE_CHUNK0, strlen (MESSAGE_CHUNK0)); g_assert (wocky_xmpp_reader_pop_stanza (reader) == NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_reader_push (reader, (guint8 *) MESSAGE_CHUNK1, strlen (MESSAGE_CHUNK1)); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); g_assert ((stanza = wocky_xmpp_reader_peek_stanza (reader)) != NULL); g_assert ((stanza = wocky_xmpp_reader_pop_stanza (reader)) != NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); g_object_unref (stanza); } static void test_no_stream_hunks (void) { WockyXmppReader *reader; reader = wocky_xmpp_reader_new_no_stream (); test_no_stream_parse_message (reader); g_object_unref (reader); } static void test_no_stream_reset (void) { WockyXmppReader *reader; reader = wocky_xmpp_reader_new_no_stream (); /* whole message, reset, whole message, reset */ test_no_stream_parse_message (reader); wocky_xmpp_reader_reset (reader); test_no_stream_parse_message (reader); wocky_xmpp_reader_reset (reader); /* push half a message and reset the parser*/ g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_OPENED); wocky_xmpp_reader_push (reader, (guint8 *) MESSAGE_CHUNK0, strlen (MESSAGE_CHUNK0)); wocky_xmpp_reader_reset (reader); /* And push a whole message through again */ test_no_stream_parse_message (reader); g_object_unref (reader); } /* libXML2 doesn't like the vcard-temp namespace test if we can still correctly parse it */ static void test_vcard_namespace (void) { WockyXmppReader *reader; WockyStanza *stanza; reader = wocky_xmpp_reader_new_no_stream (); wocky_xmpp_reader_push (reader, (guint8 *) VCARD_MESSAGE, strlen (VCARD_MESSAGE)); g_assert ((stanza = wocky_xmpp_reader_pop_stanza (reader)) != NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); g_object_unref (stanza); g_object_unref (reader); } static void test_invalid_namespace (void) { WockyXmppReader *reader; WockyStanza *stanza; reader = wocky_xmpp_reader_new_no_stream (); wocky_xmpp_reader_push (reader, (guint8 *) INVALID_NAMESPACE_MESSAGE, strlen (INVALID_NAMESPACE_MESSAGE)); g_assert ((stanza = wocky_xmpp_reader_pop_stanza (reader)) != NULL); g_assert (wocky_xmpp_reader_get_state (reader) == WOCKY_XMPP_READER_STATE_CLOSED); g_assert_cmpstr (VALID_NAMESPACE, ==, wocky_node_get_ns ( wocky_node_get_child (wocky_stanza_get_top_node (stanza), "branch"))); g_object_unref (stanza); g_object_unref (reader); } /* Helper function for the whitespace body tests */ static void test_body_with_alternative ( const gchar *xml, const gchar *expected_body_text, const gchar *alt_body_text) { WockyXmppReader *reader = wocky_xmpp_reader_new_no_stream (); WockyStanza *stanza; WockyNode *body; wocky_xmpp_reader_push (reader, (guint8 *) xml, strlen (xml)); stanza = wocky_xmpp_reader_pop_stanza (reader); g_assert (stanza != NULL); body = wocky_node_get_child (wocky_stanza_get_top_node (stanza), "body"); g_assert (body != NULL); g_assert (g_utf8_validate (body->content, -1, NULL)); if (alt_body_text == NULL) { g_assert_cmpstr (body->content, ==, expected_body_text); } else { if (wocky_strdiff (body->content, expected_body_text) && wocky_strdiff (body->content, alt_body_text)) { g_error ("Body text «%s» was neither «%s» nor «%s»", body->content, expected_body_text, alt_body_text); } } g_object_unref (stanza); g_object_unref (reader); } static void test_body (const gchar *xml, const gchar *exp) { test_body_with_alternative (xml, exp, NULL); } /* Test that whitespace around the text contents of a message isn't ignored */ static void test_whitespace_padding (void) { test_body (MESSAGE_WITH_WHITESPACE_PADDED_BODY, WHITESPACE_PADDED_BODY); } /* Test that a message body consisting entirely of whitespace isn't ignored */ static void test_whitespace_only (void) { test_body (MESSAGE_WITH_WHITESPACE_ONLY_BODY, WHITESPACE_ONLY_BODY); } /* Test that a message body containing non-character codepoints is * handled "appropriately". Older GLib replaces them with U+FFFD, * newer GLib keeps them as-is. */ static void test_non_character_codepoints (void) { test_body_with_alternative (MESSAGE_WITH_NON_CHARACTER_CODEPOINTS, NON_CHARACTER_CODEPOINTS, NON_CHARACTER_CODEPOINTS_REPLACEMENT); } static void check_namespaces ( WockyXmppReader *reader, const gchar *xml, const gchar *expected_namespace) { WockyStanza *stanza; WockyNode *top_node, *body_node; wocky_xmpp_reader_push (reader, (const guint8 *) xml, strlen (xml)); stanza = wocky_xmpp_reader_pop_stanza (reader); g_assert (stanza != NULL); top_node = wocky_stanza_get_top_node (stanza); g_assert (top_node != NULL); g_assert_cmpstr (expected_namespace, ==, wocky_node_get_ns (top_node)); body_node = wocky_node_get_first_child (top_node); g_assert (body_node != NULL); g_assert_cmpstr (expected_namespace, ==, wocky_node_get_ns (body_node)); g_object_unref (stanza); wocky_xmpp_reader_reset (reader); } static void test_no_stream_default_namespace ( WockyXmppReader *reader, const gchar *expected_default_namespace) { /* Regardless of the reader's default namespace, a root node with an * explicitly-specified namespace should get that namespace. */ check_namespaces (reader, "" "hai", WOCKY_XMPP_NS_JABBER_CLIENT); /* What namespace the nodes here end up in depends on the reader's default. */ check_namespaces (reader, "hai", expected_default_namespace); } static void test_no_stream_default_default_namespace (void) { WockyXmppReader *reader = wocky_xmpp_reader_new_no_stream (); /* WockyXmppReader defaults to the empty namespace. */ test_no_stream_default_namespace (reader, ""); g_object_unref (reader); } static void test_no_stream_specified_default_namespace (void) { #define WEIRD "wocky:weird:namespace" WockyXmppReader *reader = wocky_xmpp_reader_new_no_stream_ns (WEIRD); test_no_stream_default_namespace (reader, WEIRD); g_object_unref (reader); #undef WEIRD } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-reader/stream-no-stanzas", test_stream_no_stanzas); g_test_add_func ("/xmpp-reader/stream-open-error", test_stream_open_error); g_test_add_func ("/xmpp-reader/stream-open-unqualified-lang", test_stream_open_unqualified_lang); g_test_add_func ("/xmpp-reader/parse-error", test_parse_error); g_test_add_func ("/xmpp-reader/no-stream-hunks", test_no_stream_hunks); g_test_add_func ("/xmpp-reader/no-stream-resetting", test_no_stream_reset); g_test_add_func ("/xmpp-reader/vcard-namespace", test_vcard_namespace); g_test_add_func ("/xmpp-reader/invalid-namespace", test_invalid_namespace); g_test_add_func ("/xmpp-reader/whitespace-padding", test_whitespace_padding); g_test_add_func ("/xmpp-reader/whitespace-only", test_whitespace_only); g_test_add_func ("/xmpp-reader/utf-non-character-codepoints", test_non_character_codepoints); g_test_add_func ("/xmpp-reader/no-stream-default-default-namespace", test_no_stream_default_default_namespace); g_test_add_func ("/xmpp-reader/no-stream-specified-default-namespace", test_no_stream_specified_default_namespace); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-pubsub-test-helpers.h0000644000175000017500000000106412735676345027176 0ustar00gkiagiagkiagia00000000000000#ifndef WOCKY_PUBSUB_TEST_HELPERS_H #define WOCKY_PUBSUB_TEST_HELPERS_H #include #include typedef struct { const gchar *node; const gchar *jid; const gchar *subscription; WockyPubsubSubscriptionState state; const gchar *subid; } CannedSubscriptions; void test_pubsub_add_subscription_nodes ( WockyNode *subscriptions_node, CannedSubscriptions *subs, gboolean include_node); void test_pubsub_check_and_free_subscriptions ( GList *subscriptions, const CannedSubscriptions *expected_subs); #endif telepathy-gabble-0.18.4/lib/ext/wocky/tests/tp-glib.supp0000644000175000017500000001020112735676345024216 0ustar00gkiagiagkiagia00000000000000# Valgrind error suppression file # ============================= libc ================================== { ld.so initialization + selinux Memcheck:Leak ... fun:_dl_init obj:/lib/ld-*.so } { dlopen initialization, triggered by handle-leak-debug code Memcheck:Leak ... fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } # ============================= GLib ================================== { g_set_prgname copies its argument Memcheck:Leak ... fun:g_set_prgname } { one g_get_charset per child^Wprocess Memcheck:Leak ... fun:g_get_charset } { GQuarks can't be freed Memcheck:Leak ... fun:g_quark_from_static_string } { GQuarks can't be freed Memcheck:Leak ... fun:g_quark_from_string } { interned strings can't be freed Memcheck:Leak ... fun:g_intern_string } { interned strings can't be freed Memcheck:Leak ... fun:g_intern_static_string } { shared global default g_main_context Memcheck:Leak ... fun:g_main_context_new fun:g_main_context_default } { GTest initialization Memcheck:Leak ... fun:g_test_init fun:main } { GTest admin Memcheck:Leak ... fun:g_test_add_vtable } { GTest pseudorandomness Memcheck:Leak ... fun:g_rand_new_with_seed_array fun:test_run_seed ... fun:g_test_run } { GSLice initialization Memcheck:Leak ... fun:g_malloc0 fun:g_slice_init_nomessage fun:g_slice_alloc } # ============================= GObject =============================== { g_type_init Memcheck:Leak ... fun:g_type_init } { g_type_register_static Memcheck:Leak ... fun:g_type_register_static } # ============================= dbus-glib ============================= { dbus-glib, https://bugs.freedesktop.org/show_bug.cgi?id=14125 Memcheck:Addr4 fun:g_hash_table_foreach obj:/usr/lib/libdbus-glib-1.so.2.1.0 fun:g_object_run_dispose } { registering marshallers is permanent Memcheck:Leak ... fun:dbus_g_object_register_marshaller_array fun:dbus_g_object_register_marshaller } { dbus-glib specialized GTypes are permanent Memcheck:Leak ... fun:dbus_g_type_specialized_init } { libdbus shared connection Memcheck:Leak ... fun:dbus_g_bus_get } { dbus-gobject registrations aren't freed unless we fall off the bus Memcheck:Leak ... fun:g_slist_append fun:dbus_g_connection_register_g_object } { DBusGProxy slots aren't freed unless we fall off the bus Memcheck:Leak ... fun:dbus_connection_allocate_data_slot ... fun:dbus_g_proxy_constructor } { error registrations are for life, not just for Christmas Memcheck:Leak ... fun:dbus_g_error_domain_register } # ============================= telepathy-glib ======================== { tp_dbus_daemon_constructor @daemons once per DBusConnection Memcheck:Leak ... fun:g_slice_alloc fun:tp_dbus_daemon_constructor } { tp_proxy_subclass_add_error_mapping refs the enum Memcheck:Leak ... fun:g_type_class_ref fun:tp_proxy_subclass_add_error_mapping } { tp_proxy_or_subclass_hook_on_interface_add never frees its list Memcheck:Leak ... fun:tp_proxy_or_subclass_hook_on_interface_add } { tp_dbus_daemon_constructor filter not freed til we fall off the bus Memcheck:Leak ... fun:dbus_connection_add_filter fun:tp_dbus_daemon_constructor } # ============================= unclassified ========================== { creating param specs in tp_proxy_class_intern_init Memcheck:Leak fun:memalign fun:posix_memalign fun:slab_allocator_alloc_chunk fun:g_slice_alloc fun:g_slice_alloc0 fun:g_type_create_instance fun:g_param_spec_internal fun:g_param_spec_string } { ld.so initialization on glibc 2.9 Memcheck:Cond fun:_dl_relocate_object fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-2.9.so } { ld.so initialization on glibc 2.9 Memcheck:Cond fun:strlen fun:_dl_init_paths fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-2.9.so } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-node-tree-test.c0000644000175000017500000000501112735676345026107 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_build_simple_tree (void) { WockyNodeTree *tree; WockyNode *n; tree = wocky_node_tree_new ("lions", "animals", '(', "distribution", '$', "Only in kenya", ')', NULL); g_assert (tree != NULL); n = wocky_node_tree_get_top_node (tree); g_assert (n != NULL); g_assert_cmpstr (n->name, ==, "lions"); g_assert_cmpstr (wocky_node_get_ns (n), ==, "animals"); g_assert_cmpint (g_slist_length (n->children), ==, 1); n = wocky_node_get_first_child (n); g_assert (n != NULL); g_assert_cmpstr (n->name, ==, "distribution"); g_assert_cmpstr (wocky_node_get_ns (n), ==, "animals"); g_assert_cmpstr (n->content, ==, "Only in kenya"); g_object_unref (tree); } static void test_tree_from_node (void) { WockyNodeTree *a, *b; a = wocky_node_tree_new ("noms", "foodstocks", '(', "item", '@', "origin", "Italy", '$', "Plum cake", ')', NULL); b = wocky_node_tree_new_from_node (wocky_node_tree_get_top_node (a)); test_assert_nodes_equal (wocky_node_tree_get_top_node (a), wocky_node_tree_get_top_node (b)); g_object_unref (a); g_object_unref (b); } static void test_node_add_tree (void) { WockyNodeTree *origin, *ashes, *destination; WockyNode *ash, *top; WockyNode *ash_copy; origin = wocky_node_tree_new ("Eyjafjallajökull", "urn:wocky:lol:ísland", '(', "æsc", '*', &ash, '@', "type", "vulcanic", '(', "description", '$', "Black and smokey", ')', ')', NULL); ashes = wocky_node_tree_new_from_node (ash); destination = wocky_node_tree_new ("europe", "urn:wocky:lol:noplanesforyou", '*', &top, NULL); ash_copy = wocky_node_add_node_tree (top, ashes); test_assert_nodes_equal (ash_copy, ash); test_assert_nodes_equal ( wocky_node_get_first_child (wocky_node_tree_get_top_node (destination)), wocky_node_get_first_child (wocky_node_tree_get_top_node (origin))); g_object_unref (origin); g_object_unref (ashes); g_object_unref (destination); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-node-tree/simple-tree", test_build_simple_tree); g_test_add_func ("/xmpp-node-tree/tree-from-node", test_tree_from_node); g_test_add_func ("/xmpp-node-tree/node-add-tree", test_node_add_tree); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-contact-factory-test.c0000644000175000017500000001124512735676345027333 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_instantiation (void) { WockyContactFactory *factory; factory = wocky_contact_factory_new (); g_object_unref (factory); } gboolean add_signal_received = FALSE; static void bare_contact_added (WockyContactFactory *factory, WockyBareContact *contact, gpointer data) { add_signal_received = TRUE; } static void test_ensure_bare_contact (void) { WockyContactFactory *factory; WockyBareContact *juliet, *a, *b; factory = wocky_contact_factory_new (); juliet = wocky_bare_contact_new ("juliet@example.org"); add_signal_received = FALSE; g_signal_connect (factory, "bare-contact-added", G_CALLBACK (bare_contact_added), NULL); a = wocky_contact_factory_ensure_bare_contact (factory, "juliet@example.org"); g_assert (wocky_bare_contact_equal (a, juliet)); g_assert (add_signal_received); b = wocky_contact_factory_ensure_bare_contact (factory, "juliet@example.org"); g_assert (a == b); g_object_unref (factory); g_object_unref (juliet); g_object_unref (a); g_object_unref (b); } static void test_lookup_bare_contact (void) { WockyContactFactory *factory; WockyBareContact *contact; factory = wocky_contact_factory_new (); g_assert (wocky_contact_factory_lookup_bare_contact (factory, "juliet@example.org") == NULL); contact = wocky_contact_factory_ensure_bare_contact (factory, "juliet@example.org"); g_assert (wocky_contact_factory_lookup_bare_contact (factory, "juliet@example.org") != NULL); g_object_unref (contact); /* contact has been disposed and so is not in the factory anymore */ g_assert (wocky_contact_factory_lookup_bare_contact (factory, "juliet@example.org") == NULL); g_object_unref (factory); } static void resource_contact_added (WockyContactFactory *factory, WockyBareContact *contact, gpointer data) { add_signal_received = TRUE; } static void test_ensure_resource_contact (void) { WockyContactFactory *factory; WockyBareContact *juliet, *bare; WockyResourceContact *juliet_balcony, *juliet_pub, *a, *b; GSList *resources; factory = wocky_contact_factory_new (); juliet = wocky_bare_contact_new ("juliet@example.org"); juliet_balcony = wocky_resource_contact_new (juliet, "Balcony"); juliet_pub = wocky_resource_contact_new (juliet, "Pub"); add_signal_received = FALSE; g_signal_connect (factory, "resource-contact-added", G_CALLBACK (resource_contact_added), NULL); /* Bare contact isn't in the factory yet */ a = wocky_contact_factory_ensure_resource_contact (factory, "juliet@example.org/Balcony"); g_assert (wocky_resource_contact_equal (a, juliet_balcony)); g_assert (add_signal_received); bare = wocky_contact_factory_lookup_bare_contact (factory, "juliet@example.org"); g_assert (bare != NULL); /* Resource has been added to the bare contact */ resources = wocky_bare_contact_get_resources (bare); g_assert_cmpuint (g_slist_length (resources), ==, 1); g_assert (g_slist_find (resources, a) != NULL); g_slist_free (resources); /* Bare contact is already in the factory */ b = wocky_contact_factory_ensure_resource_contact (factory, "juliet@example.org/Pub"); g_assert (wocky_resource_contact_equal (b, juliet_pub)); g_object_unref (factory); g_object_unref (juliet); g_object_unref (juliet_balcony); g_object_unref (juliet_pub); g_object_unref (a); g_object_unref (b); } static void test_lookup_resource_contact (void) { WockyContactFactory *factory; WockyResourceContact *contact; factory = wocky_contact_factory_new (); g_assert (wocky_contact_factory_lookup_resource_contact (factory, "juliet@example.org/Balcony") == NULL); contact = wocky_contact_factory_ensure_resource_contact (factory, "juliet@example.org/Balcony"); g_assert (wocky_contact_factory_lookup_resource_contact (factory, "juliet@example.org/Balcony") != NULL); g_object_unref (factory); g_object_unref (contact); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/contact-factory/instantiation", test_instantiation); g_test_add_func ("/contact-factory/ensure-bare-contact", test_ensure_bare_contact); g_test_add_func ("/contact-factory/lookup-bare-contact", test_lookup_bare_contact); g_test_add_func ("/contact-factory/ensure-resource-contact", test_ensure_resource_contact); g_test_add_func ("/contact-factory/lookup-resource-contact", test_lookup_resource_contact); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-xmpp-connection-test.c0000644000175000017500000005713112735676345027360 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" #define SIMPLE_MESSAGE \ " " \ " " \ " " \ " Art thou not Romeo, and a Montague? " \ " " \ "" static void test_instantiation (void) { WockyXmppConnection *connection; WockyTestStream *stream;; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); g_assert (connection != NULL); g_object_unref (connection); g_object_unref (stream); } /* Simple message test */ static void stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; test_data_t *data = (test_data_t *) user_data; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); if (!data->parsed_stanza) { g_assert (s != NULL); data->parsed_stanza = TRUE; wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), NULL, stanza_received_cb, data); g_object_unref (s); } else { g_assert (s == NULL); g_main_loop_quit (data->loop); g_error_free (error); } } static void received_open_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); if (!wocky_xmpp_connection_recv_open_finish (conn, res, NULL, NULL, NULL, NULL, NULL, NULL)) g_assert_not_reached (); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (source), NULL, stanza_received_cb, user_data); } #define CHUNK_SIZE 13 static void test_recv_simple_message (void) { WockyXmppConnection *connection; WockyTestStream *stream; gsize len; gsize offset = 0; gchar message[] = SIMPLE_MESSAGE; GMainLoop *loop = NULL; test_data_t data = { NULL, FALSE }; loop = g_main_loop_new (NULL, FALSE); len = strlen (message); stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); g_timeout_add (1000, test_timeout_cb, NULL); data.loop = loop; wocky_xmpp_connection_recv_open_async (connection, NULL, received_open_cb, &data); while (offset < len) { guint l = MIN (len - offset, CHUNK_SIZE); while (g_main_context_iteration (NULL, FALSE)) ; g_output_stream_write_all (stream->stream1_output, message + offset, l, NULL, NULL, NULL); offset += l; } g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (stream); g_object_unref (connection); } /* simple send message testing */ static void send_stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *connection = WOCKY_XMPP_CONNECTION (source); WockyStanza *s; test_data_t *data = (test_data_t *) user_data; GError *error = NULL; s = wocky_xmpp_connection_recv_stanza_finish (connection, res, &error); g_assert (s != NULL); g_assert (!data->parsed_stanza); data->parsed_stanza = TRUE; g_object_unref (s); data->outstanding--; g_main_loop_quit (data->loop); } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, NULL)); data->outstanding--; g_main_loop_quit (data->loop); } static void test_send_simple_message (void) { WockyStanza *s; test_data_t *test = setup_test (); test_open_connection (test); s = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "juliet@example.com", "romeo@example.net", '(', "html", ':', "http://www.w3.org/1999/xhtml", '(', "body", '$', "Art thou not Romeo, and a Montague?", ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (WOCKY_XMPP_CONNECTION (test->in), s, NULL, send_stanza_cb, test); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (test->out), NULL, send_stanza_received_cb, test); test->outstanding += 2; test_wait_pending (test); test_close_connection (test); g_object_unref (s); teardown_test (test); } /* Test for various error codes */ static void error_pending_open_received_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL, NULL, NULL, NULL, NULL, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void error_pending_recv_open_pending_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); g_assert (!wocky_xmpp_connection_recv_open_finish ( conn, result, NULL, NULL, NULL, NULL, NULL, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); test->outstanding--; g_main_loop_quit (test->loop); g_error_free (error); } static void error_pending_stanza_received_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *s; g_assert ((s = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)) != NULL); test->outstanding--; g_main_loop_quit (test->loop); g_object_unref (s); } static void error_pending_recv_stanza_pending_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error) == NULL); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); test->outstanding--; g_main_loop_quit (test->loop); g_error_free (error); } static void error_pending_open_sent_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void error_pending_open_pending_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); test->outstanding--; g_main_loop_quit (test->loop); g_error_free (error); } static void error_pending_stanza_sent_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void error_pending_stanza_pending_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); test->outstanding--; g_main_loop_quit (test->loop); g_error_free (error); } static void error_pending_close_sent_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void error_pending_close_pending_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING); test->outstanding--; g_main_loop_quit (test->loop); g_error_free (error); } static void test_error_pending_send_pending (test_data_t *test) { WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "a"," b", NULL); /* should get a _PENDING error */ wocky_xmpp_connection_send_open_async (test->in, NULL, NULL, NULL, NULL, NULL, NULL, error_pending_open_pending_cb, test); /* should get a _PENDING error */ wocky_xmpp_connection_send_stanza_async (test->in, stanza, NULL, error_pending_stanza_pending_cb, test); /* should get a _PENDING error */ wocky_xmpp_connection_send_close_async (test->in, NULL, error_pending_close_pending_cb, test); test->outstanding += 3; g_object_unref (stanza); } static void test_error_pending (void) { test_data_t *test = setup_test (); WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "a"," b", NULL); wocky_xmpp_connection_recv_open_async (test->out, NULL, error_pending_open_received_cb, test); test->outstanding++; wocky_xmpp_connection_recv_open_async (test->out, NULL, error_pending_open_pending_cb, test); test->outstanding++; g_main_loop_run (test->loop); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, error_pending_recv_stanza_pending_cb, test); test->outstanding++; g_main_loop_run (test->loop); /* Should succeed */ wocky_xmpp_connection_send_open_async (test->in, NULL, NULL, NULL, NULL, NULL, NULL, error_pending_open_sent_cb, test); test->outstanding++; test_error_pending_send_pending (test); test_wait_pending (test); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, error_pending_stanza_received_cb, test); test->outstanding++; wocky_xmpp_connection_recv_open_async (test->out, NULL, error_pending_recv_open_pending_cb, test); test->outstanding++; g_main_loop_run (test->loop); wocky_xmpp_connection_recv_stanza_async (test->out, NULL, error_pending_recv_stanza_pending_cb, test); test->outstanding++; g_main_loop_run (test->loop); /* should succeed */ wocky_xmpp_connection_send_stanza_async (test->in, stanza, NULL, error_pending_stanza_sent_cb, test); test->outstanding++; test_error_pending_send_pending (test); test_wait_pending (test); /* should succeed */ wocky_xmpp_connection_send_close_async (test->in, NULL, error_pending_close_sent_cb, test); test->outstanding++; test_error_pending_send_pending (test); test_wait_pending (test); teardown_test (test); g_object_unref (stanza); } /* not open errors */ static void error_not_open_send_stanza_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_not_open_send_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_not_open_recv_stanza_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error) == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_error_not_open (void) { test_data_t *test = setup_test (); WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "a"," b", NULL); wocky_xmpp_connection_send_stanza_async (test->in, stanza, NULL, error_not_open_send_stanza_cb, test); wocky_xmpp_connection_send_close_async (test->in, NULL, error_not_open_send_close_cb, test); wocky_xmpp_connection_recv_stanza_async (test->in, NULL, error_not_open_recv_stanza_cb, test); test->outstanding = 3; test_wait_pending (test); teardown_test (test); g_object_unref (stanza); } /* is open tests */ static void error_is_open_send_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void is_open_send_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { g_assert (wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); wocky_xmpp_connection_send_open_async (WOCKY_XMPP_CONNECTION (source), NULL, NULL, NULL, NULL, NULL, NULL, error_is_open_send_open_cb, user_data); } static void error_is_open_recv_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL, NULL, NULL, NULL, NULL, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void is_open_recv_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); g_assert (wocky_xmpp_connection_recv_open_finish ( conn, result, NULL, NULL, NULL, NULL, NULL, NULL)); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (source), NULL, error_is_open_recv_open_cb, user_data); } static void is_open_send_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL)); test->outstanding--; g_main_loop_quit (test->loop); } static void is_open_recv_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error) == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_is_closed_send_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_open_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_is_closed_send_stanza_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_is_closed_send_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_close_finish ( WOCKY_XMPP_CONNECTION (source), result, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_is_closed_recv_open_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_recv_open_finish ( WOCKY_XMPP_CONNECTION (source), result, NULL, NULL, NULL, NULL, NULL, &error)); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void error_is_closed_recv_stanza_cb (GObject *source, GAsyncResult *result, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; GError *error = NULL; g_assert (wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), result, &error) == NULL); g_assert_error (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_error_is_open_or_closed (void) { test_data_t *test = setup_test (); WockyStanza *stanza; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "a"," b", NULL); wocky_xmpp_connection_send_open_async (WOCKY_XMPP_CONNECTION (test->in), NULL, NULL, NULL, NULL, NULL, NULL, is_open_send_open_cb, test); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (test->out), NULL, is_open_recv_open_cb, test); test->outstanding = 2; test_wait_pending (test); /* Input and output side are open, so they can be closed */ wocky_xmpp_connection_send_close_async (WOCKY_XMPP_CONNECTION (test->in), NULL, is_open_send_close_cb, test); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (test->out), NULL, is_open_recv_close_cb, test); test->outstanding = 2; test_wait_pending (test); /* both sides are closed, all calls should yield _IS_CLOSED errors */ wocky_xmpp_connection_send_open_async (WOCKY_XMPP_CONNECTION (test->in), NULL, NULL, NULL, NULL, NULL, NULL, error_is_closed_send_open_cb, test); wocky_xmpp_connection_send_stanza_async (WOCKY_XMPP_CONNECTION (test->in), stanza, NULL, error_is_closed_send_stanza_cb, test); wocky_xmpp_connection_send_close_async (WOCKY_XMPP_CONNECTION (test->in), NULL, error_is_closed_send_close_cb, test); wocky_xmpp_connection_recv_open_async (WOCKY_XMPP_CONNECTION (test->out), NULL, error_is_closed_recv_open_cb, test); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (test->out), NULL, error_is_closed_recv_stanza_cb, test); test->outstanding = 5; test_wait_pending (test); teardown_test (test); g_object_unref (stanza); } /* Send cancelled */ static void recv_cancelled_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; GError *error = NULL; g_assert (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); data->outstanding--; g_main_loop_quit (data->loop); g_error_free (error); } static void test_recv_cancel (void) { WockyStanza *stanza; test_data_t *test = setup_test (); GCancellable *cancellable; test_open_connection (test); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_CHAT, "a"," b", NULL); cancellable = g_cancellable_new (); wocky_xmpp_connection_recv_stanza_async (WOCKY_XMPP_CONNECTION (test->out), cancellable, recv_cancelled_cb, test); g_cancellable_cancel (cancellable); test->outstanding++; test_wait_pending (test); g_object_unref (stanza); g_object_unref (cancellable); test_close_connection (test); teardown_test (test); } /* Send message in a big chunk */ static void test_recv_simple_message_in_one_chunk (void) { WockyXmppConnection *connection; WockyTestStream *stream; gsize len; gchar message[] = SIMPLE_MESSAGE; GMainLoop *loop = NULL; test_data_t data = { NULL, FALSE }; loop = g_main_loop_new (NULL, FALSE); len = strlen (message); stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); g_timeout_add (1000, test_timeout_cb, NULL); data.loop = loop; g_output_stream_write_all (stream->stream1_output, message, len, NULL, NULL, NULL); wocky_xmpp_connection_recv_open_async (connection, NULL, received_open_cb, &data); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (stream); g_object_unref (connection); } /* test force close */ static void force_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyXmppConnection *conn = WOCKY_XMPP_CONNECTION (source); test_data_t *data = (test_data_t *) user_data; g_assert (wocky_xmpp_connection_force_close_finish (conn, res, NULL)); g_main_loop_quit (data->loop); } static void test_force_close (void) { WockyXmppConnection *connection; WockyTestStream *stream; GMainLoop *loop = NULL; test_data_t data = { NULL, FALSE }; loop = g_main_loop_new (NULL, FALSE); stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); g_timeout_add (1000, test_timeout_cb, NULL); data.loop = loop; wocky_xmpp_connection_force_close_async (connection, NULL, force_close_cb, &data); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (stream); g_object_unref (connection); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-connection/initiation", test_instantiation); g_test_add_func ("/xmpp-connection/recv-simple-message", test_recv_simple_message); g_test_add_func ("/xmpp-connection/send-simple-message", test_send_simple_message); g_test_add_func ("/xmpp-connection/error-pending", test_error_pending); g_test_add_func ("/xmpp-connection/error-not-open", test_error_not_open); g_test_add_func ("/xmpp-connection/error-is-open-or-closed", test_error_is_open_or_closed); g_test_add_func ("/xmpp-connection/recv-cancel", test_recv_cancel); g_test_add_func ("/xmpp-connection/recv-simple-message-in-one-chunk", test_recv_simple_message_in_one_chunk); g_test_add_func ("/xmpp-connection/force-close", test_force_close); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/summarise-tests.py0000755000175000017500000000241112735676345025475 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/env python import sys import xml.dom.minidom as minidom def process(testbinary): cases = 0 passes = 0 failures = [] for e in testbinary.childNodes: if e.nodeType != e.ELEMENT_NODE or e.localName != 'testcase': continue if e.hasAttribute('skipped'): continue path = e.getAttribute("path") cases = cases + 1 status = e.getElementsByTagName('status')[0] if status.getAttribute('result') != 'success': failures += [ path ] return (cases, failures) doc = minidom.parse(sys.argv[1]) okay = True tests = {} for e in doc.childNodes[0].childNodes: if e.nodeType != e.ELEMENT_NODE or e.localName != 'testbinary': continue path = e.getAttribute("path") cases, failures = process(e) ocases, ofailures = tests.get (path, [ 0, []]) tests[path] = [ ocases + cases, ofailures + failures ] for name, [cases, failures] in tests.iteritems(): if failures == []: result = 'PASS' else: result = 'FAIL' okay = False print "%s: %s: %u/%u tests passed" % (result, name, cases - len (failures), cases) for f in failures: print "\tFailure: %s" % f if not okay: print "Disaster! Calamity!" sys.exit(1) telepathy-gabble-0.18.4/lib/ext/wocky/tests/README0000644000175000017500000000065512735676345022643 0ustar00gkiagiagkiagia00000000000000You can valgrind all the tests by running: % make valgrind To valgrind an individual test binary (wocky-porter-test, say), run: % make wocky-porter-test.valgrind If you want to pass arguments to the tests when valgrinding (perhaps you've narrowed the leaky test down to one test case, /xmpp-porter/cancel-iq-closing say), run: % make wocky-porter-test.valgrind \ TEST_ARGS='-p /xmpp-porter/cancel-iq-closing' telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-connector-test.c0000644000175000017500000041630213012550005026175 0ustar00gkiagiagkiagia00000000000000#include #include #include #include #include #include #include #include #include #ifdef G_OS_WIN32 #include #include #else #include #include #include #include #include #endif #ifdef G_OS_UNIX #include #endif #include #include "wocky-test-connector-server.h" #include "test-resolver.h" #include "wocky-test-helper.h" #include "config.h" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif #define G_LOG_DOMAIN "wocky-connector-test" #define SASL_DB_NAME "sasl-test.db" #define INVISIBLE_HOST "unreachable.host" #define VISIBLE_HOST "reachable.host" #define REACHABLE "127.0.0.1" #define UNREACHABLE "127.255.255.255" #define DUFF_H0ST "no_such_host.at.all" #define OLD_SSL TRUE #define OLD_JABBER TRUE #define XMPP_V1 FALSE #define STARTTLS FALSE #define CERT_CHECK_STRICT FALSE #define CERT_CHECK_LENIENT TRUE #define TLS_REQUIRED TRUE #define PLAINTEXT_OK FALSE #define QUIET TRUE #define NOISY FALSE #define TLS TRUE #define NOTLS FALSE #define PLAIN FALSE #define DIGEST TRUE #define PORT_XMPP 5222 #define PORT_NONE 0 #define CONNECTOR_INTERNALS_TEST "/connector/basic/internals" #define OK 0 #define CONNECTOR_OK { OK, OK, OK, OK, OK, OK } static GError *error = NULL; static GResolver *original; static GResolver *kludged; static GMainLoop *mainloop; enum { OP_CONNECT = 0, OP_REGISTER, OP_CANCEL, }; enum { S_NO_ERROR = 0, S_WOCKY_AUTH_ERROR, S_WOCKY_CONNECTOR_ERROR, S_WOCKY_XMPP_CONNECTION_ERROR, S_WOCKY_TLS_CERT_ERROR, S_WOCKY_XMPP_STREAM_ERROR, S_G_IO_ERROR, S_G_RESOLVER_ERROR, S_ANY_ERROR = 0xff }; #define MAP(x) case S_##x: return x static GQuark map_static_domain (gint domain) { switch (domain) { MAP (WOCKY_AUTH_ERROR); MAP (WOCKY_CONNECTOR_ERROR); MAP (WOCKY_XMPP_CONNECTION_ERROR); MAP (WOCKY_TLS_CERT_ERROR); MAP (WOCKY_XMPP_STREAM_ERROR); MAP (G_IO_ERROR); MAP (G_RESOLVER_ERROR); default: g_assert_not_reached (); } } #undef MAP typedef void (*test_setup) (gpointer); typedef struct _ServerParameters ServerParameters; struct _ServerParameters { struct { gboolean tls; gchar *auth_mech; gchar *version; } features; struct { ServerProblem sasl; ConnectorProblem conn; } problem; struct { gchar *user; gchar *pass; } auth; guint port; CertSet cert; /* Extra server for see-other-host problem */ ServerParameters *extra_server; /* Runtime */ TestConnectorServer *server; GIOChannel *channel; guint watch; }; typedef struct { gchar *desc; gboolean quiet; struct { int domain; int code; int fallback_code; gchar *mech; gchar *used_mech; gpointer xmpp; gchar *jid; gchar *sid; } result; ServerParameters server_parameters; struct { char *srv; guint port; char *host; char *addr; char *srvhost; } dns; struct { gboolean require_tls; struct { gchar *jid; gchar *pass; gboolean secure; gboolean tls; } auth; struct { gchar *host; guint port; gboolean jabber; gboolean ssl; gboolean lax_ssl; const gchar *ca; } options; int op; test_setup setup; } client; /* Runtime */ WockyConnector *connector; gboolean ok; } test_t; static void _set_connector_email_prop (test_t *test) { g_object_set (G_OBJECT (test->connector), "email", "foo@bar.org", NULL); } ServerParameters see_other_host_extra_server = { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 8222 }; test_t tests[] = { /* basic connection test, no SRV record, no host or port supplied: */ /* { "/name/of/test", SUPPRESS_STDERR, // result of test: { DOMAIN, CODE, FALLBACK_CODE, AUTH_MECH_USED, XMPP_CONNECTION_PLACEHOLDER }, // When an error is expected it should match the domain and either // the given CODE or the FALLBACK_CODE (GIO over time became more // specific about the error codes it gave in certain conditions) // Server Details: { { TLS_SUPPORT, AUTH_MECH_OR_NULL_FOR_ALL }, { SERVER_PROBLEM..., CONNECTOR_PROBLEM... }, { USERNAME, PASSWORD }, SERVER_LISTEN_PORT, SERVER_CERT }, // Fake DNS Record: // SRV_HOSTs SRV record → { HOSTNAME, PORT } // HOSTs A record → IP_ADDRESS // SRV_HOSTs A record → IP_ADDR_OF_SRV_HOST { SRV_HOST, PORT, HOSTNAME, IP_ADDRESS, IP_ADDR_OF_SRV_HOST }, // Client Details { TLS_REQUIRED, { BARE_JID, PASSWORD, MUST_BE_DIGEST_AUTH, MUST_BE_SECURE }, { XMPP_HOSTNAME_OR_NULL, XMPP_PORT_OR_ZERO, OLD_JABBER, OLD_SSL } } SERVER_PROCESS_ID }, */ /* simple connection, followed by checks on all the internal state * * and get/set property methods to make sure they work */ { CONNECTOR_INTERNALS_TEST, NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", FALSE, NOTLS }, { NULL, 0 } } }, { "/connector/see-other-host", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_SEE_OTHER_HOST, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_STANDARD, &see_other_host_extra_server }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* No SRV or connect host specified */ { "/connector/basic/noserv/nohost/noport", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* No SRV or connect host specified, connect port specified */ { "/connector/basic/noserv/nohost/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 8222 }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 8222 } } }, /* No SRV or connect host specified, bad port specified: FAIL */ { "/connector/basic/noserv/nohost/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 8222 }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 8221 } } }, /* No SRV record, connect host specified */ { "/connector/basic/noserv/host/noport", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "schadenfreude.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { "schadenfreude.org", 0 } } }, /* No SRV record, connect host and port specified */ { "/connector/basic/noserv/host/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5555 }, { NULL, 0, "meerkats.net", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { "meerkats.net", 5555 } } }, /* No SRV record, connect host and bad port specified: FAIL */ { "/connector/basic/noserv/host/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5555 }, { NULL, 0, "meerkats.net", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { "meerkats.net", 5554 } } }, /* No SRV record, bad connect host: FAIL */ { "/connector/basic/noserv/duffhost/noport", NOISY, { S_G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { NULL, NULL }, PORT_NONE }, { NULL, 0, NULL, NULL, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { DUFF_H0ST, 0 } } }, /* No SRV record, bad connect host, port specified: FAIL */ { "/connector/basic/noserv/duffhost/port", NOISY, { S_G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { NULL, NULL }, PORT_NONE }, { NULL, 0, NULL, NULL, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { "still.no_such_host.at.all", 23 } } }, /* SRV record specified */ { "/connector/basic/serv/nohost/noport", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5050 }, { "weasel-juice.org", 5050, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* SRV record specified, port specified: ignore SRV and connect */ { "/connector/basic/serv/nohost/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5051 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 5051 } } }, /* SRV record specified, bad port: ignore SRV and FAIL */ { "/connector/basic/serv/nohost/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5051 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 5050 } } }, /* SRV record, connect host specified: use connect host */ { "/connector/basic/serv/host/noport", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 0 } } }, /* SRV, connect host and port specified: use host and port */ { "/connector/basic/serv/host/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5656 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 5656 } } }, /* SRV record, connect host, bad port: ignore SRV, FAIL */ { "/connector/basic/serv/host/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5656 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 5655 } } }, /* SRV record, bad connect host: use bad host and FAIL */ { "/connector/basic/serv/duffhost/noport", NOISY, { S_G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { DUFF_H0ST, 0 } } }, /* SRV record, bad connect host, connect port: use bad host and FAIL */ { "/connector/basic/serv/duffhost/port", NOISY, { S_G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { DUFF_H0ST, PORT_XMPP } } }, /* Facebook Chat has a broken SRV record: you ask for * _xmpp-client._tcp.chat.facebook.com, and it gives you back a CNAME! So * g_socket_client_connect_to_service() fails. But as it happens the real * result should have just been chat.facebook.com anyway, so Wocky tries to * fall back to that. * * So this test has a fake SRV record for an unreachable server, but * expects to succeed because it's listening on the default XMPP port on * our hypothetical 'weasel-juice.org'. */ { "/connector/basic/facebook-chat-srv-workaround", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* Further to the above test, this one tests the case where the fallback * doesn't work either. The server isn't listening anywhere (that's the * PORT_NONE in the server_parameters sub-struct), and thud.org (the result * of the SRV lookup) is unreachable. So the connection should fail. */ { "/connector/basic/duffserv/nohost/noport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_NONE }, { "not.an.xmpp.server", PORT_XMPP, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@not.an.xmpp.server", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* Bad SRV record, port specified, ignore SRV and connect to domain host */ { "/connector/basic/duffserv/nohost/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5050 }, { "weasel-juice.org", PORT_XMPP, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 5050 } } }, /* Bad SRV record, bad port specified, ignore SRV and FAIL */ { "/connector/basic/duffserv/nohost/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5050 }, { "weasel-juice.org", PORT_XMPP, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 5049 } } }, /* Bad SRV record, connect host specified, ignore SRV */ { "/connector/basic/duffserv/host/noport", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 0 } } }, /* Bad SRV record, connect host and port given: ignore SRV */ { "/connector/basic/duffserv/host/port", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5151 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 5151 } } }, /* Bad SRV record, connect host and bad port, ignore SRV and FAIL */ { "/connector/basic/duffserv/host/duffport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5151 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { VISIBLE_HOST, 5149 } } }, /* Bad SRV record, bad host and bad port: Just FAIL */ { "/connector/basic/duffserv/duffhost/noport", NOISY, { S_G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { INVISIBLE_HOST, 0 } } }, /*Bad SRV and connect host, ignore SRV and FAIL */ { "/connector/basic/duffserv/duffhost/port", NOISY, { S_G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE, G_IO_ERROR_FAILED }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, 5151 }, { "weasel-juice.org", 5050, "thud.org", UNREACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { INVISIBLE_HOST, 5151 } } }, /* ******************************************************************* * * that's it for the basic DNS/connection-logic tests * * now onto the post-tcp-connect stages: */ { "/connector/auth/secure/no-tlsplain/notls/nodigest", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { NOTLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/auth/secure/no-tlsplain/notls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/auth/insecure/no-tlsplain/notls/nodigest", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { NOTLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/auth/insecure/no-tlsplain/notls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* *************************************************************** * * This block of tests will fail as we don't advertise TLS support */ { "/connector/auth/insecure/no-tlsplain/notls/any", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE, -1 }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0 } } }, { "/connector/auth/insecure/tlsplain/notls/any", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE, -1 }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/auth/secure/no-tlsplain/notls/any", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE, -1 }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", TRUE, TLS }, { NULL, 0 } } }, { "/connector/auth/secure/tlsplain/notls/any", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_TLS_UNAVAILABLE, -1 }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", TRUE, NOTLS }, { NULL, 0 } } }, /* **************************************************************** * * this will be a mix of failures and sucesses depending on whether * * we allow plain auth or not */ { "/connector/auth/secure/no-tlsplain/tls/plain", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_INVALID_PASSWORD, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/auth/secure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0 } } }, { "/connector/auth/insecure/no-tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0 } } }, { "/connector/auth/insecure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/tls+auth/secure/no-tlsplain/tls/plain", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/tls+auth/secure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0 } } }, { "/connector/tls+auth/insecure/no-tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0 } } }, { "/connector/tls+auth/insecure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* **************************************************************** * * these should all be digest auth successes */ { "/connector/auth/secure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/auth/secure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0 } } }, { "/connector/auth/insecure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0 } } }, { "/connector/auth/insecure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/tls+auth/secure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0 } } }, { "/connector/tls+auth/secure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0 } } }, { "/connector/tls+auth/insecure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0 } } }, { "/connector/tls+auth/insecure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* ***************************************************************** * * SASL problems */ { "/connector/problem/sasl/bad-pass", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_INVALID_PASSWORD, CONNECTOR_OK }, { "foo", "bar" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "foo@weasel-juice.org", "notbar", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/sasl/bad-user", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_INVALID_USERNAME, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "caribou@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/sasl/no-sasl", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_SASL, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/sasl/no-mechanisms", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_MECHANISMS, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/sasl/bad-mechanism", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "omg-poniez" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* ********************************************************************* */ /* TLS error conditions */ { "/connector/problem/tls/refused", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_TLS_REFUSED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_TLS_REFUSED, OK, OK, OK, OK} }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* ********************************************************************* * * Invalid JID */ { "/connector/problem/jid/invalid", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BAD_JID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_NONE }, { NULL, 0, "thud.org", REACHABLE }, { PLAINTEXT_OK, { "bla@h@_b&la<>h", "something", PLAIN, NOTLS }, { "weasel-juice.org", PORT_XMPP } } }, { "/connector/problem/jid/domainless", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BAD_JID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_NONE }, { "weasel-juice.org", 5001, "thud.org", REACHABLE, REACHABLE }, { PLAINTEXT_OK, { "moose@", "something", PLAIN, NOTLS }, { "weasel-juice.org", 0 } } }, /* ********************************************************************* * * XMPP errors */ { "/connector/problem/xmpp/version/0.x", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER, -1 }, { { TLS, NULL, "0.9" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* we actually tolerate > 1.0 versions */ { "/connector/problem/xmpp/version/1.x", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL, "1.1" }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/error/host-unknown", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OTHER_HOST, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/error/tls-load", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_TLS_LOAD, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/error/bind-conflict", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_CLASH, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/error/session-fail", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_NO_SESSION, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/features", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BAD_FEATURES, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_FEATURES, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE */ { "/connector/problem/xmpp/no-bind", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_CANNOT_BIND, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_INVALID */ { "/connector/problem/xmpp/bind/invalid", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_INVALID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_INVALID, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_DENIED */ { "/connector/problem/xmpp/bind/denied", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_DENIED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_CONFLICT */ { "/connector/problem/xmpp/bind/conflict", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_CONFLICT, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_REJECTED */ { "/connector/problem/xmpp/bind/rejected", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_REJECTED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_BIND_FAILED */ { "/connector/problem/xmpp/bind/failed", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_FAILED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/bind/nonsense", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_NONSENSE, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/bind/no-jid", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, BIND_PROBLEM_NO_JID, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/session/none", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_NO_SESSION, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_FAILED */ { "/connector/problem/xmpp/session/failed", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_FAILED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_DENIED */ { "/connector/problem/xmpp/session/denied", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_DENIED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT */ { "/connector/problem/xmpp/session/conflict", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_CONFLICT, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_REJECTED */ { "/connector/problem/xmpp/session/rejected", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_REJECTED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/problem/xmpp/session/nonsense", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, SESSION_PROBLEM_NONSENSE, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/econnreset/server-start", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, SERVER_DEATH_SERVER_START, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/econnreset/client-open", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, SERVER_DEATH_CLIENT_OPEN, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/econnreset/server-open", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, SERVER_DEATH_SERVER_OPEN, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/econnreset/features", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, SERVER_DEATH_FEATURES, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/econnreset/tls-negotiate", QUIET, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, SERVER_DEATH_TLS_NEG, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* ******************************************************************** */ /* quirks */ { "/connector/google/domain-discovery/require", QUIET, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_REQUIRE_GOOGLE_JDD, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, { "/connector/google/domain-discovery/dislike", QUIET, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_DISLIKE_GOOGLE_JDD, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 } } }, /* ******************************************************************** */ /* XEP 0077 */ { "/connector/xep77/register/ok", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/no-args", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_EMPTY, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_NO_ARGS } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/email-missing", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_EMAIL_ARG } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/unknown-arg", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_STRANGE_ARG } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/unknown+email-args", NOISY, { S_ANY_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_STRANGE_ARG|XEP77_PROBLEM_EMAIL_ARG } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/email-arg-ok", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_EMAIL_ARG } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER, (test_setup)_set_connector_email_prop } }, { "/connector/xep77/register/email-arg-ok/unknown-arg", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_UNSUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_EMAIL_ARG|XEP77_PROBLEM_STRANGE_ARG } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER, (test_setup)_set_connector_email_prop } }, { "/connector/xep77/register/fail/conflict", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_FAIL_CONFLICT } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/fail/other", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_FAIL_REJECTED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/nonsense", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_QUERY_NONSENSE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/already/get", NOISY, { S_NO_ERROR, 0 , 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_QUERY_ALREADY } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/already/set", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_ALREADY } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, { "/connector/xep77/register/not-available", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_REGISTRATION_UNAVAILABLE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_NOT_AVAILABLE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_REGISTER } }, /* ******************************************************************** */ { "/connector/xep77/cancel/ok", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_CANCEL } }, { "/connector/xep77/cancel/denied", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_CANCEL_FAILED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_CANCEL } }, { "/connector/xep77/cancel/disabled", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_UNREGISTER_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_CANCEL_DISABLED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_CANCEL } }, { "/connector/xep77/cancel/rejected", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_UNREGISTER_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_CANCEL_REJECTED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_CANCEL } }, { "/connector/xep77/cancel/stream-closed", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { OK, OK, OK, OK, OK, XEP77_PROBLEM_CANCEL_STREAM } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0 }, OP_CANCEL } }, /* ******************************************************************** */ /* old school jabber tests (pre XMPP 1.0) */ { "/connector/jabber/no-ssl/auth/digest", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/reject", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, OK } }, { "moose", "blerg" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/unavailable", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_NIH } }, { "moose", "blerg" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/bind-error", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_RESOURCE_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_BIND } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/incomplete", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_PARTIAL } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/failure", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_FAILED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/bizarre", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_STRANGE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/nonsense", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_NONSENSE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/no-mechs", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "none" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/plain", NOISY, { S_NO_ERROR, }, { { TLS, "password" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/plain/rejected", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, "password" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_REJECT } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/digest/rejected", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, "digest" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER, OK, OK, OK, JABBER_PROBLEM_AUTH_REJECT } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/old+sasl", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_AUTH_FEATURE, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, { "/connector/jabber/no-ssl/auth/old-sasl", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_SASL, { XMPP_PROBLEM_OLD_AUTH_FEATURE, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER } } }, /* ******************************************************************** */ /* old SSL */ { "/connector/jabber/ssl/auth/digest", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/reject", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "blerg" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/unavailable", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_NIH } }, { "moose", "blerg" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/bind-error", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_RESOURCE_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_BIND } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/incomplete", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_PARTIAL } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/failure", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_FAILED } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/bizarre", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_STRANGE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/nonsense", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_INVALID_REPLY, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_NONSENSE } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/no-mechs", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "none" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/plain", NOISY, { S_NO_ERROR, }, { { TLS, "password" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/plain/rejected", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, "password" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_REJECT } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/digest/rejected", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_AUTHORIZED, -1 }, { { TLS, "digest" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SERVER|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, JABBER_PROBLEM_AUTH_REJECT } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/old+sasl", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_AUTH_FEATURE|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector/jabber/ssl/auth/old-sasl", NOISY, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_SASL, { XMPP_PROBLEM_OLD_AUTH_FEATURE|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, /* ******************************************************************* */ /* duplicate earlier blocks of tests, but with old SSL */ { "/connector+ssl/auth/secure/no-tlsplain/notls/nodigest", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { NOTLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, OLD_JABBER, OLD_SSL } } }, { "/connector+ssl/auth/secure/no-tlsplain/notls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/no-tlsplain/notls/nodigest", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { NOTLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/no-tlsplain/notls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { NOTLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* **************************************************************** * * this will be a mix of failures and sucesses depending on whether * * we allow plain auth or not */ { "/connector+ssl/auth/secure/no-tlsplain/tls/plain", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_INVALID_PASSWORD, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/secure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/no-tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/secure/no-tlsplain/tls/plain", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/secure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/insecure/no-tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/insecure/tlsplain/tls/plain", NOISY, { S_NO_ERROR, 0, 0, "PLAIN" }, { { TLS, "PLAIN" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* **************************************************************** * * these should all be digest auth successes */ { "/connector+ssl/auth/secure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/secure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/auth/insecure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/secure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/secure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/insecure/no-tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", DIGEST, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/tls+auth/insecure/tlsplain/tls/digest", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* ***************************************************************** * * SASL problems */ { "/connector+ssl/problem/sasl/bad-pass", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_INVALID_PASSWORD, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "foo", "bar" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "foo@weasel-juice.org", "notbar", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/sasl/bad-user", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_FAILURE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_INVALID_USERNAME, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "caribou@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/sasl/no-sasl", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_SASL, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/sas/no-mechanisms", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NOT_SUPPORTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_MECHANISMS, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/sasl/bad-mechanism", NOISY, { S_WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, -1 }, { { TLS, "omg-poniez" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/version/0.x", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_NON_XMPP_V1_SERVER, -1 }, { { TLS, NULL, "0.9" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* we actually tolerate > 1.0 versions */ { "/connector+ssl/problem/xmpp/version/1.x", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL, "1.1" }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/error/host-unknown", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OTHER_HOST|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/error/bind-conflict", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_CLASH, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/error/session-fail", NOISY, { S_WOCKY_XMPP_STREAM_ERROR, WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_NO_SESSION, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/features", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BAD_FEATURES, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_FEATURES|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE */ { "/connector+ssl/problem/xmpp/no-bind", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_UNAVAILABLE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_CANNOT_BIND|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_INVALID */ { "/connector+ssl/problem/xmpp/bind/invalid", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_INVALID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_INVALID, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_DENIED */ { "/connector+ssl/problem/xmpp/bind/denied", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_DENIED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_CONFLICT */ { "/connector+ssl/problem/xmpp/bind/conflict", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_CONFLICT, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_REJECTED */ { "/connector+ssl/problem/xmpp/bind/rejected", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_REJECTED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_BIND_FAILED */ { "/connector+ssl/problem/xmpp/bind/failed", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_FAILED, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/bind/nonsense", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_BIND_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_NONSENSE, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/bind/no-jid", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, BIND_PROBLEM_NO_JID, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/session/none", NOISY, { S_NO_ERROR, 0, 0, "DIGEST-MD5" }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_NO_SESSION|XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_FAILED */ { "/connector+ssl/problem/xmpp/session/failed", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_FAILED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_DENIED */ { "/connector+ssl/problem/xmpp/session/denied", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_DENIED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_DENIED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT */ { "/connector+ssl/problem/xmpp/session/conflict", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_CONFLICT, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_CONFLICT, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* WOCKY_CONNECTOR_ERROR_SESSION_REJECTED */ { "/connector+ssl/problem/xmpp/session/rejected", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_REJECTED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_REJECTED, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/problem/xmpp/session/nonsense", NOISY, { S_WOCKY_CONNECTOR_ERROR, WOCKY_CONNECTOR_ERROR_SESSION_FAILED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, SESSION_PROBLEM_NONSENSE, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/econnreset/server-start", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, SERVER_DEATH_SERVER_START, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/econnreset/client-open", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, SERVER_DEATH_CLIENT_OPEN, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/econnreset/server-open", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, SERVER_DEATH_SERVER_OPEN, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/econnreset/features", NOISY, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, SERVER_DEATH_FEATURES, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector+ssl/econnreset/ssl-negotiate", QUIET, { S_ANY_ERROR, 0 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, SERVER_DEATH_TLS_NEG, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, NOTLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, /* ********************************************************************* */ /* certificate verification tests */ { "/connector/cert-verification/tls/nohost/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/multica-verification/tls/nohost/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/host/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "thud.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { "thud.org", 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/nohost/fail/name-mismatch", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "tomato-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/host/fail/name-mismatch", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "tomato-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { "tomato-juice.org", 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/expired/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_EXPIRED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_EXPIRED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/inactive/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NOT_ACTIVE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_NOT_YET }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/selfsigned/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_INVALID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_SELFSIGN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/unknown/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_SIGNER_UNKNOWN, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_UNKNOWN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, /* This is a combination of the above test * (/connector/cert-verification/tls/unknown/fail) and * /connector/cert-verification/tls/host/fail/name-mismatch. It checks that * Wocky considers a hostname mismatch more erroneous than the certificate * being broken. */ { "/connector/cert-verification/tls/host/fail/name-mismatch-and-unknown", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_UNKNOWN }, { "tomato-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-verification/tls/wildcard/ok", QUIET, { S_NO_ERROR }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "foo.weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@foo.weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/wildcard/level-mismatch/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/wildcard/glob-mismatch/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "foo.diesel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@foo.diesel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/bad-wildcard/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_BADWILD }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/revoked/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_REVOKED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_REVOKED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/tls/revoked/lenient/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_REVOKED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_REVOKED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT, TLS_CA_DIR } } }, /* ********************************************************************* */ /* as above but with legacy ssl */ { "/connector/cert-verification/ssl/nohost/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/host/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@thud.org", "something", PLAIN, TLS }, { "weasel-juice.org", PORT_XMPP, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/nohost/fail/name-mismatch", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "tomato-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/host/fail/name-mismatch", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "tomato-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { "tomato-juice.org", 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/expired/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_EXPIRED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_EXPIRED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/inactive/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NOT_ACTIVE, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_NOT_YET }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/selfsigned/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_INVALID, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_SELFSIGN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/unknown/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_SIGNER_UNKNOWN, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_UNKNOWN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL } } }, { "/connector/cert-verification/ssl/wildcard/ok", QUIET, { S_NO_ERROR }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "foo.weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@foo.weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/ssl/wildcard/level-mismatch/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/ssl/wildcard/glob-mismatch/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_WILDCARD }, { "foo.diesel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@foo.diesel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/ssl/bad-wildcard/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_NAME_MISMATCH, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_BADWILD }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/ssl/revoked/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_REVOKED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_REVOKED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_STRICT, TLS_CA_DIR } } }, { "/connector/cert-verification/ssl/revoked/lenient/fail", QUIET, { S_WOCKY_TLS_CERT_ERROR, WOCKY_TLS_CERT_REVOKED, -1 }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_REVOKED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { TLS_REQUIRED, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT, TLS_CA_DIR } } }, /* ********************************************************************* */ /* certificate non-verification tests */ { "/connector/cert-nonverification/tls/nohost/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1 } } }, { "/connector/cert-nonverification/tls/host/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "thud.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { "thud.org", 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/nohost/ok/name-mismatch", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { "tomato-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/host/ok/name-mismatch", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "tomato-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { "tomato-juice.org", 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/expired/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_EXPIRED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/inactive/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_NOT_YET }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/selfsigned/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_SELFSIGN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/tls/unknown/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, CONNECTOR_OK }, { "moose", "something" }, PORT_XMPP, CERT_UNKNOWN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, STARTTLS, CERT_CHECK_LENIENT } } }, /* ********************************************************************* */ /* as above but with legacy ssl */ { "/connector/cert-nonverification/ssl/nohost/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/host/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "weasel-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@thud.org", "something", PLAIN, TLS }, { "weasel-juice.org", PORT_XMPP, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/nohost/ok/name-mismatch", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { "tomato-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/host/ok/name-mismatch", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP }, { NULL, 0, "tomato-juice.org", REACHABLE, NULL }, { PLAINTEXT_OK, { "moose@tomato-juice.org", "something", PLAIN, TLS }, { "tomato-juice.org", 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/expired/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_EXPIRED }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/inactive/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_NOT_YET }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/selfsigned/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_SELFSIGN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, { "/connector/cert-nonverification/ssl/unknown/ok", QUIET, { S_NO_ERROR, }, { { TLS, NULL }, { SERVER_PROBLEM_NO_PROBLEM, { XMPP_PROBLEM_OLD_SSL, OK, OK, OK, OK } }, { "moose", "something" }, PORT_XMPP, CERT_UNKNOWN }, { "weasel-juice.org", PORT_XMPP, "thud.org", REACHABLE, UNREACHABLE }, { PLAINTEXT_OK, { "moose@weasel-juice.org", "something", PLAIN, TLS }, { NULL, 0, XMPP_V1, OLD_SSL, CERT_CHECK_LENIENT } } }, /* we are done, cap the list: */ { NULL } }; /* ************************************************************************* */ #define STRING_OK(x) (((x) != NULL) && (*x != '\0')) static void setup_dummy_dns_entries (const test_t *test) { TestResolver *tr = TEST_RESOLVER (kludged); guint port = test->dns.port ? test->dns.port : PORT_XMPP; const char *domain = test->dns.srv; const char *host = test->dns.host; const char *addr = test->dns.addr; const char *s_ip = test->dns.srvhost; test_resolver_reset (tr); if (STRING_OK (domain) && STRING_OK (host)) test_resolver_add_SRV (tr, "xmpp-client", "tcp", domain, host, port); if (STRING_OK (domain) && STRING_OK (s_ip)) test_resolver_add_A (tr, domain, s_ip); if (STRING_OK (host) && STRING_OK (addr)) test_resolver_add_A (tr, host, addr); test_resolver_add_A (tr, INVISIBLE_HOST, UNREACHABLE); test_resolver_add_A (tr, VISIBLE_HOST, REACHABLE); } /* ************************************************************************* */ /* Dummy XMPP server */ static void start_dummy_xmpp_server (ServerParameters *srv); static gboolean client_connected (GIOChannel *channel, GIOCondition cond, gpointer data) { ServerParameters *srv = data; struct sockaddr_in client; socklen_t clen = sizeof (client); int ssock = g_io_channel_unix_get_fd (channel); int csock = accept (ssock, (struct sockaddr *) &client, &clen); GSocket *gsock = g_socket_new_from_fd (csock, NULL); ConnectorProblem *cproblem = &srv->problem.conn; GSocketConnection *gconn; if (csock < 0) { perror ("accept() failed"); g_warning ("accept() failed on socket that should have been ready."); return TRUE; } if (!srv->features.tls) cproblem->xmpp |= XMPP_PROBLEM_NO_TLS; gconn = g_object_new (G_TYPE_SOCKET_CONNECTION, "socket", gsock, NULL); g_object_unref (gsock); srv->server = test_connector_server_new (G_IO_STREAM (gconn), srv->features.auth_mech, srv->auth.user, srv->auth.pass, srv->features.version, cproblem, srv->problem.sasl, srv->cert); g_object_unref (gconn); /* Recursively start extra servers */ if (srv->extra_server != NULL) { test_connector_server_set_other_host (srv->server, REACHABLE, srv->extra_server->port); start_dummy_xmpp_server (srv->extra_server); } test_connector_server_start (srv->server); srv->watch = 0; return FALSE; } static void start_dummy_xmpp_server (ServerParameters *srv) { int ssock; int reuse = 1; struct sockaddr_in server; int res = -1; guint port = srv->port; if (port == 0) return; memset (&server, 0, sizeof (server)); server.sin_family = AF_INET; /* mingw doesn't support aton or pton so using more portable inet_addr */ server.sin_addr.s_addr = inet_addr ((const char * ) REACHABLE); server.sin_port = htons (port); ssock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, (const char *) &reuse, sizeof (reuse)); #ifdef G_OS_UNIX setsockopt (ssock, IPPROTO_TCP, TCP_NODELAY, (const char *) &reuse, sizeof (reuse)); #endif res = bind (ssock, (struct sockaddr *) &server, sizeof (server)); if (res != 0) { int code = errno; char *err = g_strdup_printf ("bind to " REACHABLE ":%d failed", port); perror (err); g_free (err); exit (code); } res = listen (ssock, 1024); if (res != 0) { int code = errno; char *err = g_strdup_printf ("listen on " REACHABLE ":%d failed", port); perror (err); g_free (err); exit (code); } srv->channel = g_io_channel_unix_new (ssock); g_io_channel_set_flags (srv->channel, G_IO_FLAG_NONBLOCK, NULL); srv->watch = g_io_add_watch (srv->channel, G_IO_IN|G_IO_PRI, client_connected, srv); g_io_channel_set_close_on_unref (srv->channel, TRUE); return; } /* ************************************************************************* */ static void test_server_teardown_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GMainLoop *loop = user_data; g_assert (test_connector_server_teardown_finish ( TEST_CONNECTOR_SERVER (source), result, NULL)); g_main_loop_quit (loop); } static gboolean test_server_idle_quit_loop_cb (GMainLoop *loop) { g_main_loop_quit (loop); return G_SOURCE_REMOVE; } static void test_server_teardown (test_t *test, ServerParameters *srv) { /* Recursively teardown extra servers */ if (srv->extra_server != NULL) test_server_teardown (test, srv->extra_server); srv->extra_server = NULL; if (srv->server != NULL) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); if (test->result.used_mech == NULL) { test->result.used_mech = g_strdup ( test_connector_server_get_used_mech (srv->server)); } /* let the server dispatch any pending events before * forcing it to tear down */ g_idle_add ((GSourceFunc) test_server_idle_quit_loop_cb, loop); g_main_loop_run (loop); /* Run until server is down */ test_connector_server_teardown (srv->server, test_server_teardown_cb, loop); g_main_loop_run (loop); g_clear_object (&srv->server); } if (srv->watch != 0) g_source_remove (srv->watch); srv->watch = 0; if (srv->channel != NULL) g_io_channel_unref (srv->channel); srv->channel = NULL; } static void test_done (GObject *source, GAsyncResult *res, gpointer data) { test_t *test = data; WockyConnector *wcon = WOCKY_CONNECTOR (source); WockyXmppConnection *conn = NULL; error = NULL; switch (test->client.op) { case OP_CONNECT: conn = wocky_connector_connect_finish (wcon, res, &test->result.jid, &test->result.sid, &error); test->ok = (conn != NULL); break; case OP_REGISTER: conn = wocky_connector_register_finish (wcon, res, &test->result.jid, &test->result.sid, &error); test->ok = (conn != NULL); break; case OP_CANCEL: test->ok = wocky_connector_unregister_finish (wcon, res, &error); break; } if (conn != NULL) test->result.xmpp = g_object_ref (conn); test_server_teardown (test, &test->server_parameters); g_main_loop_quit (mainloop); } typedef void (*test_func) (gconstpointer); #ifdef G_OS_UNIX static void connection_established_cb (WockyConnector *connector, GSocketConnection *conn, gpointer user_data) { GSocket *sock = g_socket_connection_get_socket (conn); gint fd, flag = 1; fd = g_socket_get_fd (sock); setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (const char *) &flag, sizeof (flag)); } #endif static gboolean start_test (gpointer data) { test_t *test = data; if (test->client.setup != NULL) (test->client.setup) (test); switch (test->client.op) { case OP_CONNECT: wocky_connector_connect_async (test->connector, NULL, test_done, data); break; case OP_REGISTER: wocky_connector_register_async (test->connector, NULL, test_done, data); break; case OP_CANCEL: wocky_connector_unregister_async (test->connector, NULL, test_done, data); break; } return FALSE; } static void run_test (gpointer data) { WockyConnector *wcon = NULL; WockyTLSHandler *handler; test_t *test = data; struct stat dummy; gchar *base; char *path; const gchar *ca; /* clean up any leftover messes from previous tests */ /* unlink the sasl db tmpfile, it will cause a deadlock */ base = g_get_current_dir (); path = g_strdup_printf ("%s/__db.%s", base, SASL_DB_NAME); g_free (base); g_assert ((g_stat (path, &dummy) != 0) || (g_unlink (path) == 0)); g_free (path); /* end of cleanup block */ start_dummy_xmpp_server (&test->server_parameters); setup_dummy_dns_entries (test); ca = test->client.options.ca ? test->client.options.ca : TLS_CA_CRT_FILE; /* insecure tls cert/etc not yet implemented */ handler = wocky_tls_handler_new (test->client.options.lax_ssl); wcon = g_object_new ( WOCKY_TYPE_CONNECTOR, "jid" , test->client.auth.jid, "password" , test->client.auth.pass, "xmpp-server" , test->client.options.host, "xmpp-port" , test->client.options.port, "tls-required" , test->client.require_tls, "encrypted-plain-auth-ok" , !test->client.auth.secure, /* this refers to PLAINTEXT vs CRYPT, not PLAIN vs DIGEST */ "plaintext-auth-allowed" , !test->client.auth.tls, "legacy" , test->client.options.jabber, "old-ssl" , test->client.options.ssl, "tls-handler" , handler, NULL); /* Make sure we only use the test CAs, not system-wide ones. */ wocky_tls_handler_forget_cas (handler); g_assert (wocky_tls_handler_get_cas (handler) == NULL); /* check if the cert paths are valid */ g_assert (g_file_test (TLS_CA_CRT_FILE, G_FILE_TEST_EXISTS)); wocky_tls_handler_add_ca (handler, ca); /* not having a CRL can expose a bug in the openssl error handling * (basically we get 'CRL not fetched' instead of 'Expired'): * The bug has been fixed, but we can keep checking for it by * dropping the CRLs when the test is for an expired cert */ if (test->server_parameters.cert != CERT_EXPIRED) wocky_tls_handler_add_crl (handler, TLS_CRL_DIR); g_object_unref (handler); test->connector = wcon; g_idle_add (start_test, test); #ifdef G_OS_UNIX /* set TCP_NODELAY as soon as possible */ g_signal_connect (test->connector, "connection-established", G_CALLBACK (connection_established_cb), NULL); #endif g_main_loop_run (mainloop); if (test->result.domain == S_NO_ERROR) { if (error != NULL) fprintf (stderr, "Error: %s.%d: %s\n", g_quark_to_string (error->domain), error->code, error->message); g_assert_no_error (error); if (test->client.op == OP_CANCEL) { g_assert (test->ok == TRUE); g_assert (test->result.xmpp == NULL); } else { g_assert (test->result.xmpp != NULL); /* make sure we selected the right auth mechanism */ if (test->result.mech != NULL) { g_assert_cmpstr (test->result.mech, ==, test->result.used_mech); } /* we got a JID back, I hope */ g_assert (test->result.jid != NULL); g_assert (*test->result.jid != '\0'); g_free (test->result.jid); /* we got a SID back, I hope */ g_assert (test->result.sid != NULL); g_assert (*test->result.sid != '\0'); g_free (test->result.sid); } /* property get/set functionality */ if (!strcmp (test->desc, CONNECTOR_INTERNALS_TEST)) { int i; gchar *identity, *session_id, *resource; WockyConnector *tmp = wocky_connector_new ("foo@bar.org", "abc", "xyz", NULL, NULL); WockyStanza *feat = NULL; gboolean jabber; gboolean oldssl; XmppProblem xproblem = test->server_parameters.problem.conn.xmpp; const gchar *prop = NULL; const gchar *str_prop[] = { "jid", "password", "xmpp-server", "email", NULL }; const gchar *str_vals[] = { "abc", "PASSWORD", "xmpp.server", "e@org", NULL }; const gchar *boolprop[] = { "plaintext-auth-allowed", "encrypted-plain-auth-ok", "tls-required", NULL }; g_object_get (wcon, "identity", &identity, "features", &feat, NULL); g_assert (identity != NULL); g_assert (*identity != '\0'); g_assert (feat != NULL); g_assert (G_OBJECT_TYPE (feat) == WOCKY_TYPE_STANZA); g_free (identity); g_object_unref (feat); identity = NULL; g_object_get (wcon, "session-id", &session_id, NULL); g_assert (session_id != NULL); g_assert (*session_id != '\0'); g_free (session_id); g_object_get (wcon, "resource", &resource, NULL); /* TODO: really? :resource gets updated to contain the actual * post-bind resource, but perhaps :resource should be updated too? */ g_assert_cmpstr (resource, ==, NULL); g_free (resource); g_object_get (wcon, "legacy", &jabber, "old-ssl", &oldssl, NULL); g_assert (jabber == (gboolean)(xproblem & XMPP_PROBLEM_OLD_SERVER)); g_assert (oldssl == (gboolean)(xproblem & XMPP_PROBLEM_OLD_SSL)); for (i = 0, prop = str_prop[0]; prop; prop = str_prop[++i]) { gchar *val = NULL; g_object_set (tmp, prop, str_vals[i], NULL); g_object_get (tmp, prop, &val, NULL); g_assert (!strcmp (val, str_vals[i])); g_assert (val != str_vals[i]); g_free (val); } for (i = 0, prop = boolprop[0]; prop; prop = boolprop[++i]) { gboolean val; g_object_set (tmp, prop, TRUE, NULL); g_object_get (tmp, prop, &val, NULL); g_assert (val); g_object_set (tmp, prop, FALSE, NULL); g_object_get (tmp, prop, &val, NULL); g_assert (!val); } g_object_set (tmp, "xmpp-port", 31415, NULL); g_object_get (tmp, "xmpp-port", &i, NULL); g_assert (i == 31415); g_object_unref (tmp); } } else { g_assert (test->result.xmpp == NULL); if (test->result.domain != S_ANY_ERROR) { /* We want the error to match either of result.code or * result.fallback_code, but don't care which. * The expected error domain is the same for either code. */ if (error->code == test->result.fallback_code) g_assert_error (error, map_static_domain (test->result.domain), test->result.fallback_code); else g_assert_error (error, map_static_domain (test->result.domain), test->result.code); } } if (wcon != NULL) g_object_unref (wcon); if (error != NULL) g_error_free (error); if (test->result.xmpp != NULL) g_object_unref (test->result.xmpp); g_free (test->result.used_mech); error = NULL; } int main (int argc, char **argv) { int i; gchar *base; gchar *path = NULL; struct stat dummy; int result; test_init (argc, argv); /* hook up the fake DNS resolver that lets us divert A and SRV queries * * into our local cache before asking the real DNS */ original = g_resolver_get_default (); kludged = g_object_new (TEST_TYPE_RESOLVER, "real-resolver", original, NULL); g_resolver_set_default (kludged); /* unlink the sasl db, we want to test against a fresh one */ base = g_get_current_dir (); path = g_strdup_printf ("%s/%s", base, SASL_DB_NAME); g_free (base); g_assert ((g_stat (path, &dummy) != 0) || (g_unlink (path) == 0)); g_free (path); mainloop = g_main_loop_new (NULL, FALSE); #ifdef HAVE_LIBSASL2 for (i = 0; tests[i].desc != NULL; i++) g_test_add_data_func (tests[i].desc, &tests[i], (test_func)run_test); #else g_message ("libsasl2 not found: skipping MD5 SASL tests"); for (i = 0; tests[i].desc != NULL; i++) { if (!wocky_strdiff (tests[i].result.mech, "DIGEST-MD5")) continue; g_test_add_data_func (tests[i].desc, &tests[i], (test_func)run_test); } #endif result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-sasl-utils-test.c0000644000175000017500000001315512735676345026335 0ustar00gkiagiagkiagia00000000000000/* * wocky-sasl-utils-test.c - Test sasl utilities * Copyright (C) 2010 Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include typedef struct { guint8 *key; gsize key_len; guint8 *data; gsize data_len; guint8 *result; } digest_test; /* HMAC-SHA1 test vectors as per RFC 2202 */ /* Test 1 */ guint8 key_sha1_test1[] = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }; guint8 result_sha1_test1[] = { 0xb6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64, 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, 0xf1, 0x46, 0xbe, 0x00 }; /* Test 2 */ guint8 result_sha1_test2[] = { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, 0xd2, 0x74, 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, 0x25, 0x9a, 0x7c, 0x79 }; /* Test 3 */ guint8 key_sha1_test3[] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa }; guint8 data_sha1_test3[] = { 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd }; guint8 result_sha1_test3[] = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd, 0x91, 0xa3, 0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f, 0x63, 0xf1, 0x75, 0xd3 }; /* Test 4 */ guint8 key_sha1_test4[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 }; guint8 data_sha1_test4[] = { 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd }; guint8 result_sha1_test4[] = { 0x4c, 0x90, 0x07, 0xf4, 0x02, 0x62, 0x50, 0xc6, 0xbc, 0x84, 0x14, 0xf9, 0xbf, 0x50, 0xc8, 0x6c, 0x2d, 0x72, 0x35, 0xda }; /* Test 5 */ guint8 key_sha1_test5[] = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }; guint8 result_sha1_test5[] = { 0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2, 0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04 }; /* Test 6 & 7*/ guint8 key_sha1_test6_7[] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa }; guint8 result_sha1_test6[] = { 0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, 0x95, 0x70, 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12 }; guint8 result_sha1_test7[] = { 0xe8, 0xe9, 0x9d, 0xf, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b, 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x8, 0xbb, 0xff, 0x1a, 0x91 }; digest_test hmac_sha1_tests[] = { { key_sha1_test1, 20, (guint8 *) "Hi There", 8, result_sha1_test1 }, { (guint8 *) "Jefe", 4, (guint8 *) "what do ya want for nothing?", 28, result_sha1_test2 }, { key_sha1_test3, 20, data_sha1_test3, 50, result_sha1_test3 }, { key_sha1_test4, 25, data_sha1_test4, 50, result_sha1_test4 }, { key_sha1_test5, 20, (guint8 *) "Test With Truncation", 20, result_sha1_test5 }, { key_sha1_test6_7, 80, (guint8 *) "Test Using Larger Than Block-Size Key - Hash Key First", 54, result_sha1_test6 }, { key_sha1_test6_7, 80, (guint8 *) "Test Using Larger Than Block-Size Key and Larger" \ " Than One Block-Size Data", 73, result_sha1_test7, }, { NULL, 0, NULL, 0, NULL }, }; static void test_sasl_utils_hmac_sha1 (digest_test *t) { GByteArray *result = sasl_calculate_hmac_sha1 (t->key, t->key_len, t->data, t->data_len); int i; for (i = 0; i < g_checksum_type_get_length (G_CHECKSUM_SHA1); i++) g_assert_cmphex (result->data[i], ==, t->result[i]); g_byte_array_unref (result); } int main (int argc, char **argv) { int i; g_test_init (&argc, &argv, NULL); for (i = 0 ; hmac_sha1_tests[i].key_len > 0 ; i++) { gchar *name = g_strdup_printf ("/sasl-utils/hmac-sha1-%d", i + 1); g_test_add_data_func (name, hmac_sha1_tests + i, (void (*)(const void *)) test_sasl_utils_hmac_sha1); g_free (name); } return g_test_run (); } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-stream.h0000644000175000017500000000661612735676345025541 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-stream.h - Header for WockyTestStream * Copyright (C) 2009 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __WOCKY_TEST_STREAM_H__ #define __WOCKY_TEST_STREAM_H__ #include #include G_BEGIN_DECLS typedef struct _WockyTestStream WockyTestStream; typedef struct _WockyTestStreamClass WockyTestStreamClass; typedef struct _WockyTestStreamPrivate WockyTestStreamPrivate; struct _WockyTestStreamClass { GObjectClass parent_class; }; struct _WockyTestStream { GObject parent; GIOStream *stream0; GIOStream *stream1; GInputStream *stream0_input; GOutputStream *stream0_output; GInputStream *stream1_input; GOutputStream *stream1_output; WockyTestStreamPrivate *priv; }; GType wocky_test_stream_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_TEST_STREAM \ (wocky_test_stream_get_type ()) #define WOCKY_TEST_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_TEST_STREAM, WockyTestStream)) #define WOCKY_TEST_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_TEST_STREAM, WockyTestStreamClass)) #define WOCKY_IS_TEST_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_TEST_STREAM)) #define WOCKY_IS_TEST_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_TEST_STREAM)) #define WOCKY_TEST_STREAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_TEST_STREAM, WockyTestStreamClass)) void wocky_test_input_stream_set_read_error (GInputStream *stream); void wocky_test_output_stream_set_write_error (GOutputStream *stream); void wocky_test_stream_cork (GInputStream *stream, gboolean cork); typedef enum { /* one read can have data from two writes, but never has all the data * from one specific write */ WOCK_TEST_STREAM_READ_COMBINE_SLICE = 0, /* one read reads as much as is available */ WOCK_TEST_STREAM_READ_COMBINE, /* one read reads only data from one write */ WOCK_TEST_STREAM_READ_EXACT, } WockyTestStreamReadMode; typedef enum { /* all writes are only half-done, default */ WOCKY_TEST_STREAM_WRITE_INCOMPLETE = 0, /* Always succeed in writing everything */ WOCKY_TEST_STREAM_WRITE_COMPLETE = 1, } WockyTestStreamWriteMode; void wocky_test_stream_set_mode (GInputStream *stream, WockyTestStreamReadMode mode); void wocky_test_stream_set_write_mode (GOutputStream *stream, WockyTestStreamWriteMode mode); typedef void (*WockyTestStreamDirectReadCb) (const gchar *buff, gsize len, gpointer user_data); void wocky_test_stream_set_direct_read_callback (GInputStream *stream, WockyTestStreamDirectReadCb cb, gpointer user_data); G_END_DECLS #endif /* #ifndef __WOCKY_TEST_STREAM_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-helper.h0000644000175000017500000000575212735676345025525 0ustar00gkiagiagkiagia00000000000000#ifndef __WOCKY_TEST_HELPER_H__ #define __WOCKY_TEST_HELPER_H__ G_BEGIN_DECLS #include #include "wocky-test-stream.h" typedef struct { GMainLoop *loop; gboolean parsed_stanza; GQueue *expected_stanzas; WockyXmppConnection *in; WockyXmppConnection *out; WockyPorter *sched_in; WockyPorter *sched_out; WockySession *session_in; WockySession *session_out; WockyTestStream *stream; guint outstanding; GCancellable *cancellable; gulong timeout_id; } test_data_t; test_data_t * setup_test (void); test_data_t * setup_test_with_timeout (guint timeout); test_data_t * setup_test_with_jids (const gchar *in_jid, const gchar *out_jid); void teardown_test (test_data_t *data); void test_wait_pending (test_data_t *test); gboolean test_timeout_cb (gpointer data); void test_open_connection (test_data_t *test); void test_close_connection (test_data_t *test); void test_open_both_connections (test_data_t *test); void test_close_porter (test_data_t *test); void test_expected_stanza_received (test_data_t *test, WockyStanza *stanza); void test_close_both_porters (test_data_t *test); void test_cancel_in_idle (GCancellable *cancellable); #define test_assert_nodes_equal(n1, n2) \ G_STMT_START { \ if (!wocky_node_equal ((n1), (n2))) \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ g_strdup_printf ("Nodes not equal:\n%s\n\n%s", \ wocky_node_to_string (n1), \ wocky_node_to_string (n2))); \ } G_STMT_END #define test_assert_stanzas_equal(s1, s2) \ test_assert_nodes_equal (wocky_stanza_get_top_node (s1), \ wocky_stanza_get_top_node (s2)) #define test_assert_nodes_not_equal(n1, n2) \ G_STMT_START { \ if (wocky_node_equal ((n1), (n2))) \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ g_strdup_printf ("Nodes unexpectedly equal:\n%s\n\n%s", \ wocky_node_to_string (n1), \ wocky_node_to_string (n2))); \ } G_STMT_END #define test_assert_stanzas_not_equal(s1, s2) \ test_assert_nodes_not_equal (wocky_stanza_get_top_node (s1), \ wocky_stanza_get_top_node (s2)) /* Slightly evil macro that tests that two stanzas are equal, except that if * one has an id and the other does not this is not considered a difference. It * modifies the stanzas because I am lazy. */ #define test_assert_stanzas_equal_no_id(s1, s2) \ G_STMT_START { \ WockyNode *n1 = wocky_stanza_get_top_node (s1); \ WockyNode *n2 = wocky_stanza_get_top_node (s2); \ const gchar *_id1 = wocky_node_get_attribute (n1, "id"); \ const gchar *_id2 = wocky_node_get_attribute (n2, "id"); \ if (_id1 == NULL && _id2 != NULL) \ wocky_node_set_attribute (n1, "id", _id2); \ else if (_id1 != NULL && _id2 == NULL) \ wocky_node_set_attribute (n2, "id", _id1); \ test_assert_stanzas_equal (s1, s2); \ } G_STMT_END void test_init (int argc, char **argv); void test_deinit (void); G_END_DECLS #endif /* #ifndef __WOCKY_TEST_HELPER_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-connector-server.h0000644000175000017500000001412712735676345027540 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-sasl-auth-server.h - Header for TestSaslAuthServer * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TEST_CONNECTOR_SERVER_H__ #define __TEST_CONNECTOR_SERVER_H__ #include #include #include "wocky-test-sasl-auth-server.h" G_BEGIN_DECLS #define CONNPROBLEM(x) (0x1 << x) typedef enum { XMPP_PROBLEM_NONE = 0, XMPP_PROBLEM_BAD_XMPP = CONNPROBLEM (0), XMPP_PROBLEM_NO_TLS = CONNPROBLEM (1), XMPP_PROBLEM_TLS_REFUSED = CONNPROBLEM (2), XMPP_PROBLEM_FEATURES = CONNPROBLEM (3), XMPP_PROBLEM_OLD_SERVER = CONNPROBLEM (4), XMPP_PROBLEM_WEAK_SSL = CONNPROBLEM (5), XMPP_PROBLEM_OLD_SSL = CONNPROBLEM (6), XMPP_PROBLEM_OTHER_HOST = CONNPROBLEM (7), XMPP_PROBLEM_TLS_LOAD = CONNPROBLEM (8), XMPP_PROBLEM_NO_SESSION = CONNPROBLEM (10), XMPP_PROBLEM_CANNOT_BIND = CONNPROBLEM (11), XMPP_PROBLEM_OLD_AUTH_FEATURE = CONNPROBLEM (12), XMPP_PROBLEM_SEE_OTHER_HOST = CONNPROBLEM (13), } XmppProblem; typedef enum { BIND_PROBLEM_NONE = 0, BIND_PROBLEM_INVALID = CONNPROBLEM(0), BIND_PROBLEM_DENIED = CONNPROBLEM(1), BIND_PROBLEM_CONFLICT = CONNPROBLEM(2), BIND_PROBLEM_CLASH = CONNPROBLEM(3), BIND_PROBLEM_REJECTED = CONNPROBLEM(4), BIND_PROBLEM_FAILED = CONNPROBLEM(5), BIND_PROBLEM_NO_JID = CONNPROBLEM(6), BIND_PROBLEM_NONSENSE = CONNPROBLEM(7), } BindProblem; typedef enum { SESSION_PROBLEM_NONE = 0, SESSION_PROBLEM_NO_SESSION = CONNPROBLEM(0), SESSION_PROBLEM_FAILED = CONNPROBLEM(1), SESSION_PROBLEM_DENIED = CONNPROBLEM(2), SESSION_PROBLEM_CONFLICT = CONNPROBLEM(3), SESSION_PROBLEM_REJECTED = CONNPROBLEM(4), SESSION_PROBLEM_NONSENSE = CONNPROBLEM(5), } SessionProblem; typedef enum { SERVER_DEATH_NONE = 0, SERVER_DEATH_SERVER_START = CONNPROBLEM(0), SERVER_DEATH_CLIENT_OPEN = CONNPROBLEM(1), SERVER_DEATH_SERVER_OPEN = CONNPROBLEM(2), SERVER_DEATH_FEATURES = CONNPROBLEM(3), SERVER_DEATH_TLS_NEG = CONNPROBLEM(4), } ServerDeath; typedef enum { JABBER_PROBLEM_NONE = 0, JABBER_PROBLEM_AUTH_REJECT = CONNPROBLEM (0), JABBER_PROBLEM_AUTH_BIND = CONNPROBLEM (1), JABBER_PROBLEM_AUTH_PARTIAL = CONNPROBLEM (2), JABBER_PROBLEM_AUTH_FAILED = CONNPROBLEM (3), JABBER_PROBLEM_AUTH_STRANGE = CONNPROBLEM (4), JABBER_PROBLEM_AUTH_NIH = CONNPROBLEM (5), JABBER_PROBLEM_AUTH_NONSENSE = CONNPROBLEM (6), } JabberProblem; typedef enum { XEP77_PROBLEM_NONE = 0, XEP77_PROBLEM_ALREADY = CONNPROBLEM(0), XEP77_PROBLEM_FAIL_CONFLICT = CONNPROBLEM(1), XEP77_PROBLEM_FAIL_REJECTED = CONNPROBLEM(2), XEP77_PROBLEM_NOT_AVAILABLE = CONNPROBLEM(3), XEP77_PROBLEM_QUERY_NONSENSE = CONNPROBLEM(4), XEP77_PROBLEM_QUERY_ALREADY = CONNPROBLEM(5), XEP77_PROBLEM_NO_ARGS = CONNPROBLEM(6), XEP77_PROBLEM_EMAIL_ARG = CONNPROBLEM(7), XEP77_PROBLEM_STRANGE_ARG = CONNPROBLEM(8), XEP77_PROBLEM_CANCEL_REJECTED = CONNPROBLEM(9), XEP77_PROBLEM_CANCEL_DISABLED = CONNPROBLEM(10), XEP77_PROBLEM_CANCEL_FAILED = CONNPROBLEM(11), XEP77_PROBLEM_CANCEL_STREAM = CONNPROBLEM(12), } XEP77Problem; typedef enum { CERT_STANDARD, CERT_EXPIRED, CERT_NOT_YET, CERT_UNKNOWN, CERT_SELFSIGN, CERT_REVOKED, CERT_WILDCARD, CERT_BADWILD, CERT_NONE, } CertSet; typedef struct { XmppProblem xmpp; BindProblem bind; SessionProblem session; ServerDeath death; JabberProblem jabber; XEP77Problem xep77; } ConnectorProblem; typedef struct _TestConnectorServer TestConnectorServer; typedef struct _TestConnectorServerClass TestConnectorServerClass; typedef struct _TestConnectorServerPrivate TestConnectorServerPrivate; struct _TestConnectorServerClass { GObjectClass parent_class; }; struct _TestConnectorServer { GObject parent; TestConnectorServerPrivate *priv; }; GType test_connector_server_get_type (void); /* TYPE MACROS */ #define TEST_TYPE_CONNECTOR_SERVER \ (test_connector_server_get_type ()) #define TEST_CONNECTOR_SERVER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_CONNECTOR_SERVER, \ TestConnectorServer)) #define TEST_CONNECTOR_SERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TEST_TYPE_CONNECTOR_SERVER, \ TestConnectorServerClass)) #define TEST_IS_CONNECTOR_SERVER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TEST_TYPE_CONNECTOR_SERVER)) #define TEST_IS_CONNECTOR_SERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TEST_TYPE_CONNECTOR_SERVER)) #define TEST_CONNECTOR_SERVER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_CONNECTOR_SERVER, \ TestConnectorServerClass)) TestConnectorServer * test_connector_server_new (GIOStream *stream, gchar *mech, const gchar *user, const gchar *pass, const gchar *version, ConnectorProblem *problem, ServerProblem sasl_problem, CertSet cert); void test_connector_server_start (TestConnectorServer *self); void test_connector_server_set_other_host (TestConnectorServer *self, const gchar *host, guint port); void test_connector_server_teardown (TestConnectorServer *self, GAsyncReadyCallback callback, gpointer user_data); gboolean test_connector_server_teardown_finish (TestConnectorServer *self, GAsyncResult *result, GError *error); const gchar *test_connector_server_get_used_mech (TestConnectorServer *self); G_END_DECLS #endif /* #ifndef __TEST_CONNECTOR_SERVER_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-data-form-test.c0000644000175000017500000006651213011057406026067 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_new_from_form (void) { WockyStanza *stanza; WockyNode *node; WockyDataForm *form; GError *error = NULL; stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ,WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, NULL); /* node doesn't contain a form */ form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), &error); g_assert (form == NULL); g_assert_error (error, WOCKY_DATA_FORM_ERROR, WOCKY_DATA_FORM_ERROR_NOT_FORM); g_clear_error (&error); /* add 'x' node */ node = wocky_node_add_child_ns (wocky_stanza_get_top_node (stanza), "x", WOCKY_XMPP_NS_DATA); /* the x node doesn't have a 'type' attribute */ form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), &error); g_assert (form == NULL); g_assert_error (error, WOCKY_DATA_FORM_ERROR, WOCKY_DATA_FORM_ERROR_WRONG_TYPE); g_clear_error (&error); /* set wrong type */ wocky_node_set_attribute (node, "type", "badger"); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), &error); g_assert (form == NULL); g_assert_error (error, WOCKY_DATA_FORM_ERROR, WOCKY_DATA_FORM_ERROR_WRONG_TYPE); g_clear_error (&error); /* set the right type */ wocky_node_set_attribute (node, "type", "form"); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), &error); g_assert (form != NULL); g_assert_no_error (error); g_object_unref (form); g_object_unref (stanza); } static WockyStanza * create_bot_creation_form_stanza (void) { /* This stanza is inspired from Example 2 of XEP-0004: Data Forms */ return wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ,WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "form", '(', "title", '$', "My Title", ')', '(', "instructions", '$', "Badger", ')', /* hidden field */ '(', "field", '@', "type", "hidden", '@', "var", "FORM_TYPE", '(', "value", '$', "jabber:bot", ')', ')', /* fixed field */ '(', "field", '@', "type", "fixed", '(', "value", '$', "fixed value", ')', ')', /* text-single field */ '(', "field", '@', "type", "text-single", '@', "var", "botname", '@', "label", "The name of your bot", ')', /* field with no type. type='' is only a SHOULD; the default is * text-single */ '(', "field", '@', "var", "pseudonym", '@', "label", "Your bot's name at the weekend", ')', /* text-multi field */ '(', "field", '@', "type", "text-multi", '@', "var", "description", '@', "label", "Helpful description of your bot", ')', /* boolean field */ '(', "field", '@', "type", "boolean", '@', "var", "public", '@', "label", "Public bot?", '(', "required", ')', '(', "value", '$', "false", ')', ')', /* text-private field */ '(', "field", '@', "type", "text-private", '@', "var", "password", '@', "label", "Password for special access", ')', /* list-multi field */ '(', "field", '@', "type", "list-multi", '@', "var", "features", '@', "label", "What features will the bot support?", '(', "option", '@', "label", "Contests", '(', "value", '$', "contests", ')', ')', '(', "option", '@', "label", "News", '(', "value", '$', "news", ')', ')', '(', "option", '@', "label", "Polls", '(', "value", '$', "polls", ')', ')', '(', "option", '@', "label", "Reminders", '(', "value", '$', "reminders", ')', ')', '(', "option", '@', "label", "Search", '(', "value", '$', "search", ')', ')', '(', "value", '$', "news", ')', '(', "value", '$', "search", ')', ')', /* list-single field */ '(', "field", '@', "type", "list-single", '@', "var", "maxsubs", '@', "label", "Maximum number of subscribers", '(', "value", '$', "20", ')', '(', "option", '@', "label", "10", '(', "value", '$', "10", ')', ')', '(', "option", '@', "label", "20", '(', "value", '$', "20", ')', ')', '(', "option", '@', "label", "30", '(', "value", '$', "30", ')', ')', '(', "option", '@', "label", "50", '(', "value", '$', "50", ')', ')', '(', "option", '@', "label", "100", '(', "value", '$', "100", ')', ')', '(', "option", '@', "label", "None", '(', "value", '$', "none", ')', ')', ')', /* jid-multi field */ '(', "field", '@', "type", "jid-multi", '@', "var", "invitelist", '@', "label", "People to invite", '(', "desc", '$', "Tell friends", ')', ')', /* jid-single field */ '(', "field", '@', "type", "jid-single", '@', "var", "botjid", '@', "label", "The JID of the bot", ')', ')', NULL); } static void test_parse_form (void) { WockyStanza *stanza; WockyDataForm *form; GSList *l; /* used to check that fields are stored in the right order */ WockyDataFormField expected_types[] = { { WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN, "FORM_TYPE", NULL, NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_FIXED, NULL, NULL, NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE, "botname", "The name of your bot", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE, "pseudonym", "Your bot's name at the weekend", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_TEXT_MULTI, "description", "Helpful description of your bot", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_BOOLEAN, "public", "Public bot?", NULL, TRUE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_TEXT_PRIVATE, "password", "Password for special access", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_LIST_MULTI, "features", "What features will the bot support?", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_LIST_SINGLE, "maxsubs", "Maximum number of subscribers", NULL, FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_JID_MULTI, "invitelist", "People to invite", "Tell friends", FALSE, NULL, NULL, NULL }, { WOCKY_DATA_FORM_FIELD_TYPE_JID_SINGLE, "botjid", "The JID of the bot", NULL, FALSE, NULL, NULL, NULL }, }; guint i; WockyDataFormField *field; GStrv strv; WockyDataFormFieldOption features_options[] = { { "Contests", "contests" }, { "News", "news" }, { "Polls", "polls" }, { "Reminders", "reminders" }, { "Search", "search" }, }; WockyDataFormFieldOption maxsubs_options[] = { { "10", "10" }, { "20", "20" }, { "30", "30" }, { "50", "50" }, { "100", "100" }, { "None", "none" }, }; stanza = create_bot_creation_form_stanza (); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), NULL); g_assert (form != NULL); g_object_unref (stanza); g_assert_cmpstr (wocky_data_form_get_title (form), ==, "My Title"); g_assert_cmpstr (wocky_data_form_get_instructions (form), ==, "Badger"); g_assert_cmpuint (g_slist_length (form->fields_list), ==, 11); for (l = form->fields_list, i = 0; l != NULL; l = g_slist_next (l), i++) { field = l->data; g_assert (field != NULL); g_assert_cmpuint (field->type, ==, expected_types[i].type); g_assert_cmpstr (field->var, ==, expected_types[i].var); g_assert_cmpstr (field->label, ==, expected_types[i].label); g_assert_cmpstr (field->desc, ==, expected_types[i].desc); g_assert (field->required == expected_types[i].required); g_assert (field->value == NULL); } g_assert_cmpuint (g_hash_table_size (form->fields), ==, 10); /* check hidden field */ field = g_hash_table_lookup (form->fields, "FORM_TYPE"); g_assert (field != NULL); g_assert (G_VALUE_TYPE (field->default_value) == G_TYPE_STRING); g_assert_cmpstr (g_value_get_string (field->default_value), ==, "jabber:bot"); g_assert (field->options == NULL); /* check text-single field */ field = g_hash_table_lookup (form->fields, "botname"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); /* check implicitly text-single field */ field = g_hash_table_lookup (form->fields, "pseudonym"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); /* check text-multi field */ field = g_hash_table_lookup (form->fields, "description"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); /* check boolean field */ field = g_hash_table_lookup (form->fields, "public"); g_assert (field != NULL); g_assert (G_VALUE_TYPE (field->default_value) == G_TYPE_BOOLEAN); g_assert (!g_value_get_boolean (field->default_value)); g_assert (field->options == NULL); /* check text-private field */ field = g_hash_table_lookup (form->fields, "password"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); /* check list-multi field */ field = g_hash_table_lookup (form->fields, "features"); g_assert (field != NULL); g_assert (G_VALUE_TYPE (field->default_value) == G_TYPE_STRV); strv = g_value_get_boxed (field->default_value); g_assert_cmpuint (g_strv_length (strv), ==, 2); g_assert_cmpstr (strv[0], ==, "news"); g_assert_cmpstr (strv[1], ==, "search"); g_assert_cmpuint (g_slist_length (field->options), ==, 5); for (l = field->options, i = 0; l != NULL; l = g_slist_next (l), i++) { WockyDataFormFieldOption *option = l->data; g_assert_cmpstr (option->value, ==, features_options[i].value); g_assert_cmpstr (option->label, ==, features_options[i].label); } /* check list-single field */ field = g_hash_table_lookup (form->fields, "maxsubs"); g_assert (field != NULL); g_assert (G_VALUE_TYPE (field->default_value) == G_TYPE_STRING); g_assert_cmpstr (g_value_get_string (field->default_value), ==, "20"); g_assert_cmpuint (g_slist_length (field->options), ==, 6); for (l = field->options, i = 0; l != NULL; l = g_slist_next (l), i++) { WockyDataFormFieldOption *option = l->data; g_assert_cmpstr (option->value, ==, maxsubs_options[i].value); g_assert_cmpstr (option->label, ==, maxsubs_options[i].label); } /* check jid-multi field */ field = g_hash_table_lookup (form->fields, "invitelist"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); /* check boolean field */ field = g_hash_table_lookup (form->fields, "botjid"); g_assert (field != NULL); g_assert (field->default_value == NULL); g_assert (field->options == NULL); g_object_unref (form); } static void test_raw_value_contents (void) { WockyStanza *stanza; WockyDataForm *form; const gchar *description[] = { "Badger", "Mushroom", "Snake", NULL }; gboolean set_succeeded; /* Create fields without WockyNode to trigger this bug: * https://bugs.freedesktop.org/show_bug.cgi?id=43584 */ form = g_object_new (WOCKY_TYPE_DATA_FORM, NULL); g_assert (form != NULL); /* set text-single field */ set_succeeded = wocky_data_form_set_string (form, "botname", "The Jabber Google Bot", FALSE); g_assert (!set_succeeded); set_succeeded = wocky_data_form_set_string (form, "botname", "The Jabber Google Bot", TRUE); g_assert (set_succeeded); /* set text-multi field */ set_succeeded = wocky_data_form_set_strv (form, "description", description, FALSE); g_assert (!set_succeeded); set_succeeded = wocky_data_form_set_strv (form, "description", description, TRUE); g_assert (set_succeeded); /* set boolean field */ set_succeeded = wocky_data_form_set_boolean (form, "public", FALSE, FALSE); g_assert (!set_succeeded); set_succeeded = wocky_data_form_set_boolean (form, "public", FALSE, TRUE); g_assert (set_succeeded); stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, NULL); wocky_data_form_add_to_node (form, wocky_stanza_get_top_node (stanza)); g_object_unref (stanza); g_object_unref (form); } static void test_submit (void) { WockyStanza *stanza; WockyDataForm *form; WockyNode *x; GSList *l; const gchar *description[] = { "Badger", "Mushroom", "Snake", NULL }; const gchar *features[] = { "news", "search", NULL }; const gchar *invitees[] = { "juliet@example.org", "romeo@example.org", NULL }; gboolean set_succeeded; stanza = create_bot_creation_form_stanza (); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), NULL); g_assert (form != NULL); g_object_unref (stanza); /* set text-single field */ set_succeeded = wocky_data_form_set_string (form, "botname", "The Jabber Google Bot", FALSE); g_assert (set_succeeded); /* set text-multi field */ set_succeeded = wocky_data_form_set_strv (form, "description", description, FALSE); g_assert (set_succeeded); /* set boolean field */ set_succeeded = wocky_data_form_set_boolean (form, "public", FALSE, FALSE); g_assert (set_succeeded); /* set text-private field */ set_succeeded = wocky_data_form_set_string (form, "password", "S3cr1t", FALSE); g_assert (set_succeeded); /* set list-multi field */ set_succeeded = wocky_data_form_set_strv (form, "features", features, FALSE); g_assert (set_succeeded); /* set list-single field */ set_succeeded = wocky_data_form_set_string (form, "maxsubs", "20", FALSE); g_assert (set_succeeded); /* set jid-multi field */ set_succeeded = wocky_data_form_set_strv (form, "invitelist", invitees, FALSE); g_assert (set_succeeded); /* set jid-single field */ set_succeeded = wocky_data_form_set_string (form, "botjid", "bobot@example.org", FALSE); g_assert (set_succeeded); stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, NULL); wocky_data_form_submit (form, wocky_stanza_get_top_node (stanza)); x = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "x", WOCKY_XMPP_NS_DATA); g_assert (x != NULL); g_assert_cmpstr (wocky_node_get_attribute (x, "type"), ==, "submit"); for (l = x->children; l != NULL; l = g_slist_next (l)) { WockyNode *v, *node = l->data; const gchar *var, *type, *value = NULL; g_assert_cmpstr (node->name, ==, "field"); var = wocky_node_get_attribute (node, "var"); g_assert (var != NULL); type = wocky_node_get_attribute (node, "type"); v = wocky_node_get_child (node, "value"); if (v != NULL) value = v->content; if (!wocky_strdiff (var, "FORM_TYPE")) { g_assert_cmpstr (type, ==, "hidden"); g_assert_cmpstr (value, ==, "jabber:bot"); } else if (!wocky_strdiff (var, "botname")) { g_assert_cmpstr (type, ==, "text-single"); g_assert_cmpstr (value, ==, "The Jabber Google Bot"); } else if (!wocky_strdiff (var, "description")) { GSList *m; gboolean badger = FALSE, mushroom = FALSE, snake = FALSE; g_assert_cmpstr (type, ==, "text-multi"); for (m = node->children; m != NULL; m = g_slist_next (m)) { WockyNode *tmp = m->data; g_assert_cmpstr (tmp->name, ==, "value"); if (!wocky_strdiff (tmp->content, "Badger")) badger = TRUE; else if (!wocky_strdiff (tmp->content, "Mushroom")) mushroom = TRUE; else if (!wocky_strdiff (tmp->content, "Snake")) snake = TRUE; else g_assert_not_reached (); } g_assert (badger && mushroom && snake); } else if (!wocky_strdiff (var, "public")) { g_assert_cmpstr (type, ==, "boolean"); g_assert_cmpstr (value, ==, "0"); } else if (!wocky_strdiff (var, "password")) { g_assert_cmpstr (type, ==, "text-private"); g_assert_cmpstr (value, ==, "S3cr1t"); } else if (!wocky_strdiff (var, "features")) { GSList *m; gboolean news = FALSE, search = FALSE; g_assert_cmpstr (type, ==, "list-multi"); for (m = node->children; m != NULL; m = g_slist_next (m)) { WockyNode *tmp = m->data; g_assert_cmpstr (tmp->name, ==, "value"); if (!wocky_strdiff (tmp->content, "news")) news = TRUE; else if (!wocky_strdiff (tmp->content, "search")) search = TRUE; else g_assert_not_reached (); } g_assert (news && search); } else if (!wocky_strdiff (var, "maxsubs")) { g_assert_cmpstr (type, ==, "list-single"); g_assert_cmpstr (value, ==, "20"); } else if (!wocky_strdiff (var, "invitelist")) { GSList *m; gboolean juliet = FALSE, romeo = FALSE; g_assert_cmpstr (type, ==, "jid-multi"); for (m = node->children; m != NULL; m = g_slist_next (m)) { WockyNode *tmp = m->data; g_assert_cmpstr (tmp->name, ==, "value"); if (!wocky_strdiff (tmp->content, "juliet@example.org")) juliet = TRUE; else if (!wocky_strdiff (tmp->content, "romeo@example.org")) romeo = TRUE; else g_assert_not_reached (); } g_assert (juliet && romeo); } else if (!wocky_strdiff (var, "botjid")) { g_assert_cmpstr (type, ==, "jid-single"); g_assert_cmpstr (value, ==, "bobot@example.org"); } else g_assert_not_reached (); } g_object_unref (stanza); g_object_unref (form); } /* Test creating and submitting a form response blindly, without first asking * the server for the form fields. */ static void test_submit_blindly (void) { WockyDataForm *form = g_object_new (WOCKY_TYPE_DATA_FORM, NULL); const gchar * const the_xx[] = { "Romy", "Oliver", "Jamie", NULL }; gboolean succeeded; WockyStanza *stanza, *expected; /* We didn't actually parse a form, so it doesn't have any pre-defined * fields. Thus, the setters should all fail if we don't tell them to create * the fields if missing. */ succeeded = wocky_data_form_set_string (form, "band-name", "The XX", FALSE); g_assert (!succeeded); succeeded = wocky_data_form_set_strv (form, "band-members", the_xx, FALSE); g_assert (!succeeded); succeeded = wocky_data_form_set_boolean (form, "is-meh", TRUE, FALSE); g_assert (!succeeded); g_assert (form->fields_list == NULL); g_assert_cmpuint (0, ==, g_hash_table_size (form->fields)); /* Since the form doesn't have a FORM_TYPE yet, we should be able to set it. */ succeeded = wocky_data_form_set_type (form, "http://example.com/band-info"); g_assert (succeeded); /* But now that it does have one, we shouldn't be able to change it. */ succeeded = wocky_data_form_set_type (form, "stoats"); g_assert (!succeeded); /* If we forcibly create the fields we care about, setting them should * succeed, and they should show up when we submit the form! */ succeeded = wocky_data_form_set_string (form, "band-name", "The XX", TRUE); g_assert (succeeded); succeeded = wocky_data_form_set_strv (form, "band-members", the_xx, TRUE); g_assert (succeeded); succeeded = wocky_data_form_set_boolean (form, "is-meh", TRUE, TRUE); g_assert (succeeded); stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, NULL); wocky_data_form_submit (form, wocky_stanza_get_top_node (stanza)); expected = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "submit", '(', "field", '@', "type", "hidden", '@', "var", "FORM_TYPE", '(', "value", '$', "http://example.com/band-info", ')', ')', '(', "field", '@', "var", "band-name", '(', "value", '$', "The XX", ')', ')', '(', "field", '@', "var", "band-members", '(', "value", '$', "Romy", ')', '(', "value", '$', "Oliver", ')', '(', "value", '$', "Jamie", ')', ')', '(', "field", '@', "var", "is-meh", '(', "value", '$', "1", ')', ')', ')', NULL); test_assert_stanzas_equal_no_id (expected, stanza); g_object_unref (expected); g_object_unref (stanza); g_object_unref (form); } static WockyStanza * create_search_form_stanza (void) { /* This stanza is inspired from Example 6 of XEP-0004: Data Forms */ return wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ,WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "form", '(', "title", '$', "My Title", ')', '(', "instructions", '$', "Badger", ')', '(', "field", '@', "type", "text-single", '@', "var", "search_request", ')', ')', NULL); } static void test_parse_multi_result (void) { WockyStanza *stanza; WockyDataForm *form; GSList *l; gboolean item1 = FALSE, item2 = FALSE; stanza = create_search_form_stanza (); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), NULL); g_assert (form != NULL); g_object_unref (stanza); /* create the result stanza */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "result", '(', "title", '$', "Search result", ')', '(', "reported", '(', "field", '@', "var", "name", '@', "type", "text-single", ')', '(', "field", '@', "var", "url", '@', "type", "text-single", ')', ')', /* first item */ '(', "item", '(', "field", '@', "var", "name", '(', "value", '$', "name1", ')', ')', '(', "field", '@', "var", "url", '(', "value", '$', "url1", ')', ')', ')', /* second item */ '(', "item", '(', "field", '@', "var", "name", '(', "value", '$', "name2", ')', ')', '(', "field", '@', "var", "url", '(', "value", '$', "url2", ')', ')', ')', ')', NULL); g_assert (wocky_data_form_parse_result (form, wocky_stanza_get_top_node (stanza), NULL)); g_object_unref (stanza); g_assert_cmpuint (g_slist_length (form->results), ==, 2); for (l = form->results; l != NULL; l = g_slist_next (l)) { GSList *result = l->data, *m; gboolean name = FALSE, url = FALSE; for (m = result; m != NULL; m = g_slist_next (m)) { WockyDataFormField *field = m->data; if (!wocky_strdiff (field->var, "name")) { if (!wocky_strdiff (g_value_get_string (field->value), "name1")) item1 = TRUE; else if (!wocky_strdiff (g_value_get_string (field->value), "name2")) item2 = TRUE; else g_assert_not_reached (); name = TRUE; } else if (!wocky_strdiff (field->var, "url")) { if (item2) g_assert_cmpstr (g_value_get_string (field->value), ==, "url2"); else if (item1) g_assert_cmpstr (g_value_get_string (field->value), ==, "url1"); else g_assert_not_reached (); url = TRUE; } else g_assert_not_reached (); } g_assert (name && url); } g_assert (item1 && item2); g_object_unref (form); } static void test_parse_single_result (void) { WockyStanza *stanza; WockyDataForm *form; GSList *result, *l; gboolean form_type = FALSE, botname = FALSE; stanza = create_bot_creation_form_stanza (); form = wocky_data_form_new_from_form (wocky_stanza_get_top_node (stanza), NULL); g_assert (form != NULL); g_object_unref (stanza); /* create the result stanza */ stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, NULL, NULL, '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "result", /* hidden field */ '(', "field", '@', "type", "hidden", '@', "var", "FORM_TYPE", '(', "value", '$', "jabber:bot", ')', ')', /* text-single field */ '(', "field", '@', "type", "text-single", '@', "var", "botname", '(', "value", '$', "The Bot", ')', ')', ')', NULL); g_assert (wocky_data_form_parse_result (form, wocky_stanza_get_top_node (stanza), NULL)); g_object_unref (stanza); g_assert_cmpuint (g_slist_length (form->results), ==, 1); result = form->results->data; g_assert_cmpuint (g_slist_length (result), ==, 2); for (l = result; l != NULL; l = g_slist_next (l)) { WockyDataFormField *field = l->data; if (!wocky_strdiff (field->var, "FORM_TYPE")) { g_assert_cmpstr (g_value_get_string (field->value), ==, "jabber:bot"); g_assert (field->type == WOCKY_DATA_FORM_FIELD_TYPE_HIDDEN); form_type = TRUE; } else if (!wocky_strdiff (field->var, "botname")) { g_assert_cmpstr (g_value_get_string (field->value), ==, "The Bot"); g_assert (field->type == WOCKY_DATA_FORM_FIELD_TYPE_TEXT_SINGLE); botname = TRUE; } else g_assert_not_reached (); } g_assert (form_type && botname); g_object_unref (form); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/data-form/instantiation", test_new_from_form); g_test_add_func ("/data-form/parse-form", test_parse_form); g_test_add_func ("/data-form/raw_value_contents", test_raw_value_contents); g_test_add_func ("/data-form/submit", test_submit); g_test_add_func ("/data-form/submit-blindly", test_submit_blindly); g_test_add_func ("/data-form/parse-multi-result", test_parse_multi_result); g_test_add_func ("/data-form/parse-single-result", test_parse_single_result); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/test-resolver.h0000644000175000017500000000416612735676345024753 0ustar00gkiagiagkiagia00000000000000/* * test-resolver.c - Source for TestResolver * Copyright © 2009 Collabora Ltd. * @author Vivek Dasmohapatra * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TEST_RESOLVER_H__ #define __TEST_RESOLVER_H__ #include #include G_BEGIN_DECLS GType test_resolver_get_type (void); #define TEST_TYPE_RESOLVER (test_resolver_get_type ()) #define TEST_RESOLVER(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_RESOLVER, TestResolver)) #define TEST_RESOLVER_CLASS(k) \ (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_RESOLVER, TestResolverClass)) #define TEST_IS_RESOLVER(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_RESOLVER)) #define TEST_IS_RESOLVER_CLASS(k) \ (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_RESOLVER)) #define TEST_RESOLVER_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_RESOLVER, TestResolverClass)) typedef struct { GResolver parent_instance; GResolver *real_resolver; GList *fake_A; GList *fake_SRV; } TestResolver; typedef struct { GResolverClass parent_class; } TestResolverClass; void test_resolver_reset (TestResolver *tr); gboolean test_resolver_add_A (TestResolver *tr, const char *hostname, const char *addr); gboolean test_resolver_add_SRV (TestResolver *tr, const char *service, const char *protocol, const char *domain, const char *addr, guint16 port); G_END_DECLS #endif /* __TEST_RESOLVER_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-xmpp-node-test.c0000644000175000017500000003263612735676345026151 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" #define DUMMY_NS_A "urn:wocky:test:dummy:namespace:a" #define DUMMY_NS_B "urn:wocky:test:dummy:namespace:b" static void test_node_equal (void) { WockyStanza *a, *b; /* Simple IQ node */ a = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", NULL); test_assert_stanzas_equal (a, a); /* Same as 'a' but with an ID attribute */ b = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", '@', "id", "one", NULL); test_assert_stanzas_equal (b, b); test_assert_stanzas_not_equal (a, b); test_assert_stanzas_not_equal (b, a); g_object_unref (a); g_object_unref (b); } static void test_node_add_build (void) { WockyNode *n, *child; n = wocky_node_new ("testtree", DUMMY_NS_A); wocky_node_add_build (n, '(', "testnode", '@', "test", "attribute", '$', "testcontent", ')', NULL); g_assert_cmpint (g_slist_length (n->children), ==, 1); child = wocky_node_get_first_child (n); g_assert_cmpstr (child->name, ==, "testnode"); g_assert_cmpstr (wocky_node_get_ns (child), ==, DUMMY_NS_A); g_assert_cmpstr (child->content, ==, "testcontent"); g_assert_cmpint (g_slist_length (child->attributes), ==, 1); g_assert_cmpstr (wocky_node_get_attribute (child, "test"), ==, "attribute"); wocky_node_free (n); } static void test_set_attribute (void) { WockyStanza *a, *b, *c; a = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", NULL); b = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", '@', "foo", "badger", NULL); test_assert_stanzas_not_equal (a, b); wocky_node_set_attribute (wocky_stanza_get_top_node (a), "foo", "badger"); test_assert_stanzas_equal (a, b); c = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", '@', "foo", "snake", NULL); test_assert_stanzas_not_equal (b, c); wocky_node_set_attribute (wocky_stanza_get_top_node (b), "foo", "snake"); test_assert_stanzas_equal (b, c); g_object_unref (a); g_object_unref (b); g_object_unref (c); } static gboolean _check_attr_prefix (const gchar *urn, const gchar *prefix, const gchar *attr, const gchar *xml) { gboolean rval = FALSE; gchar *ns_str_a = g_strdup_printf (" xmlns:%s='%s'", prefix, urn); gchar *ns_str_b = g_strdup_printf (" xmlns:%s=\"%s\"", prefix, urn); gchar *attr_str = g_strdup_printf (" %s:%s=", prefix, attr); rval = ((strstr (xml, ns_str_a) != NULL) || (strstr (xml, ns_str_a) != NULL)) && (strstr (xml, attr_str) != NULL); g_free (ns_str_a); g_free (ns_str_b); g_free (attr_str); return rval; } static void test_append_content_n (void) { WockyStanza *a; const gchar *content = "badger badger badger"; guint i; size_t l; a = wocky_stanza_new ("message", WOCKY_XMPP_NS_JABBER_CLIENT); l = strlen (content); /* Append content byte by byte */ for (i = 0; i < l; i++) { wocky_node_append_content_n (wocky_stanza_get_top_node (a), content + i, 1); } g_assert (!wocky_strdiff (wocky_stanza_get_top_node (a)->content, content)); g_object_unref (a); } static void test_set_attribute_ns (void) { WockyStanza *sa; WockyStanza *sb; WockyNode *na; WockyNode *nb; const gchar *ca; const gchar *cb; const gchar *cx; const gchar *cy; gchar *xml_a; gchar *xml_b; gchar *pa; gchar *pb; GQuark qa; sa = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", NULL); sb = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "juliet@example.com", "romeo@example.org", NULL); na = wocky_stanza_get_top_node (sa); nb = wocky_stanza_get_top_node (sb); test_assert_nodes_equal (na, nb); /* *********************************************************************** */ wocky_node_set_attribute_ns (na, "one", "1", DUMMY_NS_A); ca = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_A); cb = wocky_node_get_attribute_ns (nb, "one", DUMMY_NS_A); cx = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_B); cy = wocky_node_get_attribute (na, "one"); test_assert_nodes_not_equal (na, nb); g_assert (ca != NULL); g_assert (cb == NULL); g_assert (cx == NULL); g_assert (cy != NULL); g_assert (!strcmp (ca, "1")); /* *********************************************************************** */ /* set the attribute in the second node to make them equal again */ wocky_node_set_attribute_ns (nb, "one", "1", DUMMY_NS_A); ca = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_A); cb = wocky_node_get_attribute_ns (nb, "one", DUMMY_NS_A); cx = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_B); cy = wocky_node_get_attribute (na, "one"); test_assert_nodes_equal (na, nb); g_assert (ca != NULL); g_assert (cb != NULL); g_assert (cx == NULL); g_assert (cy != NULL); g_assert (!strcmp (ca, "1")); g_assert (!strcmp (ca, cb)); wocky_node_set_attribute_ns (nb, "one", "1", DUMMY_NS_A); cb = wocky_node_get_attribute_ns (nb, "one", DUMMY_NS_A); test_assert_nodes_equal (na, nb); g_assert (cb != NULL); g_assert (!strcmp (ca, cb)); /* *********************************************************************** */ /* change the namespaced atttribute */ wocky_node_set_attribute_ns (na, "one", "2", DUMMY_NS_A); ca = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_A); cb = wocky_node_get_attribute_ns (nb, "one", DUMMY_NS_A); cx = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_B); cy = wocky_node_get_attribute (na, "one"); test_assert_nodes_not_equal (na, nb); g_assert (ca != NULL); g_assert (cb != NULL); g_assert (cx == NULL); g_assert (cy != NULL); g_assert (!strcmp (ca, "2")); g_assert (strcmp (ca, cb)); /* *********************************************************************** */ /* add another attribute in a different namespace */ wocky_node_set_attribute_ns (na, "one", "3", DUMMY_NS_B); ca = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_A); cb = wocky_node_get_attribute_ns (nb, "one", DUMMY_NS_A); cx = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_B); cy = wocky_node_get_attribute (na, "one"); test_assert_nodes_not_equal (na, nb); g_assert (ca != NULL); g_assert (cb != NULL); g_assert (cx != NULL); g_assert (cy != NULL); g_assert (!strcmp (ca, "2")); g_assert (!strcmp (cx, "3")); g_assert (strcmp (ca, cb)); /* *********************************************************************** */ /* swap out the prefix for another one */ /* then check to see the right prefixes were assigned */ qa = g_quark_from_string (DUMMY_NS_B); xml_a = wocky_node_to_string (na); pa = g_strdup (wocky_node_attribute_ns_get_prefix_from_urn (DUMMY_NS_B)); pb = g_strdup (wocky_node_attribute_ns_get_prefix_from_quark (qa)); g_assert (!strcmp (pa, pb)); g_free (pb); /* change the prefix and re-write the attribute */ wocky_node_attribute_ns_set_prefix (qa, "moose"); wocky_node_set_attribute_ns (na, "one", "1", DUMMY_NS_B); xml_b = wocky_node_to_string (na); pb = g_strdup (wocky_node_attribute_ns_get_prefix_from_quark (qa)); g_assert (strcmp (pa, pb)); g_assert (_check_attr_prefix (DUMMY_NS_B, pa, "one", xml_a)); g_assert (_check_attr_prefix (DUMMY_NS_B, pb, "one", xml_b)); g_free (pa); g_free (pb); g_free (xml_a); g_free (xml_b); /* *********************************************************************** */ wocky_node_set_attribute_ns (na, "one", "4", DUMMY_NS_B); cx = wocky_node_get_attribute_ns (na, "one", DUMMY_NS_B); g_assert (cx != NULL); g_assert (!strcmp (cx, "4")); g_object_unref (sa); g_object_unref (sb); } static void do_test_iteration (WockyNodeIter *iter, const gchar **names) { WockyNode *node; int i = 0; while (wocky_node_iter_next (iter, &node)) { g_assert (names[i] != NULL && "Unexpected node"); g_assert_cmpstr (names[i], ==, wocky_node_get_attribute (node, "name")); i++; } g_assert (names[i] == NULL && "Expected more nodes"); } static void test_node_iteration (void) { WockyStanza *stanza; WockyNodeIter iter; const gchar *all[] = { "SPEEX", "THEORA", "GSM", "H264", "VIDEO?", "other", NULL }; const gchar *payloads[] = { "SPEEX", "THEORA", "GSM", "H264", NULL }; const gchar *audio[] = { "SPEEX", "GSM", NULL }; const gchar *video[] = { "THEORA", "H264", NULL }; const gchar *video_ns[] = { "THEORA", "H264", "VIDEO?", NULL }; const gchar *nothing[] = { NULL }; stanza = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, "to", "from", '(', "payload-type", ':', WOCKY_NS_GOOGLE_SESSION_PHONE, '@', "name", "SPEEX", ')', '(', "payload-type", ':', WOCKY_NS_GOOGLE_SESSION_VIDEO, '@', "name", "THEORA", ')', '(', "payload-type", ':', WOCKY_NS_GOOGLE_SESSION_PHONE, '@', "name", "GSM", ')', '(', "payload-type", ':', WOCKY_NS_GOOGLE_SESSION_VIDEO, '@', "name", "H264", ')', '(', "video", ':', WOCKY_NS_GOOGLE_SESSION_VIDEO, '@', "name", "VIDEO?", ')', '(', "misc", '@', "name", "other", ')', NULL); /* All children */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), NULL, NULL); do_test_iteration (&iter, all); /* Only the payloads */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), "payload-type", NULL); do_test_iteration (&iter, payloads); /* Only phone payloads */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), "payload-type", WOCKY_NS_GOOGLE_SESSION_PHONE); do_test_iteration (&iter, audio); /* Only nodes with the phone namespace */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), NULL, WOCKY_NS_GOOGLE_SESSION_PHONE); do_test_iteration (&iter, audio); /* only video payloads */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), "payload-type", WOCKY_NS_GOOGLE_SESSION_VIDEO); do_test_iteration (&iter, video); /* only nodes with the video namespace */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), NULL, WOCKY_NS_GOOGLE_SESSION_VIDEO); do_test_iteration (&iter, video_ns); /* nothing */ wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), "badgers", NULL); do_test_iteration (&iter, nothing); wocky_node_iter_init (&iter, wocky_stanza_get_top_node (stanza), NULL, "snakes"); do_test_iteration (&iter, nothing); g_object_unref (stanza); } static void test_node_iter_remove (void) { WockyNode *top, *child; WockyNodeTree *tree = wocky_node_tree_new ("foo", "wocky:test", '*', &top, '(', "remove-me", ')', '(', "remove-me", ')', '(', "preserve-me", ')', '(', "remove-me", ')', '(', "preserve-me", ')', '(', "remove-me", ')', '(', "remove-me", ')', NULL); WockyNodeIter iter; wocky_node_iter_init (&iter, top, "remove-me", NULL); while (wocky_node_iter_next (&iter, NULL)) wocky_node_iter_remove (&iter); g_assert_cmpuint (g_slist_length (top->children), ==, 2); wocky_node_iter_init (&iter, top, NULL, NULL); while (wocky_node_iter_next (&iter, &child)) g_assert_cmpstr (child->name, ==, "preserve-me"); g_object_unref (tree); } static void test_get_first_child (void) { WockyNodeTree *tree = wocky_node_tree_new ("my-elixir", "my:poison", '(', "th5", ')', '(', "holomovement", ':', "chinese:lantern", ')', '(', "th5", ':', "chinese:lantern", ')', NULL); WockyNode *top = wocky_node_tree_get_top_node (tree); WockyNode *n; n = wocky_node_get_first_child (top); g_assert (n != NULL); g_assert_cmpstr ("th5", ==, n->name); g_assert_cmpstr ("my:poison", ==, wocky_node_get_ns (n)); n = wocky_node_get_child (top, "th5"); g_assert (n != NULL); g_assert_cmpstr ("th5", ==, n->name); g_assert_cmpstr ("my:poison", ==, wocky_node_get_ns (n)); n = wocky_node_get_child_ns (top, "th5", "chinese:lantern"); g_assert (n != NULL); g_assert_cmpstr ("th5", ==, n->name); g_assert_cmpstr ("chinese:lantern", ==, wocky_node_get_ns (n)); n = wocky_node_get_first_child_ns (top, "chinese:lantern"); g_assert (n != NULL); g_assert_cmpstr ("holomovement", ==, n->name); g_assert_cmpstr ("chinese:lantern", ==, wocky_node_get_ns (n)); g_object_unref (tree); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-node/node-equal", test_node_equal); g_test_add_func ("/xmpp-node/add-build", test_node_add_build); g_test_add_func ("/xmpp-node/set-attribute", test_set_attribute); g_test_add_func ("/xmpp-node/append-content-n", test_append_content_n); g_test_add_func ("/xmpp-node/set-attribute-ns", test_set_attribute_ns); g_test_add_func ("/xmpp-node/node-iterator", test_node_iteration); g_test_add_func ("/xmpp-node/node-iterator-remove", test_node_iter_remove); g_test_add_func ("/xmpp-node/get-first-child", test_get_first_child); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/Makefile.am0000644000175000017500000002450113012550005023760 0ustar00gkiagiagkiagia00000000000000############################################################################ # x509 certificates: TEST_DIR := @abs_top_srcdir@/tests SUMMARY := $(TEST_DIR)/summarise-tests.py CERT_DIR := $(TEST_DIR)/certs CA_KEY := $(CERT_DIR)/ca-0-key.pem CA_CERT := $(CERT_DIR)/ca-0-cert.pem SS_KEY := $(CERT_DIR)/ss-key.pem SS_CERT := $(CERT_DIR)/ss-cert.pem REV_KEY := $(CERT_DIR)/rev-key.pem REV_CERT := $(CERT_DIR)/rev-cert.pem EXP_KEY := $(CERT_DIR)/exp-key.pem EXP_CERT := $(CERT_DIR)/exp-cert.pem NEW_KEY := $(CERT_DIR)/new-key.pem NEW_CERT := $(CERT_DIR)/new-cert.pem TLS_KEY := $(CERT_DIR)/tls-key.pem TLS_CERT := $(CERT_DIR)/tls-cert.pem WILD_KEY := $(CERT_DIR)/wild-key.pem WILD_CERT:= $(CERT_DIR)/wild-cert.pem BADWILD_KEY := $(CERT_DIR)/badwild-key.pem BADWILD_CERT := $(CERT_DIR)/badwild-cert.pem CA_DIR := $(CERT_DIR)/cas CRL_DIR := $(CERT_DIR)/crl UNKNOWN_KEY := $(CERT_DIR)/unknown-key.pem UNKNOWN_CERT := $(CERT_DIR)/unknown-cert.pem INCLUDES := -I$(top_builddir)/wocky TLSDEFS := -DTLS_CA_KEY_FILE='"$(CA_KEY)"' \ -DTLS_CA_CRT_FILE='"$(CA_CERT)"' \ -DTLS_SS_KEY_FILE='"$(SS_KEY)"' \ -DTLS_SS_CRT_FILE='"$(SS_CERT)"' \ -DTLS_EXP_KEY_FILE='"$(EXP_KEY)"' \ -DTLS_EXP_CRT_FILE='"$(EXP_CERT)"' \ -DTLS_NEW_KEY_FILE='"$(NEW_KEY)"' \ -DTLS_NEW_CRT_FILE='"$(NEW_CERT)"' \ -DTLS_REV_KEY_FILE='"$(REV_KEY)"' \ -DTLS_REV_CRT_FILE='"$(REV_CERT)"' \ -DTLS_UNKNOWN_KEY_FILE='"$(UNKNOWN_KEY)"' \ -DTLS_UNKNOWN_CRT_FILE='"$(UNKNOWN_CERT)"' \ -DTLS_SERVER_KEY_FILE='"$(TLS_KEY)"' \ -DTLS_SERVER_CRT_FILE='"$(TLS_CERT)"'\ -DTLS_WILD_KEY_FILE='"$(WILD_KEY)"' \ -DTLS_WILD_CRT_FILE='"$(WILD_CERT)"' \ -DTLS_BADWILD_CRT_FILE='"$(BADWILD_CERT)"' \ -DTLS_BADWILD_KEY_FILE='"$(BADWILD_KEY)"' \ -DTLS_CRL_DIR='"$(CRL_DIR)"' \ -DTLS_CA_DIR='"$(CA_DIR)"' ############################################################################ TEST_PROGS = \ wocky-bare-contact-test \ wocky-caps-hash-test \ wocky-connector-test \ wocky-contact-factory-test \ wocky-data-form-test \ wocky-jid-validation-test \ wocky-loopback-test \ wocky-node-tree-test \ wocky-pep-service-test \ wocky-ping-test \ wocky-porter-test \ wocky-pubsub-node-test \ wocky-pubsub-service-test \ wocky-resource-contact-test \ wocky-roster-test \ wocky-sasl-utils-test \ wocky-scram-sha1-test \ wocky-session-test \ wocky-stanza-test \ wocky-tls-test \ wocky-utils-test \ wocky-xmpp-connection-test \ wocky-xmpp-node-test \ wocky-xmpp-reader-test \ wocky-xmpp-readwrite-test \ wocky-http-proxy-test \ $(NULL) noinst_PROGRAMS = if HAVE_LIBSASL2 TEST_PROGS += wocky-test-sasl-auth noinst_PROGRAMS += wocky-dummy-xmpp-server endif wocky_bare_contact_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-bare-contact-test.c wocky_caps_hash_test_SOURCES = wocky-caps-hash-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h EXTRA_wocky_connector_test_DEPENDENCIES = $(CA_DIR) certs wocky_connector_test_SOURCES = \ wocky-connector-test.c \ wocky-test-sasl-auth-server.c \ wocky-test-sasl-auth-server.h \ wocky-test-connector-server.c \ wocky-test-connector-server.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ test-resolver.c test-resolver.h wocky_connector_test_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_connector_test_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ $(TLSDEFS) wocky_contact_factory_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-contact-factory-test.c wocky_data_form_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-data-form-test.c wocky_dummy_xmpp_server_SOURCES = wocky-dummy-xmpp-server.c \ wocky-test-connector-server.c wocky-test-connector-server.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-test-sasl-auth-server.c wocky-test-sasl-auth-server.h wocky_dummy_xmpp_server_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_dummy_xmpp_server_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ $(TLSDEFS) wocky_http_proxy_test_SOURCES = wocky-http-proxy-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_jid_validation_test_SOURCES = \ wocky-jid-validation-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_loopback_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-loopback-test.c wocky_node_tree_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-node-tree-test.c wocky_pep_service_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pep-service-test.c wocky_ping_test_SOURCES = \ wocky-ping-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_porter_test_SOURCES = \ wocky-porter-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_pubsub_node_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pubsub-test-helpers.c wocky-pubsub-test-helpers.h \ wocky-pubsub-node-test.c wocky_pubsub_service_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pubsub-test-helpers.c wocky-pubsub-test-helpers.h \ wocky-pubsub-service-test.c wocky_resource_contact_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-resource-contact-test.c wocky_roster_test_SOURCES = \ wocky-roster-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_sasl_utils_test_SOURCES = wocky-sasl-utils-test.c wocky_scram_sha1_test_SOURCES = wocky-scram-sha1-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_session_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-session-test.c wocky_stanza_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-stanza-test.c wocky_test_sasl_auth_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-sasl-auth.c \ wocky-test-sasl-handler.c \ wocky-test-sasl-handler.h \ wocky-test-sasl-auth-server.c \ wocky-test-sasl-auth-server.h \ wocky-test-stream.c \ wocky-test-stream.h wocky_test_sasl_auth_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_test_sasl_auth_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ wocky_tls_test_SOURCES = \ wocky-tls-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_tls_test_CFLAGS = $(AM_CFLAGS) $(TLSDEFS) wocky_utils_test_SOURCES = wocky-utils-test.c wocky_xmpp_connection_test_SOURCES = \ wocky-xmpp-connection-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_xmpp_node_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-xmpp-node-test.c wocky_xmpp_reader_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-xmpp-reader-test.c wocky_xmpp_readwrite_test_SOURCES = \ wocky-test-stream.c wocky-test-stream.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-xmpp-readwrite-test.c AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ \ @LIBXML2_CFLAGS@ @TLS_CFLAGS@ @WOCKY_CFLAGS@ AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @LIBXML2_LIBS@ @TLS_LIBS@ LDADD = $(top_builddir)/wocky/libwocky.la check_PROGRAMS = $(TEST_PROGS) check_c_sources = $(notdir $(wildcard $(srcdir)/*.c) $(wildcard $(srcdir)/*.h)) noinst_PROGRAMS += $(TEST_PROGS) test-report: test-report.xml gtester-report $(top_builddir)/tests/$@.xml > \ $(top_builddir)/tests/$@.html test-report.xml: ${TEST_PROGS} test test: ${TEST_PROGS} gtester -o test-report.xml -k --verbose ${TEST_PROGS} @if [ -x $(which python) ] ; then \ $(SUMMARY) $@-report.xml ; \ else \ echo "No python available, not summarizing test results" ; \ fi test-%: wocky-%-test gtester -o $@-report.xml -k --verbose $< @if [ -x $(which python) ] ; then \ $(SUMMARY) $@-report.xml ; \ else \ echo "No python available, not summarizing test results" ; \ fi .PHONY: test test-report include $(top_srcdir)/tools/check-coding-style.mk check-local: test check-coding-style ############################################################################ SUPPRESSIONS = \ threadlocal.supp \ gabble.supp \ tp-glib.supp CLEANFILES = test-report.xml \ sasl-test.db # valgrind any given test by running make test.valgrind %.valgrind: % G_SLICE=always-malloc \ G_DEBUG=gc-friendly \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(srcdir)/$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ --leak-resolution=high --num-callers=20 \ ./$* $(TEST_ARGS) 2>&1 | tee "valgrind.$*.log" @if grep "==" "valgrind.$*.log" > /dev/null 2>&1; then \ exit 1; \ fi valgrind: $(TEST_PROGS) @echo "Valgrinding tests ..." @failed=0; \ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TEST_PROGS)); do \ $(MAKE) $$t.valgrind; \ if test "$$?" -ne 0; then \ echo "Valgrind error for test $$t"; \ failed=`expr $$failed + 1`; \ whicht="$$whicht $$t"; \ fi; \ done; \ if test "$$failed" -ne 0; then \ echo "$$failed tests had leaks or errors under valgrind:"; \ echo "$$whicht"; \ false; \ fi EXTRA_DIST = $(SUPPRESSIONS) \ README \ connector-test-plan.txt \ summarise-tests.py \ wocky-dummy-xmpp-server.c \ $(wildcard $(srcdir)/certs/*.cfg) \ $(wildcard $(srcdir)/certs/*.pem) \ $(wildcard $(srcdir)/certs/cas/*.pem) \ $(wildcard $(srcdir)/certs/cas/*.0) telepathy-gabble-0.18.4/lib/ext/wocky/tests/connector-test-plan.txt0000644000175000017500000001201612735676345026415 0ustar00gkiagiagkiagia00000000000000Tests: Syntactic validity: Invalid JID (empty) → Bad JID error Invalid JID (no domain) → Bad JID error ============================================================================ Connection details: DOMAIN = latter part of JID HOST = specific host provided by user SRV = host + port from SRV record SRV │ Host │ Port │ Expected Attempt: ────┼──────┼──────┼────────────────────────────── 0 │ 0 │ 0 │ connect to DOMAIN + 5222 0 │ 0 │ 1 │ connect to DOMAIN + port 0 │ 1 │ 0 │ connect to HOST + 5222 0 │ 1 │ 1 │ connect to specified HOST+PORT 0 │ ☠ │ 0 │ duff host. die. 0 │ ☠ │ 1 │ duff host. die. 1 │ 0 │ 0 │ connect to SRV 1 │ 0 │ 1 │ connect to DOMAIN + PORT 1 │ 1 │ 0 │ connect to HOST + 5222 1 │ 1 │ 1 │ connect to HOST + PORT 1 │ ☠ │ 0 │ duff host. die. 1 │ ☠ │ 1 │ duff host. die. ☠ │ 0 │ 0 │ duff SRV. die. ☠ │ 0 │ 1 │ connect to DOMAIN + PORT ☠ │ 1 │ 0 │ connect to HOST + 5222 ☠ │ 1 │ 1 │ connect to HOST + port ☠ │ ☠ │ 0 │ duff HOST. die. ☠ │ ☠ │ 1 │ duff HOST. die. ============================================================================ Feature Requirements/Support tests: +TLS = TLS provided by server -TLS = TLS not provided INSEC AUTH = Insecure auth channels permitted TLS PLAIN = Insecure auth over TLS permitted DIGEST = + → digest auth available; - → only PLAIN available Tests flagged with * need to be repeated 4 times, with good auth details, a bad password, a bad user and with both wrong. The rest should fail before we get that far. ────┬────────────┬────────────┬─────────────────┬────────────────────────┐ TLS │ INSEC AUTH │ TLS PLAIN │ Server Features │ Attempted Action(s) │ 0 │ 0 │ x │ -TLS-DIGEST │ auth failure │ 0 │ 0 │ x │ -TLS+DIGEST │ digest auth * │ 0 │ 1 │ x │ -TLS-DIGEST │ plain auth * │ 0 │ 1 │ x │ -TLS+DIGEST │ digest auth * │ ────┼────────────┼────────────┼─────────────────┼────────────────────────┤ 1 │ 0 │ 0 │ -TLS │ TLS neg failure │ 1 │ 0 │ 1 │ -TLS │ TLS neg failure │ 1 │ 1 │ 0 │ -TLS │ TLS neg failure │ 1 │ 1 │ 1 │ -TLS │ TLS neg failure │ ────┼────────────┼────────────┼─────────────────┼────────────────────────┤ 0 │ 0 │ 0 │ +TLS-DIGEST │ TLS auth failure │ 0 │ 0 │ 1 │ +TLS-DIGEST │ TLS plain auth * │ 0 │ 1 │ 0 │ +TLS-DIGEST │ TLS plain auth * │ 0 │ 1 │ 1 │ +TLS-DIGEST │ TLS plain auth * │ 1 │ 0 │ 0 │ +TLS-DIGEST │ TLS auth failure │ 1 │ 0 │ 1 │ +TLS-DIGEST │ TLS plain auth * │ 1 │ 1 │ 0 │ +TLS-DIGEST │ TLS plain auth * │ 1 │ 1 │ 1 │ +TLS-DIGEST │ TLS plain auth * │ ────┼────────────┼────────────┼─────────────────┼────────────────────────┤ 0 │ 0 │ 0 │ +TLS+DIGEST │ TLS digest auth * │ 0 │ 0 │ 1 │ +TLS+DIGEST │ TLS digest auth * │ 0 │ 1 │ 0 │ +TLS+DIGEST │ TLS digest auth * │ 0 │ 1 │ 1 │ +TLS+DIGEST │ TLS digest auth * │ 1 │ 0 │ 0 │ +TLS+DIGEST │ TLS digest auth * │ 1 │ 0 │ 1 │ +TLS+DIGEST │ TLS digest auth * │ 1 │ 1 │ 0 │ +TLS+DIGEST │ TLS digest auth * │ 1 │ 1 │ 0 │ +TLS+DIGEST │ TLS digest auth * │ ────┴────────────┴────────────┴─────────────────┴────────────────────────┘ telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-dummy-xmpp-server.c0000644000175000017500000000462413012550005026647 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "wocky-test-connector-server.h" GMainLoop *loop; static gboolean server_quit (GIOChannel *channel, GIOCondition cond, gpointer data) { g_main_loop_quit (loop); return FALSE; } static gboolean client_connected (GIOChannel *channel, GIOCondition cond, gpointer data) { struct sockaddr_in client; socklen_t clen = sizeof (client); int ssock = g_io_channel_unix_get_fd (channel); int csock = accept (ssock, (struct sockaddr *)&client, &clen); GSocket *gsock = g_socket_new_from_fd (csock, NULL); ConnectorProblem cproblem = { 0, }; GSocketConnection *gconn; pid_t pid = 0; TestConnectorServer *server; if (csock < 0) { perror ("accept() failed"); g_warning ("accept() failed on socket that should have been ready."); return TRUE; } switch ((pid = fork ())) { case -1: perror ("Failed to spawn child process"); g_main_loop_quit (loop); break; case 0: while (g_source_remove_by_user_data (loop)); g_io_channel_shutdown (channel, TRUE, NULL); gconn = g_object_new (G_TYPE_SOCKET_CONNECTION, "socket", gsock, NULL); server = test_connector_server_new (G_IO_STREAM (gconn), NULL, "foo", "bar", "1.0", &cproblem, SERVER_PROBLEM_NO_PROBLEM, CERT_STANDARD); test_connector_server_start (server); return FALSE; default: g_socket_close (gsock, NULL); return TRUE; } return FALSE; } int main (int argc, char **argv) { int ssock; int reuse = 1; struct sockaddr_in server; GIOChannel *channel; memset (&server, 0, sizeof (server)); loop = g_main_loop_new (NULL, FALSE); server.sin_family = AF_INET; inet_aton ("127.0.0.1", &server.sin_addr); server.sin_port = htons (5222); ssock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof (reuse)); bind (ssock, (struct sockaddr *)&server, sizeof (server)); listen (ssock, 1024); channel = g_io_channel_unix_new (ssock); g_io_add_watch (channel, G_IO_IN|G_IO_PRI, client_connected, loop); g_io_add_watch (channel, G_IO_ERR|G_IO_NVAL, server_quit, loop); g_main_loop_run (loop); } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-test-stream.c0000644000175000017500000004456512735676345025541 0ustar00gkiagiagkiagia00000000000000/* * wocky-test-stream.c - Source for WockyTestStream * Copyright (C) 2009 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "wocky-test-stream.h" G_DEFINE_TYPE (WockyTestStream, wocky_test_stream, G_TYPE_OBJECT); struct _WockyTestStreamPrivate { gboolean dispose_has_run; }; enum { PROP_IO_INPUT_STREAM = 1, PROP_IO_OUTPUT_STREAM }; static GType wocky_test_io_stream_get_type (void); static GType wocky_test_input_stream_get_type (void); static GType wocky_test_output_stream_get_type (void); typedef struct { GIOStream parent; GInputStream *input; GOutputStream *output; } WockyTestIOStream; typedef struct { GIOStreamClass parent; } WockyTestIOStreamClass; typedef struct { GOutputStream parent; GAsyncQueue *queue; WockyTestStreamWriteMode mode; GError *write_error /* no, this is not a coding style violation */; gboolean dispose_has_run; } WockyTestOutputStream; typedef struct { GOutputStreamClass parent_class; } WockyTestOutputStreamClass; typedef struct { GInputStream parent; GAsyncQueue *queue; guint offset; GArray *out_array; GSimpleAsyncResult *read_result; GCancellable *read_cancellable; gulong read_cancellable_sig_id; void *buffer; gsize count; GError *read_error /* no, this is not a coding style violation */; gboolean dispose_has_run; WockyTestStreamReadMode mode; WockyTestStreamDirectReadCb direct_read_cb; gpointer direct_read_user_data; gboolean corked; } WockyTestInputStream; typedef struct { GOutputStreamClass parent_class; } WockyTestInputStreamClass; G_DEFINE_TYPE (WockyTestIOStream, wocky_test_io_stream, G_TYPE_IO_STREAM); G_DEFINE_TYPE (WockyTestInputStream, wocky_test_input_stream, G_TYPE_INPUT_STREAM); G_DEFINE_TYPE (WockyTestOutputStream, wocky_test_output_stream, G_TYPE_OUTPUT_STREAM); #define WOCKY_TYPE_TEST_IO_STREAM (wocky_test_io_stream_get_type ()) #define WOCKY_TYPE_TEST_INPUT_STREAM (wocky_test_input_stream_get_type ()) #define WOCKY_TYPE_TEST_OUTPUT_STREAM (wocky_test_output_stream_get_type ()) #define WOCKY_TEST_IO_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TEST_IO_STREAM, \ WockyTestIOStream)) #define WOCKY_TEST_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TEST_INPUT_STREAM, \ WockyTestInputStream)) #define WOCKY_TEST_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_TEST_OUTPUT_STREAM, \ WockyTestOutputStream)) static gboolean wocky_test_input_stream_try_read (WockyTestInputStream *self); static void output_data_written_cb (GOutputStream *output, WockyTestInputStream *input_stream) { wocky_test_input_stream_try_read (input_stream); } static void wocky_test_stream_init (WockyTestStream *self) { /* allocate any data required by the object here */ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_TEST_STREAM, WockyTestStreamPrivate); self->stream0_output = g_object_new (WOCKY_TYPE_TEST_OUTPUT_STREAM, NULL); self->stream1_output = g_object_new (WOCKY_TYPE_TEST_OUTPUT_STREAM, NULL); self->stream0_input = g_object_new (WOCKY_TYPE_TEST_INPUT_STREAM, NULL); WOCKY_TEST_INPUT_STREAM (self->stream0_input)->queue = g_async_queue_ref ( WOCKY_TEST_OUTPUT_STREAM (self->stream1_output)->queue); self->stream1_input = g_object_new (WOCKY_TYPE_TEST_INPUT_STREAM, NULL); WOCKY_TEST_INPUT_STREAM (self->stream1_input)->queue = g_async_queue_ref ( WOCKY_TEST_OUTPUT_STREAM (self->stream0_output)->queue); self->stream0 = g_object_new (WOCKY_TYPE_TEST_IO_STREAM, NULL); WOCKY_TEST_IO_STREAM (self->stream0)->input = self->stream0_input; WOCKY_TEST_IO_STREAM (self->stream0)->output = self->stream0_output; self->stream1 = g_object_new (WOCKY_TYPE_TEST_IO_STREAM, NULL); WOCKY_TEST_IO_STREAM (self->stream1)->input = self->stream1_input; WOCKY_TEST_IO_STREAM (self->stream1)->output = self->stream1_output; g_signal_connect (self->stream0_output, "data-written", G_CALLBACK (output_data_written_cb), self->stream1_input); g_signal_connect (self->stream1_output, "data-written", G_CALLBACK (output_data_written_cb), self->stream0_input); } static void wocky_test_stream_dispose (GObject *object); static void wocky_test_stream_class_init (WockyTestStreamClass *wocky_test_stream_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_test_stream_class); g_type_class_add_private (wocky_test_stream_class, \ sizeof (WockyTestStreamPrivate)); object_class->dispose = wocky_test_stream_dispose; } static void wocky_test_stream_dispose (GObject *object) { WockyTestStream *self = WOCKY_TEST_STREAM (object); if (self->priv->dispose_has_run) return; self->priv->dispose_has_run = TRUE; g_object_unref (self->stream0); self->stream0 = NULL; g_object_unref (self->stream1); self->stream1 = NULL; if (G_OBJECT_CLASS (wocky_test_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_test_stream_parent_class)->dispose (object); } /* IO stream */ static void wocky_test_io_stream_init (WockyTestIOStream *self) { } static void wocky_test_io_stream_class_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyTestIOStream *self = WOCKY_TEST_IO_STREAM (object); switch (property_id) { case PROP_IO_INPUT_STREAM: g_value_set_object (value, self->input); break; case PROP_IO_OUTPUT_STREAM: g_value_set_object (value, self->output); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_test_io_stream_finalize (GObject *object) { WockyTestIOStream *self = WOCKY_TEST_IO_STREAM (object); g_object_unref (self->input); g_object_unref (self->output); if (G_OBJECT_CLASS (wocky_test_io_stream_parent_class)->finalize) G_OBJECT_CLASS (wocky_test_io_stream_parent_class)->finalize (object); } static GInputStream * wocky_test_io_stream_get_input_stream (GIOStream *stream) { return WOCKY_TEST_IO_STREAM (stream)->input; } static GOutputStream * wocky_test_io_stream_get_output_stream (GIOStream *stream) { return WOCKY_TEST_IO_STREAM (stream)->output; } static void wocky_test_io_stream_class_init ( WockyTestIOStreamClass *wocky_test_io_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_test_io_stream_class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS (wocky_test_io_stream_class); obj_class->finalize = wocky_test_io_stream_finalize; obj_class->get_property = wocky_test_io_stream_class_get_property; stream_class->get_input_stream = wocky_test_io_stream_get_input_stream; stream_class->get_output_stream = wocky_test_io_stream_get_output_stream; g_object_class_install_property (obj_class, PROP_IO_INPUT_STREAM, g_param_spec_object ("input-stream", "Input stream", "the input stream", G_TYPE_INPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (obj_class, PROP_IO_OUTPUT_STREAM, g_param_spec_object ("output-stream", "Output stream", "the output stream", G_TYPE_OUTPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); } /* Input stream */ static gssize wocky_test_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyTestInputStream *self = WOCKY_TEST_INPUT_STREAM (stream); gsize written = 0; if (self->out_array == NULL) { g_assert (self->offset == 0); self->out_array = g_async_queue_pop (self->queue); } do { gsize towrite; if (self->mode == WOCK_TEST_STREAM_READ_COMBINE_SLICE && self->offset == 0) towrite = MIN (count - written, MAX (self->out_array->len/2, 1)); else towrite = MIN (count - written, self->out_array->len - self->offset); memcpy ((guchar *) buffer + written, self->out_array->data + self->offset, towrite); self->offset += towrite; written += towrite; if (self->offset == self->out_array->len) { g_array_unref (self->out_array); self->out_array = g_async_queue_try_pop (self->queue); self->offset = 0; } else if (self->mode == WOCK_TEST_STREAM_READ_COMBINE_SLICE) { break; } } while (self->mode != WOCK_TEST_STREAM_READ_EXACT && written < count && self->out_array != NULL); if (self->direct_read_cb != NULL) self->direct_read_cb (buffer, written, self->direct_read_user_data); return written; } static void read_async_complete (WockyTestInputStream *self) { GSimpleAsyncResult *r = self->read_result; if (self->read_cancellable != NULL) { g_signal_handler_disconnect (self->read_cancellable, self->read_cancellable_sig_id); g_object_unref (self->read_cancellable); self->read_cancellable = NULL; } self->read_result = NULL; g_simple_async_result_complete_in_idle (r); g_object_unref (r); } static void read_cancelled_cb (GCancellable *cancellable, WockyTestInputStream *self) { g_simple_async_result_set_error (self->read_result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Reading cancelled"); self->buffer = NULL; read_async_complete (self); } static void wocky_test_input_stream_read_async (GInputStream *stream, void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyTestInputStream *self = WOCKY_TEST_INPUT_STREAM (stream); g_assert (self->buffer == NULL); g_assert (self->read_result == NULL); g_assert (self->read_cancellable == NULL); self->buffer = buffer; self->count = count; self->read_result = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_test_input_stream_read_async); if (self->read_error != NULL) { g_simple_async_result_set_from_error (self->read_result, self->read_error); g_error_free (self->read_error); self->read_error = NULL; read_async_complete (self); return; } if (cancellable != NULL) { self->read_cancellable = g_object_ref (cancellable); self->read_cancellable_sig_id = g_signal_connect (cancellable, "cancelled", G_CALLBACK (read_cancelled_cb), self); } wocky_test_input_stream_try_read (self); } static gssize wocky_test_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, GError **error) { WockyTestInputStream *self = WOCKY_TEST_INPUT_STREAM (stream); gssize len = -1; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) goto out; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_test_input_stream_read_async), -1); len = wocky_test_input_stream_read (stream, self->buffer, self->count, NULL, error); out: self->buffer = NULL; return len; } static gboolean wocky_test_input_stream_try_read (WockyTestInputStream *self) { if (self->read_result == NULL) /* No pending read operation */ return FALSE; if (self->out_array == NULL && g_async_queue_length (self->queue) == 0) return FALSE; if (self->corked) return FALSE; read_async_complete (self); return TRUE; } static void wocky_test_input_stream_init (WockyTestInputStream *self) { } static void wocky_test_input_stream_dispose (GObject *object) { WockyTestInputStream *self = WOCKY_TEST_INPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; if (self->out_array != NULL) g_array_unref (self->out_array); self->out_array = NULL; if (self->queue != NULL) g_async_queue_unref (self->queue); self->queue = NULL; g_warn_if_fail (self->read_result == NULL); g_warn_if_fail (self->read_cancellable == NULL); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_test_input_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_test_input_stream_parent_class)->dispose (object); } static void wocky_test_input_stream_class_init ( WockyTestInputStreamClass *wocky_test_input_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_test_input_stream_class); GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (wocky_test_input_stream_class); obj_class->dispose = wocky_test_input_stream_dispose; stream_class->read_fn = wocky_test_input_stream_read; stream_class->read_async = wocky_test_input_stream_read_async; stream_class->read_finish = wocky_test_input_stream_read_finish; } /* Output stream */ enum { OUTPUT_DATA_WRITTEN, LAST_SIGNAL }; static guint output_signals[LAST_SIGNAL] = {0}; static gssize wocky_test_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyTestOutputStream *self = WOCKY_TEST_OUTPUT_STREAM (stream); GArray *data; gsize written = count; if (self->mode == WOCKY_TEST_STREAM_WRITE_INCOMPLETE) written = MAX (count/2, 1); if (self->write_error != NULL) { *error = self->write_error; self->write_error = NULL; return -1; } data = g_array_sized_new (FALSE, FALSE, sizeof (guint8), written); g_array_insert_vals (data, 0, buffer, written); g_async_queue_push (self->queue, data); g_signal_emit (self, output_signals[OUTPUT_DATA_WRITTEN], 0); return written; } static void wocky_test_output_stream_write_async (GOutputStream *stream, const void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; GError *error = NULL; gssize result; result = wocky_test_output_stream_write (stream, buffer, count, cancellable, &error); simple = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_test_output_stream_write_async); if (result == -1) { g_simple_async_result_set_from_error (simple, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gssize (simple, result); } g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static gssize wocky_test_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return -1; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (stream), wocky_test_output_stream_write_async), -1); return g_simple_async_result_get_op_res_gssize ( G_SIMPLE_ASYNC_RESULT (result)); } static void wocky_test_output_stream_dispose (GObject *object) { WockyTestOutputStream *self = WOCKY_TEST_OUTPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; g_async_queue_push (self->queue, g_array_sized_new (FALSE, FALSE, sizeof (guint8), 0)); g_async_queue_unref (self->queue); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_test_output_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_test_output_stream_parent_class)->dispose (object); } static void queue_destroyed (gpointer data) { g_array_free ((GArray *) data, TRUE); } static void wocky_test_output_stream_init (WockyTestOutputStream *self) { self->queue = g_async_queue_new_full (queue_destroyed); } static void wocky_test_output_stream_class_init ( WockyTestOutputStreamClass *wocky_test_output_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_test_output_stream_class); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (wocky_test_output_stream_class); obj_class->dispose = wocky_test_output_stream_dispose; stream_class->write_fn = wocky_test_output_stream_write; stream_class->write_async = wocky_test_output_stream_write_async; stream_class->write_finish = wocky_test_output_stream_write_finish; output_signals[OUTPUT_DATA_WRITTEN] = g_signal_new ("data-written", G_OBJECT_CLASS_TYPE(wocky_test_output_stream_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } void wocky_test_input_stream_set_read_error (GInputStream *stream) { WockyTestInputStream *self = WOCKY_TEST_INPUT_STREAM (stream); if (self->read_result == NULL) { /* No pending read operation. Set the error so next read will fail */ self->read_error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "read error"); return; } g_simple_async_result_set_error (self->read_result, G_IO_ERROR, G_IO_ERROR_FAILED, "read error"); read_async_complete (self); } void wocky_test_output_stream_set_write_error (GOutputStream *stream) { WockyTestOutputStream *self = WOCKY_TEST_OUTPUT_STREAM (stream); self->write_error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "write error"); } void wocky_test_stream_set_mode (GInputStream *stream, WockyTestStreamReadMode mode) { WOCKY_TEST_INPUT_STREAM (stream)->mode = mode; } void wocky_test_stream_cork (GInputStream *stream, gboolean cork) { WockyTestInputStream *tstream = WOCKY_TEST_INPUT_STREAM (stream); tstream->corked = cork; if (cork == FALSE) wocky_test_input_stream_try_read (tstream); } void wocky_test_stream_set_direct_read_callback (GInputStream *stream, WockyTestStreamDirectReadCb cb, gpointer user_data) { WockyTestInputStream *tstream = WOCKY_TEST_INPUT_STREAM (stream); tstream->direct_read_cb = cb; tstream->direct_read_user_data = user_data; } void wocky_test_stream_set_write_mode (GOutputStream *stream, WockyTestStreamWriteMode mode) { WOCKY_TEST_OUTPUT_STREAM (stream)->mode = mode; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-resource-contact-test.c0000644000175000017500000000620212735676345027510 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_instantiation (void) { WockyBareContact *bare_contact; WockyResourceContact *resource_contact; bare_contact = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "juliet@example.net", NULL); resource_contact = g_object_new (WOCKY_TYPE_RESOURCE_CONTACT, "resource", "Balcony", "bare-contact", bare_contact, NULL); g_assert (WOCKY_IS_RESOURCE_CONTACT (resource_contact)); /* WockyResourceContact is a sub-class of WockyContact */ g_assert (WOCKY_IS_CONTACT (resource_contact)); g_object_unref (resource_contact); resource_contact = wocky_resource_contact_new (bare_contact, "Balcony"); g_assert (WOCKY_IS_RESOURCE_CONTACT (resource_contact)); g_assert (WOCKY_IS_CONTACT (resource_contact)); g_object_unref (resource_contact); g_object_unref (bare_contact); } static void test_get_resource (void) { WockyBareContact *bare_contact; WockyResourceContact *resource_contact; bare_contact = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "juliet@example.net", NULL); resource_contact = wocky_resource_contact_new (bare_contact, "Balcony"); g_assert (!wocky_strdiff ( wocky_resource_contact_get_resource (resource_contact), "Balcony")); g_object_unref (bare_contact); g_object_unref (resource_contact); } static void test_get_bare_contact (void) { WockyBareContact *bare_contact; WockyResourceContact *resource_contact; bare_contact = g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", "juliet@example.net", NULL); resource_contact = wocky_resource_contact_new (bare_contact, "Balcony"); g_assert (wocky_resource_contact_get_bare_contact (resource_contact) == bare_contact); g_object_unref (bare_contact); g_object_unref (resource_contact); } static void test_equal (void) { WockyBareContact *a, *b; WockyResourceContact *a_1, *a_2, *b_1; a = wocky_bare_contact_new ("a@example.net"); a_1 = wocky_resource_contact_new (a, "Resource1"); g_assert (wocky_resource_contact_equal (a_1, a_1)); g_assert (!wocky_resource_contact_equal (a_1, NULL)); g_assert (!wocky_resource_contact_equal (NULL, a_1)); a_2 = wocky_resource_contact_new (a, "Resource2"); g_assert (!wocky_resource_contact_equal (a_1, a_2)); b = wocky_bare_contact_new ("b@example.net"); b_1 = wocky_resource_contact_new (b, "Resource1"); g_assert (!wocky_resource_contact_equal (b_1, a_1)); g_assert (!wocky_resource_contact_equal (b_1, a_2)); g_object_unref (a); g_object_unref (b); g_object_unref (a_1); g_object_unref (a_2); g_object_unref (b_1); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/resource-contact/instantiation", test_instantiation); g_test_add_func ("/resource-contact/get-resource", test_get_resource); g_test_add_func ("/resource-contact/get-bare-contact", test_get_bare_contact); g_test_add_func ("/resource-contact/equal", test_equal); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-session-test.c0000644000175000017500000000330012735676345025707 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-helper.h" static void test_instantiation (void) { WockyTestStream *stream; WockyXmppConnection *connection; WockySession *session; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); session = wocky_session_new_with_connection (connection, "example.com"); g_assert (session != NULL); g_assert (WOCKY_IS_SESSION (session)); g_object_unref (stream); g_object_unref (connection); g_object_unref (session); } static void test_get_porter (void) { test_data_t *test = setup_test (); WockySession *session; WockyPorter *porter; session = wocky_session_new_with_connection (test->in, "example.com"); porter = wocky_session_get_porter (session); g_assert (WOCKY_IS_PORTER (porter)); g_object_unref (session); teardown_test (test); } static void test_get_contact_factory (void) { test_data_t *test = setup_test (); WockySession *session; WockyContactFactory *factory; session = wocky_session_new_with_connection (test->in, "example.com"); factory = wocky_session_get_contact_factory (session); g_assert (WOCKY_IS_CONTACT_FACTORY (factory)); g_object_unref (session); teardown_test (test); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/session/instantiation", test_instantiation); g_test_add_func ("/session/get-porter", test_get_porter); g_test_add_func ("/session/get-contact-factory", test_get_contact_factory); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-pubsub-service-test.c0000644000175000017500000005672012735676345027200 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-pubsub-test-helpers.h" #include "wocky-test-helper.h" #include "wocky-test-stream.h" /* Test instantiating a WockyPubsubService object */ static WockySession * create_session (void) { WockyXmppConnection *connection; WockyTestStream *stream; WockySession *session; stream = g_object_new (WOCKY_TYPE_TEST_STREAM, NULL); connection = wocky_xmpp_connection_new (stream->stream0); session = wocky_session_new_with_connection (connection, "example.com"); g_object_unref (connection); g_object_unref (stream); return session; } static void test_instantiation (void) { WockyPubsubService *pubsub; WockySession *session; session = create_session (); pubsub = wocky_pubsub_service_new (session, "pubsub.localhost"); g_assert (pubsub != NULL); g_object_unref (pubsub); g_object_unref (session); } /* Test wocky_pubsub_service_ensure_node */ static void test_ensure_node (void) { WockyPubsubService *pubsub; WockySession *session; WockyPubsubNode *node; session = create_session (); pubsub = wocky_pubsub_service_new (session, "pubsub.localhost"); node = wocky_pubsub_service_lookup_node (pubsub, "node1"); g_assert (node == NULL); node = wocky_pubsub_service_ensure_node (pubsub, "node1"); g_assert (node != NULL); node = wocky_pubsub_service_lookup_node (pubsub, "node1"); g_assert (node != NULL); /* destroy the node */ g_object_unref (node); node = wocky_pubsub_service_lookup_node (pubsub, "node1"); g_assert (node == NULL); g_object_unref (pubsub); g_object_unref (session); } /* Test wocky_pubsub_service_get_default_node_configuration_async */ static gboolean test_get_default_node_configuration_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "default", '(', "x", ':', WOCKY_XMPP_NS_DATA, '@', "type", "form", '(', "field", '@', "type", "hidden", '@', "var", "FORM_TYPE", '(', "value", '$', WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG, ')', ')', '(', "field", '@', "var", "pubsub#title", '@', "type", "text-single", '@', "label", "Title", ')', '(', "field", '@', "var", "pubsub#deliver_notifications", '@', "type", "boolean", '@', "label", "Deliver event notifications", ')', ')', ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_get_default_node_configuration_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyDataForm *form; WockyDataFormField *field; form = wocky_pubsub_service_get_default_node_configuration_finish ( WOCKY_PUBSUB_SERVICE (source), res, NULL); g_assert (form != NULL); field = g_hash_table_lookup (form->fields, "pubsub#title"); g_assert (field != NULL); field = g_hash_table_lookup (form->fields, "pubsub#deliver_notifications"); g_assert (field != NULL); g_object_unref (form); test->outstanding--; g_main_loop_quit (test->loop); } static void get_default_node_configuration_test (WockyPorterHandlerFunc iq_cb, GAsyncReadyCallback get_cb) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "default", ')', ')', NULL); wocky_pubsub_service_get_default_node_configuration_async (pubsub, NULL, get_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } static void test_get_default_node_configuration (void) { get_default_node_configuration_test ( test_get_default_node_configuration_iq_cb, test_get_default_node_configuration_cb); } /* Try to retrieve default node configuration and get a insufficient * privileges error */ static gboolean test_get_default_node_configuration_insufficient_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_error (stanza, '(', "error", '@', "type", "auth", '(', "forbidden", ':', WOCKY_XMPP_NS_STANZAS, ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_get_default_node_configuration_insufficient_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyDataForm *form; GError *error = NULL; form = wocky_pubsub_service_get_default_node_configuration_finish ( WOCKY_PUBSUB_SERVICE (source), res, &error); g_assert (form == NULL); g_assert_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_FORBIDDEN); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_get_default_node_configuration_insufficient (void) { get_default_node_configuration_test ( test_get_default_node_configuration_insufficient_iq_cb, test_get_default_node_configuration_insufficient_cb); } /* Create a node with default config */ static gboolean test_create_node_no_config_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyNode *node; node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "pubsub", WOCKY_XMPP_NS_PUBSUB); g_assert (node != NULL); node = wocky_node_get_child (node, "create"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "node"), "node1")); reply = wocky_stanza_build_iq_result (stanza, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_create_node_no_config_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyPubsubNode *node; node = wocky_pubsub_service_create_node_finish (WOCKY_PUBSUB_SERVICE (source), res, NULL); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_pubsub_node_get_name (node), "node1")); g_object_unref (node); test->outstanding--; g_main_loop_quit (test->loop); } static void create_node_test (WockyPorterHandlerFunc iq_cb, GAsyncReadyCallback create_cb, const gchar *node_name) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "create", ')', ')', NULL); wocky_pubsub_service_create_node_async (pubsub, node_name, NULL, NULL, create_cb, test); test->outstanding += 2; test_wait_pending (test); g_object_unref (pubsub); test_close_both_porters (test); teardown_test (test); } static void test_create_node_no_config (void) { create_node_test (test_create_node_no_config_iq_cb, test_create_node_no_config_cb, "node1"); } /* creation of a node fails because service does not support node creation */ static gboolean test_create_node_unsupported_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_error (stanza, '(', "error", '@', "type", "cancel", '(', "feature-not-implemented", ':', WOCKY_XMPP_NS_STANZAS, ')', '(', "unsupported", ':', WOCKY_XMPP_NS_PUBSUB_ERRORS, '@', "feature", "create-nodes", ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_create_node_unsupported_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyPubsubNode *node; GError *error = NULL; node = wocky_pubsub_service_create_node_finish (WOCKY_PUBSUB_SERVICE (source), res, &error); g_assert (node == NULL); g_assert_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED); g_error_free (error); test->outstanding--; g_main_loop_quit (test->loop); } static void test_create_node_unsupported (void) { create_node_test (test_create_node_unsupported_iq_cb, test_create_node_unsupported_cb, "node1"); } /* Create an instant node (no name passed) */ static gboolean test_create_instant_node_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "create", '@', "node", "instant_node", ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_create_instant_node_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyPubsubNode *node; node = wocky_pubsub_service_create_node_finish (WOCKY_PUBSUB_SERVICE (source), res, NULL); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_pubsub_node_get_name (node), "instant_node")); g_object_unref (node); test->outstanding--; g_main_loop_quit (test->loop); } static void test_create_instant_node (void) { create_node_test (test_create_instant_node_iq_cb, test_create_instant_node_cb, NULL); } /* Ask for a node with one name, get one back with another */ static gboolean test_create_node_renamed_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyNode *node; node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "pubsub", WOCKY_XMPP_NS_PUBSUB); g_assert (node != NULL); node = wocky_node_get_child (node, "create"); g_assert (node != NULL); g_assert (!wocky_strdiff (wocky_node_get_attribute (node, "node"), "node1")); reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "create", '@', "node", "metal-bird", ')', ')', NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_create_node_renamed_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyPubsubNode *node; node = wocky_pubsub_service_create_node_finish (WOCKY_PUBSUB_SERVICE (source), res, NULL); g_assert (node != NULL); g_assert_cmpstr (wocky_pubsub_node_get_name (node), ==, "metal-bird"); g_object_unref (node); test->outstanding--; g_main_loop_quit (test->loop); } static void test_create_node_renamed (void) { create_node_test (test_create_node_renamed_iq_cb, test_create_node_renamed_cb, "node1"); } /* Create a node with configuration */ static void test_create_node_config_config_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyDataForm *form; gboolean set_succeeded; form = wocky_pubsub_service_get_default_node_configuration_finish ( WOCKY_PUBSUB_SERVICE (source), res, NULL); g_assert (form != NULL); set_succeeded = wocky_data_form_set_string (form, "pubsub#title", "Badger", FALSE); g_assert (set_succeeded); set_succeeded = wocky_data_form_set_boolean (form, "pubsub#deliver_notifications", FALSE, FALSE); g_assert (set_succeeded); wocky_pubsub_service_create_node_async (WOCKY_PUBSUB_SERVICE (source), "node1", form, NULL, test_create_node_no_config_cb, test); g_object_unref (form); test->outstanding--; g_main_loop_quit (test->loop); } static gboolean test_create_node_config_create_iq_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { test_data_t *test = (test_data_t *) user_data; WockyStanza *reply; WockyNode *node; GSList *l; gboolean form_type = FALSE, title = FALSE, notif = FALSE; node = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "pubsub", WOCKY_XMPP_NS_PUBSUB); g_assert (node != NULL); node = wocky_node_get_child (node, "configure"); g_assert (node != NULL); node = wocky_node_get_child_ns (node, "x", WOCKY_XMPP_NS_DATA); g_assert (node != NULL); for (l = node->children; l != NULL; l = g_slist_next (l)) { WockyNode *field = l->data; const gchar *type, *var, *value = NULL; WockyNode *v; g_assert (!wocky_strdiff (field->name, "field")); var = wocky_node_get_attribute (field, "var"); type = wocky_node_get_attribute (field, "type"); v = wocky_node_get_child (field, "value"); g_assert (v != NULL); value = v->content; if (!wocky_strdiff (var, "FORM_TYPE")) { g_assert (!wocky_strdiff (type, "hidden")); g_assert (!wocky_strdiff (value, WOCKY_XMPP_NS_PUBSUB_NODE_CONFIG)); form_type = TRUE; } else if (!wocky_strdiff (var, "pubsub#title")) { g_assert (!wocky_strdiff (type, "text-single")); g_assert (!wocky_strdiff (value, "Badger")); title = TRUE; } else if (!wocky_strdiff (var, "pubsub#deliver_notifications")) { g_assert (!wocky_strdiff (type, "boolean")); g_assert (!wocky_strdiff (value, "0")); notif = TRUE; } else g_assert_not_reached (); } g_assert (form_type && title && notif); reply = wocky_stanza_build_iq_result (stanza, NULL); wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void test_create_node_config (void) { test_data_t *test = setup_test (); WockyPubsubService *pubsub; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_get_default_node_configuration_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB_OWNER, '(', "default", ')', ')', NULL); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_create_node_config_create_iq_cb, test, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "create", ')', ')', NULL); wocky_pubsub_service_get_default_node_configuration_async (pubsub, NULL, test_create_node_config_config_cb, test); test->outstanding += 4; test_wait_pending (test); test_close_both_porters (test); teardown_test (test); g_object_unref (pubsub); } /* Four examples taken from §5.6 Retrieve Subscriptions */ typedef enum { MODE_NORMAL, MODE_NO_SUBSCRIPTIONS, MODE_BZZT, MODE_AT_NODE } RetrieveSubscriptionsMode; typedef struct { test_data_t *test; RetrieveSubscriptionsMode mode; } RetrieveSubscriptionsCtx; static CannedSubscriptions normal_subs[] = { { "node1", "francisco@denmark.lit", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, NULL }, { "node2", "francisco@denmark.lit/bonghits", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, NULL }, { "node5", "francisco@denmark.lit", "unconfigured", WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED, NULL }, { "node6", "francisco@denmark.lit", "pending", WOCKY_PUBSUB_SUBSCRIPTION_PENDING, NULL }, { NULL, } }; static CannedSubscriptions bonghit_subs[] = { { "bonghits", "bernardo@denmark.lit", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, "123-abc" }, { "bonghits", "bernardo@denmark.lit/i-am-poorly-read", "subscribed", WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, "004-yyy" }, { NULL, } }; static WockyStanza * make_subscriptions_response (WockyStanza *stanza, const gchar *node, CannedSubscriptions *subs) { WockyStanza *reply; WockyNode *s; reply = wocky_stanza_build_iq_result (stanza, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "subscriptions", '*', &s, ')', ')', NULL); if (node != NULL) wocky_node_set_attribute (s, "node", node); test_pubsub_add_subscription_nodes (s, subs, (node == NULL)); return reply; } static gboolean test_retrieve_subscriptions_iq_cb ( WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { RetrieveSubscriptionsCtx *ctx = user_data; test_data_t *test = ctx->test; WockyStanza *reply, *expected; WockyNode *subscriptions; expected = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, "pubsub.localhost", '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "subscriptions", '*', &subscriptions, ')', ')', NULL); if (ctx->mode == MODE_AT_NODE) wocky_node_set_attribute (subscriptions, "node", "bonghits"); test_assert_stanzas_equal_no_id (stanza, expected); g_object_unref (expected); switch (ctx->mode) { case MODE_NORMAL: reply = make_subscriptions_response (stanza, NULL, normal_subs); break; case MODE_NO_SUBSCRIPTIONS: reply = make_subscriptions_response (stanza, NULL, NULL); break; case MODE_BZZT: { GError e = { WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, "FIXME: " }; reply = wocky_stanza_build_iq_error (stanza, NULL); wocky_stanza_error_to_node (&e, wocky_stanza_get_top_node (reply)); break; } case MODE_AT_NODE: reply = make_subscriptions_response (stanza, "bonghits", bonghit_subs); break; default: g_assert_not_reached (); } wocky_porter_send (porter, reply); g_object_unref (reply); test->outstanding--; g_main_loop_quit (test->loop); return TRUE; } static void check_subscriptions ( GObject *source, GAsyncResult *res, CannedSubscriptions *expected_subs) { GList *subscriptions; g_assert (wocky_pubsub_service_retrieve_subscriptions_finish ( WOCKY_PUBSUB_SERVICE (source), res, &subscriptions, NULL)); test_pubsub_check_and_free_subscriptions (subscriptions, expected_subs); } static void retrieve_subscriptions_cb (GObject *source, GAsyncResult *res, gpointer user_data) { RetrieveSubscriptionsCtx *ctx = user_data; test_data_t *test = ctx->test; GError *error = NULL; switch (ctx->mode) { case MODE_NORMAL: check_subscriptions (source, res, normal_subs); break; case MODE_NO_SUBSCRIPTIONS: check_subscriptions (source, res, normal_subs + 4); break; case MODE_BZZT: g_assert (!wocky_pubsub_service_retrieve_subscriptions_finish ( WOCKY_PUBSUB_SERVICE (source), res, NULL, &error)); /* FIXME: moar detail */ g_assert_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED); g_clear_error (&error); break; case MODE_AT_NODE: check_subscriptions (source, res, bonghit_subs); break; default: g_assert_not_reached (); } test->outstanding--; g_main_loop_quit (test->loop); } static void test_retrieve_subscriptions (gconstpointer mode_) { test_data_t *test = setup_test (); RetrieveSubscriptionsMode mode = GPOINTER_TO_UINT (mode_); RetrieveSubscriptionsCtx ctx = { test, mode }; WockyPubsubService *pubsub; WockyPubsubNode *node = NULL; test_open_both_connections (test); wocky_porter_start (test->sched_out); wocky_session_start (test->session_in); pubsub = wocky_pubsub_service_new (test->session_in, "pubsub.localhost"); wocky_porter_register_handler_from_anyone (test->sched_out, WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_PORTER_HANDLER_PRIORITY_MAX, test_retrieve_subscriptions_iq_cb, &ctx, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "subscriptions", ')', ')', NULL); if (mode == MODE_AT_NODE) node = wocky_pubsub_service_ensure_node (pubsub, "bonghits"); wocky_pubsub_service_retrieve_subscriptions_async (pubsub, node, NULL, retrieve_subscriptions_cb, &ctx); test->outstanding += 2; test_wait_pending (test); if (node != NULL) g_object_unref (node); test_close_both_porters (test); teardown_test (test); g_object_unref (pubsub); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/pubsub-service/instantiation", test_instantiation); g_test_add_func ("/pubsub-service/ensure_node", test_ensure_node); g_test_add_func ("/pubsub-service/get-default-node-configuration", test_get_default_node_configuration); g_test_add_func ( "/pubsub-service/get-default-node-configuration-insufficient", test_get_default_node_configuration_insufficient); g_test_add_data_func ("/pubsub-service/retrieve-subscriptions/normal", GUINT_TO_POINTER (MODE_NORMAL), test_retrieve_subscriptions); g_test_add_data_func ("/pubsub-service/retrieve-subscriptions/none", GUINT_TO_POINTER (MODE_NO_SUBSCRIPTIONS), test_retrieve_subscriptions); g_test_add_data_func ("/pubsub-service/retrieve-subscriptions/error", GUINT_TO_POINTER (MODE_BZZT), test_retrieve_subscriptions); g_test_add_data_func ("/pubsub-service/retrieve-subscriptions/for-node", GUINT_TO_POINTER (MODE_AT_NODE), test_retrieve_subscriptions); g_test_add_func ("/pubsub-service/create-node-no-config", test_create_node_no_config); g_test_add_func ("/pubsub-service/create-node-unsupported", test_create_node_unsupported); g_test_add_func ("/pubsub-service/create-instant-node", test_create_instant_node); g_test_add_func ("/pubsub-service/create-node-renamed", test_create_node_renamed); g_test_add_func ("/pubsub-service/create-node-config", test_create_node_config); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/Makefile.in0000644000175000017500000030201113012560753023777 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_2) @HAVE_LIBSASL2_TRUE@am__append_1 = wocky-test-sasl-auth @HAVE_LIBSASL2_TRUE@am__append_2 = wocky-dummy-xmpp-server check_PROGRAMS = $(am__EXEEXT_2) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/tools/check-coding-style.mk subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/wocky-gcov.m4 $(top_srcdir)/m4/wocky-lcov.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @HAVE_LIBSASL2_TRUE@am__EXEEXT_1 = wocky-test-sasl-auth$(EXEEXT) am__EXEEXT_2 = wocky-bare-contact-test$(EXEEXT) \ wocky-caps-hash-test$(EXEEXT) wocky-connector-test$(EXEEXT) \ wocky-contact-factory-test$(EXEEXT) \ wocky-data-form-test$(EXEEXT) \ wocky-jid-validation-test$(EXEEXT) \ wocky-loopback-test$(EXEEXT) wocky-node-tree-test$(EXEEXT) \ wocky-pep-service-test$(EXEEXT) wocky-ping-test$(EXEEXT) \ wocky-porter-test$(EXEEXT) wocky-pubsub-node-test$(EXEEXT) \ wocky-pubsub-service-test$(EXEEXT) \ wocky-resource-contact-test$(EXEEXT) \ wocky-roster-test$(EXEEXT) wocky-sasl-utils-test$(EXEEXT) \ wocky-scram-sha1-test$(EXEEXT) wocky-session-test$(EXEEXT) \ wocky-stanza-test$(EXEEXT) wocky-tls-test$(EXEEXT) \ wocky-utils-test$(EXEEXT) wocky-xmpp-connection-test$(EXEEXT) \ wocky-xmpp-node-test$(EXEEXT) wocky-xmpp-reader-test$(EXEEXT) \ wocky-xmpp-readwrite-test$(EXEEXT) \ wocky-http-proxy-test$(EXEEXT) $(am__EXEEXT_1) @HAVE_LIBSASL2_TRUE@am__EXEEXT_3 = wocky-dummy-xmpp-server$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_wocky_bare_contact_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-bare-contact-test.$(OBJEXT) wocky_bare_contact_test_OBJECTS = \ $(am_wocky_bare_contact_test_OBJECTS) wocky_bare_contact_test_LDADD = $(LDADD) wocky_bare_contact_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_wocky_caps_hash_test_OBJECTS = wocky-caps-hash-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_caps_hash_test_OBJECTS = $(am_wocky_caps_hash_test_OBJECTS) wocky_caps_hash_test_LDADD = $(LDADD) wocky_caps_hash_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_connector_test_OBJECTS = \ wocky_connector_test-wocky-connector-test.$(OBJEXT) \ wocky_connector_test-wocky-test-sasl-auth-server.$(OBJEXT) \ wocky_connector_test-wocky-test-connector-server.$(OBJEXT) \ wocky_connector_test-wocky-test-helper.$(OBJEXT) \ wocky_connector_test-wocky-test-stream.$(OBJEXT) \ wocky_connector_test-test-resolver.$(OBJEXT) wocky_connector_test_OBJECTS = $(am_wocky_connector_test_OBJECTS) wocky_connector_test_DEPENDENCIES = $(LDADD) wocky_connector_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(wocky_connector_test_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_wocky_contact_factory_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) \ wocky-contact-factory-test.$(OBJEXT) wocky_contact_factory_test_OBJECTS = \ $(am_wocky_contact_factory_test_OBJECTS) wocky_contact_factory_test_LDADD = $(LDADD) wocky_contact_factory_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_data_form_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-data-form-test.$(OBJEXT) wocky_data_form_test_OBJECTS = $(am_wocky_data_form_test_OBJECTS) wocky_data_form_test_LDADD = $(LDADD) wocky_data_form_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_dummy_xmpp_server_OBJECTS = \ wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.$(OBJEXT) \ wocky_dummy_xmpp_server-wocky-test-connector-server.$(OBJEXT) \ wocky_dummy_xmpp_server-wocky-test-helper.$(OBJEXT) \ wocky_dummy_xmpp_server-wocky-test-stream.$(OBJEXT) \ wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.$(OBJEXT) wocky_dummy_xmpp_server_OBJECTS = \ $(am_wocky_dummy_xmpp_server_OBJECTS) wocky_dummy_xmpp_server_DEPENDENCIES = $(LDADD) wocky_dummy_xmpp_server_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_wocky_http_proxy_test_OBJECTS = wocky-http-proxy-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_http_proxy_test_OBJECTS = $(am_wocky_http_proxy_test_OBJECTS) wocky_http_proxy_test_LDADD = $(LDADD) wocky_http_proxy_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_jid_validation_test_OBJECTS = \ wocky-jid-validation-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_jid_validation_test_OBJECTS = \ $(am_wocky_jid_validation_test_OBJECTS) wocky_jid_validation_test_LDADD = $(LDADD) wocky_jid_validation_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_loopback_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-loopback-test.$(OBJEXT) wocky_loopback_test_OBJECTS = $(am_wocky_loopback_test_OBJECTS) wocky_loopback_test_LDADD = $(LDADD) wocky_loopback_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_node_tree_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-node-tree-test.$(OBJEXT) wocky_node_tree_test_OBJECTS = $(am_wocky_node_tree_test_OBJECTS) wocky_node_tree_test_LDADD = $(LDADD) wocky_node_tree_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_pep_service_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-pep-service-test.$(OBJEXT) wocky_pep_service_test_OBJECTS = $(am_wocky_pep_service_test_OBJECTS) wocky_pep_service_test_LDADD = $(LDADD) wocky_pep_service_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_ping_test_OBJECTS = wocky-ping-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_ping_test_OBJECTS = $(am_wocky_ping_test_OBJECTS) wocky_ping_test_LDADD = $(LDADD) wocky_ping_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_porter_test_OBJECTS = wocky-porter-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_porter_test_OBJECTS = $(am_wocky_porter_test_OBJECTS) wocky_porter_test_LDADD = $(LDADD) wocky_porter_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_pubsub_node_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) \ wocky-pubsub-test-helpers.$(OBJEXT) \ wocky-pubsub-node-test.$(OBJEXT) wocky_pubsub_node_test_OBJECTS = $(am_wocky_pubsub_node_test_OBJECTS) wocky_pubsub_node_test_LDADD = $(LDADD) wocky_pubsub_node_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_pubsub_service_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) \ wocky-pubsub-test-helpers.$(OBJEXT) \ wocky-pubsub-service-test.$(OBJEXT) wocky_pubsub_service_test_OBJECTS = \ $(am_wocky_pubsub_service_test_OBJECTS) wocky_pubsub_service_test_LDADD = $(LDADD) wocky_pubsub_service_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_resource_contact_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) \ wocky-resource-contact-test.$(OBJEXT) wocky_resource_contact_test_OBJECTS = \ $(am_wocky_resource_contact_test_OBJECTS) wocky_resource_contact_test_LDADD = $(LDADD) wocky_resource_contact_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_roster_test_OBJECTS = wocky-roster-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_roster_test_OBJECTS = $(am_wocky_roster_test_OBJECTS) wocky_roster_test_LDADD = $(LDADD) wocky_roster_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_sasl_utils_test_OBJECTS = wocky-sasl-utils-test.$(OBJEXT) wocky_sasl_utils_test_OBJECTS = $(am_wocky_sasl_utils_test_OBJECTS) wocky_sasl_utils_test_LDADD = $(LDADD) wocky_sasl_utils_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_scram_sha1_test_OBJECTS = wocky-scram-sha1-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_scram_sha1_test_OBJECTS = $(am_wocky_scram_sha1_test_OBJECTS) wocky_scram_sha1_test_LDADD = $(LDADD) wocky_scram_sha1_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_session_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-session-test.$(OBJEXT) wocky_session_test_OBJECTS = $(am_wocky_session_test_OBJECTS) wocky_session_test_LDADD = $(LDADD) wocky_session_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_stanza_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-stanza-test.$(OBJEXT) wocky_stanza_test_OBJECTS = $(am_wocky_stanza_test_OBJECTS) wocky_stanza_test_LDADD = $(LDADD) wocky_stanza_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_test_sasl_auth_OBJECTS = \ wocky_test_sasl_auth-wocky-test-helper.$(OBJEXT) \ wocky_test_sasl_auth-wocky-test-sasl-auth.$(OBJEXT) \ wocky_test_sasl_auth-wocky-test-sasl-handler.$(OBJEXT) \ wocky_test_sasl_auth-wocky-test-sasl-auth-server.$(OBJEXT) \ wocky_test_sasl_auth-wocky-test-stream.$(OBJEXT) wocky_test_sasl_auth_OBJECTS = $(am_wocky_test_sasl_auth_OBJECTS) wocky_test_sasl_auth_DEPENDENCIES = $(LDADD) wocky_test_sasl_auth_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_wocky_tls_test_OBJECTS = wocky_tls_test-wocky-tls-test.$(OBJEXT) \ wocky_tls_test-wocky-test-helper.$(OBJEXT) \ wocky_tls_test-wocky-test-stream.$(OBJEXT) wocky_tls_test_OBJECTS = $(am_wocky_tls_test_OBJECTS) wocky_tls_test_LDADD = $(LDADD) wocky_tls_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la wocky_tls_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(wocky_tls_test_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_wocky_utils_test_OBJECTS = wocky-utils-test.$(OBJEXT) wocky_utils_test_OBJECTS = $(am_wocky_utils_test_OBJECTS) wocky_utils_test_LDADD = $(LDADD) wocky_utils_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_xmpp_connection_test_OBJECTS = \ wocky-xmpp-connection-test.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) wocky-test-stream.$(OBJEXT) wocky_xmpp_connection_test_OBJECTS = \ $(am_wocky_xmpp_connection_test_OBJECTS) wocky_xmpp_connection_test_LDADD = $(LDADD) wocky_xmpp_connection_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_xmpp_node_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-xmpp-node-test.$(OBJEXT) wocky_xmpp_node_test_OBJECTS = $(am_wocky_xmpp_node_test_OBJECTS) wocky_xmpp_node_test_LDADD = $(LDADD) wocky_xmpp_node_test_DEPENDENCIES = $(top_builddir)/wocky/libwocky.la am_wocky_xmpp_reader_test_OBJECTS = wocky-test-helper.$(OBJEXT) \ wocky-test-stream.$(OBJEXT) wocky-xmpp-reader-test.$(OBJEXT) wocky_xmpp_reader_test_OBJECTS = $(am_wocky_xmpp_reader_test_OBJECTS) wocky_xmpp_reader_test_LDADD = $(LDADD) wocky_xmpp_reader_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la am_wocky_xmpp_readwrite_test_OBJECTS = wocky-test-stream.$(OBJEXT) \ wocky-test-helper.$(OBJEXT) \ wocky-xmpp-readwrite-test.$(OBJEXT) wocky_xmpp_readwrite_test_OBJECTS = \ $(am_wocky_xmpp_readwrite_test_OBJECTS) wocky_xmpp_readwrite_test_LDADD = $(LDADD) wocky_xmpp_readwrite_test_DEPENDENCIES = \ $(top_builddir)/wocky/libwocky.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(wocky_bare_contact_test_SOURCES) \ $(wocky_caps_hash_test_SOURCES) \ $(wocky_connector_test_SOURCES) \ $(wocky_contact_factory_test_SOURCES) \ $(wocky_data_form_test_SOURCES) \ $(wocky_dummy_xmpp_server_SOURCES) \ $(wocky_http_proxy_test_SOURCES) \ $(wocky_jid_validation_test_SOURCES) \ $(wocky_loopback_test_SOURCES) $(wocky_node_tree_test_SOURCES) \ $(wocky_pep_service_test_SOURCES) $(wocky_ping_test_SOURCES) \ $(wocky_porter_test_SOURCES) $(wocky_pubsub_node_test_SOURCES) \ $(wocky_pubsub_service_test_SOURCES) \ $(wocky_resource_contact_test_SOURCES) \ $(wocky_roster_test_SOURCES) $(wocky_sasl_utils_test_SOURCES) \ $(wocky_scram_sha1_test_SOURCES) $(wocky_session_test_SOURCES) \ $(wocky_stanza_test_SOURCES) $(wocky_test_sasl_auth_SOURCES) \ $(wocky_tls_test_SOURCES) $(wocky_utils_test_SOURCES) \ $(wocky_xmpp_connection_test_SOURCES) \ $(wocky_xmpp_node_test_SOURCES) \ $(wocky_xmpp_reader_test_SOURCES) \ $(wocky_xmpp_readwrite_test_SOURCES) DIST_SOURCES = $(wocky_bare_contact_test_SOURCES) \ $(wocky_caps_hash_test_SOURCES) \ $(wocky_connector_test_SOURCES) \ $(wocky_contact_factory_test_SOURCES) \ $(wocky_data_form_test_SOURCES) \ $(wocky_dummy_xmpp_server_SOURCES) \ $(wocky_http_proxy_test_SOURCES) \ $(wocky_jid_validation_test_SOURCES) \ $(wocky_loopback_test_SOURCES) $(wocky_node_tree_test_SOURCES) \ $(wocky_pep_service_test_SOURCES) $(wocky_ping_test_SOURCES) \ $(wocky_porter_test_SOURCES) $(wocky_pubsub_node_test_SOURCES) \ $(wocky_pubsub_service_test_SOURCES) \ $(wocky_resource_contact_test_SOURCES) \ $(wocky_roster_test_SOURCES) $(wocky_sasl_utils_test_SOURCES) \ $(wocky_scram_sha1_test_SOURCES) $(wocky_session_test_SOURCES) \ $(wocky_stanza_test_SOURCES) $(wocky_test_sasl_auth_SOURCES) \ $(wocky_tls_test_SOURCES) $(wocky_utils_test_SOURCES) \ $(wocky_xmpp_connection_test_SOURCES) \ $(wocky_xmpp_node_test_SOURCES) \ $(wocky_xmpp_reader_test_SOURCES) \ $(wocky_xmpp_readwrite_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CODING_STYLE_CHECKS = @ENABLE_CODING_STYLE_CHECKS@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GNUTLS_FOR_STREAM_CIPHERS_CFLAGS = @GNUTLS_FOR_STREAM_CIPHERS_CFLAGS@ GNUTLS_FOR_STREAM_CIPHERS_LIBS = @GNUTLS_FOR_STREAM_CIPHERS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HEADER_DIR = @HEADER_DIR@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV_PATH = @LCOV_PATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBIPHB_CFLAGS = @LIBIPHB_CFLAGS@ LIBIPHB_LIBS = @LIBIPHB_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSASL2_CFLAGS = @LIBSASL2_CFLAGS@ LIBSASL2_LIBS = @LIBSASL2_LIBS@ LIBTOOL = @LIBTOOL@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SOUP_CFLAGS = @SOUP_CFLAGS@ SOUP_LIBS = @SOUP_LIBS@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TLS_CFLAGS = @TLS_CFLAGS@ TLS_LIBS = @TLS_LIBS@ VERSION = @VERSION@ WOCKY_CFLAGS = @WOCKY_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_gcov = @have_gcov@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ############################################################################ # x509 certificates: TEST_DIR := @abs_top_srcdir@/tests SUMMARY := $(TEST_DIR)/summarise-tests.py CERT_DIR := $(TEST_DIR)/certs CA_KEY := $(CERT_DIR)/ca-0-key.pem CA_CERT := $(CERT_DIR)/ca-0-cert.pem SS_KEY := $(CERT_DIR)/ss-key.pem SS_CERT := $(CERT_DIR)/ss-cert.pem REV_KEY := $(CERT_DIR)/rev-key.pem REV_CERT := $(CERT_DIR)/rev-cert.pem EXP_KEY := $(CERT_DIR)/exp-key.pem EXP_CERT := $(CERT_DIR)/exp-cert.pem NEW_KEY := $(CERT_DIR)/new-key.pem NEW_CERT := $(CERT_DIR)/new-cert.pem TLS_KEY := $(CERT_DIR)/tls-key.pem TLS_CERT := $(CERT_DIR)/tls-cert.pem WILD_KEY := $(CERT_DIR)/wild-key.pem WILD_CERT := $(CERT_DIR)/wild-cert.pem BADWILD_KEY := $(CERT_DIR)/badwild-key.pem BADWILD_CERT := $(CERT_DIR)/badwild-cert.pem CA_DIR := $(CERT_DIR)/cas CRL_DIR := $(CERT_DIR)/crl UNKNOWN_KEY := $(CERT_DIR)/unknown-key.pem UNKNOWN_CERT := $(CERT_DIR)/unknown-cert.pem INCLUDES := -I$(top_builddir)/wocky TLSDEFS := -DTLS_CA_KEY_FILE='"$(CA_KEY)"' \ -DTLS_CA_CRT_FILE='"$(CA_CERT)"' \ -DTLS_SS_KEY_FILE='"$(SS_KEY)"' \ -DTLS_SS_CRT_FILE='"$(SS_CERT)"' \ -DTLS_EXP_KEY_FILE='"$(EXP_KEY)"' \ -DTLS_EXP_CRT_FILE='"$(EXP_CERT)"' \ -DTLS_NEW_KEY_FILE='"$(NEW_KEY)"' \ -DTLS_NEW_CRT_FILE='"$(NEW_CERT)"' \ -DTLS_REV_KEY_FILE='"$(REV_KEY)"' \ -DTLS_REV_CRT_FILE='"$(REV_CERT)"' \ -DTLS_UNKNOWN_KEY_FILE='"$(UNKNOWN_KEY)"' \ -DTLS_UNKNOWN_CRT_FILE='"$(UNKNOWN_CERT)"' \ -DTLS_SERVER_KEY_FILE='"$(TLS_KEY)"' \ -DTLS_SERVER_CRT_FILE='"$(TLS_CERT)"'\ -DTLS_WILD_KEY_FILE='"$(WILD_KEY)"' \ -DTLS_WILD_CRT_FILE='"$(WILD_CERT)"' \ -DTLS_BADWILD_CRT_FILE='"$(BADWILD_CERT)"' \ -DTLS_BADWILD_KEY_FILE='"$(BADWILD_KEY)"' \ -DTLS_CRL_DIR='"$(CRL_DIR)"' \ -DTLS_CA_DIR='"$(CA_DIR)"' ############################################################################ TEST_PROGS = wocky-bare-contact-test wocky-caps-hash-test \ wocky-connector-test wocky-contact-factory-test \ wocky-data-form-test wocky-jid-validation-test \ wocky-loopback-test wocky-node-tree-test \ wocky-pep-service-test wocky-ping-test wocky-porter-test \ wocky-pubsub-node-test wocky-pubsub-service-test \ wocky-resource-contact-test wocky-roster-test \ wocky-sasl-utils-test wocky-scram-sha1-test wocky-session-test \ wocky-stanza-test wocky-tls-test wocky-utils-test \ wocky-xmpp-connection-test wocky-xmpp-node-test \ wocky-xmpp-reader-test wocky-xmpp-readwrite-test \ wocky-http-proxy-test $(NULL) $(am__append_1) wocky_bare_contact_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-bare-contact-test.c wocky_caps_hash_test_SOURCES = wocky-caps-hash-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h EXTRA_wocky_connector_test_DEPENDENCIES = $(CA_DIR) certs wocky_connector_test_SOURCES = \ wocky-connector-test.c \ wocky-test-sasl-auth-server.c \ wocky-test-sasl-auth-server.h \ wocky-test-connector-server.c \ wocky-test-connector-server.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ test-resolver.c test-resolver.h wocky_connector_test_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_connector_test_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ $(TLSDEFS) wocky_contact_factory_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-contact-factory-test.c wocky_data_form_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-data-form-test.c wocky_dummy_xmpp_server_SOURCES = wocky-dummy-xmpp-server.c \ wocky-test-connector-server.c wocky-test-connector-server.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-test-sasl-auth-server.c wocky-test-sasl-auth-server.h wocky_dummy_xmpp_server_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_dummy_xmpp_server_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ $(TLSDEFS) wocky_http_proxy_test_SOURCES = wocky-http-proxy-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_jid_validation_test_SOURCES = \ wocky-jid-validation-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_loopback_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-loopback-test.c wocky_node_tree_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-node-tree-test.c wocky_pep_service_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pep-service-test.c wocky_ping_test_SOURCES = \ wocky-ping-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_porter_test_SOURCES = \ wocky-porter-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_pubsub_node_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pubsub-test-helpers.c wocky-pubsub-test-helpers.h \ wocky-pubsub-node-test.c wocky_pubsub_service_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-pubsub-test-helpers.c wocky-pubsub-test-helpers.h \ wocky-pubsub-service-test.c wocky_resource_contact_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-resource-contact-test.c wocky_roster_test_SOURCES = \ wocky-roster-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_sasl_utils_test_SOURCES = wocky-sasl-utils-test.c wocky_scram_sha1_test_SOURCES = wocky-scram-sha1-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_session_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-session-test.c wocky_stanza_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-stanza-test.c wocky_test_sasl_auth_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-sasl-auth.c \ wocky-test-sasl-handler.c \ wocky-test-sasl-handler.h \ wocky-test-sasl-auth-server.c \ wocky-test-sasl-auth-server.h \ wocky-test-stream.c \ wocky-test-stream.h wocky_test_sasl_auth_LDADD = $(LDADD) @LIBSASL2_LIBS@ wocky_test_sasl_auth_CFLAGS = $(AM_CFLAGS) @LIBSASL2_CFLAGS@ wocky_tls_test_SOURCES = \ wocky-tls-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_tls_test_CFLAGS = $(AM_CFLAGS) $(TLSDEFS) wocky_utils_test_SOURCES = wocky-utils-test.c wocky_xmpp_connection_test_SOURCES = \ wocky-xmpp-connection-test.c \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h wocky_xmpp_node_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-xmpp-node-test.c wocky_xmpp_reader_test_SOURCES = \ wocky-test-helper.c wocky-test-helper.h \ wocky-test-stream.c wocky-test-stream.h \ wocky-xmpp-reader-test.c wocky_xmpp_readwrite_test_SOURCES = \ wocky-test-stream.c wocky-test-stream.h \ wocky-test-helper.c wocky-test-helper.h \ wocky-xmpp-readwrite-test.c AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ \ @LIBXML2_CFLAGS@ @TLS_CFLAGS@ @WOCKY_CFLAGS@ AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @LIBXML2_LIBS@ @TLS_LIBS@ LDADD = $(top_builddir)/wocky/libwocky.la check_c_sources = $(notdir $(wildcard $(srcdir)/*.c) $(wildcard $(srcdir)/*.h)) ############################################################################ SUPPRESSIONS = \ threadlocal.supp \ gabble.supp \ tp-glib.supp CLEANFILES = test-report.xml \ sasl-test.db EXTRA_DIST = $(SUPPRESSIONS) \ README \ connector-test-plan.txt \ summarise-tests.py \ wocky-dummy-xmpp-server.c \ $(wildcard $(srcdir)/certs/*.cfg) \ $(wildcard $(srcdir)/certs/*.pem) \ $(wildcard $(srcdir)/certs/cas/*.pem) \ $(wildcard $(srcdir)/certs/cas/*.0) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/check-coding-style.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/tools/check-coding-style.mk: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list wocky-bare-contact-test$(EXEEXT): $(wocky_bare_contact_test_OBJECTS) $(wocky_bare_contact_test_DEPENDENCIES) $(EXTRA_wocky_bare_contact_test_DEPENDENCIES) @rm -f wocky-bare-contact-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_bare_contact_test_OBJECTS) $(wocky_bare_contact_test_LDADD) $(LIBS) wocky-caps-hash-test$(EXEEXT): $(wocky_caps_hash_test_OBJECTS) $(wocky_caps_hash_test_DEPENDENCIES) $(EXTRA_wocky_caps_hash_test_DEPENDENCIES) @rm -f wocky-caps-hash-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_caps_hash_test_OBJECTS) $(wocky_caps_hash_test_LDADD) $(LIBS) wocky-connector-test$(EXEEXT): $(wocky_connector_test_OBJECTS) $(wocky_connector_test_DEPENDENCIES) $(EXTRA_wocky_connector_test_DEPENDENCIES) @rm -f wocky-connector-test$(EXEEXT) $(AM_V_CCLD)$(wocky_connector_test_LINK) $(wocky_connector_test_OBJECTS) $(wocky_connector_test_LDADD) $(LIBS) wocky-contact-factory-test$(EXEEXT): $(wocky_contact_factory_test_OBJECTS) $(wocky_contact_factory_test_DEPENDENCIES) $(EXTRA_wocky_contact_factory_test_DEPENDENCIES) @rm -f wocky-contact-factory-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_contact_factory_test_OBJECTS) $(wocky_contact_factory_test_LDADD) $(LIBS) wocky-data-form-test$(EXEEXT): $(wocky_data_form_test_OBJECTS) $(wocky_data_form_test_DEPENDENCIES) $(EXTRA_wocky_data_form_test_DEPENDENCIES) @rm -f wocky-data-form-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_data_form_test_OBJECTS) $(wocky_data_form_test_LDADD) $(LIBS) wocky-dummy-xmpp-server$(EXEEXT): $(wocky_dummy_xmpp_server_OBJECTS) $(wocky_dummy_xmpp_server_DEPENDENCIES) $(EXTRA_wocky_dummy_xmpp_server_DEPENDENCIES) @rm -f wocky-dummy-xmpp-server$(EXEEXT) $(AM_V_CCLD)$(wocky_dummy_xmpp_server_LINK) $(wocky_dummy_xmpp_server_OBJECTS) $(wocky_dummy_xmpp_server_LDADD) $(LIBS) wocky-http-proxy-test$(EXEEXT): $(wocky_http_proxy_test_OBJECTS) $(wocky_http_proxy_test_DEPENDENCIES) $(EXTRA_wocky_http_proxy_test_DEPENDENCIES) @rm -f wocky-http-proxy-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_http_proxy_test_OBJECTS) $(wocky_http_proxy_test_LDADD) $(LIBS) wocky-jid-validation-test$(EXEEXT): $(wocky_jid_validation_test_OBJECTS) $(wocky_jid_validation_test_DEPENDENCIES) $(EXTRA_wocky_jid_validation_test_DEPENDENCIES) @rm -f wocky-jid-validation-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_jid_validation_test_OBJECTS) $(wocky_jid_validation_test_LDADD) $(LIBS) wocky-loopback-test$(EXEEXT): $(wocky_loopback_test_OBJECTS) $(wocky_loopback_test_DEPENDENCIES) $(EXTRA_wocky_loopback_test_DEPENDENCIES) @rm -f wocky-loopback-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_loopback_test_OBJECTS) $(wocky_loopback_test_LDADD) $(LIBS) wocky-node-tree-test$(EXEEXT): $(wocky_node_tree_test_OBJECTS) $(wocky_node_tree_test_DEPENDENCIES) $(EXTRA_wocky_node_tree_test_DEPENDENCIES) @rm -f wocky-node-tree-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_node_tree_test_OBJECTS) $(wocky_node_tree_test_LDADD) $(LIBS) wocky-pep-service-test$(EXEEXT): $(wocky_pep_service_test_OBJECTS) $(wocky_pep_service_test_DEPENDENCIES) $(EXTRA_wocky_pep_service_test_DEPENDENCIES) @rm -f wocky-pep-service-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_pep_service_test_OBJECTS) $(wocky_pep_service_test_LDADD) $(LIBS) wocky-ping-test$(EXEEXT): $(wocky_ping_test_OBJECTS) $(wocky_ping_test_DEPENDENCIES) $(EXTRA_wocky_ping_test_DEPENDENCIES) @rm -f wocky-ping-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_ping_test_OBJECTS) $(wocky_ping_test_LDADD) $(LIBS) wocky-porter-test$(EXEEXT): $(wocky_porter_test_OBJECTS) $(wocky_porter_test_DEPENDENCIES) $(EXTRA_wocky_porter_test_DEPENDENCIES) @rm -f wocky-porter-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_porter_test_OBJECTS) $(wocky_porter_test_LDADD) $(LIBS) wocky-pubsub-node-test$(EXEEXT): $(wocky_pubsub_node_test_OBJECTS) $(wocky_pubsub_node_test_DEPENDENCIES) $(EXTRA_wocky_pubsub_node_test_DEPENDENCIES) @rm -f wocky-pubsub-node-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_pubsub_node_test_OBJECTS) $(wocky_pubsub_node_test_LDADD) $(LIBS) wocky-pubsub-service-test$(EXEEXT): $(wocky_pubsub_service_test_OBJECTS) $(wocky_pubsub_service_test_DEPENDENCIES) $(EXTRA_wocky_pubsub_service_test_DEPENDENCIES) @rm -f wocky-pubsub-service-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_pubsub_service_test_OBJECTS) $(wocky_pubsub_service_test_LDADD) $(LIBS) wocky-resource-contact-test$(EXEEXT): $(wocky_resource_contact_test_OBJECTS) $(wocky_resource_contact_test_DEPENDENCIES) $(EXTRA_wocky_resource_contact_test_DEPENDENCIES) @rm -f wocky-resource-contact-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_resource_contact_test_OBJECTS) $(wocky_resource_contact_test_LDADD) $(LIBS) wocky-roster-test$(EXEEXT): $(wocky_roster_test_OBJECTS) $(wocky_roster_test_DEPENDENCIES) $(EXTRA_wocky_roster_test_DEPENDENCIES) @rm -f wocky-roster-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_roster_test_OBJECTS) $(wocky_roster_test_LDADD) $(LIBS) wocky-sasl-utils-test$(EXEEXT): $(wocky_sasl_utils_test_OBJECTS) $(wocky_sasl_utils_test_DEPENDENCIES) $(EXTRA_wocky_sasl_utils_test_DEPENDENCIES) @rm -f wocky-sasl-utils-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_sasl_utils_test_OBJECTS) $(wocky_sasl_utils_test_LDADD) $(LIBS) wocky-scram-sha1-test$(EXEEXT): $(wocky_scram_sha1_test_OBJECTS) $(wocky_scram_sha1_test_DEPENDENCIES) $(EXTRA_wocky_scram_sha1_test_DEPENDENCIES) @rm -f wocky-scram-sha1-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_scram_sha1_test_OBJECTS) $(wocky_scram_sha1_test_LDADD) $(LIBS) wocky-session-test$(EXEEXT): $(wocky_session_test_OBJECTS) $(wocky_session_test_DEPENDENCIES) $(EXTRA_wocky_session_test_DEPENDENCIES) @rm -f wocky-session-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_session_test_OBJECTS) $(wocky_session_test_LDADD) $(LIBS) wocky-stanza-test$(EXEEXT): $(wocky_stanza_test_OBJECTS) $(wocky_stanza_test_DEPENDENCIES) $(EXTRA_wocky_stanza_test_DEPENDENCIES) @rm -f wocky-stanza-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_stanza_test_OBJECTS) $(wocky_stanza_test_LDADD) $(LIBS) wocky-test-sasl-auth$(EXEEXT): $(wocky_test_sasl_auth_OBJECTS) $(wocky_test_sasl_auth_DEPENDENCIES) $(EXTRA_wocky_test_sasl_auth_DEPENDENCIES) @rm -f wocky-test-sasl-auth$(EXEEXT) $(AM_V_CCLD)$(wocky_test_sasl_auth_LINK) $(wocky_test_sasl_auth_OBJECTS) $(wocky_test_sasl_auth_LDADD) $(LIBS) wocky-tls-test$(EXEEXT): $(wocky_tls_test_OBJECTS) $(wocky_tls_test_DEPENDENCIES) $(EXTRA_wocky_tls_test_DEPENDENCIES) @rm -f wocky-tls-test$(EXEEXT) $(AM_V_CCLD)$(wocky_tls_test_LINK) $(wocky_tls_test_OBJECTS) $(wocky_tls_test_LDADD) $(LIBS) wocky-utils-test$(EXEEXT): $(wocky_utils_test_OBJECTS) $(wocky_utils_test_DEPENDENCIES) $(EXTRA_wocky_utils_test_DEPENDENCIES) @rm -f wocky-utils-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_utils_test_OBJECTS) $(wocky_utils_test_LDADD) $(LIBS) wocky-xmpp-connection-test$(EXEEXT): $(wocky_xmpp_connection_test_OBJECTS) $(wocky_xmpp_connection_test_DEPENDENCIES) $(EXTRA_wocky_xmpp_connection_test_DEPENDENCIES) @rm -f wocky-xmpp-connection-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_xmpp_connection_test_OBJECTS) $(wocky_xmpp_connection_test_LDADD) $(LIBS) wocky-xmpp-node-test$(EXEEXT): $(wocky_xmpp_node_test_OBJECTS) $(wocky_xmpp_node_test_DEPENDENCIES) $(EXTRA_wocky_xmpp_node_test_DEPENDENCIES) @rm -f wocky-xmpp-node-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_xmpp_node_test_OBJECTS) $(wocky_xmpp_node_test_LDADD) $(LIBS) wocky-xmpp-reader-test$(EXEEXT): $(wocky_xmpp_reader_test_OBJECTS) $(wocky_xmpp_reader_test_DEPENDENCIES) $(EXTRA_wocky_xmpp_reader_test_DEPENDENCIES) @rm -f wocky-xmpp-reader-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_xmpp_reader_test_OBJECTS) $(wocky_xmpp_reader_test_LDADD) $(LIBS) wocky-xmpp-readwrite-test$(EXEEXT): $(wocky_xmpp_readwrite_test_OBJECTS) $(wocky_xmpp_readwrite_test_DEPENDENCIES) $(EXTRA_wocky_xmpp_readwrite_test_DEPENDENCIES) @rm -f wocky-xmpp-readwrite-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wocky_xmpp_readwrite_test_OBJECTS) $(wocky_xmpp_readwrite_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-bare-contact-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-caps-hash-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-contact-factory-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-data-form-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-http-proxy-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-jid-validation-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-loopback-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-node-tree-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-pep-service-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-ping-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-porter-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-pubsub-node-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-pubsub-service-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-pubsub-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-resource-contact-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-roster-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-sasl-utils-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-scram-sha1-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-session-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-stanza-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-test-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-test-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-utils-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-xmpp-connection-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-xmpp-node-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-xmpp-reader-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky-xmpp-readwrite-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-test-resolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-wocky-connector-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-wocky-test-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_connector_test-wocky-test-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_tls_test-wocky-test-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_tls_test-wocky-test-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wocky_tls_test-wocky-tls-test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< wocky_connector_test-wocky-connector-test.o: wocky-connector-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-connector-test.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-connector-test.Tpo -c -o wocky_connector_test-wocky-connector-test.o `test -f 'wocky-connector-test.c' || echo '$(srcdir)/'`wocky-connector-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-connector-test.Tpo $(DEPDIR)/wocky_connector_test-wocky-connector-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-connector-test.c' object='wocky_connector_test-wocky-connector-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-connector-test.o `test -f 'wocky-connector-test.c' || echo '$(srcdir)/'`wocky-connector-test.c wocky_connector_test-wocky-connector-test.obj: wocky-connector-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-connector-test.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-connector-test.Tpo -c -o wocky_connector_test-wocky-connector-test.obj `if test -f 'wocky-connector-test.c'; then $(CYGPATH_W) 'wocky-connector-test.c'; else $(CYGPATH_W) '$(srcdir)/wocky-connector-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-connector-test.Tpo $(DEPDIR)/wocky_connector_test-wocky-connector-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-connector-test.c' object='wocky_connector_test-wocky-connector-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-connector-test.obj `if test -f 'wocky-connector-test.c'; then $(CYGPATH_W) 'wocky-connector-test.c'; else $(CYGPATH_W) '$(srcdir)/wocky-connector-test.c'; fi` wocky_connector_test-wocky-test-sasl-auth-server.o: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-sasl-auth-server.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Tpo -c -o wocky_connector_test-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_connector_test-wocky-test-sasl-auth-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c wocky_connector_test-wocky-test-sasl-auth-server.obj: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-sasl-auth-server.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Tpo -c -o wocky_connector_test-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_connector_test-wocky-test-sasl-auth-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` wocky_connector_test-wocky-test-connector-server.o: wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-connector-server.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Tpo -c -o wocky_connector_test-wocky-test-connector-server.o `test -f 'wocky-test-connector-server.c' || echo '$(srcdir)/'`wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-connector-server.c' object='wocky_connector_test-wocky-test-connector-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-connector-server.o `test -f 'wocky-test-connector-server.c' || echo '$(srcdir)/'`wocky-test-connector-server.c wocky_connector_test-wocky-test-connector-server.obj: wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-connector-server.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Tpo -c -o wocky_connector_test-wocky-test-connector-server.obj `if test -f 'wocky-test-connector-server.c'; then $(CYGPATH_W) 'wocky-test-connector-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-connector-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-connector-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-connector-server.c' object='wocky_connector_test-wocky-test-connector-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-connector-server.obj `if test -f 'wocky-test-connector-server.c'; then $(CYGPATH_W) 'wocky-test-connector-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-connector-server.c'; fi` wocky_connector_test-wocky-test-helper.o: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-helper.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-helper.Tpo -c -o wocky_connector_test-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-helper.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_connector_test-wocky-test-helper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c wocky_connector_test-wocky-test-helper.obj: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-helper.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-helper.Tpo -c -o wocky_connector_test-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-helper.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_connector_test-wocky-test-helper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` wocky_connector_test-wocky-test-stream.o: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-stream.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-stream.Tpo -c -o wocky_connector_test-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-stream.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_connector_test-wocky-test-stream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c wocky_connector_test-wocky-test-stream.obj: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-wocky-test-stream.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-wocky-test-stream.Tpo -c -o wocky_connector_test-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-wocky-test-stream.Tpo $(DEPDIR)/wocky_connector_test-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_connector_test-wocky-test-stream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` wocky_connector_test-test-resolver.o: test-resolver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-test-resolver.o -MD -MP -MF $(DEPDIR)/wocky_connector_test-test-resolver.Tpo -c -o wocky_connector_test-test-resolver.o `test -f 'test-resolver.c' || echo '$(srcdir)/'`test-resolver.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-test-resolver.Tpo $(DEPDIR)/wocky_connector_test-test-resolver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-resolver.c' object='wocky_connector_test-test-resolver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-test-resolver.o `test -f 'test-resolver.c' || echo '$(srcdir)/'`test-resolver.c wocky_connector_test-test-resolver.obj: test-resolver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -MT wocky_connector_test-test-resolver.obj -MD -MP -MF $(DEPDIR)/wocky_connector_test-test-resolver.Tpo -c -o wocky_connector_test-test-resolver.obj `if test -f 'test-resolver.c'; then $(CYGPATH_W) 'test-resolver.c'; else $(CYGPATH_W) '$(srcdir)/test-resolver.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_connector_test-test-resolver.Tpo $(DEPDIR)/wocky_connector_test-test-resolver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-resolver.c' object='wocky_connector_test-test-resolver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_connector_test_CFLAGS) $(CFLAGS) -c -o wocky_connector_test-test-resolver.obj `if test -f 'test-resolver.c'; then $(CYGPATH_W) 'test-resolver.c'; else $(CYGPATH_W) '$(srcdir)/test-resolver.c'; fi` wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.o: wocky-dummy-xmpp-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.o -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.o `test -f 'wocky-dummy-xmpp-server.c' || echo '$(srcdir)/'`wocky-dummy-xmpp-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-dummy-xmpp-server.c' object='wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.o `test -f 'wocky-dummy-xmpp-server.c' || echo '$(srcdir)/'`wocky-dummy-xmpp-server.c wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.obj: wocky-dummy-xmpp-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.obj -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.obj `if test -f 'wocky-dummy-xmpp-server.c'; then $(CYGPATH_W) 'wocky-dummy-xmpp-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-dummy-xmpp-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-dummy-xmpp-server.c' object='wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-dummy-xmpp-server.obj `if test -f 'wocky-dummy-xmpp-server.c'; then $(CYGPATH_W) 'wocky-dummy-xmpp-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-dummy-xmpp-server.c'; fi` wocky_dummy_xmpp_server-wocky-test-connector-server.o: wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-connector-server.o -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-connector-server.o `test -f 'wocky-test-connector-server.c' || echo '$(srcdir)/'`wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-connector-server.c' object='wocky_dummy_xmpp_server-wocky-test-connector-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-connector-server.o `test -f 'wocky-test-connector-server.c' || echo '$(srcdir)/'`wocky-test-connector-server.c wocky_dummy_xmpp_server-wocky-test-connector-server.obj: wocky-test-connector-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-connector-server.obj -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-connector-server.obj `if test -f 'wocky-test-connector-server.c'; then $(CYGPATH_W) 'wocky-test-connector-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-connector-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-connector-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-connector-server.c' object='wocky_dummy_xmpp_server-wocky-test-connector-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-connector-server.obj `if test -f 'wocky-test-connector-server.c'; then $(CYGPATH_W) 'wocky-test-connector-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-connector-server.c'; fi` wocky_dummy_xmpp_server-wocky-test-helper.o: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-helper.o -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_dummy_xmpp_server-wocky-test-helper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c wocky_dummy_xmpp_server-wocky-test-helper.obj: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-helper.obj -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_dummy_xmpp_server-wocky-test-helper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` wocky_dummy_xmpp_server-wocky-test-stream.o: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-stream.o -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_dummy_xmpp_server-wocky-test-stream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c wocky_dummy_xmpp_server-wocky-test-stream.obj: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-stream.obj -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_dummy_xmpp_server-wocky-test-stream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.o: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.o -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.obj: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -MT wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.obj -MD -MP -MF $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Tpo -c -o wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_dummy_xmpp_server_CFLAGS) $(CFLAGS) -c -o wocky_dummy_xmpp_server-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` wocky_test_sasl_auth-wocky-test-helper.o: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-helper.o -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Tpo -c -o wocky_test_sasl_auth-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_test_sasl_auth-wocky-test-helper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c wocky_test_sasl_auth-wocky-test-helper.obj: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-helper.obj -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Tpo -c -o wocky_test_sasl_auth-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_test_sasl_auth-wocky-test-helper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` wocky_test_sasl_auth-wocky-test-sasl-auth.o: wocky-test-sasl-auth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-auth.o -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-auth.o `test -f 'wocky-test-sasl-auth.c' || echo '$(srcdir)/'`wocky-test-sasl-auth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth.c' object='wocky_test_sasl_auth-wocky-test-sasl-auth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-auth.o `test -f 'wocky-test-sasl-auth.c' || echo '$(srcdir)/'`wocky-test-sasl-auth.c wocky_test_sasl_auth-wocky-test-sasl-auth.obj: wocky-test-sasl-auth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-auth.obj -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-auth.obj `if test -f 'wocky-test-sasl-auth.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth.c' object='wocky_test_sasl_auth-wocky-test-sasl-auth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-auth.obj `if test -f 'wocky-test-sasl-auth.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth.c'; fi` wocky_test_sasl_auth-wocky-test-sasl-handler.o: wocky-test-sasl-handler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-handler.o -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-handler.o `test -f 'wocky-test-sasl-handler.c' || echo '$(srcdir)/'`wocky-test-sasl-handler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-handler.c' object='wocky_test_sasl_auth-wocky-test-sasl-handler.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-handler.o `test -f 'wocky-test-sasl-handler.c' || echo '$(srcdir)/'`wocky-test-sasl-handler.c wocky_test_sasl_auth-wocky-test-sasl-handler.obj: wocky-test-sasl-handler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-handler.obj -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-handler.obj `if test -f 'wocky-test-sasl-handler.c'; then $(CYGPATH_W) 'wocky-test-sasl-handler.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-handler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-handler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-handler.c' object='wocky_test_sasl_auth-wocky-test-sasl-handler.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-handler.obj `if test -f 'wocky-test-sasl-handler.c'; then $(CYGPATH_W) 'wocky-test-sasl-handler.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-handler.c'; fi` wocky_test_sasl_auth-wocky-test-sasl-auth-server.o: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-auth-server.o -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_test_sasl_auth-wocky-test-sasl-auth-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-auth-server.o `test -f 'wocky-test-sasl-auth-server.c' || echo '$(srcdir)/'`wocky-test-sasl-auth-server.c wocky_test_sasl_auth-wocky-test-sasl-auth-server.obj: wocky-test-sasl-auth-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-sasl-auth-server.obj -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Tpo -c -o wocky_test_sasl_auth-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-sasl-auth-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-sasl-auth-server.c' object='wocky_test_sasl_auth-wocky-test-sasl-auth-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-sasl-auth-server.obj `if test -f 'wocky-test-sasl-auth-server.c'; then $(CYGPATH_W) 'wocky-test-sasl-auth-server.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-sasl-auth-server.c'; fi` wocky_test_sasl_auth-wocky-test-stream.o: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-stream.o -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Tpo -c -o wocky_test_sasl_auth-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_test_sasl_auth-wocky-test-stream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c wocky_test_sasl_auth-wocky-test-stream.obj: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -MT wocky_test_sasl_auth-wocky-test-stream.obj -MD -MP -MF $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Tpo -c -o wocky_test_sasl_auth-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Tpo $(DEPDIR)/wocky_test_sasl_auth-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_test_sasl_auth-wocky-test-stream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_test_sasl_auth_CFLAGS) $(CFLAGS) -c -o wocky_test_sasl_auth-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` wocky_tls_test-wocky-tls-test.o: wocky-tls-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-tls-test.o -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-tls-test.Tpo -c -o wocky_tls_test-wocky-tls-test.o `test -f 'wocky-tls-test.c' || echo '$(srcdir)/'`wocky-tls-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-tls-test.Tpo $(DEPDIR)/wocky_tls_test-wocky-tls-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-tls-test.c' object='wocky_tls_test-wocky-tls-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-tls-test.o `test -f 'wocky-tls-test.c' || echo '$(srcdir)/'`wocky-tls-test.c wocky_tls_test-wocky-tls-test.obj: wocky-tls-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-tls-test.obj -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-tls-test.Tpo -c -o wocky_tls_test-wocky-tls-test.obj `if test -f 'wocky-tls-test.c'; then $(CYGPATH_W) 'wocky-tls-test.c'; else $(CYGPATH_W) '$(srcdir)/wocky-tls-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-tls-test.Tpo $(DEPDIR)/wocky_tls_test-wocky-tls-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-tls-test.c' object='wocky_tls_test-wocky-tls-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-tls-test.obj `if test -f 'wocky-tls-test.c'; then $(CYGPATH_W) 'wocky-tls-test.c'; else $(CYGPATH_W) '$(srcdir)/wocky-tls-test.c'; fi` wocky_tls_test-wocky-test-helper.o: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-test-helper.o -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-test-helper.Tpo -c -o wocky_tls_test-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-test-helper.Tpo $(DEPDIR)/wocky_tls_test-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_tls_test-wocky-test-helper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-test-helper.o `test -f 'wocky-test-helper.c' || echo '$(srcdir)/'`wocky-test-helper.c wocky_tls_test-wocky-test-helper.obj: wocky-test-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-test-helper.obj -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-test-helper.Tpo -c -o wocky_tls_test-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-test-helper.Tpo $(DEPDIR)/wocky_tls_test-wocky-test-helper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-helper.c' object='wocky_tls_test-wocky-test-helper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-test-helper.obj `if test -f 'wocky-test-helper.c'; then $(CYGPATH_W) 'wocky-test-helper.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-helper.c'; fi` wocky_tls_test-wocky-test-stream.o: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-test-stream.o -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-test-stream.Tpo -c -o wocky_tls_test-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-test-stream.Tpo $(DEPDIR)/wocky_tls_test-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_tls_test-wocky-test-stream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-test-stream.o `test -f 'wocky-test-stream.c' || echo '$(srcdir)/'`wocky-test-stream.c wocky_tls_test-wocky-test-stream.obj: wocky-test-stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -MT wocky_tls_test-wocky-test-stream.obj -MD -MP -MF $(DEPDIR)/wocky_tls_test-wocky-test-stream.Tpo -c -o wocky_tls_test-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wocky_tls_test-wocky-test-stream.Tpo $(DEPDIR)/wocky_tls_test-wocky-test-stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wocky-test-stream.c' object='wocky_tls_test-wocky-test-stream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wocky_tls_test_CFLAGS) $(CFLAGS) -c -o wocky_tls_test-wocky-test-stream.obj `if test -f 'wocky-test-stream.c'; then $(CYGPATH_W) 'wocky-test-stream.c'; else $(CYGPATH_W) '$(srcdir)/wocky-test-stream.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am test-report: test-report.xml gtester-report $(top_builddir)/tests/$@.xml > \ $(top_builddir)/tests/$@.html test-report.xml: ${TEST_PROGS} test test: ${TEST_PROGS} gtester -o test-report.xml -k --verbose ${TEST_PROGS} @if [ -x $(which python) ] ; then \ $(SUMMARY) $@-report.xml ; \ else \ echo "No python available, not summarizing test results" ; \ fi test-%: wocky-%-test gtester -o $@-report.xml -k --verbose $< @if [ -x $(which python) ] ; then \ $(SUMMARY) $@-report.xml ; \ else \ echo "No python available, not summarizing test results" ; \ fi .PHONY: test test-report check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: test check-coding-style # valgrind any given test by running make test.valgrind %.valgrind: % G_SLICE=always-malloc \ G_DEBUG=gc-friendly \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(srcdir)/$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ --leak-resolution=high --num-callers=20 \ ./$* $(TEST_ARGS) 2>&1 | tee "valgrind.$*.log" @if grep "==" "valgrind.$*.log" > /dev/null 2>&1; then \ exit 1; \ fi valgrind: $(TEST_PROGS) @echo "Valgrinding tests ..." @failed=0; \ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TEST_PROGS)); do \ $(MAKE) $$t.valgrind; \ if test "$$?" -ne 0; then \ echo "Valgrind error for test $$t"; \ failed=`expr $$failed + 1`; \ whicht="$$whicht $$t"; \ fi; \ done; \ if test "$$failed" -ne 0; then \ echo "$$failed tests had leaks or errors under valgrind:"; \ echo "$$whicht"; \ false; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-scram-sha1-test.c0000644000175000017500000000742212735676345026174 0ustar00gkiagiagkiagia00000000000000/* * wocky-scram-sha1-test.c - Test for wocky scram-sha1 * Copyright (C) 2010 Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "wocky-test-helper.h" typedef struct { guint32 seed; gchar *server; gchar *user; gchar *password; gchar *client_initial_response; gchar *server_initial_response; gchar *client_final_response; gchar *server_final_response; } testcase; static void test_scram_sha1 (testcase *test) { WockyAuthHandler *scram; GString *out, *in; GError *error = NULL; g_random_set_seed (test->seed); scram = WOCKY_AUTH_HANDLER (wocky_sasl_scram_new ( test->server, test->user, test->password)); g_assert (wocky_auth_handler_get_initial_response (scram, &out, &error)); g_assert_no_error (error); g_assert_cmpstr (test->client_initial_response, ==, out->str); g_string_free (out, TRUE); /* Initial challenge, response */ in = g_string_new (test->server_initial_response); (wocky_auth_handler_handle_auth_data (scram, in, &out, &error)); g_assert_no_error (error); g_assert_cmpstr (test->client_final_response, ==, out->str); g_string_free (in, TRUE); g_string_free (out, TRUE); in = g_string_new (test->server_final_response); out = NULL; g_assert (wocky_auth_handler_handle_auth_data (scram, in, &out, &error)); g_assert_no_error (error); g_assert (out == NULL); g_string_free (in, TRUE); g_assert (wocky_auth_handler_handle_success (scram, &error)); g_assert_no_error (error); g_object_unref (scram); } /* Some static tests as generated by trail of our current implementation, which * has been tested against real servers. These testcases are mostly here * because to prevent regressions and differences of output on different * platforms */ static testcase tests[] = { { 42, "example.com", "harry", "blaat", /* client first */ "n,,n=harry,r=ZtzhX7M96stcA2LzDpX1Lmr0Y7tH1JnHvK5BmRQsy5g=", /* server first */ "r=ZtzhX7M96stcA2LzDpX1Lmr0Y7tH1JnHvK5BmRQsy5g=deadfish," "s=snakes==,i=128", /* client final */ "c=biws,r=ZtzhX7M96stcA2LzDpX1Lmr0Y7tH1JnHvK5BmRQsy5g=deadfish," "p=0933cKmf/GHBIh+GYTROuRT78zM=", /* server final */ "v=zW58Ag+pg9C8lGkof3wb7/jvQQQ=" }, { 0xcafe, "eagle.co.uk", "watson", "dna", /* client first */ "n,,n=watson,r=xHkPPK3a6sJZYzbEJVq965vi70Mt9ZaFPI3PdSj8SEU=", /* server first */ "r=xHkPPK3a6sJZYzbEJVq965vi70Mt9ZaFPI3PdSj8SEU=doublehelix," "s=francis=,i=4096", /* client final */ "c=biws," "r=xHkPPK3a6sJZYzbEJVq965vi70Mt9ZaFPI3PdSj8SEU=doublehelix," "p=V4VHXC1JL++UDZWRg82mcP16Hdc=", /* server final */ "v=LYJrt3+nDh0XOEjKZC6DRccsnG0=" }, { 0, } }; int main (int argc, char **argv) { int i; test_init (argc, argv); for (i = 0; tests[i].seed != 0; i++) { gchar *name = g_strdup_printf ("/scram-sha1/test-%d", i); g_test_add_data_func (name, tests + i, (void (*)(const void *)) test_scram_sha1); g_free (name); } return g_test_run (); } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-utils-test.c0000644000175000017500000000317412735676345025375 0ustar00gkiagiagkiagia00000000000000/* * wocky-utils-test.c - Tests for utility code * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include static void test_compose_jid (void) { gchar *s = NULL; g_assert_cmpstr ((s = wocky_compose_jid ("juliet", "example.com", "Balcony")), ==, "juliet@example.com/Balcony"); g_free (s); g_assert_cmpstr ((s = wocky_compose_jid ("juliet", "example.com", NULL)), ==, "juliet@example.com"); g_free (s); g_assert_cmpstr ((s = wocky_compose_jid (NULL, "example.com", NULL)), ==, "example.com"); g_free (s); g_assert_cmpstr ((s = wocky_compose_jid (NULL, "example.com", "Server")), ==, "example.com/Server"); g_free (s); } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_add_func ("/utils/compose-jid", test_compose_jid); return g_test_run (); } telepathy-gabble-0.18.4/lib/ext/wocky/tests/threadlocal.supp0000644000175000017500000000013612735676345025150 0ustar00gkiagiagkiagia00000000000000{ Memcheck:Leak fun:calloc fun:_dl_allocate_tls fun:pthread_create@@* } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-ping-test.c0000644000175000017500000000772512735676345025200 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "wocky-test-stream.h" #include "wocky-test-helper.h" #define PING_COUNT 2 #define PING_INTERVAL 1 /* We expect PING_COUNT pings, followed by disabling pings and waiting for * PING_COUNT * PING_INTERVAL to see if we get any pings we didn't want, * followed by turning pings back on again and testing if we get any. The +1 is * a fudge factor. ;-) */ #define TOTAL_TIMEOUT (PING_COUNT * PING_INTERVAL + 1) * 3 static void ping_recv_cb (const gchar *buff, gsize len, gpointer user_data) { test_data_t *data = user_data; gchar *tmp_buff; /* There is no g_assert_cmpnstr */ tmp_buff = g_strndup (buff, len); g_assert_cmpstr (tmp_buff, ==, " "); g_free (tmp_buff); g_assert_cmpuint (data->outstanding, >, 0); data->outstanding--; g_main_loop_quit (data->loop); } static gboolean we_have_waited_long_enough (gpointer user_data) { test_data_t *test = user_data; g_assert_cmpuint (test->outstanding, ==, 1); test->outstanding--; g_main_loop_quit (test->loop); return FALSE; } static void test_periodic_ping (void) { WockyPing *ping; test_data_t *test = setup_test_with_timeout (TOTAL_TIMEOUT); WockyXmppConnection *connection; GIOStream *stream; GInputStream *stream_in; g_assert (WOCKY_IS_C2S_PORTER (test->sched_in)); /* First, we ping every n seconds */ ping = wocky_ping_new (WOCKY_C2S_PORTER (test->sched_in), PING_INTERVAL); test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_porter_start (test->sched_out); g_object_get (test->sched_out, "connection", &connection, NULL); g_object_get (connection, "base-stream", &stream, NULL); stream_in = g_io_stream_get_input_stream (stream); g_object_unref (stream); g_object_unref (connection); wocky_test_stream_set_direct_read_callback (stream_in, ping_recv_cb, test); test->outstanding += PING_COUNT; test_wait_pending (test); /* Now, we disable pings, and wait briefly to see if we get any pings. */ g_object_set (ping, "ping-interval", 0, NULL); g_timeout_add_seconds (PING_INTERVAL * PING_COUNT, we_have_waited_long_enough, test); test->outstanding = 1; test_wait_pending (test); /* And then we enable pings again, and wait for one more. */ g_object_set (ping, "ping-interval", PING_INTERVAL, NULL); test->outstanding += 1; test_wait_pending (test); wocky_test_stream_set_direct_read_callback (stream_in, NULL, NULL); test_close_both_porters (test); g_object_unref (ping); teardown_test (test); } static void send_ping_cb (GObject *source, GAsyncResult *res, gpointer user_data) { test_data_t *data = (test_data_t *) user_data; WockyStanza *reply; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, NULL); g_assert (reply != NULL); g_object_unref (reply); data->outstanding--; g_main_loop_quit (data->loop); } static void test_pong (void) { WockyStanza *s; WockyPing *ping; test_data_t *test = setup_test (); g_assert (WOCKY_IS_C2S_PORTER (test->sched_in)); ping = wocky_ping_new (WOCKY_C2S_PORTER (test->sched_in), 0); test_open_both_connections (test); wocky_porter_start (test->sched_in); wocky_porter_start (test->sched_out); /* Server pings us */ s = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, "capulet.lit", "juliet@capulet.lit/balcony", '(', "ping", ':', WOCKY_XMPP_NS_PING, ')', NULL); wocky_porter_send_iq_async (test->sched_out, s, NULL, send_ping_cb, test); g_object_unref (s); test->outstanding++; test_wait_pending (test); test_close_both_porters (test); g_object_unref (ping); teardown_test (test); } int main (int argc, char **argv) { int result; test_init (argc, argv); g_test_add_func ("/xmpp-ping/pong", test_pong); g_test_add_func ("/xmpp-ping/periodic", test_periodic_ping); result = g_test_run (); test_deinit (); return result; } telepathy-gabble-0.18.4/lib/ext/wocky/tests/wocky-pubsub-test-helpers.c0000644000175000017500000000266312735676345027177 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-pubsub-test-helpers.h" #include void test_pubsub_add_subscription_nodes ( WockyNode *subscriptions_node, CannedSubscriptions *subs, gboolean include_node) { CannedSubscriptions *l; for (l = subs; l != NULL && l->node != NULL; l++) { WockyNode *sub = wocky_node_add_child (subscriptions_node, "subscription"); if (include_node) wocky_node_set_attribute (sub, "node", l->node); wocky_node_set_attribute (sub, "jid", l->jid); wocky_node_set_attribute (sub, "subscription", l->subscription); if (l->subid != NULL) wocky_node_set_attribute (sub, "subid", l->subid); } } void test_pubsub_check_and_free_subscriptions ( GList *subscriptions, const CannedSubscriptions *expected_subs) { GList *l; guint i = 0; for (l = subscriptions; l != NULL; l = l->next, i++) { WockyPubsubSubscription *sub = l->data; g_assert (expected_subs[i].jid != NULL); g_assert_cmpstr (expected_subs[i].jid, ==, sub->jid); g_assert_cmpstr (expected_subs[i].node, ==, wocky_pubsub_node_get_name (sub->node)); g_assert_cmpuint (expected_subs[i].state, ==, sub->state); g_assert_cmpstr (expected_subs[i].subid, ==, sub->subid); } g_assert_cmpstr (expected_subs[i].jid, ==, NULL); wocky_pubsub_subscription_list_free (subscriptions); } telepathy-gabble-0.18.4/lib/ext/wocky/config.h.in0000644000175000017500000000551313012560753022622 0ustar00gkiagiagkiagia00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Enable debug code */ #undef ENABLE_DEBUG /* Enable Google Jingle relay support */ #undef ENABLE_GOOGLE_RELAY /* Prefer stream ciphers over block ones to save bandwidth */ #undef ENABLE_PREFER_STREAM_CIPHERS /* Prevent post 2.44 APIs */ #undef GLIB_VERSION_MAX_ALLOWED /* Ignore post 2.44 deprecations */ #undef GLIB_VERSION_MIN_REQUIRED /* path to system Certificate Authority list */ #undef GTLS_SYSTEM_CA_CERTIFICATES /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Defined if gcov is enabled to force a rebuild due to config.h changing */ #undef HAVE_GCOV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* libiphb is available */ #undef HAVE_IPHB /* Define if libsasl2 is available */ #undef HAVE_LIBSASL2 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if using openssl */ #undef USING_OPENSSL /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif telepathy-gabble-0.18.4/lib/ext/wocky/NEWS0000644000175000017500000000002512735676345021307 0ustar00gkiagiagkiagia00000000000000No news is good news telepathy-gabble-0.18.4/lib/ext/wocky/wocky/0000755000175000017500000000000013012562225021723 5ustar00gkiagiagkiagia00000000000000telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-bare-contact.c0000644000175000017500000004305012735676345025611 0ustar00gkiagiagkiagia00000000000000/* * wocky-bare-contact.c - Source for WockyBareContact * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-bare-contact * @title: WockyBareContact * @short_description: Wrapper around a roster item. * @include: wocky/wocky-bare-contact.h * * Stores information regarding a roster item and provides a higher level API * for altering its details. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-bare-contact.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_ROSTER #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyBareContact, wocky_bare_contact, WOCKY_TYPE_CONTACT) /* properties */ enum { PROP_JID = 1, PROP_NAME, PROP_SUBSCRIPTION, PROP_GROUPS, }; /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockyBareContactPrivate { gboolean dispose_has_run; gchar *jid; gchar *name; WockyRosterSubscriptionFlags subscription; gchar **groups; /* list of weak reffed (WockyResourceContact *) * Each WockyResourceContact has a ref on its WockyBareContact so we don't * have to keep a ref on it. */ GSList *resources; }; static void wocky_bare_contact_init (WockyBareContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_BARE_CONTACT, WockyBareContactPrivate); self->priv->resources = NULL; } static void wocky_bare_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: priv->jid = g_value_dup_string (value); break; case PROP_NAME: wocky_bare_contact_set_name (WOCKY_BARE_CONTACT (object), g_value_get_string (value)); break; case PROP_SUBSCRIPTION: priv->subscription = g_value_get_uint (value); break; case PROP_GROUPS: priv->groups = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_bare_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; switch (property_id) { case PROP_JID: g_value_set_string (value, priv->jid); break; case PROP_NAME: g_value_set_string (value, priv->name); break; case PROP_SUBSCRIPTION: g_value_set_uint (value, priv->subscription); break; case PROP_GROUPS: g_value_set_boxed (value, priv->groups); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_bare_contact_constructed (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; g_assert (priv->jid != NULL); } static void resource_disposed_cb (gpointer user_data, GObject *resource) { WockyBareContact *self = WOCKY_BARE_CONTACT (user_data); WockyBareContactPrivate *priv = self->priv; priv->resources = g_slist_remove (priv->resources, resource); } static void wocky_bare_contact_dispose (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; GSList *l; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; for (l = priv->resources; l != NULL; l = g_slist_next (l)) { g_object_weak_unref (G_OBJECT (l->data), resource_disposed_cb, self); } if (G_OBJECT_CLASS (wocky_bare_contact_parent_class)->dispose) G_OBJECT_CLASS (wocky_bare_contact_parent_class)->dispose (object); } static void wocky_bare_contact_finalize (GObject *object) { WockyBareContact *self = WOCKY_BARE_CONTACT (object); WockyBareContactPrivate *priv = self->priv; if (priv->jid != NULL) g_free (priv->jid); if (priv->name != NULL) g_free (priv->name); if (priv->groups != NULL) g_strfreev (priv->groups); g_slist_free (priv->resources); G_OBJECT_CLASS (wocky_bare_contact_parent_class)->finalize (object); } static gchar * bare_contact_dup_jid (WockyContact *contact) { return g_strdup (wocky_bare_contact_get_jid (WOCKY_BARE_CONTACT (contact))); } static void wocky_bare_contact_class_init (WockyBareContactClass *wocky_bare_contact_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_bare_contact_class); WockyContactClass *contact_class = WOCKY_CONTACT_CLASS (wocky_bare_contact_class); GParamSpec *spec; g_type_class_add_private (wocky_bare_contact_class, sizeof (WockyBareContactPrivate)); object_class->constructed = wocky_bare_contact_constructed; object_class->set_property = wocky_bare_contact_set_property; object_class->get_property = wocky_bare_contact_get_property; object_class->dispose = wocky_bare_contact_dispose; object_class->finalize = wocky_bare_contact_finalize; contact_class->dup_jid = bare_contact_dup_jid; /** * WockyBareContact:jid: * * The contact's bare JID, according to the roster. */ spec = g_param_spec_string ("jid", "Contact JID", "Contact JID", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_JID, spec); /** * WockyBareContact:name: * * The contact's name, according to the roster. */ spec = g_param_spec_string ("name", "Contact Name", "Contact Name", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, spec); /** * WockyBareContact:subscription: * * The subscription type of the contact, according to the roster. */ spec = g_param_spec_uint ("subscription", "Contact Subscription", "Contact Subscription", 0, LAST_WOCKY_ROSTER_SUBSCRIPTION_TYPE, WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUBSCRIPTION, spec); /** * WockyBareContact:groups: * * A list of the contact's groups, according to the roster. */ spec = g_param_spec_boxed ("groups", "Contact Groups", "Contact Groups", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUPS, spec); } /** * wocky_bare_contact_new: * @jid: the JID of the contact to create * * Creates a new #WockyBareContact for a given JID. * * Returns: a newly constructed #WockyBareContact */ WockyBareContact * wocky_bare_contact_new (const gchar *jid) { return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", jid, NULL); } /** * wocky_bare_contact_get_jid: * @contact: a #WockyBareContact instance * * Returns the JID of the contact wrapped by @contact. * * Returns: @contact's JID. */ const gchar * wocky_bare_contact_get_jid (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return priv->jid; } /** * wocky_bare_contact_get_name: * @contact: #WockyBareContact instance * * Returns the name of the contact wrapped by @contact. * * Returns: @contact's name */ const gchar * wocky_bare_contact_get_name (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return priv->name; } /* FIXME: document that wocky_bare_contact_set_* shouldn't be used by users */ /** * wocky_bare_contact_set_name: * @contact: a #WockyBareContact instance * @name: the name to set @contact * * Sets @contact's name to @name. * */ void wocky_bare_contact_set_name (WockyBareContact *contact, const gchar *name) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (!wocky_strdiff (priv->name, name)) return; g_free (priv->name); priv->name = g_strdup (name); g_object_notify (G_OBJECT (contact), "name"); } /** * wocky_bare_contact_get_subscription: * @contact: a #WockyBareContact instance * * Gets the subscription type @contact has. * * Returns: @contact's subscription. */ WockyRosterSubscriptionFlags wocky_bare_contact_get_subscription (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE); priv = contact->priv; return priv->subscription; } /** * wocky_bare_contact_set_subscription: * @contact: a #WockyBareContact instance * @subscription: the new subscription type * * Sets the subscription of @contact. * */ void wocky_bare_contact_set_subscription (WockyBareContact *contact, WockyRosterSubscriptionFlags subscription) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (priv->subscription == subscription) return; priv->subscription = subscription; g_object_notify (G_OBJECT (contact), "subscription"); } /** * wocky_bare_contact_get_groups: * @contact: a #WockyBareContact instance * * Returns the list of the groups of @contact. * * Returns: a list of @contact's groups */ const gchar * const * wocky_bare_contact_get_groups (WockyBareContact *contact) { WockyBareContactPrivate *priv; g_return_val_if_fail (WOCKY_IS_BARE_CONTACT (contact), NULL); priv = contact->priv; return (const gchar * const *) priv->groups; } static gint cmp_str (gchar **a, gchar **b) { return strcmp (*a, *b); } static GPtrArray * sort_groups (GStrv groups) { GPtrArray *arr; guint i; arr = g_ptr_array_sized_new (g_strv_length (groups)); for (i = 0; groups[i] != NULL; i++) { g_ptr_array_add (arr, groups[i]); } g_ptr_array_sort (arr, (GCompareFunc) cmp_str); return arr; } static gboolean groups_equal (const gchar * const * groups_a, const gchar * const * groups_b) { GPtrArray *arr_a, *arr_b; guint i; gboolean result = TRUE; if (groups_a == NULL && groups_b == NULL) return TRUE; if (groups_a == NULL || groups_b == NULL) return FALSE; if (g_strv_length ((GStrv) groups_a) != g_strv_length ((GStrv) groups_b)) return FALSE; /* Sort both groups array and then compare elements one by one */ arr_a = sort_groups ((GStrv) groups_a); arr_b = sort_groups ((GStrv) groups_b); for (i = 0; i != arr_a->len && result; i++) { const gchar *a = g_ptr_array_index (arr_a, i); const gchar *b = g_ptr_array_index (arr_b, i); if (wocky_strdiff (a, b)) result = FALSE; } g_ptr_array_unref (arr_a); g_ptr_array_unref (arr_b); return result; } /** * wocky_bare_contact_set_groups: * @contact: a #WockyBareContact instance * @groups: a list of groups * * Sets @contact's groups. * */ void wocky_bare_contact_set_groups (WockyBareContact *contact, gchar **groups) { WockyBareContactPrivate *priv; g_return_if_fail (WOCKY_IS_BARE_CONTACT (contact)); priv = contact->priv; if (groups_equal ((const gchar * const *) groups, (const gchar * const *) priv->groups)) return; if (priv->groups != NULL) g_strfreev (priv->groups); priv->groups = g_strdupv (groups); g_object_notify (G_OBJECT (contact), "groups"); } /** * wocky_bare_contact_equal: * @a: a #WockyBareContact instance * @b: a #WockyBareContact instance to compare with @a * * Compares whether two #WockyBareContact instances refer to the same * roster item. * * Returns: #TRUE if the two contacts match. */ gboolean wocky_bare_contact_equal (WockyBareContact *a, WockyBareContact *b) { const gchar * const * groups_a; const gchar * const * groups_b; if (a == NULL || b == NULL) return FALSE; if (wocky_strdiff (wocky_bare_contact_get_jid (a), wocky_bare_contact_get_jid (b))) return FALSE; if (wocky_strdiff (wocky_bare_contact_get_name (a), wocky_bare_contact_get_name (b))) return FALSE; if (wocky_bare_contact_get_subscription (a) != wocky_bare_contact_get_subscription (b)) return FALSE; groups_a = wocky_bare_contact_get_groups (a); groups_b = wocky_bare_contact_get_groups (b); return groups_equal (groups_a, groups_b); } /** * wocky_bare_contact_add_group: * @contact: a #WockyBareContact instance * @group: a group * * Adds @group to contact's groups. */ void wocky_bare_contact_add_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; GPtrArray *arr; gboolean group_already_present = FALSE; if (priv->groups != NULL) { guint len, i; len = g_strv_length (priv->groups); arr = g_ptr_array_sized_new (len + 2); for (i = 0; priv->groups[i] != NULL; i++) { g_ptr_array_add (arr, g_strdup (priv->groups[i])); if (!wocky_strdiff (priv->groups[i], group)) /* Don't add the group twice */ group_already_present = TRUE; } g_strfreev (priv->groups); } else { arr = g_ptr_array_sized_new (2); } if (!group_already_present) g_ptr_array_add (arr, g_strdup (group)); /* Add trailing NULL */ g_ptr_array_add (arr, NULL); priv->groups = (GStrv) g_ptr_array_free (arr, FALSE); } /** * wocky_bare_contact_in_group: * @contact: a #WockyBareContact instance * @group: a group * * Determines whether the given contact is in @group. * * Returns: #TRUE if the contact is in the given group. */ gboolean wocky_bare_contact_in_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; guint i; if (priv->groups == NULL) return FALSE; for (i = 0; priv->groups[i] != NULL; i++) { if (!wocky_strdiff (priv->groups[i], group)) return TRUE; } return FALSE; } /** * wocky_bare_contact_remove_group: * @contact: a #WockyBareContact instance * @group: a group * * Removes @group from the contact's groups. */ void wocky_bare_contact_remove_group (WockyBareContact *self, const gchar *group) { WockyBareContactPrivate *priv = self->priv; GPtrArray *arr; guint len, i; if (priv->groups == NULL) return; len = g_strv_length (priv->groups); arr = g_ptr_array_sized_new (len); for (i = 0; priv->groups[i] != NULL; i++) { if (!wocky_strdiff (priv->groups[i], group)) continue; g_ptr_array_add (arr, g_strdup (priv->groups[i])); } g_strfreev (priv->groups); /* Add trailing NULL */ g_ptr_array_add (arr, NULL); priv->groups = (GStrv) g_ptr_array_free (arr, FALSE); } /** * wocky_bare_contact_copy: * @contact: a #WockyBareContact instance * * Convenience function to obtain a copy of the given #WockyBareContact. * * Returns: a newly created #WockyBareContact which is a copy of the given * one. */ WockyBareContact * wocky_bare_contact_copy (WockyBareContact *contact) { return g_object_new (WOCKY_TYPE_BARE_CONTACT, "jid", wocky_bare_contact_get_jid (contact), "name", wocky_bare_contact_get_name (contact), "subscription", wocky_bare_contact_get_subscription (contact), "groups", wocky_bare_contact_get_groups (contact), NULL); } /** * wocky_bare_contact_debug_print: * @contact: a #WockyBareContact instance * * Prints debug information for the given #WockyBareContact. */ void wocky_bare_contact_debug_print (WockyBareContact *self) { WockyBareContactPrivate *priv = self->priv; guint i; DEBUG ("Contact: %s Name: %s Subscription: %s Groups:", priv->jid, priv->name, wocky_roster_subscription_to_string (priv->subscription)); for (i = 0; priv->groups[i] != NULL; i++) DEBUG (" - %s", priv->groups[i]); } /** * wocky_bare_contact_add_resource: * @contact: a #WockyBareContact instance * @resource: a #WockyResourceContact instance * * Adds @resource to the contact's resources. * The #WockyBareContact instance doesn't assume a reference to @resource. */ void wocky_bare_contact_add_resource (WockyBareContact *self, WockyResourceContact *resource) { WockyBareContactPrivate *priv = self->priv; g_object_weak_ref (G_OBJECT (resource), resource_disposed_cb, self); priv->resources = g_slist_append (priv->resources, resource); } /** * wocky_bare_contact_get_resources: * @contact: a #WockyBareContact instance * * Gets a #GSList of all the contact's resources. * You should call #g_slist_free on the list when done with it. * * Returns: a #GSList of #WockyResourceContact objects. */ GSList * wocky_bare_contact_get_resources (WockyBareContact *self) { WockyBareContactPrivate *priv = self->priv; return g_slist_copy (priv->resources); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-xep-0115-capabilities.c0000644000175000017500000000434412735676345027061 0ustar00gkiagiagkiagia00000000000000/* * wocky-xep-0115-capabilities.c - interface for holding capabilities * of contacts * * Copyright (C) 2011-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "wocky-xep-0115-capabilities.h" #include "wocky-contact.h" G_DEFINE_INTERFACE (WockyXep0115Capabilities, wocky_xep_0115_capabilities, G_TYPE_OBJECT); static void wocky_xep_0115_capabilities_default_init ( WockyXep0115CapabilitiesInterface *interface) { GType iface_type = G_TYPE_FROM_INTERFACE (interface); static gsize initialization_value = 0; if (g_once_init_enter (&initialization_value)) { g_signal_new ("capabilities-changed", iface_type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_once_init_leave (&initialization_value, 1); } } const GPtrArray * wocky_xep_0115_capabilities_get_data_forms ( WockyXep0115Capabilities *contact) { WockyXep0115CapabilitiesInterface *iface = WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE (contact); WockyXep0115CapabilitiesGetDataFormsFunc method = iface->get_data_forms; if (method != NULL) return method (contact); return NULL; } gboolean wocky_xep_0115_capabilities_has_feature ( WockyXep0115Capabilities *contact, const gchar *feature) { WockyXep0115CapabilitiesInterface *iface = WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE (contact); WockyXep0115CapabilitiesHasFeatureFunc method = iface->has_feature; if (method != NULL) return method (contact, feature); return FALSE; } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jabber-auth-password.c0000644000175000017500000000734412735676345027301 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-jabber-auth-password.h" #include "wocky-auth-registry.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" static void auth_handler_iface_init (gpointer g_iface); G_DEFINE_TYPE_WITH_CODE (WockyJabberAuthPassword, wocky_jabber_auth_password, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_AUTH_HANDLER, auth_handler_iface_init)) enum { PROP_PASSWORD = 1 }; struct _WockyJabberAuthPasswordPrivate { gchar *password; }; static void wocky_jabber_auth_password_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJabberAuthPassword *self = WOCKY_JABBER_AUTH_PASSWORD (object); WockyJabberAuthPasswordPrivate *priv = self->priv; switch (property_id) { case PROP_PASSWORD: g_value_set_string (value, priv->password); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_password_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJabberAuthPassword *self = WOCKY_JABBER_AUTH_PASSWORD (object); WockyJabberAuthPasswordPrivate *priv = self->priv; switch (property_id) { case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_password_dispose (GObject *object) { WockyJabberAuthPassword *self = WOCKY_JABBER_AUTH_PASSWORD (object); WockyJabberAuthPasswordPrivate *priv = self->priv; g_free (priv->password); G_OBJECT_CLASS (wocky_jabber_auth_password_parent_class)->dispose (object); } static void wocky_jabber_auth_password_class_init (WockyJabberAuthPasswordClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyJabberAuthPasswordPrivate)); object_class->get_property = wocky_jabber_auth_password_get_property; object_class->set_property = wocky_jabber_auth_password_set_property; object_class->dispose = wocky_jabber_auth_password_dispose; g_object_class_install_property (object_class, PROP_PASSWORD, g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); } static gboolean password_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error); static void auth_handler_iface_init (gpointer g_iface) { WockyAuthHandlerIface *iface = g_iface; iface->mechanism = WOCKY_AUTH_MECH_JABBER_PASSWORD; iface->plain = TRUE; iface->initial_response_func = password_initial_response; } static void wocky_jabber_auth_password_init (WockyJabberAuthPassword *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( self, WOCKY_TYPE_JABBER_AUTH_PASSWORD, WockyJabberAuthPasswordPrivate); } WockyJabberAuthPassword * wocky_jabber_auth_password_new (const gchar *password) { return g_object_new (WOCKY_TYPE_JABBER_AUTH_PASSWORD, "password", password, NULL); } static gboolean password_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error) { WockyJabberAuthPassword *self = WOCKY_JABBER_AUTH_PASSWORD (handler); WockyJabberAuthPasswordPrivate *priv = self->priv; if (priv->password == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, "No password provided"); return FALSE; } DEBUG ("Got password"); *initial_data = g_string_new (priv->password); return TRUE; } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-pep-service.c0000644000175000017500000003142412735676345025473 0ustar00gkiagiagkiagia00000000000000/* * wocky-pep-service.c - WockyPepService * Copyright © 2009,2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-pep-service * @title: WockyPepService * @short_description: Object to represent a single PEP service * @include: wocky/wocky-pep-service.h * * Object to aid with looking up PEP nodes and listening for changes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-pep-service.h" #include "wocky-pubsub-helpers.h" #include "wocky-porter.h" #include "wocky-utils.h" #include "wocky-namespaces.h" #include "wocky-signals-marshal.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PUBSUB #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyPepService, wocky_pep_service, G_TYPE_OBJECT) /* signal enum */ enum { CHANGED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; enum { PROP_NODE = 1, PROP_SUBSCRIBE, }; /* private structure */ struct _WockyPepServicePrivate { WockySession *session; WockyPorter *porter; WockyContactFactory *contact_factory; gchar *node; gboolean subscribe; guint handler_id; gboolean dispose_has_run; }; static void wocky_pep_service_init (WockyPepService *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_PEP_SERVICE, WockyPepServicePrivate); } static void wocky_pep_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; switch (property_id) { case PROP_NODE: priv->node = g_value_dup_string (value); break; case PROP_SUBSCRIBE: priv->subscribe = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pep_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; switch (property_id) { case PROP_NODE: g_value_set_string (value, priv->node); break; case PROP_SUBSCRIBE: g_value_set_boolean (value, priv->subscribe); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pep_service_dispose (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->porter != NULL) { g_assert (priv->handler_id != 0); wocky_porter_unregister_handler (priv->porter, priv->handler_id); g_object_unref (priv->porter); } if (priv->contact_factory != NULL) g_object_unref (priv->contact_factory); if (G_OBJECT_CLASS (wocky_pep_service_parent_class)->dispose) G_OBJECT_CLASS (wocky_pep_service_parent_class)->dispose (object); } static void wocky_pep_service_finalize (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; g_free (priv->node); G_OBJECT_CLASS (wocky_pep_service_parent_class)->finalize (object); } static void wocky_pep_service_constructed (GObject *object) { WockyPepService *self = WOCKY_PEP_SERVICE (object); WockyPepServicePrivate *priv = self->priv; g_assert (priv->node != NULL); } static void wocky_pep_service_class_init (WockyPepServiceClass *wocky_pep_service_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_pep_service_class); GParamSpec *param_spec; g_type_class_add_private (wocky_pep_service_class, sizeof (WockyPepServicePrivate)); object_class->set_property = wocky_pep_service_set_property; object_class->get_property = wocky_pep_service_get_property; object_class->dispose = wocky_pep_service_dispose; object_class->finalize = wocky_pep_service_finalize; object_class->constructed = wocky_pep_service_constructed; /** * WockyPepService:node: * * Namespace of the PEP node. */ param_spec = g_param_spec_string ("node", "node", "namespace of the pep node", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NODE, param_spec); /** * WockyPepService:subscribe: * * %TRUE if Wocky is to subscribe to the notifications of the node. */ param_spec = g_param_spec_boolean ("subscribe", "subscribe", "if TRUE, Wocky will subscribe to the notifications of the node", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUBSCRIBE, param_spec); /** * WockyPepService::changed: * @self: a #WockyPepService object * @contact: the #WockyBareContact who changed the node * @stanza: the #WockyStanza * @item: the first—and typically only—<item> element in @stanza, or * %NULL if there is none. * * Emitted when the node value changes. */ signals[CHANGED] = g_signal_new ("changed", G_OBJECT_CLASS_TYPE (wocky_pep_service_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_OBJECT_POINTER, G_TYPE_NONE, 3, WOCKY_TYPE_BARE_CONTACT, WOCKY_TYPE_STANZA, G_TYPE_POINTER); } /** * wocky_pep_service_new: * @node: the namespace of the PEP node * @subscribe: %TRUE if Wocky is to subscribe to the notifications of * the node, otherwise %FALSE * * A convenience function to create a new #WockyPepService object. * * Returns: a new #WockyPepService */ WockyPepService * wocky_pep_service_new (const gchar *node, gboolean subscribe) { return g_object_new (WOCKY_TYPE_PEP_SERVICE, "node", node, "subscribe", subscribe, NULL); } static gboolean msg_event_cb (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyPepService *self = WOCKY_PEP_SERVICE (user_data); WockyPepServicePrivate *priv = self->priv; const gchar *from; WockyBareContact *contact; WockyStanzaSubType sub_type; WockyNode *event, *items, *item; from = wocky_stanza_get_from (stanza); if (from == NULL) { DEBUG ("No 'from' attribute; ignoring event"); return FALSE; } wocky_stanza_get_type_info (stanza, NULL, &sub_type); /* type of the message is supposed to be 'headline' but old ejabberd * omits it */ if (sub_type != WOCKY_STANZA_SUB_TYPE_NONE && sub_type != WOCKY_STANZA_SUB_TYPE_HEADLINE) { return FALSE; } event = wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "event", WOCKY_XMPP_NS_PUBSUB_EVENT); g_return_val_if_fail (event != NULL, FALSE); items = wocky_node_get_child (event, "items"); g_return_val_if_fail (items != NULL, FALSE); item = wocky_node_get_child (items, "item"); contact = wocky_contact_factory_ensure_bare_contact ( priv->contact_factory, from); g_signal_emit (G_OBJECT (self), signals[CHANGED], 0, contact, stanza, item); g_object_unref (contact); return TRUE; } /** * wocky_pep_service_start: * @self: a #WockyPepService object * @session: a #WockySession object * * Start listening to the PEP node @node and signal changes by using * #WockyPepService::changed. */ void wocky_pep_service_start (WockyPepService *self, WockySession *session) { WockyPepServicePrivate *priv = self->priv; g_assert (priv->session == NULL); priv->session = session; priv->porter = wocky_session_get_porter (priv->session); g_object_ref (priv->porter); priv->contact_factory = wocky_session_get_contact_factory (priv->session); g_object_ref (priv->contact_factory); /* Register event handler */ priv->handler_id = wocky_porter_register_handler_from_anyone (priv->porter, WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_MAX, msg_event_cb, self, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", priv->node, ')', ')', NULL); /* TODO: subscribe to node if needed */ } static void send_query_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); GError *error = NULL; WockyStanza *reply; reply = wocky_porter_send_iq_finish (WOCKY_PORTER (source), res, &error); if (reply == NULL) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gpointer (result, reply, g_object_unref); } g_simple_async_result_complete (result); g_object_unref (result); } /** * wocky_pep_service_get_async: * @self: a #WockyPepService object * @contact: a #WockyBareContact object * @cancellable: an optional #GCancellable object, or %NULL * @callback: a function to call when the node is retrieved * @user_data: user data for @callback * * Starts an asynchronous operation to get the PEP node, * #WockyPepService:node. * * When the operation is complete, @callback will be called and the * function should call wocky_pep_service_get_finish(). */ void wocky_pep_service_get_async (WockyPepService *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPepServicePrivate *priv = self->priv; WockyStanza *msg; GSimpleAsyncResult *result; const gchar *jid; if (priv->porter == NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Service has not been started"); return; } jid = wocky_bare_contact_get_jid (contact); msg = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, jid, '(', "pubsub", ':', WOCKY_XMPP_NS_PUBSUB, '(', "items", '@', "node", priv->node, ')', ')', NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pep_service_get_async); wocky_porter_send_iq_async (priv->porter, msg, cancellable, send_query_cb, result); g_object_unref (msg); } /** * wocky_pep_service_get_finish: * @self: a #WockyPepService object * @result: a #GAsyncResult * @item: (out) (allow-none): on success, the first <item> element * in the result, or %NULL if @self has no published items. * @error: a location to store a #GError if an error occurs * * Finishes an asynchronous operation to get the PEP node, * #WockyPepService:node. For more details, see * wocky_pep_service_get_async(). * * Returns: the #WockyStanza retrieved from getting the PEP node. */ WockyStanza * wocky_pep_service_get_finish (WockyPepService *self, GAsyncResult *result, WockyNode **item, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); WockyStanza *reply; if (g_simple_async_result_propagate_error (simple, error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pep_service_get_async), NULL); reply = WOCKY_STANZA (g_simple_async_result_get_op_res_gpointer (simple)); if (item != NULL) { WockyNode *pubsub_node = wocky_node_get_child_ns ( wocky_stanza_get_top_node (reply), "pubsub", WOCKY_XMPP_NS_PUBSUB); WockyNode *items_node = NULL; if (pubsub_node != NULL) items_node = wocky_node_get_child (pubsub_node, "items"); if (items_node != NULL) *item = wocky_node_get_child (items_node, "item"); else *item = NULL; } return g_object_ref (reply); } /** * wocky_pep_service_make_publish_stanza: * @self: a #WockyPepService * @item: a location to store the item #WockyNode, or %NULL * * Generates a new IQ type='set' PEP publish stanza. * * Returns: a new #WockyStanza PEP publish stanza; free with g_object_unref() */ WockyStanza * wocky_pep_service_make_publish_stanza (WockyPepService *self, WockyNode **item) { WockyPepServicePrivate *priv = self->priv; return wocky_pubsub_make_publish_stanza (NULL, priv->node, NULL, NULL, item); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jabber-auth-digest.c0000644000175000017500000001117713006434361026673 0ustar00gkiagiagkiagia00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-jabber-auth-digest.h" #include "wocky-auth-registry.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" static void auth_handler_iface_init (gpointer g_iface); G_DEFINE_TYPE_WITH_CODE (WockyJabberAuthDigest, wocky_jabber_auth_digest, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_AUTH_HANDLER, auth_handler_iface_init)) enum { PROP_SESSION_ID = 1, PROP_PASSWORD, }; struct _WockyJabberAuthDigestPrivate { gchar *session_id; gchar *password; }; static void wocky_jabber_auth_digest_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_value_set_string (value, priv->session_id); break; case PROP_PASSWORD: g_value_set_string (value, priv->password); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_digest_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_free (priv->session_id); priv->session_id = g_value_dup_string (value); break; case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_jabber_auth_digest_dispose (GObject *object) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (object); WockyJabberAuthDigestPrivate *priv = self->priv; g_free (priv->session_id); g_free (priv->password); G_OBJECT_CLASS (wocky_jabber_auth_digest_parent_class)->dispose (object); } static void wocky_jabber_auth_digest_class_init (WockyJabberAuthDigestClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyJabberAuthDigestPrivate)); object_class->get_property = wocky_jabber_auth_digest_get_property; object_class->set_property = wocky_jabber_auth_digest_set_property; object_class->dispose = wocky_jabber_auth_digest_dispose; g_object_class_install_property (object_class, PROP_SESSION_ID, g_param_spec_string ("session-id", "session-id", "The session_id to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PASSWORD, g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); } static gboolean digest_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error); static void auth_handler_iface_init (gpointer g_iface) { WockyAuthHandlerIface *iface = g_iface; iface->mechanism = WOCKY_AUTH_MECH_JABBER_DIGEST; iface->plain = FALSE; iface->initial_response_func = digest_initial_response; } static void wocky_jabber_auth_digest_init (WockyJabberAuthDigest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( self, WOCKY_TYPE_JABBER_AUTH_DIGEST, WockyJabberAuthDigestPrivate); } WockyJabberAuthDigest * wocky_jabber_auth_digest_new (const gchar *session_id, const gchar *password) { return g_object_new (WOCKY_TYPE_JABBER_AUTH_DIGEST, "session-id", session_id, "password", password, NULL); } static GString * digest_generate_initial_response (const gchar *session_id, const gchar *password) { gchar *hsrc = g_strconcat (session_id, password, NULL); gchar *sha1 = g_compute_checksum_for_string (G_CHECKSUM_SHA1, hsrc, -1); GString *response = g_string_new (sha1); g_free (hsrc); g_free (sha1); return response; } static gboolean digest_initial_response (WockyAuthHandler *handler, GString **initial_data, GError **error) { WockyJabberAuthDigest *self = WOCKY_JABBER_AUTH_DIGEST (handler); WockyJabberAuthDigestPrivate *priv = self->priv; if (priv->password == NULL || priv->session_id == NULL) { g_set_error (error, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_CREDENTIALS, "No session-id or password provided"); return FALSE; } DEBUG ("Got session-id and password"); *initial_data = digest_generate_initial_response (priv->session_id, priv->password); return TRUE; } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-uninstalled.pc.in0000644000175000017500000000055112735676345026355 0ustar00gkiagiagkiagia00000000000000prefix= exec_prefix= abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ Name: Wocky (uninstalled copy) Description: XMPP library Version: @VERSION@ Requires.private: glib-2.0 >= 2.32, gobject-2.0 >= 2.32, gio-2.0 >= 2.32 Libs: ${abs_top_builddir}/wocky/libwocky.la Cflags: -I${abs_top_srcdir} -I${abs_top_builddir} -I${abs_top_builddir}/wocky telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-ping.h0000644000175000017500000000431112735676345024206 0ustar00gkiagiagkiagia00000000000000/* * wocky-ping.h - Header for WockyPing * Copyright (C) 2010 Collabora Ltd. * @author Senko Rasic * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PING_H__ #define __WOCKY_PING_H__ #include #include "wocky-types.h" #include "wocky-c2s-porter.h" G_BEGIN_DECLS typedef struct _WockyPing WockyPing; /** * WockyPingClass: * * The class of a #WockyPing. */ typedef struct _WockyPingClass WockyPingClass; typedef struct _WockyPingPrivate WockyPingPrivate; GQuark wocky_ping_error_quark (void); struct _WockyPingClass { /**/ GObjectClass parent_class; }; struct _WockyPing { /**/ GObject parent; WockyPingPrivate *priv; }; GType wocky_ping_get_type (void); #define WOCKY_TYPE_PING \ (wocky_ping_get_type ()) #define WOCKY_PING(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_PING, \ WockyPing)) #define WOCKY_PING_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_PING, \ WockyPingClass)) #define WOCKY_IS_PING(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_PING)) #define WOCKY_IS_PING_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_PING)) #define WOCKY_PING_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_PING, \ WockyPingClass)) WockyPing * wocky_ping_new (WockyC2SPorter *porter, guint interval); G_END_DECLS #endif /* #ifndef __WOCKY_PING_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-session.h0000644000175000017500000001172312735676345026207 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-session.h - Header for WockyJingleSession * Copyright (C) 2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __JINGLE_SESSION_H__ #define __JINGLE_SESSION_H__ #include #include "wocky-jingle-content.h" #include "wocky-jingle-factory.h" #include "wocky-jingle-types.h" G_BEGIN_DECLS typedef struct _WockyJingleSessionClass WockyJingleSessionClass; GType wocky_jingle_session_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_JINGLE_SESSION \ (wocky_jingle_session_get_type ()) #define WOCKY_JINGLE_SESSION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_JINGLE_SESSION, \ WockyJingleSession)) #define WOCKY_JINGLE_SESSION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_JINGLE_SESSION, \ WockyJingleSessionClass)) #define WOCKY_IS_JINGLE_SESSION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_JINGLE_SESSION)) #define WOCKY_IS_JINGLE_SESSION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_JINGLE_SESSION)) #define WOCKY_JINGLE_SESSION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JINGLE_SESSION, \ WockyJingleSessionClass)) struct _WockyJingleSessionClass { GObjectClass parent_class; }; typedef struct _WockyJingleSessionPrivate WockyJingleSessionPrivate; struct _WockyJingleSession { GObject parent; WockyJingleSessionPrivate *priv; }; WockyJingleSession *wocky_jingle_session_new ( WockyJingleFactory *factory, WockyPorter *porter, const gchar *session_id, gboolean local_initiator, WockyContact *peer, WockyJingleDialect dialect, gboolean local_hold); const gchar * wocky_jingle_session_detect (WockyStanza *stanza, WockyJingleAction *action, WockyJingleDialect *dialect); gboolean wocky_jingle_session_parse (WockyJingleSession *sess, WockyJingleAction action, WockyStanza *stanza, GError **error); WockyStanza *wocky_jingle_session_new_message (WockyJingleSession *sess, WockyJingleAction action, WockyNode **sess_node); void wocky_jingle_session_accept (WockyJingleSession *sess); gboolean wocky_jingle_session_terminate (WockyJingleSession *sess, WockyJingleReason reason, const gchar *text, GError **error); void wocky_jingle_session_remove_content (WockyJingleSession *sess, WockyJingleContent *c); WockyJingleContent * wocky_jingle_session_add_content (WockyJingleSession *sess, WockyJingleMediaType mtype, WockyJingleContentSenders senders, const char *name, const gchar *content_ns, const gchar *transport_ns); GType wocky_jingle_session_get_content_type (WockyJingleSession *); GList *wocky_jingle_session_get_contents (WockyJingleSession *sess); const gchar *wocky_jingle_session_get_peer_resource ( WockyJingleSession *sess); const gchar *wocky_jingle_session_get_initiator ( WockyJingleSession *sess); const gchar *wocky_jingle_session_get_sid (WockyJingleSession *sess); WockyJingleDialect wocky_jingle_session_get_dialect (WockyJingleSession *sess); gboolean wocky_jingle_session_can_modify_contents (WockyJingleSession *sess); gboolean wocky_jingle_session_peer_has_cap ( WockyJingleSession *self, const gchar *cap_or_quirk); void wocky_jingle_session_send ( WockyJingleSession *sess, WockyStanza *stanza); void wocky_jingle_session_set_local_hold (WockyJingleSession *sess, gboolean held); gboolean wocky_jingle_session_get_remote_hold (WockyJingleSession *sess); gboolean wocky_jingle_session_get_remote_ringing (WockyJingleSession *sess); gboolean wocky_jingle_session_defines_action (WockyJingleSession *sess, WockyJingleAction action); WockyContact *wocky_jingle_session_get_peer_contact (WockyJingleSession *self); const gchar *wocky_jingle_session_get_peer_jid (WockyJingleSession *sess); const gchar *wocky_jingle_session_get_reason_name (WockyJingleReason reason); WockyJingleFactory *wocky_jingle_session_get_factory (WockyJingleSession *self); WockyPorter *wocky_jingle_session_get_porter (WockyJingleSession *self); void wocky_jingle_session_acknowledge_iq (WockyJingleSession *self, WockyStanza *stanza); G_END_DECLS #endif /* __JINGLE_SESSION_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-transport-iface.h0000644000175000017500000001047313012550005027573 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-transport-iface.h - Header for WockyJingleTransportIface * Copyright (C) 2007-2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_JINGLE_TRANSPORT_IFACE_H__ #define __WOCKY_JINGLE_TRANSPORT_IFACE_H__ #include #include "wocky-jingle-factory.h" #include "wocky-jingle-types.h" G_BEGIN_DECLS typedef enum { WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED, WOCKY_JINGLE_TRANSPORT_STATE_CONNECTING, WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED } WockyJingleTransportState; typedef struct _WockyJingleTransportIface WockyJingleTransportIface; typedef struct _WockyJingleTransportIfaceClass WockyJingleTransportIfaceClass; struct _WockyJingleTransportIfaceClass { GTypeInterface parent; void (*parse_candidates) (WockyJingleTransportIface *, WockyNode *, GError **); void (*new_local_candidates) (WockyJingleTransportIface *, GList *); void (*inject_candidates) (WockyJingleTransportIface *, WockyNode *transport_node); void (*send_candidates) (WockyJingleTransportIface *, gboolean all); gboolean (*can_accept) (WockyJingleTransportIface *); GList * (*get_remote_candidates) (WockyJingleTransportIface *); GList * (*get_local_candidates) (WockyJingleTransportIface *); gboolean (*get_credentials) (WockyJingleTransportIface *, gchar **ufrag, gchar **pwd); WockyJingleTransportType (*get_transport_type) (void); }; GType wocky_jingle_transport_iface_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_JINGLE_TRANSPORT_IFACE \ (wocky_jingle_transport_iface_get_type ()) #define WOCKY_JINGLE_TRANSPORT_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_JINGLE_TRANSPORT_IFACE, WockyJingleTransportIface)) #define WOCKY_IS_JINGLE_TRANSPORT_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_JINGLE_TRANSPORT_IFACE)) #define WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WOCKY_TYPE_JINGLE_TRANSPORT_IFACE,\ WockyJingleTransportIfaceClass)) void wocky_jingle_transport_iface_parse_candidates (WockyJingleTransportIface *, WockyNode *, GError **); void wocky_jingle_transport_iface_new_local_candidates ( WockyJingleTransportIface *self, GList *candidates); void wocky_jingle_transport_iface_inject_candidates ( WockyJingleTransportIface *self, WockyNode *transport_node); void wocky_jingle_transport_iface_send_candidates ( WockyJingleTransportIface *self, gboolean all); gboolean wocky_jingle_transport_iface_can_accept ( WockyJingleTransportIface *self); GList *wocky_jingle_transport_iface_get_remote_candidates (WockyJingleTransportIface *); GList *wocky_jingle_transport_iface_get_local_candidates (WockyJingleTransportIface *); WockyJingleTransportType wocky_jingle_transport_iface_get_transport_type (WockyJingleTransportIface *); gboolean jingle_transport_get_credentials (WockyJingleTransportIface *, gchar **ufrag, gchar **pwd); WockyJingleTransportIface *wocky_jingle_transport_iface_new ( GType type, WockyJingleContent *content, const gchar *transport_ns); WockyJingleCandidate *wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol, WockyJingleCandidateType type, const gchar *id, int component, const gchar *address, int port, int generation, int preference, const gchar *username, const gchar *password, int network); void wocky_jingle_candidate_free (WockyJingleCandidate *c); void jingle_transport_free_candidates (GList *candidates); G_END_DECLS #endif /* #ifndef __WOCKY_JINGLE_TRANSPORT_IFACE_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-session.c0000644000175000017500000023262212735676345026205 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-session.c - Source for WockyJingleSession * Copyright (C) 2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "wocky-jingle-session.h" #include #include #include #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_JINGLE #include "wocky-debug-internal.h" #include "wocky-signals-marshal.h" #include "wocky-enumtypes.h" #include "wocky-jingle-content.h" #include "wocky-jingle-factory.h" /* FIXME: the RTP-specific bits of this file should be separated from the * generic Jingle code. */ #include "wocky-jingle-media-rtp.h" #include "wocky-namespaces.h" #include "wocky-node-private.h" #include "wocky-resource-contact.h" #include "wocky-utils.h" G_DEFINE_TYPE(WockyJingleSession, wocky_jingle_session, G_TYPE_OBJECT); /* signal enum */ enum { NEW_CONTENT, REMOTE_STATE_CHANGED, TERMINATED, CONTENT_REJECTED, QUERY_CAP, ABOUT_TO_INITIATE, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; /* properties */ enum { PROP_JINGLE_FACTORY = 1, PROP_PORTER, PROP_SESSION_ID, PROP_PEER_CONTACT, PROP_LOCAL_INITIATOR, PROP_STATE, PROP_DIALECT, PROP_LOCAL_HOLD, PROP_REMOTE_HOLD, PROP_REMOTE_RINGING, LAST_PROPERTY }; struct _WockyJingleSessionPrivate { /* Borrowed; the factory owns us. */ WockyJingleFactory *jingle_factory; WockyPorter *porter; WockyContact *peer_contact; /* Borrowed from peer_contact if it's a WockyResourceContact. */ const gchar *peer_resource; gchar *peer_jid; /* Either borrowed from 'porter' or equal to peer_jid. */ const gchar *initiator; gboolean local_initiator; /* WockyJingleContent objects keyed by content name. * Table owns references to these objects. */ GHashTable *initiator_contents; GHashTable *responder_contents; WockyJingleDialect dialect; WockyJingleState state; gchar *sid; gboolean locally_accepted; gboolean locally_terminated; gboolean local_hold; gboolean remote_hold; gboolean remote_ringing; gboolean dispose_has_run; }; typedef struct { WockyJingleState state; WockyJingleAction *actions; } WockyJingleStateActions; /* gcc should be able to figure this out from the table below, but.. */ #define MAX_ACTIONS_PER_STATE 12 /* NB: WOCKY_JINGLE_ACTION_UNKNOWN is used as a terminator here. */ static WockyJingleAction allowed_actions[WOCKY_N_JINGLE_STATES][MAX_ACTIONS_PER_STATE] = { /* WOCKY_JINGLE_STATE_PENDING_CREATED */ { WOCKY_JINGLE_ACTION_SESSION_INITIATE, WOCKY_JINGLE_ACTION_UNKNOWN }, /* WOCKY_JINGLE_STATE_PENDING_INITIATE_SENT */ { WOCKY_JINGLE_ACTION_SESSION_TERMINATE, WOCKY_JINGLE_ACTION_SESSION_ACCEPT, WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT, /* required for GTalk4 */ WOCKY_JINGLE_ACTION_DESCRIPTION_INFO, WOCKY_JINGLE_ACTION_SESSION_INFO, WOCKY_JINGLE_ACTION_TRANSPORT_INFO, WOCKY_JINGLE_ACTION_INFO, WOCKY_JINGLE_ACTION_UNKNOWN }, /* WOCKY_JINGLE_STATE_PENDING_INITIATED */ { WOCKY_JINGLE_ACTION_SESSION_ACCEPT, WOCKY_JINGLE_ACTION_SESSION_TERMINATE, WOCKY_JINGLE_ACTION_TRANSPORT_INFO, WOCKY_JINGLE_ACTION_CONTENT_REJECT, WOCKY_JINGLE_ACTION_CONTENT_MODIFY, WOCKY_JINGLE_ACTION_CONTENT_ACCEPT, WOCKY_JINGLE_ACTION_CONTENT_REMOVE, WOCKY_JINGLE_ACTION_DESCRIPTION_INFO, WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT, WOCKY_JINGLE_ACTION_SESSION_INFO, WOCKY_JINGLE_ACTION_INFO, WOCKY_JINGLE_ACTION_UNKNOWN }, /* WOCKY_JINGLE_STATE_PENDING_ACCEPT_SENT */ { WOCKY_JINGLE_ACTION_TRANSPORT_INFO, WOCKY_JINGLE_ACTION_DESCRIPTION_INFO, WOCKY_JINGLE_ACTION_SESSION_TERMINATE, WOCKY_JINGLE_ACTION_SESSION_INFO, WOCKY_JINGLE_ACTION_INFO, WOCKY_JINGLE_ACTION_UNKNOWN }, /* WOCKY_JINGLE_STATE_ACTIVE */ { WOCKY_JINGLE_ACTION_CONTENT_MODIFY, WOCKY_JINGLE_ACTION_CONTENT_ADD, WOCKY_JINGLE_ACTION_CONTENT_REMOVE, WOCKY_JINGLE_ACTION_CONTENT_REPLACE, WOCKY_JINGLE_ACTION_CONTENT_ACCEPT, WOCKY_JINGLE_ACTION_CONTENT_REJECT, WOCKY_JINGLE_ACTION_SESSION_INFO, WOCKY_JINGLE_ACTION_TRANSPORT_INFO, WOCKY_JINGLE_ACTION_DESCRIPTION_INFO, WOCKY_JINGLE_ACTION_INFO, WOCKY_JINGLE_ACTION_SESSION_TERMINATE, WOCKY_JINGLE_ACTION_UNKNOWN }, /* WOCKY_JINGLE_STATE_ENDED */ { WOCKY_JINGLE_ACTION_UNKNOWN } }; gboolean wocky_jingle_session_defines_action (WockyJingleSession *sess, WockyJingleAction a) { WockyJingleDialect d = sess->priv->dialect; if (a == WOCKY_JINGLE_ACTION_UNKNOWN) return FALSE; switch (d) { case WOCKY_JINGLE_DIALECT_V032: return TRUE; case WOCKY_JINGLE_DIALECT_V015: return (a != WOCKY_JINGLE_ACTION_DESCRIPTION_INFO && a != WOCKY_JINGLE_ACTION_SESSION_INFO); case WOCKY_JINGLE_DIALECT_GTALK4: if (a == WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT || a == WOCKY_JINGLE_ACTION_INFO ) return TRUE; case WOCKY_JINGLE_DIALECT_GTALK3: return (a == WOCKY_JINGLE_ACTION_SESSION_ACCEPT || a == WOCKY_JINGLE_ACTION_SESSION_INITIATE || a == WOCKY_JINGLE_ACTION_SESSION_TERMINATE || a == WOCKY_JINGLE_ACTION_TRANSPORT_INFO || a == WOCKY_JINGLE_ACTION_INFO); default: return FALSE; } } static void wocky_jingle_session_send_held (WockyJingleSession *sess); static void content_ready_cb (WockyJingleContent *c, gpointer user_data); static void content_removed_cb (WockyJingleContent *c, gpointer user_data); static void wocky_jingle_session_init (WockyJingleSession *obj) { WockyJingleSessionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, WOCKY_TYPE_JINGLE_SESSION, WockyJingleSessionPrivate); obj->priv = priv; DEBUG ("Initializing the jingle session %p", obj); priv->initiator_contents = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->responder_contents = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->state = WOCKY_JINGLE_STATE_PENDING_CREATED; priv->locally_accepted = FALSE; priv->locally_terminated = FALSE; priv->dispose_has_run = FALSE; } static void dispose_content_hash ( WockyJingleSession *sess, GHashTable **contents) { GHashTableIter iter; gpointer content; g_hash_table_iter_init (&iter, *contents); while (g_hash_table_iter_next (&iter, NULL, &content)) { g_signal_handlers_disconnect_by_func (content, content_ready_cb, sess); g_signal_handlers_disconnect_by_func (content, content_removed_cb, sess); g_hash_table_iter_remove (&iter); } g_hash_table_unref (*contents); *contents = NULL; } static void wocky_jingle_session_dispose (GObject *object) { WockyJingleSession *sess = WOCKY_JINGLE_SESSION (object); WockyJingleSessionPrivate *priv = sess->priv; if (priv->dispose_has_run) return; DEBUG ("called"); priv->dispose_has_run = TRUE; g_assert ((priv->state == WOCKY_JINGLE_STATE_PENDING_CREATED) || (priv->state == WOCKY_JINGLE_STATE_ENDED)); dispose_content_hash (sess, &priv->initiator_contents); dispose_content_hash (sess, &priv->responder_contents); g_clear_object (&priv->peer_contact); g_clear_object (&priv->porter); g_free (priv->sid); priv->sid = NULL; g_free (priv->peer_jid); priv->peer_jid = NULL; if (G_OBJECT_CLASS (wocky_jingle_session_parent_class)->dispose) G_OBJECT_CLASS (wocky_jingle_session_parent_class)->dispose (object); } static void wocky_jingle_session_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJingleSession *sess = WOCKY_JINGLE_SESSION (object); WockyJingleSessionPrivate *priv = sess->priv; switch (property_id) { case PROP_JINGLE_FACTORY: g_value_set_object (value, priv->jingle_factory); break; case PROP_PORTER: g_value_set_object (value, priv->porter); break; case PROP_SESSION_ID: g_value_set_string (value, priv->sid); break; case PROP_LOCAL_INITIATOR: g_value_set_boolean (value, priv->local_initiator); break; case PROP_PEER_CONTACT: g_value_set_object (value, priv->peer_contact); break; case PROP_STATE: g_value_set_uint (value, priv->state); break; case PROP_DIALECT: g_value_set_uint (value, priv->dialect); break; case PROP_LOCAL_HOLD: g_value_set_boolean (value, priv->local_hold); break; case PROP_REMOTE_HOLD: g_value_set_boolean (value, priv->remote_hold); break; case PROP_REMOTE_RINGING: g_value_set_boolean (value, priv->remote_ringing); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jingle_session_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJingleSession *sess = WOCKY_JINGLE_SESSION (object); WockyJingleSessionPrivate *priv = sess->priv; switch (property_id) { case PROP_JINGLE_FACTORY: priv->jingle_factory = g_value_get_object (value); g_assert (priv->jingle_factory != NULL); break; case PROP_PORTER: priv->porter = g_value_dup_object (value); g_assert (priv->porter != NULL); break; case PROP_SESSION_ID: g_free (priv->sid); priv->sid = g_value_dup_string (value); break; case PROP_LOCAL_INITIATOR: priv->local_initiator = g_value_get_boolean (value); break; case PROP_DIALECT: priv->dialect = g_value_get_uint (value); break; case PROP_PEER_CONTACT: priv->peer_contact = g_value_dup_object (value); break; case PROP_LOCAL_HOLD: { gboolean local_hold = g_value_get_boolean (value); if (priv->local_hold != local_hold) { priv->local_hold = local_hold; if (priv->state >= WOCKY_JINGLE_STATE_PENDING_INITIATED && priv->state < WOCKY_JINGLE_STATE_ENDED) wocky_jingle_session_send_held (sess); /* else, we'll send this in set_state when we move to PENDING_INITIATED or * better. */ } break; } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); g_assert_not_reached (); break; } } static void wocky_jingle_session_constructed (GObject *object) { void (*chain_up) (GObject *) = G_OBJECT_CLASS (wocky_jingle_session_parent_class)->constructed; WockyJingleSession *self = WOCKY_JINGLE_SESSION (object); WockyJingleSessionPrivate *priv = self->priv; if (chain_up != NULL) chain_up (object); g_assert (priv->jingle_factory != NULL); g_assert (priv->porter != NULL); g_assert (priv->peer_contact != NULL); g_assert (priv->sid != NULL); priv->peer_jid = wocky_contact_dup_jid (priv->peer_contact); if (priv->local_initiator) priv->initiator = wocky_porter_get_full_jid (priv->porter); else priv->initiator = priv->peer_jid; if (WOCKY_IS_RESOURCE_CONTACT (priv->peer_contact)) priv->peer_resource = wocky_resource_contact_get_resource ( WOCKY_RESOURCE_CONTACT (priv->peer_contact)); } WockyJingleSession * wocky_jingle_session_new ( WockyJingleFactory *factory, WockyPorter *porter, const gchar *session_id, gboolean local_initiator, WockyContact *peer, WockyJingleDialect dialect, gboolean local_hold) { return g_object_new (WOCKY_TYPE_JINGLE_SESSION, "session-id", session_id, "jingle-factory", factory, "porter", porter, "local-initiator", local_initiator, "peer-contact", peer, "dialect", dialect, "local-hold", local_hold, NULL); } static void wocky_jingle_session_class_init (WockyJingleSessionClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (WockyJingleSessionPrivate)); object_class->constructed = wocky_jingle_session_constructed; object_class->get_property = wocky_jingle_session_get_property; object_class->set_property = wocky_jingle_session_set_property; object_class->dispose = wocky_jingle_session_dispose; /* property definitions */ param_spec = g_param_spec_object ("jingle-factory", "WockyJingleFactory object", "The Jingle factory which created this session", WOCKY_TYPE_JINGLE_FACTORY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_JINGLE_FACTORY, param_spec); param_spec = g_param_spec_object ("porter", "WockyPorter", "The WockyPorter for the current connection", WOCKY_TYPE_PORTER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PORTER, param_spec); param_spec = g_param_spec_string ("session-id", "Session ID", "A unique session identifier used throughout all communication.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SESSION_ID, param_spec); param_spec = g_param_spec_boolean ("local-initiator", "Session initiator", "Specifies if local end initiated the session.", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_INITIATOR, param_spec); /** * WockyJingleSession:peer-contact: * * The #WockyContact representing the other party in the session. Note that * if this is a #WockyBareContact (as opposed to a #WockyResourceContact) the * session is with the contact's bare JID. */ param_spec = g_param_spec_object ("peer-contact", "Session peer", "The WockyContact representing the other party in the session.", WOCKY_TYPE_CONTACT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PEER_CONTACT, param_spec); param_spec = g_param_spec_uint ("state", "Session state", "The current state that the session is in.", 0, G_MAXUINT32, WOCKY_JINGLE_STATE_PENDING_CREATED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); param_spec = g_param_spec_uint ("dialect", "Jingle dialect", "Jingle dialect used for this session.", 0, G_MAXUINT32, WOCKY_JINGLE_DIALECT_ERROR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DIALECT, param_spec); param_spec = g_param_spec_boolean ("local-hold", "Local hold", "TRUE if we've placed the peer on hold", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_HOLD, param_spec); param_spec = g_param_spec_boolean ("remote-hold", "Remote hold", "TRUE if the peer has placed us on hold", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_HOLD, param_spec); param_spec = g_param_spec_boolean ("remote-ringing", "Remote ringing", "TRUE if the peer's client is ringing", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_RINGING, param_spec); /* signal definitions */ signals[NEW_CONTENT] = g_signal_new ("new-content", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); /** * WockyJingleSession::terminated: * @session: the session * @locally_terminated: %TRUE if the session ended due to a call to * wocky_jingle_session_terminate(); %FALSE if the peer ended the session. * @reason: a #WockyJingleReason describing why the session terminated * @text: a possibly-%NULL human-readable string describing why the session * terminated * * Emitted when the session ends, just after #WockyJingleSession:state moves * to #WOCKY_JINGLE_STATE_ENDED. */ signals[TERMINATED] = g_signal_new ("terminated", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__BOOLEAN_UINT_STRING, G_TYPE_NONE, 3, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING); signals[REMOTE_STATE_CHANGED] = g_signal_new ("remote-state-changed", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[CONTENT_REJECTED] = g_signal_new ("content-rejected", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_UINT_STRING, G_TYPE_NONE, 3, G_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_STRING); /* * @contact: this call's peer (the artist commonly known as * wocky_jingle_session_get_peer_contact()) * @cap: the XEP-0115 feature string the session is interested in. * * Emitted when the session wants to check whether the peer has a particular * capability. The handler should return %TRUE if @contact has @cap. */ signals[QUERY_CAP] = g_signal_new ("query-cap", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, g_signal_accumulator_first_wins, NULL, _wocky_signals_marshal_BOOLEAN__OBJECT_STRING, G_TYPE_BOOLEAN, 2, WOCKY_TYPE_CONTACT, G_TYPE_STRING); signals[ABOUT_TO_INITIATE] = g_signal_new ("about-to-initiate", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } typedef void (*HandlerFunc)(WockyJingleSession *sess, WockyNode *node, GError **error); typedef void (*ContentHandlerFunc)(WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error); static gboolean extract_reason (WockyNode *node, WockyJingleReason *reason, gchar **message) { WockyJingleReason _reason = WOCKY_JINGLE_REASON_UNKNOWN; WockyNode *child; WockyNodeIter iter; g_return_val_if_fail (node != NULL, FALSE); if (message != NULL) *message = g_strdup (wocky_node_get_content_from_child (node, "text")); wocky_node_iter_init (&iter, node, NULL, NULL); while (wocky_node_iter_next (&iter, &child)) { if (wocky_enum_from_nick ( wocky_jingle_reason_get_type (), child->name, (gint *) &_reason)) { if (reason != NULL) *reason = _reason; return TRUE; } } return FALSE; } static WockyJingleAction parse_action (const gchar *txt) { if (txt == NULL) return WOCKY_JINGLE_ACTION_UNKNOWN; /* synonyms, best deal with them right now */ if (!wocky_strdiff (txt, "initiate") || !wocky_strdiff (txt, "session-initiate")) return WOCKY_JINGLE_ACTION_SESSION_INITIATE; else if (!wocky_strdiff (txt, "terminate") || !wocky_strdiff (txt, "session-terminate") || !wocky_strdiff (txt, "reject")) return WOCKY_JINGLE_ACTION_SESSION_TERMINATE; else if (!wocky_strdiff (txt, "accept") || !wocky_strdiff (txt, "session-accept")) return WOCKY_JINGLE_ACTION_SESSION_ACCEPT; else if (!wocky_strdiff (txt, "candidates") || !wocky_strdiff (txt, "transport-info")) return WOCKY_JINGLE_ACTION_TRANSPORT_INFO; else if (!wocky_strdiff (txt, "content-accept")) return WOCKY_JINGLE_ACTION_CONTENT_ACCEPT; else if (!wocky_strdiff (txt, "content-add")) return WOCKY_JINGLE_ACTION_CONTENT_ADD; else if (!wocky_strdiff (txt, "content-modify")) return WOCKY_JINGLE_ACTION_CONTENT_MODIFY; else if (!wocky_strdiff (txt, "content-replace")) return WOCKY_JINGLE_ACTION_CONTENT_REPLACE; else if (!wocky_strdiff (txt, "content-reject")) return WOCKY_JINGLE_ACTION_CONTENT_REJECT; else if (!wocky_strdiff (txt, "content-remove")) return WOCKY_JINGLE_ACTION_CONTENT_REMOVE; else if (!wocky_strdiff (txt, "session-info")) return WOCKY_JINGLE_ACTION_SESSION_INFO; else if (!wocky_strdiff (txt, "transport-accept")) return WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT; else if (!wocky_strdiff (txt, "description-info")) return WOCKY_JINGLE_ACTION_DESCRIPTION_INFO; else if (!wocky_strdiff (txt, "info")) return WOCKY_JINGLE_ACTION_INFO; return WOCKY_JINGLE_ACTION_UNKNOWN; } static const gchar * produce_action (WockyJingleAction action, WockyJingleDialect dialect) { gboolean gmode = (dialect == WOCKY_JINGLE_DIALECT_GTALK3) || (dialect == WOCKY_JINGLE_DIALECT_GTALK4); g_return_val_if_fail (action != WOCKY_JINGLE_ACTION_UNKNOWN, NULL); switch (action) { case WOCKY_JINGLE_ACTION_SESSION_INITIATE: return (gmode) ? "initiate" : "session-initiate"; case WOCKY_JINGLE_ACTION_SESSION_TERMINATE: return (gmode) ? "terminate" : "session-terminate"; case WOCKY_JINGLE_ACTION_SESSION_ACCEPT: return (gmode) ? "accept" : "session-accept"; case WOCKY_JINGLE_ACTION_TRANSPORT_INFO: return (dialect == WOCKY_JINGLE_DIALECT_GTALK3) ? "candidates" : "transport-info"; case WOCKY_JINGLE_ACTION_CONTENT_ACCEPT: return "content-accept"; case WOCKY_JINGLE_ACTION_CONTENT_ADD: return "content-add"; case WOCKY_JINGLE_ACTION_CONTENT_MODIFY: return "content-modify"; case WOCKY_JINGLE_ACTION_CONTENT_REMOVE: return "content-remove"; case WOCKY_JINGLE_ACTION_CONTENT_REPLACE: return "content-replace"; case WOCKY_JINGLE_ACTION_CONTENT_REJECT: return "content-reject"; case WOCKY_JINGLE_ACTION_SESSION_INFO: return "session-info"; case WOCKY_JINGLE_ACTION_TRANSPORT_ACCEPT: return "transport-accept"; case WOCKY_JINGLE_ACTION_DESCRIPTION_INFO: return "description-info"; case WOCKY_JINGLE_ACTION_INFO: return "info"; default: /* only reached if g_return_val_if_fail is disabled */ DEBUG ("unknown action %u", action); return NULL; } } static gboolean action_is_allowed (WockyJingleAction action, WockyJingleState state) { guint i; for (i = 0; allowed_actions[state][i] != WOCKY_JINGLE_ACTION_UNKNOWN; i++) { if (allowed_actions[state][i] == action) return TRUE; } return FALSE; } static void wocky_jingle_session_send_rtp_info (WockyJingleSession *sess, const gchar *name); static void set_state (WockyJingleSession *sess, WockyJingleState state, WockyJingleReason termination_reason, const gchar *text); static WockyJingleContent *_get_any_content (WockyJingleSession *session); gboolean wocky_jingle_session_peer_has_cap ( WockyJingleSession *self, const gchar *cap_or_quirk) { gboolean ret; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (self), FALSE); g_return_val_if_fail (cap_or_quirk != NULL, FALSE); g_signal_emit (self, signals[QUERY_CAP], 0, self->priv->peer_contact, cap_or_quirk, &ret); return ret; } static gboolean lookup_content (WockyJingleSession *sess, const gchar *name, const gchar *creator, gboolean fail_if_missing, WockyJingleContent **c, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; if (name == NULL) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "'name' attribute unset"); return FALSE; } if (WOCKY_JINGLE_DIALECT_IS_GOOGLE (priv->dialect)) { /* Only the initiator can create contents on GTalk. */ *c = g_hash_table_lookup (priv->initiator_contents, name); } else { /* Versions of Gabble between 0.7.16 and 0.7.28 (inclusive) omitted the * 'creator' attribute from transport-info (and possibly other) stanzas. * We try to detect contacts using such a version of Gabble from their * caps; if 'creator' is missing and the peer has that caps flag, we look * up the content in both hashes. * * While this doesn't deal with the case where the content is found in * both hashes, this isn't a problem in practice: the versions of Gabble * we're working around didn't allow this to happen (they'd either reject * the second stream, or let it replace the first, depending on the phase * of the moon, and get kind of confused in the process), and we try to * pick globally-unique content names. */ if (creator == NULL && wocky_jingle_session_peer_has_cap (sess, WOCKY_QUIRK_OMITS_CONTENT_CREATORS)) { DEBUG ("working around missing 'creator' attribute"); *c = g_hash_table_lookup (priv->initiator_contents, name); if (*c == NULL) *c = g_hash_table_lookup (priv->responder_contents, name); } else if (!wocky_strdiff (creator, "initiator")) { *c = g_hash_table_lookup (priv->initiator_contents, name); } else if (!wocky_strdiff (creator, "responder")) { *c = g_hash_table_lookup (priv->responder_contents, name); } else { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "'creator' attribute %s", (creator == NULL ? "missing" : "invalid")); return FALSE; } } if (fail_if_missing && *c == NULL) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "Content '%s' (created by %s) does not exist", name, creator); return FALSE; } return TRUE; } static void _foreach_content (WockyJingleSession *sess, WockyNode *node, gboolean fail_if_missing, ContentHandlerFunc func, gpointer user_data, GError **error) { WockyJingleContent *c; WockyNode *content_node; WockyNodeIter iter; wocky_node_iter_init (&iter, node, "content", NULL); while (wocky_node_iter_next (&iter, &content_node)) { if (!lookup_content (sess, wocky_node_get_attribute (content_node, "name"), wocky_node_get_attribute (content_node, "creator"), fail_if_missing, &c, error)) return; func (sess, c, content_node, user_data, error); if (*error != NULL) return; } } struct idle_content_reject_ctx { WockyJingleSession *session; WockyStanza *msg; }; static gboolean idle_content_reject (gpointer data) { struct idle_content_reject_ctx *ctx = data; wocky_jingle_session_send (ctx->session, ctx->msg); g_object_unref (ctx->session); g_free (ctx); return FALSE; } static void fire_idle_content_reject (WockyJingleSession *sess, const gchar *name, const gchar *creator) { struct idle_content_reject_ctx *ctx = g_new0 (struct idle_content_reject_ctx, 1); WockyNode *sess_node, *node; if (creator == NULL) creator = ""; ctx->session = g_object_ref (sess); ctx->msg = wocky_jingle_session_new_message (ctx->session, WOCKY_JINGLE_ACTION_CONTENT_REJECT, &sess_node); g_debug ("name = %s, initiator = %s", name, creator); node = wocky_node_add_child (sess_node, "content"); wocky_node_set_attributes (node, "name", name, "creator", creator, NULL); /* FIXME: add API for ordering IQs rather than using g_idle_add. */ g_idle_add (idle_content_reject, ctx); } static WockyJingleContent * create_content (WockyJingleSession *sess, GType content_type, WockyJingleMediaType type, WockyJingleContentSenders senders, const gchar *content_ns, const gchar *transport_ns, const gchar *name, WockyNode *content_node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; WockyJingleContent *c; GHashTable *contents; DEBUG ("session creating new content name %s, type %d", name, type); /* FIXME: media-type is introduced by WockyJingleMediaRTP, not by the * superclass, so this call is unsafe in the general case */ c = g_object_new (content_type, "session", sess, "content-ns", content_ns, "transport-ns", transport_ns, "media-type", type, "name", name, "disposition", "session", "senders", senders, NULL); g_signal_connect (c, "ready", (GCallback) content_ready_cb, sess); g_signal_connect (c, "removed", (GCallback) content_removed_cb, sess); /* if we are called by parser, parse content add */ if (content_node != NULL) { wocky_jingle_content_parse_add (c, content_node, WOCKY_JINGLE_DIALECT_IS_GOOGLE (priv->dialect), error); if (*error != NULL) { g_object_unref (c); return NULL; } /* gtalk streams don't have name, so use whatever Content came up with */ if (name == NULL) name = wocky_jingle_content_get_name (c); } if (priv->local_initiator == wocky_jingle_content_is_created_by_us (c)) { DEBUG ("inserting content %s into initiator_contents", name); contents = priv->initiator_contents; } else { DEBUG ("inserting content %s into responder_contents", name); contents = priv->responder_contents; } /* If the content already existed, either we shouldn't have picked the name * we did (if we're creating it) or _each_content_add should have already * said no. */ g_assert (g_hash_table_lookup (contents, name) == NULL); g_hash_table_insert (contents, g_strdup (name), c); g_signal_emit (sess, signals[NEW_CONTENT], 0, c); return c; } static void _each_content_add (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; const gchar *name = wocky_node_get_attribute (content_node, "name"); WockyNode *desc_node = wocky_node_get_child (content_node, "description"); GType content_type = 0; const gchar *content_ns = NULL; if (desc_node != NULL) { content_ns = wocky_node_get_ns (desc_node); DEBUG ("namespace: %s", content_ns); content_type = wocky_jingle_factory_lookup_content_type ( wocky_jingle_session_get_factory (sess), content_ns); } if (content_type == 0) { /* if this is session-initiate, we should return error, otherwise, * we should respond with content-reject */ if (priv->state < WOCKY_JINGLE_STATE_PENDING_INITIATED) g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "unsupported content type with ns %s", content_ns); else fire_idle_content_reject (sess, name, wocky_node_get_attribute (content_node, "creator")); return; } if (c != NULL) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "content '%s' already exists", name); return; } create_content (sess, content_type, WOCKY_JINGLE_MEDIA_TYPE_NONE, WOCKY_JINGLE_CONTENT_SENDERS_BOTH, content_ns, NULL, NULL, content_node, error); } static void _each_content_remove (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { g_assert (c != NULL); wocky_jingle_content_remove (c, FALSE); } static void _each_content_rejected (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { WockyJingleReason reason = GPOINTER_TO_UINT (user_data); g_assert (c != NULL); g_signal_emit (sess, signals[CONTENT_REJECTED], 0, c, reason, ""); wocky_jingle_content_remove (c, FALSE); } static void _each_content_modify (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { g_assert (c != NULL); wocky_jingle_content_update_senders (c, content_node, error); if (*error != NULL) return; } static void _each_content_replace (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { _each_content_remove (sess, c, content_node, NULL, error); if (*error != NULL) return; _each_content_add (sess, c, content_node, NULL, error); } static void _each_content_accept (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; WockyJingleContentState state; g_assert (c != NULL); g_object_get (c, "state", &state, NULL); if (state != WOCKY_JINGLE_CONTENT_STATE_SENT) { #ifdef ENABLE_DEBUG const gchar *name = wocky_node_get_attribute (content_node, "name"); DEBUG ("ignoring content \"%s\"s acceptance for content not in SENT state", name); #endif return; } wocky_jingle_content_parse_accept (c, content_node, WOCKY_JINGLE_DIALECT_IS_GOOGLE (priv->dialect), error); } static void _each_description_info (WockyJingleSession *sess, WockyJingleContent *c, WockyNode *content_node, gpointer user_data, GError **error) { wocky_jingle_content_parse_description_info (c, content_node, error); } static void on_session_initiate (WockyJingleSession *sess, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; /* we can't call ourselves at the moment */ if (priv->local_initiator) { /* We ignore initiate from us, and terminate the session immediately * afterwards */ wocky_jingle_session_terminate (sess, WOCKY_JINGLE_REASON_BUSY, NULL, NULL); return; } if ((priv->dialect == WOCKY_JINGLE_DIALECT_GTALK3)) { const gchar *content_ns = NULL; WockyNode *desc_node = wocky_node_get_child (node, "description"); content_ns = wocky_node_get_ns (desc_node); if (!wocky_strdiff (content_ns, WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO)) { WockyJingleFactory *factory = wocky_jingle_session_get_factory (sess); GType content_type = 0; DEBUG ("GTalk v3 session with audio and video"); /* audio and video content */ content_type = wocky_jingle_factory_lookup_content_type ( factory, content_ns); create_content (sess, content_type, WOCKY_JINGLE_MEDIA_TYPE_VIDEO, WOCKY_JINGLE_CONTENT_SENDERS_BOTH, WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO, NULL, "video", node, error); content_type = wocky_jingle_factory_lookup_content_type ( factory, WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE); create_content (sess, content_type, WOCKY_JINGLE_MEDIA_TYPE_AUDIO, WOCKY_JINGLE_CONTENT_SENDERS_BOTH, WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE, NULL, "audio", node, error); } else { _each_content_add (sess, NULL, node, NULL, error); } } else if (priv->dialect == WOCKY_JINGLE_DIALECT_GTALK4) { /* in this case we implicitly have just one content */ _each_content_add (sess, NULL, node, NULL, error); } else { _foreach_content (sess, node, FALSE, _each_content_add, NULL, error); } if (*error == NULL) { /* FIXME: contents defined here should always have "session" content * disposition; resolve this as soon as the proper procedure is defined * in XEP-0166. */ set_state (sess, WOCKY_JINGLE_STATE_PENDING_INITIATED, WOCKY_JINGLE_REASON_UNKNOWN, NULL); wocky_jingle_session_send_rtp_info (sess, "ringing"); } } static void on_content_add (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, FALSE, _each_content_add, NULL, error); } static void on_content_modify (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, TRUE, _each_content_modify, NULL, error); } static void on_content_remove (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, TRUE, _each_content_remove, NULL, error); } static void on_content_replace (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, TRUE, _each_content_replace, NULL, error); } static void on_content_reject (WockyJingleSession *sess, WockyNode *node, GError **error) { WockyNode *n = wocky_node_get_child (node, "reason"); WockyJingleReason reason = WOCKY_JINGLE_REASON_UNKNOWN; DEBUG (" "); if (n != NULL) extract_reason (n, &reason, NULL); if (reason == WOCKY_JINGLE_REASON_UNKNOWN) reason = WOCKY_JINGLE_REASON_GENERAL_ERROR; _foreach_content (sess, node, TRUE, _each_content_rejected, GUINT_TO_POINTER (reason), error); } static void on_content_accept (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, TRUE, _each_content_accept, NULL, error); } static void on_session_accept (WockyJingleSession *sess, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; DEBUG ("called"); if ((priv->dialect == WOCKY_JINGLE_DIALECT_GTALK3) || (priv->dialect == WOCKY_JINGLE_DIALECT_GTALK4)) { /* Google Talk calls don't have contents per se; they just have * s in different namespaces for audio and video, in the * same stanza. So we need to feed the whole stanza to each * content in turn. */ GList *cs = wocky_jingle_session_get_contents (sess); GList *l; for (l = cs; l != NULL; l = l->next) _each_content_accept (sess, l->data, node, NULL, error); g_list_free (cs); } else { _foreach_content (sess, node, TRUE, _each_content_accept, NULL, error); } if (*error != NULL) return; set_state (sess, WOCKY_JINGLE_STATE_ACTIVE, WOCKY_JINGLE_REASON_UNKNOWN, NULL); /* Make sure each content knows the session is active */ g_list_foreach (wocky_jingle_session_get_contents (sess), (GFunc) g_object_notify, "state"); if (priv->dialect != WOCKY_JINGLE_DIALECT_V032) { /* If this is a dialect that doesn't support , we treat * session-accept as the cue to remove the ringing flag. */ priv->remote_ringing = FALSE; g_signal_emit (sess, signals[REMOTE_STATE_CHANGED], 0); } } static void mute_all_foreach (gpointer key, gpointer value, gpointer mute) { if (G_OBJECT_TYPE (value) == WOCKY_TYPE_JINGLE_MEDIA_RTP) g_object_set (value, "remote-mute", GPOINTER_TO_INT (mute), NULL); } static void mute_all (WockyJingleSession *sess, gboolean mute) { g_hash_table_foreach (sess->priv->initiator_contents, mute_all_foreach, GINT_TO_POINTER (mute)); g_hash_table_foreach (sess->priv->responder_contents, mute_all_foreach, GINT_TO_POINTER (mute)); } static gboolean set_mute (WockyJingleSession *sess, const gchar *name, const gchar *creator, gboolean mute, GError **error) { WockyJingleContent *c; if (name == NULL) { mute_all (sess, mute); return TRUE; } if (!lookup_content (sess, name, creator, TRUE /* fail if missing */, &c, error)) return FALSE; if (G_OBJECT_TYPE (c) != WOCKY_TYPE_JINGLE_MEDIA_RTP) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "content '%s' isn't an RTP session", name); return FALSE; } g_object_set (c, "remote-mute", mute, NULL); return TRUE; } static void set_hold (WockyJingleSession *sess, gboolean hold) { sess->priv->remote_hold = hold; } static void set_ringing (WockyJingleSession *sess, gboolean ringing) { sess->priv->remote_ringing = ringing; } static gboolean handle_payload (WockyJingleSession *sess, WockyNode *payload, gboolean *handled, GError **error) { const gchar *ns = wocky_node_get_ns (payload); const gchar *elt = payload->name; const gchar *name = wocky_node_get_attribute (payload, "name"); const gchar *creator = wocky_node_get_attribute (payload, "creator"); if (wocky_strdiff (ns, WOCKY_XMPP_NS_JINGLE_RTP_INFO)) { *handled = FALSE; return TRUE; } *handled = TRUE; if (!wocky_strdiff (elt, "active")) { /* Clear all states, we're active */ mute_all (sess, FALSE); set_ringing (sess, FALSE); set_hold (sess, FALSE); } else if (!wocky_strdiff (elt, "ringing")) { set_ringing (sess, TRUE); } else if (!wocky_strdiff (elt, "hold")) { set_hold (sess, TRUE); } else if (!wocky_strdiff (elt, "unhold")) { set_hold (sess, FALSE); } /* XEP-0178 says that only and can have a name='' * attribute. */ else if (!wocky_strdiff (elt, "mute")) { return set_mute (sess, name, creator, TRUE, error); } else if (!wocky_strdiff (elt, "unmute")) { return set_mute (sess, name, creator, FALSE, error); } else { g_set_error (error, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO, "<%s> is not known in namespace %s", elt, ns); return FALSE; } return TRUE; } static void on_session_info (WockyJingleSession *sess, WockyNode *node, GError **error) { gboolean understood_a_payload = FALSE; gboolean hit_an_error = FALSE; WockyNodeIter i; WockyNode *n; /* if this is a ping, just ack it. */ if (wocky_node_get_first_child (node) == NULL) return; wocky_node_iter_init (&i, node, NULL, NULL); while (wocky_node_iter_next (&i, &n)) { gboolean handled; GError *e = NULL; if (handle_payload (sess, n, &handled, &e)) { understood_a_payload = understood_a_payload || handled; } else if (hit_an_error) { DEBUG ("already got another error; ignoring %s", e->message); g_error_free (e); } else { DEBUG ("hit an error: %s", e->message); hit_an_error = TRUE; g_propagate_error (error, e); } } /* If we understood something, the remote state (may have) changed. Else, * return an error to the peer. */ if (understood_a_payload) g_signal_emit (sess, signals[REMOTE_STATE_CHANGED], 0); else if (!hit_an_error) g_set_error (error, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO, "no recognized session-info payloads"); } static void on_session_terminate (WockyJingleSession *sess, WockyNode *node, GError **error) { gchar *text = NULL; WockyNode *n = wocky_node_get_child (node, "reason"); WockyJingleReason wocky_jingle_reason = WOCKY_JINGLE_REASON_UNKNOWN; if (n != NULL) extract_reason (n, &wocky_jingle_reason, &text); DEBUG ("remote end terminated the session with reason %s and text '%s'", wocky_jingle_session_get_reason_name (wocky_jingle_reason), (text != NULL ? text : "(none)")); set_state (sess, WOCKY_JINGLE_STATE_ENDED, wocky_jingle_reason, text); g_free (text); } static void on_transport_info (WockyJingleSession *sess, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; WockyJingleContent *c = NULL; if (WOCKY_JINGLE_DIALECT_IS_GOOGLE (priv->dialect)) { GHashTableIter iter; gpointer value; if (priv->dialect == WOCKY_JINGLE_DIALECT_GTALK4) { if (!wocky_strdiff (wocky_node_get_attribute (node, "type"), "candidates")) { GList *contents = wocky_jingle_session_get_contents (sess); GList *l; DEBUG ("switching to gtalk3 dialect and retransmiting our candidates"); priv->dialect = WOCKY_JINGLE_DIALECT_GTALK3; for (l = contents; l != NULL; l = l->next) wocky_jingle_content_retransmit_candidates (l->data, TRUE); g_list_free (contents); } else { node = wocky_node_get_child (node, "transport"); if (node == NULL) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "transport-info stanza without a "); return; } } } g_hash_table_iter_init (&iter, priv->initiator_contents); while (g_hash_table_iter_next (&iter, NULL, &value)) { c = value; wocky_jingle_content_parse_transport_info (c, node, error); if (error != NULL && *error != NULL) break; } } else { WockyNodeIter i; WockyNode *content_node; GError *e = NULL; wocky_node_iter_init (&i, node, "content", NULL); while (wocky_node_iter_next (&i, &content_node)) { WockyNode *transport_node; if (lookup_content (sess, wocky_node_get_attribute (content_node, "name"), wocky_node_get_attribute (content_node, "creator"), TRUE /* fail_if_missing */, &c, &e)) { /* we need transport child of content node */ transport_node = wocky_node_get_child ( content_node, "transport"); wocky_jingle_content_parse_transport_info (c, transport_node, &e); } /* Save the first error we encounter, but go through all remaining * contents anyway to try and recover as much info as we can */ if (e != NULL && error != NULL && *error == NULL) { *error = e; e = NULL; } g_clear_error (&e); } } } static void on_transport_accept (WockyJingleSession *sess, WockyNode *node, GError **error) { DEBUG ("Ignoring 'transport-accept' action from peer"); } static void on_description_info (WockyJingleSession *sess, WockyNode *node, GError **error) { _foreach_content (sess, node, TRUE, _each_description_info, NULL, error); } static void on_info (WockyJingleSession *sess, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; WockyJingleContent *c = NULL; DEBUG ("received info "); if (WOCKY_JINGLE_DIALECT_IS_GOOGLE (priv->dialect)) { GHashTableIter iter; g_hash_table_iter_init (&iter, priv->initiator_contents); while (g_hash_table_iter_next (&iter, NULL, (gpointer) &c)) { wocky_jingle_content_parse_info (c, node, error); if (error != NULL && *error != NULL) break; } } } static HandlerFunc handlers[] = { NULL, /* for unknown action */ on_content_accept, on_content_add, on_content_modify, on_content_remove, on_content_replace, on_content_reject, on_session_accept, /* jingle_on_session_accept */ on_session_info, on_session_initiate, on_session_terminate, /* jingle_on_session_terminate */ on_transport_info, /* jingle_on_transport_info */ on_transport_accept, on_description_info, on_info }; static void wocky_jingle_state_machine_dance (WockyJingleSession *sess, WockyJingleAction action, WockyNode *node, GError **error) { WockyJingleSessionPrivate *priv = sess->priv; /* parser should've checked this already */ g_assert (action_is_allowed (action, priv->state)); g_assert (handlers[action] != NULL); handlers[action] (sess, node, error); } static WockyJingleDialect detect_google_dialect (WockyNode *session_node) { /* The GTALK3 dialect is the only one that supports video at this time */ if (wocky_node_get_child_ns (session_node, "description", WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO) != NULL) return WOCKY_JINGLE_DIALECT_GTALK3; /* GTalk4 has a transport item, GTalk3 doesn't */ if (wocky_node_get_child_ns (session_node, "transport", WOCKY_XMPP_NS_GOOGLE_TRANSPORT_P2P) == NULL) return WOCKY_JINGLE_DIALECT_GTALK3; return WOCKY_JINGLE_DIALECT_GTALK4; } static const gchar * wocky_jingle_session_detect_internal ( WockyStanza *stanza, WockyJingleAction *action, WockyJingleDialect *dialect, WockyNode **session_node_out) { const gchar *actxt, *sid; WockyNode *iq_node, *session_node; WockyStanzaSubType sub_type; gboolean google_mode = FALSE; /* all jingle actions are sets */ wocky_stanza_get_type_info (stanza, NULL, &sub_type); if (sub_type != WOCKY_STANZA_SUB_TYPE_SET) return NULL; iq_node = wocky_stanza_get_top_node (stanza); if ((NULL == wocky_stanza_get_from (stanza)) || (NULL == wocky_stanza_get_to (stanza))) return NULL; /* first, we try standard jingle */ session_node = wocky_node_get_child_ns (iq_node, "jingle", WOCKY_XMPP_NS_JINGLE); if (session_node != NULL) { if (dialect != NULL) *dialect = WOCKY_JINGLE_DIALECT_V032; } else { /* then, we try a bit older jingle version */ session_node = wocky_node_get_child_ns (iq_node, "jingle", WOCKY_XMPP_NS_JINGLE015); if (session_node != NULL) { if (dialect != NULL) *dialect = WOCKY_JINGLE_DIALECT_V015; } else { /* next, we try googletalk */ session_node = wocky_node_get_child_ns (iq_node, "session", WOCKY_XMPP_NS_GOOGLE_SESSION); if (session_node != NULL) { if (dialect != NULL) *dialect = detect_google_dialect (session_node); google_mode = TRUE; } else { return NULL; } } } if (google_mode) { actxt = wocky_node_get_attribute (session_node, "type"); sid = wocky_node_get_attribute (session_node, "id"); } else { actxt = wocky_node_get_attribute (session_node, "action"); sid = wocky_node_get_attribute (session_node, "sid"); } if (session_node_out != NULL) *session_node_out = session_node; if (action != NULL) *action = parse_action (actxt); return sid; } const gchar * wocky_jingle_session_detect ( WockyStanza *stanza, WockyJingleAction *action, WockyJingleDialect *dialect) { g_return_val_if_fail (WOCKY_IS_STANZA (stanza), NULL); return wocky_jingle_session_detect_internal (stanza, action, dialect, NULL); } gboolean wocky_jingle_session_parse ( WockyJingleSession *sess, WockyJingleAction action, WockyStanza *stanza, GError **error) { WockyJingleSessionPrivate *priv; WockyNode *iq_node, *session_node; const gchar *from, *action_name; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); g_return_val_if_fail (WOCKY_IS_STANZA (stanza), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); priv = sess->priv; /* IQ from/to can come in handy */ from = wocky_stanza_get_from (stanza); iq_node = wocky_stanza_get_top_node (stanza); if (action == WOCKY_JINGLE_ACTION_UNKNOWN) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "unknown session action"); return FALSE; } action_name = produce_action (action, priv->dialect); DEBUG ("jingle action '%s' from '%s' in session '%s' dialect %u state %u", action_name, from, priv->sid, priv->dialect, priv->state); switch (priv->dialect) { case WOCKY_JINGLE_DIALECT_V032: session_node = wocky_node_get_child_ns (iq_node, "jingle", WOCKY_XMPP_NS_JINGLE); break; case WOCKY_JINGLE_DIALECT_V015: session_node = wocky_node_get_child_ns (iq_node, "jingle", WOCKY_XMPP_NS_JINGLE015); break; case WOCKY_JINGLE_DIALECT_GTALK3: case WOCKY_JINGLE_DIALECT_GTALK4: session_node = wocky_node_get_child_ns (iq_node, "session", WOCKY_XMPP_NS_GOOGLE_SESSION); break; default: /* just to make gcc happy about dealing with default case */ session_node = NULL; } if (session_node == NULL) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "malformed jingle stanza"); return FALSE; } if (!wocky_jingle_session_defines_action (sess, action)) { g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "action '%s' unknown (using dialect %u)", action_name, priv->dialect); return FALSE; } if (!action_is_allowed (action, priv->state)) { g_set_error (error, WOCKY_JINGLE_ERROR, WOCKY_JINGLE_ERROR_OUT_OF_ORDER, "action '%s' not allowed in current state", action_name); return FALSE; } wocky_jingle_state_machine_dance (sess, action, session_node, error); if (*error != NULL) return FALSE; return TRUE; } WockyStanza * wocky_jingle_session_new_message (WockyJingleSession *sess, WockyJingleAction action, WockyNode **sess_node) { WockyJingleSessionPrivate *priv = sess->priv; WockyStanza *stanza; WockyNode *session_node; gchar *el = NULL, *ns = NULL; gboolean gtalk_mode = FALSE; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); g_return_val_if_fail (action != WOCKY_JINGLE_ACTION_UNKNOWN, NULL); g_assert ((action == WOCKY_JINGLE_ACTION_SESSION_INITIATE) || (priv->state > WOCKY_JINGLE_STATE_PENDING_CREATED)); switch (priv->dialect) { case WOCKY_JINGLE_DIALECT_V032: el = "jingle"; ns = WOCKY_XMPP_NS_JINGLE; break; case WOCKY_JINGLE_DIALECT_V015: el = "jingle"; ns = WOCKY_XMPP_NS_JINGLE015; break; case WOCKY_JINGLE_DIALECT_GTALK3: case WOCKY_JINGLE_DIALECT_GTALK4: el = "session"; ns = WOCKY_XMPP_NS_GOOGLE_SESSION; gtalk_mode = TRUE; break; case WOCKY_JINGLE_DIALECT_ERROR: g_assert_not_reached (); } stanza = wocky_stanza_build ( WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, priv->peer_jid, '(', el, ':', ns, '*', &session_node, ')', NULL); wocky_node_set_attributes (session_node, "initiator", priv->initiator, (gtalk_mode) ? "id" : "sid", priv->sid, (gtalk_mode) ? "type" : "action", produce_action (action, priv->dialect), NULL); if (sess_node != NULL) *sess_node = session_node; return stanza; } typedef void (*ContentMapperFunc) (WockyJingleSession *sess, WockyJingleContent *c, gpointer user_data); static void _map_initial_contents (WockyJingleSession *sess, ContentMapperFunc mapper, gpointer user_data) { GList *li; GList *contents = wocky_jingle_session_get_contents (sess); for (li = contents; li; li = li->next) { WockyJingleContent *c = WOCKY_JINGLE_CONTENT (li->data); const gchar *disposition = wocky_jingle_content_get_disposition (c); if (!wocky_strdiff (disposition, "session")) mapper (sess, c, user_data); } g_list_free (contents); } static void _check_content_ready (WockyJingleSession *sess, WockyJingleContent *c, gpointer user_data) { gboolean *ready = (gboolean *) user_data; if (!wocky_jingle_content_is_ready (c)) { *ready = FALSE; } } static void _transmit_candidates (WockyJingleSession *sess, WockyJingleContent *c, gpointer user_data) { wocky_jingle_content_retransmit_candidates (c, FALSE); } static void _fill_content (WockyJingleSession *sess, WockyJingleContent *c, gpointer user_data) { WockyNode *sess_node = user_data; WockyNode *transport_node; WockyJingleContentState state; wocky_jingle_content_produce_node (c, sess_node, TRUE, TRUE, &transport_node); wocky_jingle_content_inject_candidates (c, transport_node); g_object_get (c, "state", &state, NULL); if (state == WOCKY_JINGLE_CONTENT_STATE_EMPTY) { g_object_set (c, "state", WOCKY_JINGLE_CONTENT_STATE_SENT, NULL); } else if (state == WOCKY_JINGLE_CONTENT_STATE_NEW) { g_object_set (c, "state", WOCKY_JINGLE_CONTENT_STATE_ACKNOWLEDGED, NULL); } else { DEBUG ("content %p is in state %u", c, state); g_assert_not_reached (); } } /** * wocky_jingle_session_send: * @sess: a session * @stanza: (transfer full): a stanza, of which this function will take ownership * * A shorthand for sending a Jingle IQ without waiting for the reply. */ void wocky_jingle_session_send (WockyJingleSession *sess, WockyStanza *stanza) { g_return_if_fail (WOCKY_IS_JINGLE_SESSION (sess)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); wocky_porter_send_iq_async (sess->priv->porter, stanza, NULL, NULL, NULL); g_object_unref (stanza); } static void _on_initiate_reply ( GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); WockyJingleSession *sess = WOCKY_JINGLE_SESSION (user_data); WockyJingleSessionPrivate *priv = sess->priv; WockyStanza *reply; if (priv->state != WOCKY_JINGLE_STATE_PENDING_INITIATE_SENT) { DEBUG ("Ignoring session-initiate reply; session %p is in state %u.", sess, priv->state); g_object_unref (sess); return; } reply = wocky_porter_send_iq_finish (porter, result, NULL); if (reply != NULL && !wocky_stanza_extract_errors (reply, NULL, NULL, NULL, NULL)) { set_state (sess, WOCKY_JINGLE_STATE_PENDING_INITIATED, 0, NULL); if (priv->dialect != WOCKY_JINGLE_DIALECT_V032) { /* If this is a dialect that doesn't support , we treat the * session-initiate being acked as the cue to say we're ringing. */ priv->remote_ringing = TRUE; g_signal_emit (sess, signals[REMOTE_STATE_CHANGED], 0); } } else { set_state (sess, WOCKY_JINGLE_STATE_ENDED, WOCKY_JINGLE_REASON_UNKNOWN, NULL); } g_clear_object (&reply); g_object_unref (sess); } static void _on_accept_reply ( GObject *source, GAsyncResult *result, gpointer user_data) { WockyPorter *porter = WOCKY_PORTER (source); WockyJingleSession *sess = WOCKY_JINGLE_SESSION (user_data); WockyJingleSessionPrivate *priv = sess->priv; WockyStanza *reply; if (priv->state != WOCKY_JINGLE_STATE_PENDING_ACCEPT_SENT) { DEBUG ("Ignoring session-accept reply; session %p is in state %u.", sess, priv->state); g_object_unref (sess); return; } reply = wocky_porter_send_iq_finish (porter, result, NULL); if (reply != NULL && !wocky_stanza_extract_errors (reply, NULL, NULL, NULL, NULL)) { set_state (sess, WOCKY_JINGLE_STATE_ACTIVE, 0, NULL); wocky_jingle_session_send_rtp_info (sess, "active"); } else { set_state (sess, WOCKY_JINGLE_STATE_ENDED, WOCKY_JINGLE_REASON_UNKNOWN, NULL); } g_clear_object (&reply); g_object_unref (sess); } static void try_session_initiate_or_accept (WockyJingleSession *sess) { WockyJingleSessionPrivate *priv = sess->priv; WockyStanza *msg; WockyNode *sess_node; gboolean contents_ready = TRUE; WockyJingleAction action; WockyJingleState new_state; GAsyncReadyCallback handler; DEBUG ("Trying initiate or accept"); /* If there are no contents yet, we shouldn't have been called at all. */ g_assert (g_hash_table_size (priv->initiator_contents) + g_hash_table_size (priv->responder_contents) > 0); if (priv->local_initiator) { if (priv->state != WOCKY_JINGLE_STATE_PENDING_CREATED) { DEBUG ("session is in state %u, won't try to initiate", priv->state); return; } if (!priv->locally_accepted) { DEBUG ("session not locally accepted yet, not initiating"); return; } action = WOCKY_JINGLE_ACTION_SESSION_INITIATE; new_state = WOCKY_JINGLE_STATE_PENDING_INITIATE_SENT; handler = _on_initiate_reply; } else { if (priv->state != WOCKY_JINGLE_STATE_PENDING_INITIATED) { DEBUG ("session is in state %u, won't try to accept", priv->state); return; } if (!priv->locally_accepted) { DEBUG ("session not locally accepted yet, not accepting"); return; } action = WOCKY_JINGLE_ACTION_SESSION_ACCEPT; new_state = WOCKY_JINGLE_STATE_PENDING_ACCEPT_SENT; handler = _on_accept_reply; } _map_initial_contents (sess, _check_content_ready, &contents_ready); DEBUG ("Contents are ready: %s", contents_ready ? "yes" : "no"); if (!contents_ready) { DEBUG ("Contents not yet ready, not initiating/accepting now.."); return; } if (action == WOCKY_JINGLE_ACTION_SESSION_INITIATE) g_signal_emit (sess, signals[ABOUT_TO_INITIATE], 0); msg = wocky_jingle_session_new_message (sess, action, &sess_node); if (priv->dialect == WOCKY_JINGLE_DIALECT_GTALK3) { gboolean has_video = FALSE; gboolean has_audio = FALSE; GHashTableIter iter; gpointer value; g_hash_table_iter_init (&iter, priv->initiator_contents); while (g_hash_table_iter_next (&iter, NULL, &value)) { WockyJingleMediaType type; g_object_get (value, "media-type", &type, NULL); if (type == WOCKY_JINGLE_MEDIA_TYPE_VIDEO) { has_video = TRUE; } else if (type == WOCKY_JINGLE_MEDIA_TYPE_AUDIO) { has_audio = TRUE; } } if (has_video || has_audio) { sess_node = wocky_node_add_child_ns_q (sess_node, "description", g_quark_from_static_string (has_video ? WOCKY_XMPP_NS_GOOGLE_SESSION_VIDEO : WOCKY_XMPP_NS_GOOGLE_SESSION_PHONE)); } } _map_initial_contents (sess, _fill_content, sess_node); wocky_porter_send_iq_async (priv->porter, msg, NULL, handler, g_object_ref (sess)); g_object_unref (msg); set_state (sess, new_state, 0, NULL); /* now all initial contents can transmit their candidates */ _map_initial_contents (sess, _transmit_candidates, NULL); } /** * set_state: * @sess: a jingle session * @state: the new state for the session * @termination_reason: if @state is WOCKY_JINGLE_STATE_ENDED, the reason the session * ended. Otherwise, must be WOCKY_JINGLE_REASON_UNKNOWN. * @text: if @state is WOCKY_JINGLE_STATE_ENDED, the human-readable reason the session * ended. */ static void set_state (WockyJingleSession *sess, WockyJingleState state, WockyJingleReason termination_reason, const gchar *text) { WockyJingleSessionPrivate *priv = sess->priv; if (state <= priv->state) { DEBUG ("ignoring request to set state from %u back to %u", priv->state, state); return; } if (state != WOCKY_JINGLE_STATE_ENDED) g_assert (termination_reason == WOCKY_JINGLE_REASON_UNKNOWN); DEBUG ("Setting state of JingleSession: %p (priv = %p) from %u to %u", sess, priv, priv->state, state); priv->state = state; g_object_notify (G_OBJECT (sess), "state"); /* If we have an outstanding "you're on hold notification", send it */ if (priv->local_hold && state >= WOCKY_JINGLE_STATE_PENDING_INITIATED && state < WOCKY_JINGLE_STATE_ENDED) wocky_jingle_session_send_held (sess); if (state == WOCKY_JINGLE_STATE_ENDED) g_signal_emit (sess, signals[TERMINATED], 0, priv->locally_terminated, termination_reason, text); } /** * wocky_jingle_session_accept: * @sess: the session. * * For incoming calls, accepts the call. For outgoing calls, indicates that the * initial contents for the call have been created and the offer can be sent to * the peer. * * The acceptance or offer will only be signalled to the peer once all contents * are ready (as returned by wocky_jingle_content_is_ready()). For an RTP * session with #WockyJingleMediaRtp contents, this translates to a media * description and transport candidates having been provided to all contents. */ void wocky_jingle_session_accept (WockyJingleSession *sess) { g_return_if_fail (WOCKY_IS_JINGLE_SESSION (sess)); sess->priv->locally_accepted = TRUE; try_session_initiate_or_accept (sess); } const gchar * wocky_jingle_session_get_reason_name (WockyJingleReason reason) { GEnumClass *klass = g_type_class_ref (wocky_jingle_reason_get_type ()); GEnumValue *enum_value = g_enum_get_value (klass, (gint) reason); g_return_val_if_fail (enum_value != NULL, NULL); return enum_value->value_nick; } /** * wocky_jingle_session_terminate: * @sess: the session * @reason: the reason the session should be terminated * @text: (allow-none): human-readable information about why the session * terminated * @error: Unused, because this function never fails. * * Ends a session. * * If called for an outgoing session which has not yet been signalled to the * peer (perhaps because wocky_jingle_session_accept() has not been called, or * codecs or candidates have not been provided), the session will quietly * terminate without the peer hearing anything about it. * * If called for an already-terminated session, this is a no-op. * * Returns: %TRUE. */ gboolean wocky_jingle_session_terminate (WockyJingleSession *sess, WockyJingleReason reason, const gchar *text, GError **error G_GNUC_UNUSED) { WockyJingleSessionPrivate *priv; const gchar *reason_elt; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); priv = sess->priv; if (priv->state == WOCKY_JINGLE_STATE_ENDED) { DEBUG ("session already terminated, ignoring terminate request"); return TRUE; } if (reason == WOCKY_JINGLE_REASON_UNKNOWN) reason = (priv->state == WOCKY_JINGLE_STATE_ACTIVE) ? WOCKY_JINGLE_REASON_SUCCESS : WOCKY_JINGLE_REASON_CANCEL; reason_elt = wocky_jingle_session_get_reason_name (reason); if (priv->state != WOCKY_JINGLE_STATE_PENDING_CREATED) { WockyNode *session_node; WockyStanza *msg = wocky_jingle_session_new_message (sess, WOCKY_JINGLE_ACTION_SESSION_TERMINATE, &session_node); if (priv->dialect == WOCKY_JINGLE_DIALECT_V032 && reason_elt != NULL) { WockyNode *r = wocky_node_add_child_with_content (session_node, "reason", NULL); wocky_node_add_child (r, reason_elt); if (text != NULL && *text != '\0') wocky_node_add_child_with_content (r, "text", text); } wocky_jingle_session_send (sess, msg); } /* NOTE: on "terminated", jingle factory and media channel will unref * it, bringing refcount to 0, so dispose will be called, and it * takes care of cleanup */ DEBUG ("we are terminating this session"); priv->locally_terminated = TRUE; set_state (sess, WOCKY_JINGLE_STATE_ENDED, reason, text); return TRUE; } static void _foreach_count_active_contents (gpointer key, gpointer value, gpointer user_data) { WockyJingleContent *c = value; guint *n_contents = user_data; WockyJingleContentState state; g_object_get (c, "state", &state, NULL); if ((state >= WOCKY_JINGLE_CONTENT_STATE_NEW) && (state < WOCKY_JINGLE_CONTENT_STATE_REMOVING)) { *n_contents = *n_contents + 1; } } static gboolean count_active_contents (WockyJingleSession *sess) { WockyJingleSessionPrivate *priv = sess->priv; guint n_contents = 0; g_hash_table_foreach (priv->initiator_contents, _foreach_count_active_contents, &n_contents); g_hash_table_foreach (priv->responder_contents, _foreach_count_active_contents, &n_contents); return n_contents; } static void content_removed_cb (WockyJingleContent *c, gpointer user_data) { WockyJingleSession *sess = WOCKY_JINGLE_SESSION (user_data); WockyJingleSessionPrivate *priv = sess->priv; const gchar *name = wocky_jingle_content_get_name (c); if (wocky_jingle_content_creator_is_initiator (c)) g_hash_table_remove (priv->initiator_contents, name); else g_hash_table_remove (priv->responder_contents, name); if (priv->state == WOCKY_JINGLE_STATE_ENDED) return; if (count_active_contents (sess) == 0) { wocky_jingle_session_terminate (sess, WOCKY_JINGLE_REASON_UNKNOWN, NULL, NULL); } else { /* It's possible the content now removed was * blocking us from creating or accepting the * session, so we might as well try now. */ try_session_initiate_or_accept (sess); } } void wocky_jingle_session_remove_content (WockyJingleSession *sess, WockyJingleContent *c) { g_return_if_fail (WOCKY_IS_JINGLE_SESSION (sess)); g_return_if_fail (WOCKY_IS_JINGLE_CONTENT (c)); if (count_active_contents (sess) > 1) { wocky_jingle_content_remove (c, TRUE); } else { /* session will be terminated when the content gets marked as removed */ DEBUG ("called for last active content, doing session-terminate instead"); wocky_jingle_content_remove (c, FALSE); } } /** * wocky_jingle_session_add_content: * @sess: the session * @mtype: what kind of media will be exchanged on the content * @senders: which directions media should initially flow in. * @name: (allow-none): a descriptive name to use for the content; this is * typically not shown to users * @content_ns: the namespace to use for the content's description * @transport_ns: the namespace of the media transport to use for the call * * Adds a content to the session. Once it has its codecs and transport * candidates filled in, it will be signalled to the peer (either as part of * the session-initiate, if it has not been sent yet, or as a content-add if * @sess has already been initiated). * * Legal values for @content_ns and @transport_ns depend on the Jingle dialect * in use for this session (and in some cases on @mtype); sensible values * depend on the peer's capabilities. * * Returns: (transfer none): the new content, which is guaranteed not to be %NULL. */ WockyJingleContent * wocky_jingle_session_add_content (WockyJingleSession *sess, WockyJingleMediaType mtype, WockyJingleContentSenders senders, const gchar *name, const gchar *content_ns, const gchar *transport_ns) { WockyJingleSessionPrivate *priv; WockyJingleContent *c; GType content_type; GHashTable *contents; guint id; gchar *cname = NULL; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); priv = sess->priv; contents = priv->local_initiator ? priv->initiator_contents : priv->responder_contents; id = g_hash_table_size (contents) + 1; if (name == NULL || *name == '\0') name = (mtype == WOCKY_JINGLE_MEDIA_TYPE_AUDIO ? "Audio" : "Video"); cname = g_strdup (name); while (g_hash_table_lookup (priv->initiator_contents, cname) != NULL || g_hash_table_lookup (priv->responder_contents, cname) != NULL) { g_free (cname); cname = g_strdup_printf ("%s_%d", name, id++); } content_type = wocky_jingle_factory_lookup_content_type ( wocky_jingle_session_get_factory (sess), content_ns); g_assert (content_type != 0); c = create_content (sess, content_type, mtype, senders, content_ns, transport_ns, cname, NULL, NULL); /* The new content better have ended up in the set we thought it would... */ g_assert (g_hash_table_lookup (contents, cname) != NULL); g_free (cname); return c; } /* Get any content. Either we're in google mode (so we only have one content * anyways), or we just need any content type to figure out what use case * we're in (media, ft, etc). */ static WockyJingleContent * _get_any_content (WockyJingleSession *session) { WockyJingleContent *c; GList *li = wocky_jingle_session_get_contents (session); if (li == NULL) return NULL; c = li->data; g_list_free (li); return c; } /* Note: if there are multiple content types, not guaranteed which one will * be returned. Typically, the same GType will know how to handle related * contents found in a session (e.g. media-rtp for audio/video), so that * should not be a problem. Returns 0 if there are no contents yet. */ GType wocky_jingle_session_get_content_type (WockyJingleSession *sess) { WockyJingleContent *c; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), G_TYPE_INVALID); c = _get_any_content (sess); if (c == NULL) return 0; return G_OBJECT_TYPE (c); } /* FIXME: probably should make this into a property */ GList * wocky_jingle_session_get_contents (WockyJingleSession *sess) { WockyJingleSessionPrivate *priv; g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); priv = sess->priv; return g_list_concat (g_hash_table_get_values (priv->initiator_contents), g_hash_table_get_values (priv->responder_contents)); } const gchar * wocky_jingle_session_get_peer_resource (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); return sess->priv->peer_resource; } const gchar * wocky_jingle_session_get_initiator (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); return sess->priv->initiator; } const gchar * wocky_jingle_session_get_sid (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); return sess->priv->sid; } static void content_ready_cb (WockyJingleContent *c, gpointer user_data) { WockyJingleSession *sess = WOCKY_JINGLE_SESSION (user_data); const gchar *disposition; DEBUG ("called"); disposition = wocky_jingle_content_get_disposition (c); /* This assertion is actually safe, because 'ready' is only emitted by * contents with disposition "session". But this is crazy. */ g_assert (!wocky_strdiff (disposition, "session")); try_session_initiate_or_accept (sess); } static void wocky_jingle_session_send_rtp_info (WockyJingleSession *sess, const gchar *name) { WockyStanza *message; WockyNode *jingle; if (!wocky_jingle_session_defines_action (sess, WOCKY_JINGLE_ACTION_SESSION_INFO)) { DEBUG ("Not sending <%s/>; not using modern Jingle", name); return; } message = wocky_jingle_session_new_message (sess, WOCKY_JINGLE_ACTION_SESSION_INFO, &jingle); wocky_node_add_child_ns_q (jingle, name, g_quark_from_static_string (WOCKY_XMPP_NS_JINGLE_RTP_INFO)); /* This is just informational, so ignoring the reply. */ wocky_jingle_session_send (sess, message); } static void wocky_jingle_session_send_held (WockyJingleSession *sess) { const gchar *s = (sess->priv->local_hold ? "hold" : "unhold"); wocky_jingle_session_send_rtp_info (sess, s); } void wocky_jingle_session_set_local_hold (WockyJingleSession *sess, gboolean held) { g_return_if_fail (WOCKY_IS_JINGLE_SESSION (sess)); g_object_set (sess, "local-hold", held, NULL); } gboolean wocky_jingle_session_get_remote_hold (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); return sess->priv->remote_hold; } gboolean wocky_jingle_session_get_remote_ringing (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); return sess->priv->remote_ringing; } gboolean wocky_jingle_session_can_modify_contents (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE); return !WOCKY_JINGLE_DIALECT_IS_GOOGLE (sess->priv->dialect) && !wocky_jingle_session_peer_has_cap (sess, WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT); } WockyJingleDialect wocky_jingle_session_get_dialect (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), WOCKY_JINGLE_DIALECT_ERROR); return sess->priv->dialect; } WockyContact * wocky_jingle_session_get_peer_contact (WockyJingleSession *self) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (self), NULL); return self->priv->peer_contact; } /* * wocky_jingle_session_get_peer_jid: * @sess: a jingle session * * Returns: the full JID of the remote contact. */ const gchar * wocky_jingle_session_get_peer_jid (WockyJingleSession *sess) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), NULL); return sess->priv->peer_jid; } WockyJingleFactory * wocky_jingle_session_get_factory (WockyJingleSession *self) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (self), NULL); return self->priv->jingle_factory; } WockyPorter * wocky_jingle_session_get_porter (WockyJingleSession *self) { g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (self), NULL); return self->priv->porter; } void wocky_jingle_session_acknowledge_iq (WockyJingleSession *self, WockyStanza *stanza) { g_return_if_fail (WOCKY_IS_JINGLE_SESSION (self)); g_return_if_fail (WOCKY_IS_STANZA (stanza)); if (wocky_jingle_session_peer_has_cap (self, WOCKY_QUIRK_GOOGLE_WEBMAIL_CLIENT)) { WockyJingleAction action = WOCKY_JINGLE_ACTION_UNKNOWN; WockyNode *used_node = NULL; /* As of 2013-05-29, the Google webmail client sends a session-initiate * IQ with two child nodes (which is not valid XMPP Core but never mind) * and replies to session-initiate by echoing the child for the dialect * it chose. We have to do the same echoing, otherwise it can't call us. * * It doesn't seem to reply to our other IQs at all; we still reply * here (we'd be violating XMPP Core if we didn't), but we don't * bother putting content in the IQ, to reduce bandwidth. */ if (wocky_jingle_session_detect_internal (stanza, &action, NULL, &used_node) != NULL && action == WOCKY_JINGLE_ACTION_SESSION_INITIATE) { WockyStanza *reply = wocky_stanza_build_iq_result (stanza, NULL); if (reply != NULL) { WockyNode *reply_node = wocky_stanza_get_top_node (reply); reply_node->children = g_slist_append (reply_node->children, _wocky_node_copy (used_node)); wocky_porter_send (self->priv->porter, reply); g_object_unref (reply); return; } } } /* normal Jingle just says "OK" without echoing */ wocky_porter_acknowledge_iq (self->priv->porter, stanza, NULL); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-ll-connection-factory.c0000644000175000017500000001762012735676345027464 0ustar00gkiagiagkiagia00000000000000/* * wocky-ll-connection-factory.c - Source for WockyLLConnectionFactory * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-ll-connection-factory.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_CONNECTION_FACTORY #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyLLConnectionFactory, wocky_ll_connection_factory, G_TYPE_OBJECT) /* private structure */ struct _WockyLLConnectionFactoryPrivate { GSocketClient *client; }; GQuark wocky_ll_connection_factory_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ( "wocky_ll_connection_factory_error"); return quark; } static void wocky_ll_connection_factory_init (WockyLLConnectionFactory *self) { WockyLLConnectionFactoryPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_LL_CONNECTION_FACTORY, WockyLLConnectionFactoryPrivate); priv = self->priv; priv->client = g_socket_client_new (); } static void wocky_ll_connection_factory_dispose (GObject *object) { WockyLLConnectionFactory *self = WOCKY_LL_CONNECTION_FACTORY (object); g_object_unref (self->priv->client); if (G_OBJECT_CLASS (wocky_ll_connection_factory_parent_class)->dispose) G_OBJECT_CLASS (wocky_ll_connection_factory_parent_class)->dispose (object); } static void wocky_ll_connection_factory_class_init ( WockyLLConnectionFactoryClass *wocky_ll_connection_factory_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_ll_connection_factory_class); object_class->dispose = wocky_ll_connection_factory_dispose; g_type_class_add_private (wocky_ll_connection_factory_class, sizeof (WockyLLConnectionFactoryPrivate)); } /** * wocky_ll_connection_factory_new: * * Convenience function to create a new #WockyLLConnectionFactory object. * * Returns: a newly created instance of #WockyLLConnectionFactory */ WockyLLConnectionFactory * wocky_ll_connection_factory_new (void) { return g_object_new (WOCKY_TYPE_LL_CONNECTION_FACTORY, NULL); } typedef struct { /* the simple async result will hold a ref to this */ WockyLLConnectionFactory *self; GSimpleAsyncResult *simple; GCancellable *cancellable; GQueue *addresses; } NewConnectionData; static void free_new_connection_data (NewConnectionData *data) { g_queue_foreach (data->addresses, (GFunc) g_object_unref, NULL); g_queue_free (data->addresses); if (data->cancellable != NULL) g_object_unref (data->cancellable); g_object_unref (data->simple); g_slice_free (NewConnectionData, data); } static void process_one_address (NewConnectionData *data); static void connect_to_host_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { GSocketClient *client = G_SOCKET_CLIENT (source_object); NewConnectionData *data = user_data; GSocketConnection *conn; GError *error = NULL; WockyXmppConnection *connection; conn = g_socket_client_connect_to_host_finish (client, result, &error); if (conn == NULL) { DEBUG ("failed to connect: %s", error->message); g_clear_error (&error); /* shame, well let's move on */ process_one_address (data); return; } connection = wocky_xmpp_connection_new (G_IO_STREAM (conn)); DEBUG ("made connection"); g_simple_async_result_set_op_res_gpointer (data->simple, connection, NULL); g_simple_async_result_complete (data->simple); free_new_connection_data (data); } static void process_one_address (NewConnectionData *data) { GInetSocketAddress *addr; gchar *host; if (g_cancellable_is_cancelled (data->cancellable)) { g_simple_async_result_set_error (data->simple, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation cancelled"); g_simple_async_result_complete (data->simple); free_new_connection_data (data); return; } addr = g_queue_pop_head (data->addresses); /* check we haven't gotten to the end of the list */ if (addr == NULL) { g_simple_async_result_set_error (data->simple, WOCKY_LL_CONNECTION_FACTORY_ERROR, WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESS_CAN_BE_CONNECTED_TO, "Failed to connect to any of the contact's addresses"); g_simple_async_result_complete (data->simple); free_new_connection_data (data); return; } host = g_inet_address_to_string (g_inet_socket_address_get_address (addr)); DEBUG ("connecting to %s (port %" G_GUINT16_FORMAT ")", host, g_inet_socket_address_get_port (addr)); g_socket_client_connect_to_host_async (data->self->priv->client, host, g_inet_socket_address_get_port (addr), data->cancellable, connect_to_host_cb, data); g_free (host); g_object_unref (addr); } static void add_to_queue (gpointer data, gpointer user_data) { GQueue *queue = user_data; g_queue_push_tail (queue, data); } /** * wocky_ll_connection_factory_make_connection_async: * @factory: a #WockyLLConnectionFactory * @contact: the #WockyLLStanza to connect to * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: callback to call when the request is satisfied * @user_data: the data to pass to callback function * * Request a connection to @contact. When the connection has been * made, @callback will be called and the caller can then call * #wocky_ll_connection_factorymake_connection_finish to get the * connection. */ void wocky_ll_connection_factory_make_connection_async ( WockyLLConnectionFactory *self, WockyLLContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { NewConnectionData *data; GList *addr; g_return_if_fail (WOCKY_IS_LL_CONNECTION_FACTORY (self)); g_return_if_fail (WOCKY_IS_LL_CONTACT (contact)); g_return_if_fail (callback != NULL); data = g_slice_new0 (NewConnectionData); data->self = self; if (cancellable != NULL) data->cancellable = g_object_ref (cancellable); data->simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_ll_connection_factory_make_connection_async); data->addresses = g_queue_new (); addr = wocky_ll_contact_get_addresses (contact); g_list_foreach (addr, add_to_queue, data->addresses); g_list_free (addr); if (data->addresses == NULL) { g_simple_async_result_set_error (data->simple, WOCKY_LL_CONNECTION_FACTORY_ERROR, WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESSES, "No addresses available for contact"); g_simple_async_result_complete (data->simple); free_new_connection_data (data); return; } /* go go go */ process_one_address (data); } /** * wocky_ll_connection_factory_make_connection_finish: * @factory: a #WockyLLConnectionFactory * @result: a #GAsyncResult * @error: a #GError location to store the error occuring, or %NULL to ignore * * Gets the connection that's been created. * * Returns: the new #WockyXmppConnection on success, %NULL on error */ WockyXmppConnection * wocky_ll_connection_factory_make_connection_finish ( WockyLLConnectionFactory *self, GAsyncResult *result, GError **error) { wocky_implement_finish_return_pointer (self, wocky_ll_connection_factory_make_connection_async); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-transport-rawudp.c0000644000175000017500000003014112735676345030046 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-transport-rawudp.c - Source for WockyJingleTransportRawUdp * * Copyright (C) 2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "wocky-jingle-transport-rawudp.h" #include #include #include #include #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_JINGLE #include "wocky-debug-internal.h" #include "wocky-jingle-content.h" #include "wocky-jingle-factory.h" #include "wocky-jingle-session.h" #include "wocky-namespaces.h" static void transport_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (WockyJingleTransportRawUdp, wocky_jingle_transport_rawudp, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_JINGLE_TRANSPORT_IFACE, transport_iface_init)); /* signal enum */ enum { NEW_CANDIDATES, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; /* properties */ enum { PROP_CONTENT = 1, PROP_TRANSPORT_NS, PROP_STATE, LAST_PROPERTY }; struct _WockyJingleTransportRawUdpPrivate { WockyJingleContent *content; WockyJingleTransportState state; gchar *transport_ns; GList *local_candidates; GList *remote_candidates; gboolean dispose_has_run; }; static void wocky_jingle_transport_rawudp_init (WockyJingleTransportRawUdp *obj) { WockyJingleTransportRawUdpPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, WOCKY_TYPE_JINGLE_TRANSPORT_RAWUDP, WockyJingleTransportRawUdpPrivate); obj->priv = priv; priv->dispose_has_run = FALSE; } static void wocky_jingle_transport_rawudp_dispose (GObject *object) { WockyJingleTransportRawUdp *trans = WOCKY_JINGLE_TRANSPORT_RAWUDP (object); WockyJingleTransportRawUdpPrivate *priv = trans->priv; if (priv->dispose_has_run) return; DEBUG ("dispose called"); priv->dispose_has_run = TRUE; jingle_transport_free_candidates (priv->remote_candidates); priv->remote_candidates = NULL; jingle_transport_free_candidates (priv->local_candidates); priv->local_candidates = NULL; g_free (priv->transport_ns); priv->transport_ns = NULL; if (G_OBJECT_CLASS (wocky_jingle_transport_rawudp_parent_class)->dispose) G_OBJECT_CLASS (wocky_jingle_transport_rawudp_parent_class)->dispose (object); } static void wocky_jingle_transport_rawudp_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJingleTransportRawUdp *trans = WOCKY_JINGLE_TRANSPORT_RAWUDP (object); WockyJingleTransportRawUdpPrivate *priv = trans->priv; switch (property_id) { case PROP_CONTENT: g_value_set_object (value, priv->content); break; case PROP_TRANSPORT_NS: g_value_set_string (value, priv->transport_ns); break; case PROP_STATE: g_value_set_uint (value, priv->state); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jingle_transport_rawudp_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJingleTransportRawUdp *trans = WOCKY_JINGLE_TRANSPORT_RAWUDP (object); WockyJingleTransportRawUdpPrivate *priv = trans->priv; switch (property_id) { case PROP_CONTENT: priv->content = g_value_get_object (value); break; case PROP_TRANSPORT_NS: g_free (priv->transport_ns); priv->transport_ns = g_value_dup_string (value); break; case PROP_STATE: priv->state = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jingle_transport_rawudp_class_init (WockyJingleTransportRawUdpClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (WockyJingleTransportRawUdpPrivate)); object_class->get_property = wocky_jingle_transport_rawudp_get_property; object_class->set_property = wocky_jingle_transport_rawudp_set_property; object_class->dispose = wocky_jingle_transport_rawudp_dispose; /* property definitions */ param_spec = g_param_spec_object ("content", "WockyJingleContent object", "Jingle content object using this transport.", WOCKY_TYPE_JINGLE_CONTENT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_CONTENT, param_spec); param_spec = g_param_spec_string ("transport-ns", "Transport namespace", "Namespace identifying the transport type.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_TRANSPORT_NS, param_spec); param_spec = g_param_spec_uint ("state", "Connection state for the transport.", "Enum specifying the connection state of the transport.", WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED, WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED, WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_STATE, param_spec); /* signal definitions */ signals[NEW_CANDIDATES] = g_signal_new ( "new-candidates", G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); } static void parse_candidates (WockyJingleTransportIface *obj, WockyNode *transport_node, GError **error) { WockyJingleTransportRawUdp *t = WOCKY_JINGLE_TRANSPORT_RAWUDP (obj); WockyJingleTransportRawUdpPrivate *priv = t->priv; GList *candidates = NULL; WockyNodeIter i; WockyNode *node; DEBUG ("called"); if (priv->remote_candidates != NULL) { DEBUG ("already have raw udp candidates, ignoring extra ones"); return; } wocky_node_iter_init (&i, transport_node, "candidate", NULL); while (wocky_node_iter_next (&i, &node)) { const gchar *id, *ip, *str; guint port, gen, component = 1; WockyJingleCandidate *c; str = wocky_node_get_attribute (node, "component"); if (str != NULL) component = atoi (str); if ((component != 1) && (component != 2)) { DEBUG ("Ignoring non-RTP/RTCP component %d", component); continue; } id = wocky_node_get_attribute (node, "id"); if (id == NULL) break; ip = wocky_node_get_attribute (node, "ip"); if (ip == NULL) break; str = wocky_node_get_attribute (node, "port"); if (str == NULL) break; port = atoi (str); str = wocky_node_get_attribute (node, "generation"); if (str == NULL) break; gen = atoi (str); c = wocky_jingle_candidate_new (WOCKY_JINGLE_TRANSPORT_PROTOCOL_UDP, WOCKY_JINGLE_CANDIDATE_TYPE_LOCAL, id, component, ip, port, gen, 1.0, NULL, NULL, 0); candidates = g_list_append (candidates, c); } if (wocky_node_iter_next (&i, NULL)) { DEBUG ("not all nodes were processed, reporting error"); /* rollback these */ jingle_transport_free_candidates (candidates); g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "invalid candidate"); return; } DEBUG ("emitting %d new remote candidates", g_list_length (candidates)); g_signal_emit (obj, signals[NEW_CANDIDATES], 0, candidates); priv->remote_candidates = candidates; } static void inject_candidates (WockyJingleTransportIface *obj, WockyNode *transport_node) { WockyJingleTransportRawUdp *self = WOCKY_JINGLE_TRANSPORT_RAWUDP (obj); WockyJingleTransportRawUdpPrivate *priv = self->priv; WockyJingleCandidate *c; GList *li; gchar port_str[16], comp_str[16]; WockyNode *cnode; /* If we don't have the local candidates yet, we should've waited with * the session initiation, or can_accept would have returned FALSE. */ g_assert (priv->local_candidates != NULL); for (li = priv->local_candidates; li != NULL; li = li->next) { c = (WockyJingleCandidate *) li->data; sprintf (port_str, "%d", c->port); sprintf (comp_str, "%d", c->component); cnode = wocky_node_add_child (transport_node, "candidate"); wocky_node_set_attributes (cnode, "ip", c->address, "port", port_str, "generation", "0", "id", c->id, "component", comp_str, NULL); } } /* Takes in a list of slice-allocated WockyJingleCandidate structs */ static void new_local_candidates (WockyJingleTransportIface *obj, GList *new_candidates) { WockyJingleTransportRawUdp *transport = WOCKY_JINGLE_TRANSPORT_RAWUDP (obj); WockyJingleTransportRawUdpPrivate *priv = transport->priv; if (priv->local_candidates != NULL) { DEBUG ("ignoring new local candidates for RAW UDP"); jingle_transport_free_candidates (new_candidates); return; } priv->local_candidates = new_candidates; } static gboolean can_accept (WockyJingleTransportIface *iface) { WockyJingleTransportRawUdp *self = WOCKY_JINGLE_TRANSPORT_RAWUDP (iface); return (self->priv->local_candidates != NULL); } static GList * get_local_candidates (WockyJingleTransportIface *iface) { WockyJingleTransportRawUdp *transport = WOCKY_JINGLE_TRANSPORT_RAWUDP (iface); WockyJingleTransportRawUdpPrivate *priv = transport->priv; return priv->local_candidates; } static GList * get_remote_candidates (WockyJingleTransportIface *iface) { WockyJingleTransportRawUdp *transport = WOCKY_JINGLE_TRANSPORT_RAWUDP (iface); WockyJingleTransportRawUdpPrivate *priv = transport->priv; return priv->remote_candidates; } static WockyJingleTransportType get_transport_type (void) { DEBUG ("called"); return JINGLE_TRANSPORT_RAW_UDP; } static void transport_iface_init (gpointer g_iface, gpointer iface_data) { WockyJingleTransportIfaceClass *klass = (WockyJingleTransportIfaceClass *) g_iface; klass->parse_candidates = parse_candidates; klass->new_local_candidates = new_local_candidates; klass->inject_candidates = inject_candidates; /* Not implementing _send: XEP-0177 says that the candidates live in * content-{add,accept}, not in transport-info. */ klass->can_accept = can_accept; klass->get_remote_candidates = get_remote_candidates; klass->get_local_candidates = get_local_candidates; klass->get_transport_type = get_transport_type; } void jingle_transport_rawudp_register (WockyJingleFactory *factory) { wocky_jingle_factory_register_transport (factory, WOCKY_XMPP_NS_JINGLE_TRANSPORT_RAWUDP, WOCKY_TYPE_JINGLE_TRANSPORT_RAWUDP); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jabber-auth.c0000644000175000017500000004320412735676345025434 0ustar00gkiagiagkiagia00000000000000/* * wocky-jabber-auth.c - Source for WockyJabberAuth * Copyright (C) 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "wocky-jabber-auth.h" #include "wocky-signals-marshal.h" #include "wocky-namespaces.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" G_DEFINE_TYPE(WockyJabberAuth, wocky_jabber_auth, G_TYPE_OBJECT) enum { PROP_SESSION_ID = 1, PROP_USERNAME, PROP_RESOURCE, PROP_PASSWORD, PROP_CONNECTION, PROP_AUTH_REGISTRY, }; /* private structure */ struct _WockyJabberAuthPrivate { gboolean dispose_has_run; WockyXmppConnection *connection; gchar *username; gchar *resource; gchar *password; gchar *session_id; GCancellable *cancel; GSimpleAsyncResult *result; WockyAuthRegistry *auth_registry; gboolean allow_plain; gboolean is_secure; }; static void wocky_jabber_auth_init (WockyJabberAuth *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_JABBER_AUTH, WockyJabberAuthPrivate); } static void wocky_jabber_auth_dispose (GObject *object); static void wocky_jabber_auth_finalize (GObject *object); static void wocky_jabber_auth_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_free (priv->session_id); priv->session_id = g_value_dup_string (value); break; case PROP_USERNAME: g_free (priv->username); priv->username = g_value_dup_string (value); break; case PROP_RESOURCE: g_free (priv->resource); priv->resource = g_value_dup_string (value); break; case PROP_PASSWORD: g_free (priv->password); priv->password = g_value_dup_string (value); break; case PROP_CONNECTION: priv->connection = g_value_dup_object (value); break; case PROP_AUTH_REGISTRY: if (g_value_get_object (value) == NULL) priv->auth_registry = wocky_auth_registry_new (); else priv->auth_registry = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jabber_auth_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; switch (property_id) { case PROP_SESSION_ID: g_value_set_string (value, priv->session_id); break; case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_AUTH_REGISTRY: g_value_set_object (value, priv->auth_registry); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_jabber_auth_class_init (WockyJabberAuthClass *wocky_jabber_auth_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_jabber_auth_class); GParamSpec *spec; g_type_class_add_private (wocky_jabber_auth_class, sizeof (WockyJabberAuthPrivate)); object_class->set_property = wocky_jabber_auth_set_property; object_class->get_property = wocky_jabber_auth_get_property; spec = g_param_spec_string ("session-id", "session-id", "The XMPP session ID", NULL, G_PARAM_READWRITE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_SESSION_ID, spec); spec = g_param_spec_string ("username", "username", "The username to authenticate with", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_USERNAME, spec); spec = g_param_spec_string ("resource", "resource", "The XMPP resource to bind to", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_RESOURCE, spec); spec = g_param_spec_string ("password", "password", "The password to authenticate with", NULL, G_PARAM_WRITABLE|G_PARAM_CONSTRUCT); g_object_class_install_property (object_class, PROP_PASSWORD, spec); spec = g_param_spec_object ("connection", "connection", "The Xmpp connection to user", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_CONNECTION, spec); spec = g_param_spec_object ("auth-registry", "Authentication Registry", "Authentication Registry", WOCKY_TYPE_AUTH_REGISTRY, G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_AUTH_REGISTRY, spec); object_class->dispose = wocky_jabber_auth_dispose; object_class->finalize = wocky_jabber_auth_finalize; } void wocky_jabber_auth_dispose (GObject *object) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; if (priv->connection != NULL) g_object_unref (priv->connection); if (priv->auth_registry != NULL) g_object_unref (priv->auth_registry); if (G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->dispose) G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->dispose (object); } void wocky_jabber_auth_finalize (GObject *object) { WockyJabberAuth *self = WOCKY_JABBER_AUTH (object); WockyJabberAuthPrivate *priv = self->priv; /* free any data held directly by the object here */ g_free (priv->session_id); g_free (priv->username); g_free (priv->resource); g_free (priv->password); G_OBJECT_CLASS (wocky_jabber_auth_parent_class)->finalize (object); } static void auth_reset (WockyJabberAuth *self) { WockyJabberAuthPrivate *priv = self->priv; g_free (priv->session_id); priv->session_id = NULL; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } if (priv->cancel != NULL) { g_object_unref (priv->cancel); priv->cancel = NULL; } } static void auth_succeeded (WockyJabberAuth *self) { WockyJabberAuthPrivate *priv = self->priv; GSimpleAsyncResult *r; DEBUG ("Authentication succeeded"); auth_reset (self); r = priv->result; priv->result = NULL; g_simple_async_result_complete (r); g_object_unref (r); } static void auth_failed (WockyJabberAuth *self, gint code, const gchar *format, ...) { gchar *message; va_list args; GSimpleAsyncResult *r; GError *error = NULL; WockyJabberAuthPrivate *priv = self->priv; auth_reset (self); va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); DEBUG ("Authentication failed!: %s", message); r = priv->result; priv->result = NULL; error = g_error_new_literal (WOCKY_AUTH_ERROR, code, message); g_simple_async_result_set_from_error (r, error); wocky_auth_registry_failure (priv->auth_registry, error); g_simple_async_result_complete (r); g_object_unref (r); g_error_free (error); g_free (message); } static gboolean stream_error (WockyJabberAuth *self, WockyStanza *stanza) { GError *error = NULL; if (stanza == NULL) { auth_failed (self, WOCKY_AUTH_ERROR_CONNRESET, "Disconnected"); return TRUE; } if (wocky_stanza_extract_stream_error (stanza, &error)) { auth_failed (self, WOCKY_AUTH_ERROR_STREAM, "%s: %s", wocky_enum_to_nick (WOCKY_TYPE_XMPP_STREAM_ERROR, error->code), error->message); g_error_free (error); return TRUE; } return FALSE; } WockyJabberAuth * wocky_jabber_auth_new (const gchar *session_id, const gchar *username, const gchar *resource, const gchar *password, WockyXmppConnection *connection, WockyAuthRegistry *auth_registry) { return g_object_new (WOCKY_TYPE_JABBER_AUTH, "session-id", session_id, "username", username, "resource", resource, "password", password, "connection", connection, "auth-registry", auth_registry, NULL); } gboolean wocky_jabber_auth_authenticate_finish (WockyJabberAuth *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_jabber_auth_authenticate_async); } static void wocky_jabber_auth_success_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; GError *error = NULL; if (!wocky_auth_registry_success_finish (priv->auth_registry, res, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); } else { auth_succeeded (self); } } static void jabber_auth_reply (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; WockyStanza *reply = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; DEBUG (""); reply = wocky_xmpp_connection_recv_stanza_finish (conn, res, &error); if (stream_error (self, reply)) return; wocky_stanza_get_type_info (reply, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { auth_failed (self, WOCKY_AUTH_ERROR_INVALID_REPLY, "Jabber Auth Reply: Response Invalid"); goto out; } switch (sub) { WockyAuthError code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL); switch (error->code) { case WOCKY_XMPP_ERROR_NOT_AUTHORIZED: code = WOCKY_AUTH_ERROR_NOT_AUTHORIZED; break; case WOCKY_XMPP_ERROR_CONFLICT: code = WOCKY_AUTH_ERROR_RESOURCE_CONFLICT; break; case WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: code = WOCKY_AUTH_ERROR_NO_CREDENTIALS; break; default: code = WOCKY_AUTH_ERROR_FAILURE; } auth_failed (self, code, "Authentication failed: %s", error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: wocky_auth_registry_success_async (priv->auth_registry, wocky_jabber_auth_success_cb, self); break; default: auth_failed (self, WOCKY_AUTH_ERROR_INVALID_REPLY, "Bizarre response to Jabber Auth request"); break; } out: g_object_unref (reply); } static void jabber_auth_query (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (conn, res, &error)) { auth_failed (self, error->code, "Jabber Auth IQ Set: %s", error->message); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (conn, priv->cancel, jabber_auth_reply, user_data); } static void wocky_jabber_auth_start_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; gchar *iqid; WockyStanza *iq; const gchar *auth_field; GError *error = NULL; WockyAuthRegistryStartData *start_data = NULL; if (!wocky_auth_registry_start_auth_finish (priv->auth_registry, res, &start_data, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); return; } g_assert (start_data->mechanism != NULL); g_assert (start_data->initial_response != NULL); if (g_strcmp0 (start_data->mechanism, "X-WOCKY-JABBER-PASSWORD") == 0) auth_field = "password"; else auth_field = "digest"; iqid = wocky_xmpp_connection_new_id (conn); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET, NULL, NULL, '@', "id", iqid, '(', "query", ':', WOCKY_JABBER_NS_AUTH, '(', "username", '$', priv->username, ')', '(', auth_field, '$', start_data->initial_response->str, ')', '(', "resource", '$', priv->resource, ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancel, jabber_auth_query, self); g_free (iqid); g_object_unref (iq); wocky_auth_registry_start_data_free (start_data); } static void jabber_auth_fields (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; WockyStanza *fields = NULL; WockyStanzaType type = WOCKY_STANZA_TYPE_NONE; WockyStanzaSubType sub = WOCKY_STANZA_SUB_TYPE_NONE; fields = wocky_xmpp_connection_recv_stanza_finish (conn, res, &error); if (stream_error (self, fields)) return; wocky_stanza_get_type_info (fields, &type, &sub); if (type != WOCKY_STANZA_TYPE_IQ) { auth_failed (self, WOCKY_AUTH_ERROR_FAILURE, "Jabber Auth Init: Response Invalid"); goto out; } switch (sub) { WockyNode *node = NULL; WockyAuthError code; case WOCKY_STANZA_SUB_TYPE_ERROR: wocky_stanza_extract_errors (fields, NULL, &error, NULL, NULL); if (error->code == WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE) code = WOCKY_AUTH_ERROR_NOT_SUPPORTED; else code = WOCKY_AUTH_ERROR_FAILURE; auth_failed (self, code, "Jabber Auth: %s %s", wocky_xmpp_error_string (error->code), error->message); g_clear_error (&error); break; case WOCKY_STANZA_SUB_TYPE_RESULT: node = wocky_stanza_get_top_node (fields); node = wocky_node_get_child_ns (node, "query", WOCKY_JABBER_NS_AUTH); if ((node != NULL) && (wocky_node_get_child (node, "resource") != NULL) && (wocky_node_get_child (node, "username") != NULL)) { GSList *mechanisms = NULL; if (wocky_node_get_child (node, "password") != NULL) mechanisms = g_slist_append (mechanisms, WOCKY_AUTH_MECH_JABBER_PASSWORD); if (wocky_node_get_child (node, "digest") != NULL) mechanisms = g_slist_append (mechanisms, WOCKY_AUTH_MECH_JABBER_DIGEST); wocky_auth_registry_start_auth_async (priv->auth_registry, mechanisms, priv->allow_plain, priv->is_secure, priv->username, priv->password, NULL, priv->session_id, wocky_jabber_auth_start_cb, self); g_slist_free (mechanisms); } break; default: auth_failed (self, WOCKY_AUTH_ERROR_FAILURE, "Bizarre response to Jabber Auth request"); break; } out: g_object_unref (fields); } static void jabber_auth_init_sent (GObject *source, GAsyncResult *res, gpointer user_data) { WockyJabberAuth *self = (WockyJabberAuth *) user_data; WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; GError *error = NULL; DEBUG (""); if (!wocky_xmpp_connection_send_stanza_finish (conn, res, &error)) { auth_failed (self, error->code, error->message); g_error_free (error); return; } wocky_xmpp_connection_recv_stanza_async (conn, priv->cancel, jabber_auth_fields, user_data); } /* Initiate jabber auth. features should contain the stream features stanza as * receiver from the session_id */ void wocky_jabber_auth_authenticate_async (WockyJabberAuth *self, gboolean allow_plain, gboolean is_secure, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyJabberAuthPrivate *priv = self->priv; WockyXmppConnection *conn = priv->connection; gchar *id = wocky_xmpp_connection_new_id (conn); WockyStanza *iq = NULL; DEBUG (""); priv->allow_plain = allow_plain; priv->is_secure = is_secure; priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_jabber_auth_authenticate_async); if (cancellable != NULL) priv->cancel = g_object_ref (cancellable); iq = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, NULL, '@', "id", id, '(', "query", ':', WOCKY_JABBER_NS_AUTH, /* This is a workaround for * : while * doesn't require * us to include a username, it seems to be required by jabberd 1.4. */ '(', "username", '$', priv->username, ')', ')', NULL); wocky_xmpp_connection_send_stanza_async (conn, iq, priv->cancel, jabber_auth_init_sent, self); g_free (id); g_object_unref (iq); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-sasl-scram.h0000644000175000017500000000424312735676345025322 0ustar00gkiagiagkiagia00000000000000/* * wocky-sasl-scram.h - SCRAM-SHA1 implementation (to be RFC 5802) * Copyright (C) 2010 Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_SASL_SCRAM_H #define _WOCKY_SASL_SCRAM_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_SASL_SCRAM \ wocky_sasl_scram_get_type () #define WOCKY_SASL_SCRAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScram)) #define WOCKY_SASL_SCRAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScramClass)) #define WOCKY_IS_SASL_SCRAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_SASL_SCRAM)) #define WOCKY_IS_SASL_SCRAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_SASL_SCRAM)) #define WOCKY_SASL_SCRAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SASL_SCRAM, \ WockySaslScramClass)) typedef struct _WockySaslScramPrivate WockySaslScramPrivate; typedef struct { GObject parent; WockySaslScramPrivate *priv; } WockySaslScram; typedef struct { GObjectClass parent_class; } WockySaslScramClass; GType wocky_sasl_scram_get_type (void); WockySaslScram * wocky_sasl_scram_new ( const gchar *server, const gchar *username, const gchar *password); G_END_DECLS #endif /* _WOCKY_SASL_SCRAM_H */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-auth-registry.c0000644000175000017500000003576013001732442026041 0ustar00gkiagiagkiagia00000000000000/* wocky-auth-registry.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-auth-registry.h" #include "wocky-auth-handler.h" #include "wocky-sasl-scram.h" #include "wocky-sasl-digest-md5.h" #include "wocky-sasl-plain.h" #include "wocky-jabber-auth-password.h" #include "wocky-jabber-auth-digest.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_AUTH #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyAuthRegistry, wocky_auth_registry, G_TYPE_OBJECT) /* private structure */ struct _WockyAuthRegistryPrivate { gboolean dispose_has_run; WockyAuthHandler *handler; GSList *handlers; }; static void wocky_auth_registry_start_auth_async_func (WockyAuthRegistry *self, GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_start_auth_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error); static void wocky_auth_registry_challenge_async_func (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_challenge_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error); static void wocky_auth_registry_success_async_func (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data); static gboolean wocky_auth_registry_success_finish_func ( WockyAuthRegistry *self, GAsyncResult *result, GError **error); GQuark wocky_auth_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("wocky_auth_error"); return quark; } static void wocky_auth_registry_constructed (GObject *object) { } static void wocky_auth_registry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_auth_registry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void wocky_auth_registry_dispose (GObject *object) { WockyAuthRegistry *self = WOCKY_AUTH_REGISTRY (object); WockyAuthRegistryPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (priv->handler != NULL) { g_object_unref (priv->handler); } if (priv->handlers != NULL) { g_slist_foreach (priv->handlers, (GFunc) g_object_unref, NULL); g_slist_free (priv->handlers); } G_OBJECT_CLASS (wocky_auth_registry_parent_class)->dispose (object); } static void wocky_auth_registry_finalize (GObject *object) { G_OBJECT_CLASS (wocky_auth_registry_parent_class)->finalize (object); } static void wocky_auth_registry_class_init (WockyAuthRegistryClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (WockyAuthRegistryPrivate)); object_class->constructed = wocky_auth_registry_constructed; object_class->get_property = wocky_auth_registry_get_property; object_class->set_property = wocky_auth_registry_set_property; object_class->dispose = wocky_auth_registry_dispose; object_class->finalize = wocky_auth_registry_finalize; klass->start_auth_async_func = wocky_auth_registry_start_auth_async_func; klass->start_auth_finish_func = wocky_auth_registry_start_auth_finish_func; klass->challenge_async_func = wocky_auth_registry_challenge_async_func; klass->challenge_finish_func = wocky_auth_registry_challenge_finish_func; klass->success_async_func = wocky_auth_registry_success_async_func; klass->success_finish_func = wocky_auth_registry_success_finish_func; klass->failure_func = NULL; } static void wocky_auth_registry_init (WockyAuthRegistry *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_AUTH_REGISTRY, WockyAuthRegistryPrivate); } WockyAuthRegistry * wocky_auth_registry_new (void) { return g_object_new (WOCKY_TYPE_AUTH_REGISTRY, NULL); } static gboolean wocky_auth_registry_has_mechanism ( GSList *list, const gchar *mech) { return (g_slist_find_custom (list, mech, (GCompareFunc) g_strcmp0) != NULL); } WockyAuthRegistryStartData * wocky_auth_registry_start_data_new (const gchar *mechanism, const GString *initial_response) { WockyAuthRegistryStartData *start_data = g_slice_new0 ( WockyAuthRegistryStartData); start_data->mechanism = g_strdup (mechanism); start_data->initial_response = wocky_g_string_dup (initial_response); return start_data; } WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup (WockyAuthRegistryStartData *start_data) { return wocky_auth_registry_start_data_new ( start_data->mechanism, start_data->initial_response); } void wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data) { g_free (start_data->mechanism); if (start_data->initial_response != NULL) g_string_free (start_data->initial_response, TRUE); g_slice_free (WockyAuthRegistryStartData, start_data); } static gboolean wocky_auth_registry_select_handler (WockyAuthRegistry *self, GSList *mechanisms, gboolean allow_plain, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, WockyAuthHandler **out_handler) { WockyAuthRegistryPrivate *priv = self->priv; GSList *k; for (k = priv->handlers; k != NULL; k = k->next) { WockyAuthHandler *handler = k->data; const gchar *handler_mech = wocky_auth_handler_get_mechanism (handler); if (wocky_auth_handler_is_plain (handler) && !allow_plain) continue; if (wocky_auth_registry_has_mechanism (mechanisms, handler_mech)) { if (out_handler != NULL) *out_handler = g_object_ref (handler); return TRUE; } } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ DEBUG ("Choosing SCRAM-SHA-1 as auth mechanism"); *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_scram_new ( server, username, password)); } return TRUE; } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_DIGEST_MD5)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_digest_md5_new ( server, username, password)); } return TRUE; } if (wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_JABBER_DIGEST)) { if (out_handler != NULL) { *out_handler = WOCKY_AUTH_HANDLER (wocky_jabber_auth_digest_new ( session_id, password)); } return TRUE; } if (allow_plain && wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_SASL_PLAIN)) { if (out_handler != NULL) { /* XXX: check for username and password here? */ DEBUG ("Choosing PLAIN as auth mechanism"); *out_handler = WOCKY_AUTH_HANDLER (wocky_sasl_plain_new ( username, password)); } return TRUE; } if (allow_plain && wocky_auth_registry_has_mechanism (mechanisms, WOCKY_AUTH_MECH_JABBER_PASSWORD)) { if (out_handler != NULL) { *out_handler = WOCKY_AUTH_HANDLER (wocky_jabber_auth_password_new ( password)); } return TRUE; } if (out_handler) *out_handler = NULL; return FALSE; } static void wocky_auth_registry_start_auth_async_func (WockyAuthRegistry *self, GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GSimpleAsyncResult *result; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_start_auth_async); g_assert (priv->handler == NULL); if (!wocky_auth_registry_select_handler (self, mechanisms, allow_plain, username, password, server, session_id, &priv->handler)) { g_simple_async_result_set_error (result, WOCKY_AUTH_ERROR, WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS, "No supported mechanisms found"); } else { GString *initial_data; GError *error = NULL; if (!wocky_auth_handler_get_initial_response (priv->handler, &initial_data, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { WockyAuthRegistryStartData *start_data = wocky_auth_registry_start_data_new ( wocky_auth_handler_get_mechanism (priv->handler), initial_data); g_simple_async_result_set_op_res_gpointer (result, start_data, (GDestroyNotify) wocky_auth_registry_start_data_free); wocky_g_string_free (initial_data); } } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_start_auth_async (WockyAuthRegistry *self, GSList *mechanisms, gboolean allow_plain, gboolean is_secure_channel, const gchar *username, const gchar *password, const gchar *server, const gchar *session_id, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->start_auth_async_func (self, mechanisms, allow_plain, is_secure_channel, username, password, server, session_id, callback, user_data); } gboolean wocky_auth_registry_start_auth_finish (WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->start_auth_finish_func (self, result, start_data, error); } static gboolean wocky_auth_registry_start_auth_finish_func (WockyAuthRegistry *self, GAsyncResult *result, WockyAuthRegistryStartData **start_data, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_auth_registry_start_auth_async, wocky_auth_registry_start_data_dup, start_data); } static void wocky_auth_registry_challenge_async_func (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GString *response = NULL; GError *error = NULL; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_challenge_async); g_assert (priv->handler != NULL); if (!wocky_auth_handler_handle_auth_data (priv->handler, challenge_data, &response, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gpointer (result, response, (GDestroyNotify) wocky_g_string_free); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_challenge_async (WockyAuthRegistry *self, const GString *challenge_data, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->challenge_async_func (self, challenge_data, callback, user_data); } gboolean wocky_auth_registry_challenge_finish (WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->challenge_finish_func (self, result, response, error); } static gboolean wocky_auth_registry_challenge_finish_func (WockyAuthRegistry *self, GAsyncResult *result, GString **response, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_auth_registry_challenge_async, wocky_g_string_dup, response); } static void wocky_auth_registry_success_async_func (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryPrivate *priv = self->priv; GError *error = NULL; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_auth_registry_success_async); g_assert (priv->handler != NULL); if (!wocky_auth_handler_handle_success (priv->handler, &error)) { g_simple_async_result_set_from_error (result, error); g_error_free (error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void wocky_auth_registry_success_async (WockyAuthRegistry *self, GAsyncReadyCallback callback, gpointer user_data) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); cls->success_async_func (self, callback, user_data); } gboolean wocky_auth_registry_success_finish (WockyAuthRegistry *self, GAsyncResult *result, GError **error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); return cls->success_finish_func (self, result, error); } static gboolean wocky_auth_registry_success_finish_func (WockyAuthRegistry *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_auth_registry_success_async); } void wocky_auth_registry_failure (WockyAuthRegistry *self, GError *error) { WockyAuthRegistryClass *cls = WOCKY_AUTH_REGISTRY_GET_CLASS (self); if (cls->failure_func != NULL) cls->failure_func (self, error); } void wocky_auth_registry_add_handler (WockyAuthRegistry *self, WockyAuthHandler *handler) { WockyAuthRegistryPrivate *priv = self->priv; g_object_ref (handler); priv->handlers = g_slist_append (priv->handlers, handler); } /** * wocky_auth_registry_supports_one_of: * @self: a #WockyAuthRegistry * @allow_plain: Whether auth in plain text is allowed * @mechanisms: a #GSList of gchar* of auth mechanisms * * Checks whether at least one of @mechanisms is supported by Wocky. At present, * Wocky itself only implements password-based authentication mechanisms. * * Returns: %TRUE if one of the @mechanisms is supported by wocky, * %FALSE otherwise. */ gboolean wocky_auth_registry_supports_one_of (WockyAuthRegistry *self, GSList *mechanisms, gboolean allow_plain) { return wocky_auth_registry_select_handler (self, mechanisms, allow_plain, NULL, NULL, NULL, NULL, NULL); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-ll-connection-factory.h0000644000175000017500000000634412735676345027472 0ustar00gkiagiagkiagia00000000000000/* * wocky-ll-connection-factory.h - Header for WockyLLConnectionFactory * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_LL_CONNECTION_FACTORY_H__ #define __WOCKY_LL_CONNECTION_FACTORY_H__ #include #include #include "wocky-xmpp-connection.h" #include "wocky-ll-contact.h" G_BEGIN_DECLS typedef struct _WockyLLConnectionFactory WockyLLConnectionFactory; typedef struct _WockyLLConnectionFactoryClass WockyLLConnectionFactoryClass; typedef struct _WockyLLConnectionFactoryPrivate WockyLLConnectionFactoryPrivate; typedef enum { WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESSES, WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESS_CAN_BE_CONNECTED_TO, /* omg so long! */ } WockyLLConnectionFactoryError; GQuark wocky_ll_connection_factory_error_quark (void); #define WOCKY_LL_CONNECTION_FACTORY_ERROR (wocky_ll_connection_factory_error_quark ()) struct _WockyLLConnectionFactoryClass { GObjectClass parent_class; }; struct _WockyLLConnectionFactory { GObject parent; WockyLLConnectionFactoryPrivate *priv; }; GType wocky_ll_connection_factory_get_type (void); #define WOCKY_TYPE_LL_CONNECTION_FACTORY \ (wocky_ll_connection_factory_get_type ()) #define WOCKY_LL_CONNECTION_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactory)) #define WOCKY_LL_CONNECTION_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactoryClass)) #define WOCKY_IS_LL_CONNECTION_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY)) #define WOCKY_IS_LL_CONNECTION_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_LL_CONNECTION_FACTORY)) #define WOCKY_LL_CONNECTION_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_LL_CONNECTION_FACTORY, \ WockyLLConnectionFactoryClass)) WockyLLConnectionFactory * wocky_ll_connection_factory_new (void); void wocky_ll_connection_factory_make_connection_async ( WockyLLConnectionFactory *factory, WockyLLContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyXmppConnection * wocky_ll_connection_factory_make_connection_finish ( WockyLLConnectionFactory *factory, GAsyncResult *result, GError **error); G_END_DECLS #endif /* #ifndef __WOCKY_LL_CONNECTION_FACTORY_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-transport-iface.c0000644000175000017500000002001613012550005027560 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-transport-iface.c - Source for WockyJingleTransportIface * Copyright (C) 2007-2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "wocky-jingle-transport-iface.h" #include #include "wocky-jingle-content.h" #include "wocky-jingle-session.h" WockyJingleTransportIface * wocky_jingle_transport_iface_new (GType type, WockyJingleContent *content, const gchar *transport_ns) { g_return_val_if_fail (g_type_is_a (type, WOCKY_TYPE_JINGLE_TRANSPORT_IFACE), NULL); return g_object_new (type, "content", content, "transport-ns", transport_ns, NULL); } void wocky_jingle_transport_iface_parse_candidates (WockyJingleTransportIface *self, WockyNode *node, GError **error) { void (*virtual_method)(WockyJingleTransportIface *, WockyNode *, GError **) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->parse_candidates; g_assert (virtual_method != NULL); return virtual_method (self, node, error); } /* Takes in a list of slice-allocated WockyJingleCandidate structs */ void wocky_jingle_transport_iface_new_local_candidates (WockyJingleTransportIface *self, GList *candidates) { void (*virtual_method)(WockyJingleTransportIface *, GList *) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->new_local_candidates; g_assert (virtual_method != NULL); virtual_method (self, candidates); } /* Inserts candidates into the given node, or equivalent, of a * session-initiate, session-accept, content-add or content-accept action. */ void wocky_jingle_transport_iface_inject_candidates ( WockyJingleTransportIface *self, WockyNode *transport_node) { void (*virtual_method)(WockyJingleTransportIface *, WockyNode *) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->inject_candidates; if (virtual_method != NULL) virtual_method (self, transport_node); } /* Transmits outstanding or all candidates (if applicable and @all is set). */ void wocky_jingle_transport_iface_send_candidates ( WockyJingleTransportIface *self, gboolean all) { void (*virtual_method) (WockyJingleTransportIface *, gboolean) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->send_candidates; if (virtual_method != NULL) virtual_method (self, all); } /* Returns TRUE if and only if @self has enough candidates to inject into a * {session,content}-accept, and is connected. */ gboolean wocky_jingle_transport_iface_can_accept (WockyJingleTransportIface *self) { WockyJingleTransportState state; gboolean (*m) (WockyJingleTransportIface *) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->can_accept; g_object_get (self, "state", &state, NULL); if (state != WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED) return FALSE; /* Only Raw UDP *needs* candidates in order to accept. */ if (m != NULL) return m (self); else return TRUE; } GList * wocky_jingle_transport_iface_get_remote_candidates ( WockyJingleTransportIface *self) { GList * (*virtual_method)(WockyJingleTransportIface *) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->get_remote_candidates; g_assert (virtual_method != NULL); return virtual_method (self); } GList * wocky_jingle_transport_iface_get_local_candidates ( WockyJingleTransportIface *self) { GList * (*virtual_method)(WockyJingleTransportIface *) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->get_local_candidates; g_assert (virtual_method != NULL); return virtual_method (self); } gboolean jingle_transport_get_credentials (WockyJingleTransportIface *self, gchar **ufrag, gchar **pwd) { WockyJingleTransportIfaceClass *klass = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self); if (klass->get_credentials) return klass->get_credentials (self, ufrag, pwd); else return FALSE; } WockyJingleTransportType wocky_jingle_transport_iface_get_transport_type (WockyJingleTransportIface *self) { WockyJingleTransportType (*virtual_method)(void) = WOCKY_JINGLE_TRANSPORT_IFACE_GET_CLASS (self)->get_transport_type; g_assert (virtual_method != NULL); return virtual_method (); } static void wocky_jingle_transport_iface_base_init (gpointer klass) { static gboolean initialized = FALSE; if (!initialized) { GParamSpec *param_spec; param_spec = g_param_spec_object ( "content", "WockyJingleContent object", "Jingle content that's using this jingle transport object.", WOCKY_TYPE_JINGLE_CONTENT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_interface_install_property (klass, param_spec); param_spec = g_param_spec_string ( "transport-ns", "Transport namespace", "Namespace identifying the transport type.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_interface_install_property (klass, param_spec); param_spec = g_param_spec_uint ( "state", "Connection state for the transport.", "Enum specifying the connection state of the transport.", WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED, WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED, WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_interface_install_property (klass, param_spec); initialized = TRUE; } } GType wocky_jingle_transport_iface_get_type (void) { static GType type = 0; if (type == 0) { static const GTypeInfo info = { sizeof (WockyJingleTransportIfaceClass), wocky_jingle_transport_iface_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, 0, /* n_preallocs */ NULL /* instance_init */ }; type = g_type_register_static (G_TYPE_INTERFACE, "WockyJingleTransportIface", &info, 0); } return type; } WockyJingleCandidate * wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol, WockyJingleCandidateType type, const gchar *id, int component, const gchar *address, int port, int generation, int preference, const gchar *username, const gchar *password, int network) { WockyJingleCandidate *c = g_slice_new0 (WockyJingleCandidate); c->protocol = protocol; c->type = type; c->id = g_strdup (id); c->address = g_strdup (address); c->component = component; c->port = port; c->generation = generation; c->preference = preference; c->username = g_strdup (username); c->password = g_strdup (password); c->network = network; return c; } void wocky_jingle_candidate_free (WockyJingleCandidate *c) { g_free (c->id); g_free (c->address); g_free (c->username); g_free (c->password); g_slice_free (WockyJingleCandidate, c); } void jingle_transport_free_candidates (GList *candidates) { while (candidates != NULL) { WockyJingleCandidate *c = (WockyJingleCandidate *) candidates->data; wocky_jingle_candidate_free (c); candidates = g_list_remove (candidates, c); } } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jabber-auth.h0000644000175000017500000000603212735676345025437 0ustar00gkiagiagkiagia00000000000000/* * wocky-jabber-auth.h - Header for WockyJabberAuth * Copyright (C) 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_JABBER_AUTH_H__ #define __WOCKY_JABBER_AUTH_H__ #include #include #include "wocky-stanza.h" #include "wocky-xmpp-connection.h" #include "wocky-auth-registry.h" G_BEGIN_DECLS typedef struct _WockyJabberAuth WockyJabberAuth; /** * WockyJabberAuthClass: * * The class of a #WockyJabberAuth. */ typedef struct _WockyJabberAuthClass WockyJabberAuthClass; typedef struct _WockyJabberAuthPrivate WockyJabberAuthPrivate; struct _WockyJabberAuthClass { /**/ GObjectClass parent_class; }; struct _WockyJabberAuth { /**/ GObject parent; WockyJabberAuthPrivate *priv; }; GType wocky_jabber_auth_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_JABBER_AUTH \ (wocky_jabber_auth_get_type ()) #define WOCKY_JABBER_AUTH(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_JABBER_AUTH, WockyJabberAuth)) #define WOCKY_JABBER_AUTH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_JABBER_AUTH, WockyJabberAuthClass)) #define WOCKY_IS_JABBER_AUTH(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_JABBER_AUTH)) #define WOCKY_IS_JABBER_AUTH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_JABBER_AUTH)) #define WOCKY_JABBER_AUTH_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JABBER_AUTH, WockyJabberAuthClass)) WockyJabberAuth *wocky_jabber_auth_new (const gchar *server, const gchar *username, const gchar *resource, const gchar *password, WockyXmppConnection *connection, WockyAuthRegistry *auth_registry); void wocky_jabber_auth_add_handler (WockyJabberAuth *self, WockyAuthHandler *handler); void wocky_jabber_auth_authenticate_async (WockyJabberAuth *self, gboolean allow_plain, gboolean is_secure, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_jabber_auth_authenticate_finish (WockyJabberAuth *self, GAsyncResult *result, GError **error); void wocky_jabber_auth_add_handler (WockyJabberAuth *auth, WockyAuthHandler *handler); G_END_DECLS #endif /* #ifndef __WOCKY_JABBER_AUTH_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-sasl-auth.h0000644000175000017500000000575012735676345025162 0ustar00gkiagiagkiagia00000000000000/* * wocky-sasl-auth.h - Header for WockySaslAuth * Copyright (C) 2006 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_SASL_AUTH_H__ #define __WOCKY_SASL_AUTH_H__ #include #include #include "wocky-stanza.h" #include "wocky-xmpp-connection.h" #include "wocky-auth-registry.h" G_BEGIN_DECLS typedef struct _WockySaslAuth WockySaslAuth; /** * WockySaslAuthClass: * * The class of a #WockySaslAuth. */ typedef struct _WockySaslAuthClass WockySaslAuthClass; typedef struct _WockySaslAuthPrivate WockySaslAuthPrivate; struct _WockySaslAuthClass { /**/ GObjectClass parent_class; }; struct _WockySaslAuth { /**/ GObject parent; WockySaslAuthPrivate *priv; }; GType wocky_sasl_auth_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_SASL_AUTH \ (wocky_sasl_auth_get_type ()) #define WOCKY_SASL_AUTH(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_SASL_AUTH, WockySaslAuth)) #define WOCKY_SASL_AUTH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_SASL_AUTH, WockySaslAuthClass)) #define WOCKY_IS_SASL_AUTH(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_SASL_AUTH)) #define WOCKY_IS_SASL_AUTH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_SASL_AUTH)) #define WOCKY_SASL_AUTH_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_SASL_AUTH, WockySaslAuthClass)) WockySaslAuth *wocky_sasl_auth_new (const gchar *server, const gchar *username, const gchar *password, WockyXmppConnection *connection, WockyAuthRegistry *auth_registry); void wocky_sasl_auth_add_handler (WockySaslAuth *sasl, WockyAuthHandler *handler); void wocky_sasl_auth_authenticate_async (WockySaslAuth *sasl, WockyStanza *features, gboolean allow_plain, gboolean is_secure, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_sasl_auth_authenticate_finish (WockySaslAuth *sasl, GAsyncResult *result, GError **error); void wocky_sasl_auth_add_handler (WockySaslAuth *auth, WockyAuthHandler *handler); G_END_DECLS #endif /* #ifndef __WOCKY_SASL_AUTH_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jingle-factory.h0000644000175000017500000000606712735676345026200 0ustar00gkiagiagkiagia00000000000000/* * wocky-jingle-factory.h - Header for WockyJingleFactory * Copyright (C) 2008 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __JINGLE_FACTORY_H__ #define __JINGLE_FACTORY_H__ #include #include "wocky-jingle-info.h" #include "wocky-jingle-types.h" G_BEGIN_DECLS typedef struct _WockyJingleFactoryClass WockyJingleFactoryClass; GType wocky_jingle_factory_get_type (void); /* TYPE MACROS */ #define WOCKY_TYPE_JINGLE_FACTORY \ (wocky_jingle_factory_get_type ()) #define WOCKY_JINGLE_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_JINGLE_FACTORY, \ WockyJingleFactory)) #define WOCKY_JINGLE_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_JINGLE_FACTORY, \ WockyJingleFactoryClass)) #define WOCKY_IS_JINGLE_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_JINGLE_FACTORY)) #define WOCKY_IS_JINGLE_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_JINGLE_FACTORY)) #define WOCKY_JINGLE_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JINGLE_FACTORY, \ WockyJingleFactoryClass)) struct _WockyJingleFactoryClass { GObjectClass parent_class; }; typedef struct _WockyJingleFactoryPrivate WockyJingleFactoryPrivate; struct _WockyJingleFactory { GObject parent; WockyJingleFactoryPrivate *priv; }; WockyJingleFactory *wocky_jingle_factory_new ( WockySession *session); void wocky_jingle_factory_stop (WockyJingleFactory *self); void wocky_jingle_factory_register_content_type (WockyJingleFactory *self, gchar *xmlns, GType content_type); GType wocky_jingle_factory_lookup_content_type (WockyJingleFactory *self, const gchar *xmlns); void wocky_jingle_factory_register_transport (WockyJingleFactory *self, gchar *xmlns, GType transport_type); GType wocky_jingle_factory_lookup_transport (WockyJingleFactory *self, const gchar *xmlns); WockyJingleSession *wocky_jingle_factory_create_session ( WockyJingleFactory *fac, const gchar *jid, WockyJingleDialect dialect, gboolean local_hold); WockyJingleInfo *wocky_jingle_factory_get_jingle_info ( WockyJingleFactory *fac); G_END_DECLS #endif /* __JINGLE_FACTORY_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-c2s-porter.c0000644000175000017500000017507012735676345025257 0ustar00gkiagiagkiagia00000000000000/* * wocky-c2s-porter.c - Source for WockyC2SPorter * Copyright (C) 2009-2011 Collabora Ltd. * @author Guillaume Desmottes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-c2s-porter * @title: WockyC2SPorter * @short_description: Wrapper around a #WockyXmppConnection providing a * higher level API. * * Sends and receives #WockyStanza from an underlying * #WockyXmppConnection. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-c2s-porter.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include "wocky-porter.h" #include "wocky-utils.h" #include "wocky-namespaces.h" #include "wocky-contact-factory.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PORTER #include "wocky-debug-internal.h" static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (WockyC2SPorter, wocky_c2s_porter, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (WOCKY_TYPE_PORTER, wocky_porter_iface_init)); /* properties */ enum { PROP_CONNECTION = 1, PROP_FULL_JID, PROP_BARE_JID, PROP_RESOURCE, }; /* private structure */ struct _WockyC2SPorterPrivate { gboolean dispose_has_run; gboolean forced_shutdown; gchar *full_jid; gchar *bare_jid; gchar *resource; gchar *domain; /* Queue of (sending_queue_elem *) */ GQueue *sending_queue; GCancellable *receive_cancellable; gboolean sending_whitespace_ping; GSimpleAsyncResult *close_result; gboolean waiting_to_close; gboolean remote_closed; gboolean local_closed; GCancellable *close_cancellable; GSimpleAsyncResult *force_close_result; GCancellable *force_close_cancellable; /* guint => owned (StanzaHandler *) */ GHashTable *handlers_by_id; /* Sort listed (by decreasing priority) of borrowed (StanzaHandler *) */ GList *handlers; guint next_handler_id; /* (const gchar *) => owned (StanzaIqHandler *) * This key is the ID of the IQ */ GHashTable *iq_reply_handlers; gboolean power_saving_mode; /* Queue of (owned WockyStanza *) */ GQueue *unimportant_queue; /* List of (owned WockyStanza *) */ GQueue queueable_stanza_patterns; WockyXmppConnection *connection; }; typedef struct { WockyC2SPorter *self; WockyStanza *stanza; GCancellable *cancellable; GSimpleAsyncResult *result; gulong cancelled_sig_id; } sending_queue_elem; static void wocky_c2s_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); static sending_queue_elem * sending_queue_elem_new (WockyC2SPorter *self, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { sending_queue_elem *elem = g_slice_new0 (sending_queue_elem); elem->self = self; elem->stanza = g_object_ref (stanza); if (cancellable != NULL) elem->cancellable = g_object_ref (cancellable); elem->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_async); return elem; } static void sending_queue_elem_free (sending_queue_elem *elem) { g_object_unref (elem->stanza); if (elem->cancellable != NULL) { g_object_unref (elem->cancellable); if (elem->cancelled_sig_id != 0) g_signal_handler_disconnect (elem->cancellable, elem->cancelled_sig_id); /* FIXME: we should use g_cancellable_disconnect but it raises a dead * lock (#587300) */ } g_object_unref (elem->result); g_slice_free (sending_queue_elem, elem); } typedef enum { MATCH_ANYONE, MATCH_SERVER, MATCH_JID } SenderMatch; typedef struct { gchar *node; gchar *domain; gchar *resource; } JidTriple; typedef struct { WockyStanzaType type; WockyStanzaSubType sub_type; SenderMatch sender_match; JidTriple jid; guint priority; WockyStanza *match; WockyPorterHandlerFunc callback; gpointer user_data; } StanzaHandler; static StanzaHandler * stanza_handler_new ( WockyStanzaType type, WockyStanzaSubType sub_type, SenderMatch sender_match, JidTriple *jid, guint priority, WockyStanza *stanza, WockyPorterHandlerFunc callback, gpointer user_data) { StanzaHandler *result = g_slice_new0 (StanzaHandler); result->type = type; result->sub_type = sub_type; result->priority = priority; result->callback = callback; result->user_data = user_data; result->sender_match = sender_match; if (stanza != NULL) result->match = g_object_ref (stanza); if (sender_match == MATCH_JID) { g_assert (jid != NULL); result->jid = *jid; } else { g_assert (jid == NULL); } return result; } static void stanza_handler_free (StanzaHandler *handler) { g_free (handler->jid.node); g_free (handler->jid.domain); g_free (handler->jid.resource); if (handler->match != NULL) g_object_unref (handler->match); g_slice_free (StanzaHandler, handler); } typedef struct { WockyC2SPorter *self; GSimpleAsyncResult *result; GCancellable *cancellable; gulong cancelled_sig_id; gchar *recipient; gchar *id; gboolean sent; } StanzaIqHandler; static StanzaIqHandler * stanza_iq_handler_new (WockyC2SPorter *self, gchar *id, GSimpleAsyncResult *result, GCancellable *cancellable, const gchar *recipient) { StanzaIqHandler *handler = g_slice_new0 (StanzaIqHandler); gchar *to = NULL; if (recipient != NULL) { to = wocky_normalise_jid (recipient); if (to == NULL) { DEBUG ("Failed to normalise stanza recipient '%s'", recipient); to = g_strdup (recipient); } } handler->self = self; handler->result = result; handler->id = id; if (cancellable != NULL) handler->cancellable = g_object_ref (cancellable); handler->recipient = to; return handler; } static void stanza_iq_handler_remove_cancellable (StanzaIqHandler *handler) { if (handler->cancellable != NULL) { /* FIXME: we should use g_cancellable_disconnect but it raises a dead * lock (#587300) */ /* We might have already have disconnected the signal handler * from send_head_stanza(), so check whether it's still connected. */ if (handler->cancelled_sig_id > 0) g_signal_handler_disconnect (handler->cancellable, handler->cancelled_sig_id); g_object_unref (handler->cancellable); handler->cancelled_sig_id = 0; handler->cancellable = NULL; } } static void stanza_iq_handler_free (StanzaIqHandler *handler) { if (handler->result != NULL) g_object_unref (handler->result); stanza_iq_handler_remove_cancellable (handler); g_free (handler->id); g_free (handler->recipient); g_slice_free (StanzaIqHandler, handler); } static void stanza_iq_handler_maybe_remove (StanzaIqHandler *handler) { /* Always wait till the iq sent operation has finished and something * completed the operation from the perspective of the API user */ if (handler->sent && handler->result == NULL) { WockyC2SPorterPrivate *priv = handler->self->priv; g_hash_table_remove (priv->iq_reply_handlers, handler->id); } } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data); static void send_close (WockyC2SPorter *self); static gboolean handle_iq_reply (WockyPorter *porter, WockyStanza *reply, gpointer user_data); static void remote_connection_closed (WockyC2SPorter *self, GError *error); static void wocky_c2s_porter_init (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_C2S_PORTER, WockyC2SPorterPrivate); priv = self->priv; priv->sending_queue = g_queue_new (); priv->handlers_by_id = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) stanza_handler_free); /* these are guints, reserve 0 for "not a valid handler" */ priv->next_handler_id = 1; priv->handlers = NULL; priv->power_saving_mode = FALSE; priv->unimportant_queue = g_queue_new (); priv->iq_reply_handlers = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) stanza_iq_handler_free); } static void wocky_c2s_porter_dispose (GObject *object); static void wocky_c2s_porter_finalize (GObject *object); static void wocky_c2s_porter_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyC2SPorter *connection = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = connection->priv; switch (property_id) { gchar *node; case PROP_CONNECTION: g_assert (priv->connection == NULL); priv->connection = g_value_dup_object (value); g_assert (priv->connection != NULL); break; case PROP_FULL_JID: g_assert (priv->full_jid == NULL); /* construct-only */ g_assert (priv->bare_jid == NULL); g_assert (priv->resource == NULL); priv->full_jid = g_value_dup_string (value); g_assert (priv->full_jid != NULL); wocky_decode_jid (priv->full_jid, &node, &priv->domain, &priv->resource); priv->bare_jid = wocky_compose_jid (node, priv->domain, NULL); g_free (node); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_c2s_porter_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyC2SPorter *connection = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = connection->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_FULL_JID: g_value_set_string (value, priv->full_jid); break; case PROP_BARE_JID: g_value_set_string (value, priv->bare_jid); break; case PROP_RESOURCE: g_value_set_string (value, priv->resource); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gboolean handle_stream_error (WockyPorter *porter, WockyStanza *stanza, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); GError *error = NULL; gboolean ret = wocky_stanza_extract_stream_error (stanza, &error); /* If wocky_stanza_extract_stream_error() failed, @stanza wasn't a stream * error, in which case we are broken. */ g_return_val_if_fail (ret, FALSE); DEBUG ("Received stream error; consider the remote connection to be closed"); remote_connection_closed (self, error); g_error_free (error); return TRUE; } static void wocky_c2s_porter_constructed (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->constructed) G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->constructed (object); g_assert (priv->connection != NULL); /* Register the IQ reply handler */ wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_RESULT, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_iq_reply, self, NULL); wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_ERROR, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_iq_reply, self, NULL); /* Register the stream error handler. We use _from_anyone() here because we can * trust servers not to relay spurious stream errors to us, and this feels * safer than risking missing a stream error to bugs in the _from_server() * checking code. */ wocky_porter_register_handler_from_anyone (WOCKY_PORTER (self), WOCKY_STANZA_TYPE_STREAM_ERROR, WOCKY_STANZA_SUB_TYPE_NONE, WOCKY_PORTER_HANDLER_PRIORITY_MAX, handle_stream_error, self, NULL); } static void wocky_c2s_porter_class_init ( WockyC2SPorterClass *wocky_c2s_porter_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_c2s_porter_class); g_type_class_add_private (wocky_c2s_porter_class, sizeof (WockyC2SPorterPrivate)); object_class->constructed = wocky_c2s_porter_constructed; object_class->set_property = wocky_c2s_porter_set_property; object_class->get_property = wocky_c2s_porter_get_property; object_class->dispose = wocky_c2s_porter_dispose; object_class->finalize = wocky_c2s_porter_finalize; g_object_class_override_property (object_class, PROP_CONNECTION, "connection"); g_object_class_override_property (object_class, PROP_FULL_JID, "full-jid"); g_object_class_override_property (object_class, PROP_BARE_JID, "bare-jid"); g_object_class_override_property (object_class, PROP_RESOURCE, "resource"); } void wocky_c2s_porter_dispose (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } if (priv->receive_cancellable != NULL) { g_warning ("Disposing an open XMPP porter"); g_cancellable_cancel (priv->receive_cancellable); g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } if (priv->close_result != NULL) { g_object_unref (priv->close_result); priv->close_result = NULL; } if (priv->close_cancellable != NULL) { g_object_unref (priv->close_cancellable); priv->close_cancellable = NULL; } if (priv->force_close_result != NULL) { g_object_unref (priv->force_close_result); priv->force_close_result = NULL; } if (priv->force_close_cancellable != NULL) { g_object_unref (priv->force_close_cancellable); priv->force_close_cancellable = NULL; } if (G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->dispose) G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->dispose (object); } void wocky_c2s_porter_finalize (GObject *object) { WockyC2SPorter *self = WOCKY_C2S_PORTER (object); WockyC2SPorterPrivate *priv = self->priv; DEBUG ("finalize porter %p", self); /* sending_queue_elem keeps a ref on the Porter (through the * GSimpleAsyncResult) so it shouldn't be destroyed while there are * elements in the queue. */ g_assert_cmpuint (g_queue_get_length (priv->sending_queue), ==, 0); g_queue_free (priv->sending_queue); g_hash_table_unref (priv->handlers_by_id); g_list_free (priv->handlers); g_hash_table_unref (priv->iq_reply_handlers); g_queue_free (priv->unimportant_queue); g_queue_foreach (&priv->queueable_stanza_patterns, (GFunc) g_object_unref, NULL); g_queue_clear (&priv->queueable_stanza_patterns); g_free (priv->full_jid); g_free (priv->bare_jid); g_free (priv->resource); g_free (priv->domain); G_OBJECT_CLASS (wocky_c2s_porter_parent_class)->finalize (object); } /** * wocky_c2s_porter_new: * @connection: #WockyXmppConnection which will be used to receive and send * #WockyStanza * @full_jid: the full JID of the user * * Convenience function to create a new #WockyC2SPorter. * * Returns: a new #WockyPorter. */ WockyPorter * wocky_c2s_porter_new (WockyXmppConnection *connection, const gchar *full_jid) { return g_object_new (WOCKY_TYPE_C2S_PORTER, "connection", connection, "full-jid", full_jid, NULL); } static void send_head_stanza (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; elem = g_queue_peek_head (priv->sending_queue); if (elem == NULL) /* Nothing to send */ return; if (elem->cancelled_sig_id != 0) { /* We are going to start sending the stanza. Lower layers are now * responsible of handling the cancellable. */ g_signal_handler_disconnect (elem->cancellable, elem->cancelled_sig_id); elem->cancelled_sig_id = 0; } wocky_xmpp_connection_send_stanza_async (priv->connection, elem->stanza, elem->cancellable, send_stanza_cb, g_object_ref (self)); g_signal_emit_by_name (self, "sending", elem->stanza); } static void terminate_sending_operations (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; g_return_if_fail (error != NULL); while ((elem = g_queue_pop_head (priv->sending_queue))) { g_simple_async_result_set_from_error (elem->result, error); g_simple_async_result_complete (elem->result); sending_queue_elem_free (elem); } } static gboolean sending_in_progress (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; return g_queue_get_length (priv->sending_queue) > 0 || priv->sending_whitespace_ping; } static void close_if_waiting (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; if (priv->waiting_to_close && !sending_in_progress (self)) { /* Nothing to send left and we are waiting to close the connection. */ DEBUG ("Queue has been flushed. Closing the connection."); send_close (self); } } static void send_stanza_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; if (!wocky_xmpp_connection_send_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, &error)) { /* Sending failed. Cancel this sending operation and all the others * pending ones as we won't be able to send any more stanza. */ terminate_sending_operations (self, error); g_error_free (error); } else { sending_queue_elem *elem = g_queue_pop_head (priv->sending_queue); if (elem == NULL) /* The elem could have been removed from the queue if its sending * operation has already been completed (for example by forcing to * close the connection). */ return; g_simple_async_result_complete (elem->result); sending_queue_elem_free (elem); if (g_queue_get_length (priv->sending_queue) > 0) { /* Send next stanza */ send_head_stanza (self); } } close_if_waiting (self); g_object_unref (self); } static void send_cancelled_cb (GCancellable *cancellable, gpointer user_data) { sending_queue_elem *elem = (sending_queue_elem *) user_data; WockyC2SPorterPrivate *priv = elem->self->priv; GError error = { G_IO_ERROR, G_IO_ERROR_CANCELLED, "Sending was cancelled" }; g_simple_async_result_set_from_error (elem->result, &error); g_simple_async_result_complete_in_idle (elem->result); g_queue_remove (priv->sending_queue, elem); sending_queue_elem_free (elem); } static void wocky_c2s_porter_send_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; sending_queue_elem *elem; if (priv->close_result != NULL || priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing"); return; } elem = sending_queue_elem_new (self, stanza, cancellable, callback, user_data); g_queue_push_tail (priv->sending_queue, elem); if (g_queue_get_length (priv->sending_queue) == 1 && !priv->sending_whitespace_ping) { send_head_stanza (self); } else if (cancellable != NULL) { elem->cancelled_sig_id = g_cancellable_connect (cancellable, G_CALLBACK (send_cancelled_cb), elem, NULL); } } static gboolean wocky_c2s_porter_send_finish (WockyPorter *porter, GAsyncResult *result, GError **error) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_send_async), FALSE); return TRUE; } static void receive_stanza (WockyC2SPorter *self); static void complete_close (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *tmp; if (g_cancellable_is_cancelled (priv->close_cancellable)) { g_simple_async_result_set_error (priv->close_result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "closing operation was cancelled"); } if (priv->close_cancellable) g_object_unref (priv->close_cancellable); priv->close_cancellable = NULL; if (priv->force_close_cancellable) g_object_unref (priv->force_close_cancellable); priv->force_close_cancellable = NULL; tmp = priv->close_result; priv->close_result = NULL; g_simple_async_result_complete (tmp); g_object_unref (tmp); } static gboolean stanza_is_from_server ( WockyC2SPorter *self, const gchar *nfrom) { return (nfrom == NULL || !wocky_strdiff (nfrom, self->priv->full_jid) || !wocky_strdiff (nfrom, self->priv->bare_jid) || !wocky_strdiff (nfrom, self->priv->domain)); } /* Return TRUE if not spoofed. */ static gboolean check_spoofing (WockyC2SPorter *self, WockyStanza *reply, const gchar *should_be_from) { const gchar *from; gchar *nfrom; gboolean ret = TRUE; from = wocky_stanza_get_from (reply); /* fast path for a byte-for-byte match */ if (G_LIKELY (!wocky_strdiff (from, should_be_from))) return TRUE; /* OK, we have to do some work */ nfrom = wocky_normalise_jid (from); /* nearly-as-fast path for a normalized match */ if (!wocky_strdiff (nfrom, should_be_from)) goto finally; /* if we sent an IQ without a 'to' attribute, it's to our server: allow it * to use our full/bare JID or domain to reply */ if (should_be_from == NULL) { if (stanza_is_from_server (self, nfrom)) goto finally; } /* If we sent an IQ to the server itself, allow it to * omit 'from' in its reply, which is normally used * for messages from the server on behalf of our own * account (as of 2013-09-02, the Facebook beta server * does this). See fd.o #68829 */ if (from == NULL && !wocky_strdiff (should_be_from, self->priv->domain)) { goto finally; } /* if we sent an IQ to our full or bare JID, allow our server to omit 'to' * in the reply (Prosody 0.6.1 does this with the resulting error if we * send disco#info to our own bare JID), or to use our full JID. */ if (from == NULL || !wocky_strdiff (nfrom, self->priv->full_jid)) { if (!wocky_strdiff (should_be_from, self->priv->full_jid) || !wocky_strdiff (should_be_from, self->priv->bare_jid)) goto finally; } DEBUG ("'%s' (normal: '%s') attempts to spoof an IQ reply from '%s'", from == NULL ? "(null)" : from, nfrom == NULL ? "(null)" : nfrom, should_be_from == NULL ? "(null)" : should_be_from); DEBUG ("Our full JID is '%s' and our bare JID is '%s'", self->priv->full_jid, self->priv->bare_jid); ret = FALSE; finally: g_free (nfrom); return ret; } static gboolean handle_iq_reply (WockyPorter *porter, WockyStanza *reply, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; const gchar *id; StanzaIqHandler *handler; gboolean ret = FALSE; id = wocky_node_get_attribute (wocky_stanza_get_top_node (reply), "id"); if (id == NULL) { DEBUG ("Ignoring reply without IQ id"); return FALSE; } handler = g_hash_table_lookup (priv->iq_reply_handlers, id); if (handler == NULL) { DEBUG ("Ignored IQ reply"); return FALSE; } if (!check_spoofing (self, reply, handler->recipient)) return FALSE; if (handler->result != NULL) { GSimpleAsyncResult *r = handler->result; handler->result = NULL; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_op_res_gpointer (r, reply, NULL); g_simple_async_result_complete (r); g_object_unref (r); ret = TRUE; } stanza_iq_handler_maybe_remove (handler); return ret; } static void handle_stanza (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; GList *l; const gchar *from; WockyStanzaType type; WockyStanzaSubType sub_type; gchar *node = NULL, *domain = NULL, *resource = NULL; gboolean is_from_server; gboolean handled = FALSE; wocky_stanza_get_type_info (stanza, &type, &sub_type); /* The from attribute of the stanza need not always be present, for example * when receiving roster items, so don't enforce it. */ from = wocky_stanza_get_from (stanza); if (from == NULL) { is_from_server = TRUE; } else if (wocky_decode_jid (from, &node, &domain, &resource)) { /* FIXME: the stanza should really ensure that 'from' and 'to' are * pre-validated and normalized so we don't have to do this again. */ gchar *nfrom = wocky_compose_jid (node, domain, resource); is_from_server = stanza_is_from_server (self, nfrom); g_free (nfrom); } else { is_from_server = FALSE; } for (l = priv->handlers; l != NULL && !handled; l = g_list_next (l)) { StanzaHandler *handler = (StanzaHandler *) l->data; if (type != handler->type && handler->type != WOCKY_STANZA_TYPE_NONE) continue; if (sub_type != handler->sub_type && handler->sub_type != WOCKY_STANZA_SUB_TYPE_NONE) continue; switch (handler->sender_match) { case MATCH_ANYONE: break; case MATCH_SERVER: if (!is_from_server) continue; break; case MATCH_JID: g_assert (handler->jid.domain != NULL); if (wocky_strdiff (node, handler->jid.node)) continue; if (wocky_strdiff (domain, handler->jid.domain)) continue; /* If a resource was specified, we need to match against it. */ if (handler->jid.resource != NULL && wocky_strdiff (resource, handler->jid.resource)) continue; break; } /* Check if the stanza matches the pattern */ if (handler->match != NULL && !wocky_node_is_superset (wocky_stanza_get_top_node (stanza), wocky_stanza_get_top_node (handler->match))) continue; handled = handler->callback (WOCKY_PORTER (self), stanza, handler->user_data); } if (!handled) { DEBUG ("Stanza not handled"); if (type == WOCKY_STANZA_TYPE_IQ && (sub_type == WOCKY_STANZA_SUB_TYPE_GET || sub_type == WOCKY_STANZA_SUB_TYPE_SET)) wocky_porter_send_iq_error (WOCKY_PORTER (self), stanza, WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE, NULL); } g_free (node); g_free (domain); g_free (resource); } /* immediately handle any queued stanzas */ static void flush_unimportant_queue (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; while (!g_queue_is_empty (priv->unimportant_queue)) { WockyStanza *stanza = g_queue_pop_head (priv->unimportant_queue); handle_stanza (self, stanza); g_object_unref (stanza); } } /* create a list of patterns of stanzas that can be safely queued */ static void build_queueable_stanza_patterns (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; gchar **node_name = NULL; gchar *node_names [] = { "http://jabber.org/protocol/geoloc", "http://jabber.org/protocol/nick", "http://laptop.org/xmpp/buddy-properties", "http://laptop.org/xmpp/activities", "http://laptop.org/xmpp/current-activity", "http://laptop.org/xmpp/activity-properties", NULL}; for (node_name = node_names; *node_name != NULL ; node_name++) { WockyStanza *pattern = wocky_stanza_build ( WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, '(', "event", ':', WOCKY_XMPP_NS_PUBSUB_EVENT, '(', "items", '@', "node", *node_name, ')', ')', NULL); g_queue_push_tail (&priv->queueable_stanza_patterns, pattern); } } static gboolean is_stanza_important (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; WockyNode *node = wocky_stanza_get_top_node (stanza); WockyStanzaType type; WockyStanzaSubType sub_type; GList *l; wocky_stanza_get_type_info (stanza, &type, &sub_type); /* and are queueable */ if (type == WOCKY_STANZA_TYPE_PRESENCE && (sub_type == WOCKY_STANZA_SUB_TYPE_NONE || sub_type == WOCKY_STANZA_SUB_TYPE_UNAVAILABLE)) { return FALSE; } if (priv->queueable_stanza_patterns.length == 0) build_queueable_stanza_patterns (self); /* check whether stanza matches any of the queueable patterns */ for (l = priv->queueable_stanza_patterns.head; l != NULL; l = l->next) { if (wocky_node_is_superset (node, wocky_stanza_get_top_node ( WOCKY_STANZA (l->data)))) return FALSE; } /* everything else is important */ return TRUE; } static void queue_or_handle_stanza (WockyC2SPorter *self, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; if (priv->power_saving_mode) { if (is_stanza_important (self, stanza)) { flush_unimportant_queue (self); handle_stanza (self, stanza); } else { g_queue_push_tail (priv->unimportant_queue, g_object_ref (stanza)); } } else { handle_stanza (self, stanza); } } static void abort_pending_iqs (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; GHashTableIter iter; gpointer value; g_hash_table_iter_init (&iter, priv->iq_reply_handlers); while (g_hash_table_iter_next (&iter, NULL, &value)) { StanzaIqHandler *handler = value; if (handler->result == NULL) continue; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_from_error (handler->result, error); g_simple_async_result_complete_in_idle (handler->result); g_object_unref (handler->result); handler->result = NULL; if (handler->sent) g_hash_table_iter_remove (&iter); } } static void remote_connection_closed (WockyC2SPorter *self, GError *error) { WockyC2SPorterPrivate *priv = self->priv; gboolean error_occured = TRUE; /* Completing a close operation and firing the remote-closed/remote-error * signals could make the library user unref the porter. So we take a * reference to ourself for the duration of this function. */ g_object_ref (self); /* Complete pending send IQ operations as we won't be able to receive their * IQ replies */ abort_pending_iqs (self, error); if (g_error_matches (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED)) error_occured = FALSE; /* This flag MUST be set before we emit the remote-* signals: If it is not * * some very subtle and hard to debug problems are created, which can in * * turn conceal further problems in the code. You have been warned. */ priv->remote_closed = TRUE; if (error_occured) { g_signal_emit_by_name (self, "remote-error", error->domain, error->code, error->message); } else { g_signal_emit_by_name (self, "remote-closed"); } if (priv->close_result != NULL && priv->local_closed) { if (error_occured) { /* We sent our close but something went wrong with the connection * so we won't be able to receive close from the other side. * Complete the close operation. */ g_simple_async_result_set_from_error (priv->close_result, error); } complete_close (self); } if (priv->receive_cancellable != NULL) { g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } g_object_unref (self); } static void connection_force_close_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *r = priv->force_close_result; GError *error = NULL; /* null out the result so no-one else can use it after us * * this should never happen, but nullifying it lets us trap * * that internal inconsistency if it arises */ priv->force_close_result = NULL; priv->local_closed = TRUE; /* This can fail if the porter has put two * * wocky_xmpp_connection_force_close_async ops in flight * * at the same time: this is bad and should never happen: */ g_assert (r != NULL); if (!wocky_xmpp_connection_force_close_finish (WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (r, error); g_error_free (error); } if (priv->receive_cancellable != NULL) { g_object_unref (priv->receive_cancellable); priv->receive_cancellable = NULL; } DEBUG ("XMPP connection has been closed; complete the force close operation"); g_simple_async_result_complete (r); g_object_unref (r); g_object_unref (self); } static void stanza_received_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; WockyStanza *stanza; GError *error = NULL; stanza = wocky_xmpp_connection_recv_stanza_finish ( WOCKY_XMPP_CONNECTION (source), res, &error); if (stanza == NULL) { if (g_error_matches (error, WOCKY_XMPP_CONNECTION_ERROR, WOCKY_XMPP_CONNECTION_ERROR_CLOSED)) { DEBUG ("Remote connection has been closed"); } else { DEBUG ("Error receiving stanza: %s", error->message); } if (priv->force_close_result != NULL) { DEBUG ("Receive operation has been cancelled; "); if (!priv->forced_shutdown) { /* We are forcing the closing. Actually close the connection. */ DEBUG ("force shutdown of the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); } else { DEBUG ("forced shutdown of XMPP connection already in progress"); } } else { remote_connection_closed (self, error); } g_error_free (error); return; } /* Calling out to a stanza handler could make the library user unref the * porter; hence, we take a reference to ourself for the rest of the * function. */ g_object_ref (self); queue_or_handle_stanza (self, stanza); g_object_unref (stanza); if (!priv->remote_closed) { /* We didn't detect any error on the stream, wait for next stanza */ receive_stanza (self); } else { DEBUG ("Remote connection has been closed, don't wait for next stanza"); DEBUG ("Remote connection has been closed; "); if (priv->forced_shutdown) { DEBUG ("forced shutdown of the XMPP connection already in progress"); } else if (priv->force_close_result != NULL) { DEBUG ("force shutdown of the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); } } g_object_unref (self); } static void receive_stanza (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; wocky_xmpp_connection_recv_stanza_async (priv->connection, priv->receive_cancellable, stanza_received_cb, self); } static void wocky_c2s_porter_start (WockyPorter *porter) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; if (priv->receive_cancellable != NULL) /* Porter has already been started */ return; priv->receive_cancellable = g_cancellable_new (); receive_stanza (self); } static void close_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (user_data); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; priv->local_closed = TRUE; if (!wocky_xmpp_connection_send_close_finish (WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (priv->close_result, error); g_error_free (error); goto out; } if (!g_cancellable_is_cancelled (priv->close_cancellable) && !priv->remote_closed) { /* we'll complete the close operation once the remote side closes it's * connection */ return; } out: if (priv->close_result != NULL) { /* close operation could already be completed if the other side closes * before we send our close */ complete_close (self); } } static void send_close (WockyC2SPorter *self) { WockyC2SPorterPrivate *priv = self->priv; wocky_xmpp_connection_send_close_async (priv->connection, NULL, close_sent_cb, self); priv->waiting_to_close = FALSE; } static void wocky_c2s_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; if (priv->local_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSED, "Porter has already been closed"); return; } if (priv->receive_cancellable == NULL && !priv->remote_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Porter has not been started"); return; } if (priv->close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another close operation is pending"); return; } if (priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "A force close operation is pending"); return; } priv->close_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_close_async); g_assert (priv->close_cancellable == NULL); if (cancellable != NULL) priv->close_cancellable = g_object_ref (cancellable); g_signal_emit_by_name (self, "closing"); if (sending_in_progress (self)) { DEBUG ("Sending queue is not empty. Flushing it before " "closing the connection."); priv->waiting_to_close = TRUE; return; } send_close (self); } static gboolean wocky_c2s_porter_close_finish (WockyPorter *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_close_async), FALSE); return TRUE; } static gint compare_handler (StanzaHandler *a, StanzaHandler *b) { /* List is sorted by decreasing priority */ if (a->priority < b->priority) return 1; else if (a->priority > b->priority) return -1; else return 0; } static guint wocky_c2s_porter_register_handler_internal (WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, SenderMatch sender_match, JidTriple *jid, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorterPrivate *priv = self->priv; StanzaHandler *handler; g_return_val_if_fail (WOCKY_IS_PORTER (self), 0); handler = stanza_handler_new (type, sub_type, sender_match, jid, priority, stanza, callback, user_data); g_hash_table_insert (priv->handlers_by_id, GUINT_TO_POINTER (priv->next_handler_id), handler); priv->handlers = g_list_insert_sorted (priv->handlers, handler, (GCompareFunc) compare_handler); return priv->next_handler_id++; } static guint wocky_c2s_porter_register_handler_from_by_stanza (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); JidTriple jid; gboolean from_valid; g_return_val_if_fail (from != NULL, 0); from_valid = wocky_decode_jid (from, &jid.node, &jid.domain, &jid.resource); if (!from_valid) { g_critical ("from='%s' isn't a valid JID", from); return 0; } return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_JID, &jid, priority, callback, user_data, stanza); } static guint wocky_c2s_porter_register_handler_from_anyone_by_stanza ( WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_ANYONE, NULL, priority, callback, user_data, stanza); } /** * wocky_c2s_porter_register_handler_from_server_va: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @ap: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * A va_list version of * wocky_c2s_porter_register_handler_from_server(); see that function for more * details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server_va ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, va_list ap) { guint ret; WockyStanza *stanza; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) { stanza = NULL; g_return_val_if_fail ( (va_arg (ap, WockyNodeBuildTag) == 0) && "Pattern-matching is not supported when matching stanzas " "of any type", 0); } else { stanza = wocky_stanza_build_va (type, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL, ap); g_assert (stanza != NULL); } ret = wocky_c2s_porter_register_handler_from_server_by_stanza (self, type, sub_type, priority, callback, user_data, stanza); if (stanza != NULL) g_object_unref (stanza); return ret; } /** * wocky_c2s_porter_register_handler_from_server_by_stanza: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @stanza: a #WockyStanza. The handler will match a stanza only if * the stanza received is a superset of the one passed to this * function, as per wocky_node_is_superset(). * * A #WockyStanza version of * wocky_c2s_porter_register_handler_from_server(); see that function for more * details. * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server_by_stanza ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyStanza *stanza) { g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); if (type == WOCKY_STANZA_TYPE_NONE) g_return_val_if_fail (stanza == NULL, 0); else g_return_val_if_fail (WOCKY_IS_STANZA (stanza), 0); return wocky_c2s_porter_register_handler_internal (self, type, sub_type, MATCH_SERVER, NULL, priority, callback, user_data, stanza); } /** * wocky_c2s_porter_register_handler_from_server: * @self: A #WockyC2SPorter instance (passed to @callback). * @type: The type of stanza to be handled, or WOCKY_STANZA_TYPE_NONE to match * any type of stanza. * @sub_type: The subtype of stanza to be handled, or * WOCKY_STANZA_SUB_TYPE_NONE to match any type of stanza. * @priority: a priority between %WOCKY_PORTER_HANDLER_PRIORITY_MIN and * %WOCKY_PORTER_HANDLER_PRIORITY_MAX (often * %WOCKY_PORTER_HANDLER_PRIORITY_NORMAL). Handlers with a higher priority * (larger number) are called first. * @callback: A #WockyPorterHandlerFunc, which should return %FALSE to decline * the stanza (Wocky will continue to the next handler, if any), or %TRUE to * stop further processing. * @user_data: Passed to @callback. * @...: a wocky_stanza_build() specification. The handler * will match a stanza only if the stanza received is a superset of the one * passed to this function, as per wocky_node_is_superset(). * * Registers a handler for incoming stanzas from the local user's server; that * is, stanzas with no "from" attribute, or where the sender is the user's own * bare or full JID. * * For example, to register a handler for roster pushes, call: * * |[ * id = wocky_c2s_porter_register_handler_from_server (porter, * WOCKY_STANZA_TYPE_MESSAGE, WOCKY_STANZA_SUB_TYPE_SET, * WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, roster_push_received_cb, NULL, * '(', * "query", ':', WOCKY_XMPP_NS_ROSTER, * ')', NULL); * ]| * * Returns: a non-zero ID for use with wocky_porter_unregister_handler(). */ guint wocky_c2s_porter_register_handler_from_server ( WockyC2SPorter *self, WockyStanzaType type, WockyStanzaSubType sub_type, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, ...) { va_list ap; guint ret; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (self), 0); va_start (ap, user_data); ret = wocky_c2s_porter_register_handler_from_server_va (self, type, sub_type, priority, callback, user_data, ap); va_end (ap); return ret; } static void wocky_c2s_porter_unregister_handler (WockyPorter *porter, guint id) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; StanzaHandler *handler; handler = g_hash_table_lookup (priv->handlers_by_id, GUINT_TO_POINTER (id)); if (handler == NULL) { g_warning ("Trying to remove an unregistered handler: %u", id); return; } priv->handlers = g_list_remove (priv->handlers, handler); g_hash_table_remove (priv->handlers_by_id, GUINT_TO_POINTER (id)); } /** * wocky_c2s_porter_enable_power_saving_mode: * @porter: a #WockyC2SPorter * @enable: A boolean specifying whether power saving mode should be used * * Enable or disable power saving. In power saving mode, Wocky will * attempt to queue "uninteresting" stanza until it is either manually * flushed, until important stanza arrives, or until the power saving * mode is disabled. * * Queueable stanzas are: * * * <presence/> and * <presence type="unavailable"/>; * PEP updates for a hardcoded list of namespaces. * * * Whenever stanza is handled, all previously queued stanzas * (if any) are handled as well, in the order they arrived. This preserves * stanza ordering. * * Note that exiting the power saving mode will immediately handle any * queued stanzas. */ void wocky_c2s_porter_enable_power_saving_mode (WockyC2SPorter *porter, gboolean enable) { WockyC2SPorterPrivate *priv = porter->priv; if (priv->power_saving_mode && !enable) { flush_unimportant_queue (porter); } priv->power_saving_mode = enable; } static void send_iq_cancelled_cb (GCancellable *cancellable, gpointer user_data) { StanzaIqHandler *handler = (StanzaIqHandler *) user_data; GError error = { G_IO_ERROR, G_IO_ERROR_CANCELLED, "IQ sending was cancelled" }; /* The disconnect should always be disconnected if the result has been * finished */ g_assert (handler->result != NULL); g_simple_async_result_set_from_error (handler->result, &error); g_simple_async_result_complete_in_idle (handler->result); g_object_unref (handler->result); handler->result = NULL; stanza_iq_handler_maybe_remove (handler); } static void iq_sent_cb (GObject *source, GAsyncResult *res, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (source); StanzaIqHandler *handler = (StanzaIqHandler *) user_data; GError *error = NULL; handler->sent = TRUE; if (wocky_c2s_porter_send_finish (WOCKY_PORTER (self), res, &error)) goto finished; /* Raise an error */ if (handler->result != NULL) { GSimpleAsyncResult *r = handler->result; handler->result = NULL; /* Don't want to get cancelled during completion */ stanza_iq_handler_remove_cancellable (handler); g_simple_async_result_set_from_error (r, error); g_simple_async_result_complete (r); g_object_unref (r); } g_error_free (error); finished: stanza_iq_handler_maybe_remove (handler); } static void wocky_c2s_porter_send_iq_async (WockyPorter *porter, WockyStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; StanzaIqHandler *handler; const gchar *recipient; gchar *id = NULL; GSimpleAsyncResult *result; WockyStanzaType type; WockyStanzaSubType sub_type; if (priv->close_result != NULL || priv->force_close_result != NULL) { gchar *node = NULL; g_assert (stanza != NULL && wocky_stanza_get_top_node (stanza) != NULL); node = wocky_node_to_string (wocky_stanza_get_top_node (stanza)); g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing: iq '%s' aborted", node); g_free (node); return; } wocky_stanza_get_type_info (stanza, &type, &sub_type); if (type != WOCKY_STANZA_TYPE_IQ) goto wrong_stanza; if (sub_type != WOCKY_STANZA_SUB_TYPE_GET && sub_type != WOCKY_STANZA_SUB_TYPE_SET) goto wrong_stanza; recipient = wocky_stanza_get_to (stanza); /* Set an unique ID */ do { g_free (id); id = wocky_xmpp_connection_new_id (priv->connection); } while (g_hash_table_lookup (priv->iq_reply_handlers, id) != NULL); wocky_node_set_attribute (wocky_stanza_get_top_node (stanza), "id", id); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_iq_async); handler = stanza_iq_handler_new (self, id, result, cancellable, recipient); if (cancellable != NULL) { handler->cancelled_sig_id = g_cancellable_connect (cancellable, G_CALLBACK (send_iq_cancelled_cb), handler, NULL); } g_hash_table_insert (priv->iq_reply_handlers, id, handler); wocky_c2s_porter_send_async (WOCKY_PORTER (self), stanza, cancellable, iq_sent_cb, handler); return; wrong_stanza: g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_IQ, "Stanza is not an IQ query"); } static WockyStanza * wocky_c2s_porter_send_iq_finish (WockyPorter *self, GAsyncResult *result, GError **error) { WockyStanza *reply; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_send_iq_async), NULL); reply = g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (result)); return g_object_ref (reply); } static void wocky_c2s_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorter *self = WOCKY_C2S_PORTER (porter); WockyC2SPorterPrivate *priv = self->priv; GError err = { WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, "Porter was closed forcibly" }; if (priv->force_close_result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_PENDING, "Another force close operation is pending"); return; } if (priv->receive_cancellable == NULL && priv->local_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSED, "Porter has already been closed"); return; } if (priv->receive_cancellable == NULL && !priv->remote_closed) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_NOT_STARTED, "Porter has not been started"); return; } /* Ensure to keep us alive during the closing */ g_object_ref (self); if (priv->close_result != NULL) { /* Finish pending close operation */ g_simple_async_result_set_from_error (priv->close_result, &err); g_simple_async_result_complete_in_idle (priv->close_result); g_object_unref (priv->close_result); priv->close_result = NULL; } else { /* the "closing" signal has already been fired when _close_async has * been called */ g_signal_emit_by_name (self, "closing"); } priv->force_close_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_force_close_async); g_assert (priv->force_close_cancellable == NULL); if (cancellable != NULL) priv->force_close_cancellable = g_object_ref (cancellable); /* force_close_result now keeps a ref on ourself so we can release the ref * without risking to destroy the object */ g_object_unref (self); /* Terminate all the pending sending operations */ terminate_sending_operations (self, &err); /* Terminate all the pending send IQ operations */ abort_pending_iqs (self, &err); if (priv->remote_closed) { /* forced shutdown in progress. noop */ if (priv->forced_shutdown) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, "Porter is already executing a forced-shutdown"); g_object_unref (priv->force_close_result); priv->force_close_result = NULL; return; } /* No need to wait, close connection right now */ DEBUG ("remote is already closed, close the XMPP connection"); g_object_ref (self); priv->forced_shutdown = TRUE; wocky_xmpp_connection_force_close_async (priv->connection, priv->force_close_cancellable, connection_force_close_cb, self); return; } /* The operation will be completed when: * - the receive operation has been cancelled * - the XMPP connection has been closed */ g_cancellable_cancel (priv->receive_cancellable); } static gboolean wocky_c2s_porter_force_close_finish ( WockyPorter *self, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_c2s_porter_force_close_async), FALSE); return TRUE; } static void send_whitespace_ping_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *res_out = user_data; WockyC2SPorter *self = WOCKY_C2S_PORTER ( g_async_result_get_source_object (G_ASYNC_RESULT (res_out))); WockyC2SPorterPrivate *priv = self->priv; GError *error = NULL; priv->sending_whitespace_ping = FALSE; if (!wocky_xmpp_connection_send_whitespace_ping_finish ( WOCKY_XMPP_CONNECTION (source), res, &error)) { g_simple_async_result_set_from_error (res_out, error); g_simple_async_result_complete (res_out); /* Sending the ping failed; there is no point in trying to send * anything else at this point. */ terminate_sending_operations (self, error); g_error_free (error); } else { g_simple_async_result_complete (res_out); /* Somebody could have tried sending a stanza while we were sending * the ping */ if (g_queue_get_length (priv->sending_queue) > 0) send_head_stanza (self); } close_if_waiting (self); g_object_unref (self); g_object_unref (res_out); } /** * wocky_c2s_porter_send_whitespace_ping_async: * @self: a #WockyC2SPorter * @cancellable: optional GCancellable object, NULL to ignore. * @callback: callback to call when the request is satisfied. * @user_data: the data to pass to callback function. * * Request asynchronous sending of a whitespace ping. When the operation is * finished @callback will be called. You can then call * wocky_c2s_porter_send_whitespace_ping_finish() to get the result of the * operation. * No pings are sent if there are already other stanzas or pings being sent * when this function is called; it would be useless. */ void wocky_c2s_porter_send_whitespace_ping_async (WockyC2SPorter *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyC2SPorterPrivate *priv = self->priv; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_c2s_porter_send_whitespace_ping_async); if (priv->close_result != NULL || priv->force_close_result != NULL) { g_simple_async_result_set_error (result, WOCKY_PORTER_ERROR, WOCKY_PORTER_ERROR_CLOSING, "Porter is closing"); g_simple_async_result_complete_in_idle (result); } else if (sending_in_progress (self)) { g_simple_async_result_complete_in_idle (result); } else { priv->sending_whitespace_ping = TRUE; wocky_xmpp_connection_send_whitespace_ping_async (priv->connection, cancellable, send_whitespace_ping_cb, g_object_ref (result)); g_signal_emit_by_name (self, "sending", NULL); } g_object_unref (result); } /** * wocky_c2s_porter_send_whitespace_ping_finish: * @self: a #WockyC2SPorter * @result: a GAsyncResult. * @error: a GError location to store the error occuring, or NULL to ignore. * * Finishes sending a whitespace ping. * * Returns: TRUE if the ping was succesfully sent, FALSE on error. */ gboolean wocky_c2s_porter_send_whitespace_ping_finish (WockyC2SPorter *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_c2s_porter_send_whitespace_ping_async); } static const gchar * wocky_c2s_porter_get_full_jid (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->full_jid; } static const gchar * wocky_c2s_porter_get_bare_jid (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->bare_jid; } static const gchar * wocky_c2s_porter_get_resource (WockyPorter *porter) { WockyC2SPorter *self; g_return_val_if_fail (WOCKY_IS_C2S_PORTER (porter), NULL); self = (WockyC2SPorter *) porter; return self->priv->resource; } static void wocky_porter_iface_init (gpointer g_iface, gpointer iface_data) { WockyPorterInterface *iface = g_iface; iface->get_full_jid = wocky_c2s_porter_get_full_jid; iface->get_bare_jid = wocky_c2s_porter_get_bare_jid; iface->get_resource = wocky_c2s_porter_get_resource; iface->start = wocky_c2s_porter_start; iface->send_async = wocky_c2s_porter_send_async; iface->send_finish = wocky_c2s_porter_send_finish; iface->register_handler_from_by_stanza = wocky_c2s_porter_register_handler_from_by_stanza; iface->register_handler_from_anyone_by_stanza = wocky_c2s_porter_register_handler_from_anyone_by_stanza; iface->unregister_handler = wocky_c2s_porter_unregister_handler; iface->close_async = wocky_c2s_porter_close_async; iface->close_finish = wocky_c2s_porter_close_finish; iface->send_iq_async = wocky_c2s_porter_send_iq_async; iface->send_iq_finish = wocky_c2s_porter_send_iq_finish; iface->force_close_async = wocky_c2s_porter_force_close_async; iface->force_close_finish = wocky_c2s_porter_force_close_finish; } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-disco-identity.h0000644000175000017500000000460612735676345026210 0ustar00gkiagiagkiagia00000000000000/* * wocky-disco-identity.h — utility API representing a Disco Identity * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_DISCO_IDENTITY_H__ #define __WOCKY_DISCO_IDENTITY_H__ #include G_BEGIN_DECLS typedef struct _WockyDiscoIdentity WockyDiscoIdentity; /** * WockyDiscoIdentity: * @category: the identity category * @type: the identity type * @lang: the identity language * @name: the identity name * * A structure used to hold information regarding an identity from a * disco reply as described in XEP-0030. */ struct _WockyDiscoIdentity { gchar *category; gchar *type; gchar *lang; gchar *name; }; #define WOCKY_TYPE_DISCO_IDENTITY (wocky_disco_identity_get_type ()) GType wocky_disco_identity_get_type (void); WockyDiscoIdentity *wocky_disco_identity_new (const gchar *category, const gchar *type, const gchar *lang, const gchar *name) G_GNUC_WARN_UNUSED_RESULT; WockyDiscoIdentity *wocky_disco_identity_copy ( const WockyDiscoIdentity *source) G_GNUC_WARN_UNUSED_RESULT; void wocky_disco_identity_free (WockyDiscoIdentity *identity); gint wocky_disco_identity_cmp (WockyDiscoIdentity *left, WockyDiscoIdentity *right); /* array of WockyDiscoIdentity helper methods */ GPtrArray * wocky_disco_identity_array_new (void) G_GNUC_WARN_UNUSED_RESULT; GPtrArray * wocky_disco_identity_array_copy (const GPtrArray *source) G_GNUC_WARN_UNUSED_RESULT; void wocky_disco_identity_array_free (GPtrArray *arr); G_END_DECLS #endif /* #ifndef __WOCKY_DISCO_IDENTITY_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-pubsub-service.h0000644000175000017500000001177412735676345026222 0ustar00gkiagiagkiagia00000000000000/* * wocky-pubsub-service.h - Header of WockyPubsubService * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_PUBSUB_SERVICE_H__ #define __WOCKY_PUBSUB_SERVICE_H__ #include #include #include "wocky-enumtypes.h" #include "wocky-stanza.h" #include "wocky-session.h" #include "wocky-types.h" #include "wocky-data-form.h" G_BEGIN_DECLS typedef struct _WockyPubsubService WockyPubsubService; typedef struct _WockyPubsubServiceClass WockyPubsubServiceClass; typedef struct _WockyPubsubServicePrivate WockyPubsubServicePrivate; /** * WockyPubsubServiceError: * @WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY: A wrong reply was received * * #WockyPubsubService specific errors. */ typedef enum { WOCKY_PUBSUB_SERVICE_ERROR_WRONG_REPLY, } WockyPubsubServiceError; GQuark wocky_pubsub_service_error_quark (void); #define WOCKY_PUBSUB_SERVICE_ERROR (wocky_pubsub_service_error_quark ()) struct _WockyPubsubServiceClass { GObjectClass parent_class; GType node_object_type; }; struct _WockyPubsubService { GObject parent; WockyPubsubServicePrivate *priv; }; GType wocky_pubsub_service_get_type (void); #define WOCKY_TYPE_PUBSUB_SERVICE \ (wocky_pubsub_service_get_type ()) #define WOCKY_PUBSUB_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubService)) #define WOCKY_PUBSUB_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubServiceClass)) #define WOCKY_IS_PUBSUB_SERVICE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_PUBSUB_SERVICE)) #define WOCKY_IS_PUBSUB_SERVICE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_PUBSUB_SERVICE)) #define WOCKY_PUBSUB_SERVICE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_PUBSUB_SERVICE, \ WockyPubsubServiceClass)) WockyPubsubService * wocky_pubsub_service_new (WockySession *session, const gchar *jid); WockyPubsubNode * wocky_pubsub_service_ensure_node (WockyPubsubService *self, const gchar *name); WockyPubsubNode * wocky_pubsub_service_lookup_node (WockyPubsubService *self, const gchar *name); void wocky_pubsub_service_get_default_node_configuration_async ( WockyPubsubService *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyDataForm * wocky_pubsub_service_get_default_node_configuration_finish ( WockyPubsubService *self, GAsyncResult *result, GError **error); void wocky_pubsub_service_retrieve_subscriptions_async ( WockyPubsubService *self, WockyPubsubNode *node, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_pubsub_service_retrieve_subscriptions_finish ( WockyPubsubService *self, GAsyncResult *result, GList **subscriptions, GError **error); void wocky_pubsub_service_create_node_async (WockyPubsubService *self, const gchar *name, WockyDataForm *config, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyPubsubNode * wocky_pubsub_service_create_node_finish ( WockyPubsubService *self, GAsyncResult *result, GError **error); /*< prefix=WOCKY_PUBSUB_SUBSCRIPTION >*/ typedef enum { WOCKY_PUBSUB_SUBSCRIPTION_NONE, WOCKY_PUBSUB_SUBSCRIPTION_PENDING, WOCKY_PUBSUB_SUBSCRIPTION_SUBSCRIBED, WOCKY_PUBSUB_SUBSCRIPTION_UNCONFIGURED } WockyPubsubSubscriptionState; typedef struct { /*< public >*/ WockyPubsubNode *node; gchar *jid; WockyPubsubSubscriptionState state; gchar *subid; } WockyPubsubSubscription; #define WOCKY_TYPE_PUBSUB_SUBSCRIPTION \ (wocky_pubsub_subscription_get_type ()) GType wocky_pubsub_subscription_get_type (void); WockyPubsubSubscription *wocky_pubsub_subscription_new ( WockyPubsubNode *node, const gchar *jid, WockyPubsubSubscriptionState state, const gchar *subid); WockyPubsubSubscription *wocky_pubsub_subscription_copy ( WockyPubsubSubscription *sub); void wocky_pubsub_subscription_free (WockyPubsubSubscription *sub); GList *wocky_pubsub_subscription_list_copy (GList *subs); void wocky_pubsub_subscription_list_free (GList *subs); G_END_DECLS #endif /* __WOCKY_PUBSUB_SERVICE_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-types.h0000644000175000017500000000257612735676345024430 0ustar00gkiagiagkiagia00000000000000/* * wocky-contact.h - Header for Wocky type definitions * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_TYPES_H__ #define __WOCKY_TYPES_H__ #include G_BEGIN_DECLS typedef struct _WockyBareContact WockyBareContact; typedef struct _WockyLLContact WockyLLContact; typedef struct _WockyNodeTree WockyNodeTree; typedef struct _WockyResourceContact WockyResourceContact; typedef struct _WockySession WockySession; typedef struct _WockyPubsubNode WockyPubsubNode; G_END_DECLS #endif /* #ifndef __WOCKY_TYPES_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-jabber-auth-digest.h0000644000175000017500000000301712735676345026714 0ustar00gkiagiagkiagia00000000000000#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef _WOCKY_JABBER_AUTH_DIGEST_H #define _WOCKY_JABBER_AUTH_DIGEST_H #include #include "wocky-auth-handler.h" G_BEGIN_DECLS #define WOCKY_TYPE_JABBER_AUTH_DIGEST wocky_jabber_auth_digest_get_type() #define WOCKY_JABBER_AUTH_DIGEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigest)) #define WOCKY_JABBER_AUTH_DIGEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigestClass)) #define WOCKY_IS_JABBER_AUTH_DIGEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST)) #define WOCKY_IS_JABBER_AUTH_DIGEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), WOCKY_TYPE_JABBER_AUTH_DIGEST)) #define WOCKY_JABBER_AUTH_DIGEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_JABBER_AUTH_DIGEST, \ WockyJabberAuthDigestClass)) typedef struct _WockyJabberAuthDigestPrivate WockyJabberAuthDigestPrivate; typedef struct { /**/ GObject parent; WockyJabberAuthDigestPrivate *priv; } WockyJabberAuthDigest; typedef struct { /**/ GObjectClass parent_class; } WockyJabberAuthDigestClass; GType wocky_jabber_auth_digest_get_type (void); WockyJabberAuthDigest *wocky_jabber_auth_digest_new ( const gchar *server, const gchar *password); G_END_DECLS #endif /* defined _WOCKY_JABBER_AUTH_DIGEST_H */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-roster.h0000644000175000017500000001411012735676345024565 0ustar00gkiagiagkiagia00000000000000/* * wocky-roster.h - Header for WockyRoster * Copyright (C) 2009 Collabora Ltd. * @author Jonny Lamb * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_ROSTER_H__ #define __WOCKY_ROSTER_H__ #include #include "wocky-types.h" #include "wocky-xmpp-connection.h" G_BEGIN_DECLS typedef struct _WockyRoster WockyRoster; /** * WockyRosterClass: * * The class of a #WockyRoster. */ typedef struct _WockyRosterClass WockyRosterClass; typedef struct _WockyRosterPrivate WockyRosterPrivate; GQuark wocky_roster_error_quark (void); struct _WockyRosterClass { /**/ GObjectClass parent_class; }; struct _WockyRoster { /**/ GObject parent; WockyRosterPrivate *priv; }; GType wocky_roster_get_type (void); #define WOCKY_TYPE_ROSTER \ (wocky_roster_get_type ()) #define WOCKY_ROSTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_ROSTER, \ WockyRoster)) #define WOCKY_ROSTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_ROSTER, \ WockyRosterClass)) #define WOCKY_IS_ROSTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_ROSTER)) #define WOCKY_IS_ROSTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_ROSTER)) #define WOCKY_ROSTER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_ROSTER, \ WockyRosterClass)) /** * WockyRosterSubscriptionFlags: * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE: the user does not have a * subscription to the contact's presence information, and the * contact does not have a subscription to the user's presence * information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO: the user has a subscription to * the contact's presence information, but the contact does not have * a subscription to the user's presence information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM: the contact has a * subscription to the user's presence information, but the user * does not have a subscription to the contact's presence * information * @WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH: both the user and the contact * have subscriptions to each other's presence information * * Flags to document the subscription information between contacts. */ typedef enum { WOCKY_ROSTER_SUBSCRIPTION_TYPE_NONE = 0, WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO = 1 << 0, WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM = 1 << 1, WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH = WOCKY_ROSTER_SUBSCRIPTION_TYPE_TO | WOCKY_ROSTER_SUBSCRIPTION_TYPE_FROM, /*< private >*/ LAST_WOCKY_ROSTER_SUBSCRIPTION_TYPE = WOCKY_ROSTER_SUBSCRIPTION_TYPE_BOTH } WockyRosterSubscriptionFlags; /** * WockyRosterError: * @WOCKY_ROSTER_ERROR_INVALID_STANZA : received an invalid roster stanza * from the server * @WOCKY_ROSTER_ERROR_NOT_IN_ROSTER : the contact is not in the roster * * The #WockyRosterError specific errors. */ typedef enum { WOCKY_ROSTER_ERROR_INVALID_STANZA, WOCKY_ROSTER_ERROR_NOT_IN_ROSTER, } WockyRosterError; GQuark wocky_roster_error_quark (void); /** * WOCKY_ROSTER_ERROR: * * Get access to the error quark of the roster. */ #define WOCKY_ROSTER_ERROR (wocky_roster_error_quark ()) WockyRoster * wocky_roster_new (WockySession *session); void wocky_roster_fetch_roster_async (WockyRoster *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_fetch_roster_finish (WockyRoster *self, GAsyncResult *result, GError **error); WockyBareContact * wocky_roster_get_contact (WockyRoster *self, const gchar *jid); GSList * wocky_roster_get_all_contacts (WockyRoster *self); void wocky_roster_add_contact_async (WockyRoster *self, const gchar *jid, const gchar *name, const gchar * const * groups, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_add_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_remove_contact_async (WockyRoster *self, WockyBareContact *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_remove_contact_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_change_contact_name_async (WockyRoster *self, WockyBareContact *contact, const gchar *name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_change_contact_name_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_contact_add_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_contact_add_group_finish (WockyRoster *self, GAsyncResult *result, GError **error); void wocky_roster_contact_remove_group_async (WockyRoster *self, WockyBareContact *contact, const gchar *group, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_roster_contact_remove_group_finish (WockyRoster *self, GAsyncResult *result, GError **error); /* For debugging only */ const gchar * wocky_roster_subscription_to_string ( WockyRosterSubscriptionFlags subscription); G_END_DECLS #endif /* #ifndef __WOCKY_ROSTER_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-xep-0115-capabilities.h0000644000175000017500000000514112735676345027062 0ustar00gkiagiagkiagia00000000000000/* * wocky-xep-0115-capabilities.h - interface for holding capabilities * of contacts * * Copyright (C) 2011-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XEP_0115_CAPABILITIES_H__ #define __WOCKY_XEP_0115_CAPABILITIES_H__ #include G_BEGIN_DECLS #define WOCKY_TYPE_XEP_0115_CAPABILITIES \ (wocky_xep_0115_capabilities_get_type ()) #define WOCKY_XEP_0115_CAPABILITIES(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ WOCKY_TYPE_XEP_0115_CAPABILITIES, WockyXep0115Capabilities)) #define WOCKY_IS_XEP_0115_CAPABILITIES(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ WOCKY_TYPE_XEP_0115_CAPABILITIES)) #define WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ WOCKY_TYPE_XEP_0115_CAPABILITIES, WockyXep0115CapabilitiesInterface)) typedef struct _WockyXep0115Capabilities WockyXep0115Capabilities; typedef struct _WockyXep0115CapabilitiesInterface WockyXep0115CapabilitiesInterface; /* virtual methods */ typedef const GPtrArray * (*WockyXep0115CapabilitiesGetDataFormsFunc) ( WockyXep0115Capabilities *contact); typedef gboolean (*WockyXep0115CapabilitiesHasFeatureFunc) ( WockyXep0115Capabilities *contact, const gchar *feature); const GPtrArray * wocky_xep_0115_capabilities_get_data_forms ( WockyXep0115Capabilities *contact); gboolean wocky_xep_0115_capabilities_has_feature ( WockyXep0115Capabilities *contact, const gchar *feature); struct _WockyXep0115CapabilitiesInterface { GTypeInterface parent; /* TODO: capability enumeration and identities! */ WockyXep0115CapabilitiesGetDataFormsFunc get_data_forms; WockyXep0115CapabilitiesHasFeatureFunc has_feature; }; GType wocky_xep_0115_capabilities_get_type (void); G_END_DECLS #endif /* WOCKY_XEP_0115_CAPABILITIES_H */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-xmpp-writer.c0000644000175000017500000003427012735676345025551 0ustar00gkiagiagkiagia00000000000000/* * wocky-xmpp-writer.c - Source for WockyXmppWriter * Copyright (C) 2006-2009 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-xmpp-writer * @title: WockyXmppWriter * @short_description: Xmpp stanza to XML serializer * * The #WockyXmppWriter serializes #WockyStanzas and XMPP stream opening * and closing to raw XML. The various functions provide a pointer to an * internal buffer, which remains valid until the next call to the writer. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "wocky-xmpp-writer.h" G_DEFINE_TYPE (WockyXmppWriter, wocky_xmpp_writer, G_TYPE_OBJECT) #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_XMPP_WRITER #include "wocky-debug-internal.h" /* properties */ enum { PROP_STREAMING_MODE = 1, }; /* private structure */ struct _WockyXmppWriterPrivate { gboolean dispose_has_run; xmlTextWriterPtr xmlwriter; GQuark current_ns; GQuark stream_ns; gboolean stream_mode; xmlBufferPtr buffer; }; static void wocky_xmpp_writer_init (WockyXmppWriter *self) { WockyXmppWriterPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_XMPP_WRITER, WockyXmppWriterPrivate); priv = self->priv; priv->current_ns = 0; priv->stream_ns = 0; priv->buffer = xmlBufferCreate (); priv->xmlwriter = xmlNewTextWriterMemory (priv->buffer, 0); priv->stream_mode = TRUE; /* xmlTextWriterSetIndent (priv->xmlwriter, 1); */ } static void wocky_xmpp_writer_dispose (GObject *object); static void wocky_xmpp_writer_finalize (GObject *object); static void wocky_xmpp_write_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void wocky_xmpp_write_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void wocky_xmpp_writer_class_init (WockyXmppWriterClass *wocky_xmpp_writer_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_xmpp_writer_class); GParamSpec *param_spec; g_type_class_add_private (wocky_xmpp_writer_class, sizeof (WockyXmppWriterPrivate)); object_class->dispose = wocky_xmpp_writer_dispose; object_class->finalize = wocky_xmpp_writer_finalize; object_class->set_property = wocky_xmpp_write_set_property; object_class->get_property = wocky_xmpp_write_get_property; param_spec = g_param_spec_boolean ("streaming-mode", "streaming-mode", "Whether the xml to be written is one big stream or separate documents", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STREAMING_MODE, param_spec); } void wocky_xmpp_writer_dispose (GObject *object) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->dispose) G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->dispose (object); } void wocky_xmpp_writer_finalize (GObject *object) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = self->priv; /* free any data held directly by the object here */ xmlFreeTextWriter (priv->xmlwriter); xmlBufferFree (priv->buffer); G_OBJECT_CLASS (wocky_xmpp_writer_parent_class)->finalize (object); } static void wocky_xmpp_write_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyXmppWriter *writer = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = writer->priv; switch (property_id) { case PROP_STREAMING_MODE: priv->stream_mode = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_xmpp_write_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyXmppWriter *writer = WOCKY_XMPP_WRITER (object); WockyXmppWriterPrivate *priv = writer->priv; switch (property_id) { case PROP_STREAMING_MODE: g_value_set_boolean (value, priv->stream_mode); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /** * wocky_xmpp_writer_new * * Convenience function to create a new #WockyXmppWriter. * * Returns: a new #WockyXmppWriter */ WockyXmppWriter * wocky_xmpp_writer_new (void) { return g_object_new (WOCKY_TYPE_XMPP_WRITER, NULL); } /** * wocky_xmpp_writer_new_no_stream * * Convenience function to create a new #WockyXmppWriter that has streaming * mode disabled. * * Returns: a new #WockyXmppWriter in non-streaming mode */ WockyXmppWriter * wocky_xmpp_writer_new_no_stream (void) { return g_object_new (WOCKY_TYPE_XMPP_WRITER, "streaming-mode", FALSE, NULL); } /** * wocky_xmpp_writer_stream_open: * @writer: a WockyXmppWriter * @to: the target of the stream opening (usually the xmpp server name) * @from: the sender of the stream opening (usually the jid of the client) * @version: XMPP version * @lang: default XMPP stream language * @id: XMPP Stream ID, if any, or NULL * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Create the XML opening header of an XMPP stream. The result is available in * the @data buffer. The buffer is only valid until the next call to a function * the writer. * * This function can only be called in streaming mode. */ void wocky_xmpp_writer_stream_open (WockyXmppWriter *writer, const gchar *to, const gchar *from, const gchar *version, const gchar *lang, const gchar *id, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; g_assert (priv->stream_mode); xmlBufferEmpty (priv->buffer); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *) "\n" \ "xmlwriter, (xmlChar *)" to=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) to); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (from != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" from=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) from); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (version != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" version=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) version); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (lang != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" xml:lang=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) lang); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } if (id != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)" id=\""); xmlTextWriterFlush (priv->xmlwriter); xmlAttrSerializeTxtContent (priv->buffer, NULL, NULL, (xmlChar *) id); xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *)"\""); } xmlTextWriterWriteString (priv->xmlwriter, (xmlChar *) ">\n"); xmlTextWriterFlush (priv->xmlwriter); *data = (const guint8 *)priv->buffer->content; *length = priv->buffer->use; /* Set the magic known namespaces */ priv->current_ns = g_quark_from_string ("jabber:client"); priv->stream_ns = g_quark_from_string ("http://etherx.jabber.org/streams"); DEBUG ("Writing stream opening: %.*s", (int) *length, *data); } /** * wocky_xmpp_writer_stream_close: * @writer: a WockyXmppWriter * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Create the XML closing footer of an XMPP stream . The result is available * in the @data buffer. The buffer is only valid until the next call to a * function * * This function can only be called in streaming mode. */ void wocky_xmpp_writer_stream_close (WockyXmppWriter *writer, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; static const guint8 *close = (const guint8 *)"\n"; g_assert (priv->stream_mode); *data = close; *length = strlen ((gchar *) close); DEBUG ("Writing stream close: %.*s", (int) *length, *data); } static void _xml_write_node (WockyXmppWriter *writer, WockyNode *node); static gboolean _write_attr (const gchar *key, const gchar *value, const gchar *prefix, const gchar *ns, gpointer user_data) { WockyXmppWriter *self = WOCKY_XMPP_WRITER (user_data); WockyXmppWriterPrivate *priv = self->priv; GQuark attrns = 0; if (ns != NULL) { attrns = g_quark_from_string (ns); } if (attrns == 0 || attrns == priv->current_ns) { xmlTextWriterWriteAttribute (priv->xmlwriter, (const xmlChar *)key, (const xmlChar *)value); } else if (attrns == priv->stream_ns) { xmlTextWriterWriteAttributeNS (priv->xmlwriter, (const xmlChar *)"stream", (const xmlChar *)key, (const xmlChar *)NULL, (const xmlChar *)value); } else { xmlTextWriterWriteAttributeNS (priv->xmlwriter, (const xmlChar *)prefix, (const xmlChar *)key, (const xmlChar *)ns, (const xmlChar *)value); } return TRUE; } static gboolean _write_child (WockyNode *node, gpointer user_data) { _xml_write_node (WOCKY_XMPP_WRITER (user_data), node); return TRUE; } static void _xml_write_node (WockyXmppWriter *writer, WockyNode *node) { const gchar *l; GQuark oldns; WockyXmppWriterPrivate *priv = writer->priv; oldns = priv->current_ns; if (node->ns == 0 || oldns == node->ns) { /* Another element in the current namespace */ xmlTextWriterStartElement (priv->xmlwriter, (const xmlChar*) node->name); } else if (node->ns == priv->stream_ns) { xmlTextWriterStartElementNS(priv->xmlwriter, (const xmlChar *) "stream", (const xmlChar *) node->name, NULL); } else { priv->current_ns = node->ns; xmlTextWriterStartElementNS (priv->xmlwriter, NULL, (const xmlChar *) node->name, (const xmlChar *) wocky_node_get_ns (node)); } wocky_node_each_attribute (node, _write_attr, writer); l = wocky_node_get_language (node); if (l != NULL) { xmlTextWriterWriteAttributeNS(priv->xmlwriter, (const xmlChar *)"xml", (const xmlChar *)"lang", NULL, (const xmlChar *)l); } wocky_node_each_child (node, _write_child, writer); if (node->content != NULL) { xmlTextWriterWriteString (priv->xmlwriter, (const xmlChar*)node->content); } xmlTextWriterEndElement (priv->xmlwriter); priv->current_ns = oldns; } static void _write_node_tree (WockyXmppWriter *writer, WockyNodeTree *tree, const guint8 **data, gsize *length) { WockyXmppWriterPrivate *priv = writer->priv; xmlBufferEmpty (priv->buffer); DEBUG_NODE_TREE (tree, "Serializing tree:"); if (!priv->stream_mode) { xmlTextWriterStartDocument (priv->xmlwriter, "1.0", "utf-8", NULL); } _xml_write_node (writer, wocky_node_tree_get_top_node (tree)); if (!priv->stream_mode) { xmlTextWriterEndDocument (priv->xmlwriter); } xmlTextWriterFlush (priv->xmlwriter); *data = (const guint8 *)priv->buffer->content; *length = priv->buffer->use; #ifdef ENABLE_DEBUG wocky_debug (WOCKY_DEBUG_NET, "Writing xml: %.*s", (int)*length, *data); #endif } /** * wocky_xmpp_writer_write_stanza: * @writer: a WockyXmppWriter * @stanza: the stanza to serialize * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Serialize the @stanza to XML. The result is available in the * @data buffer. The buffer is only valid until the next call to a function */ void wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer, WockyStanza *stanza, const guint8 **data, gsize *length) { _write_node_tree (writer, WOCKY_NODE_TREE (stanza), data, length); } /** * wocky_xmpp_writer_write_node_tree: * @writer: a WockyXmppWriter * @tree: the node tree to serialize * @data: location to store a pointer to the data buffer * @length: length of the data buffer * * Serialize the @tree to XML. The result is available in the * @data buffer. The buffer is only valid until the next call to a function. * This function may only be called in non-streaming mode. */ void wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer, WockyNodeTree *tree, const guint8 **data, gsize *length) { *data = NULL; *length = 0; g_return_if_fail (!writer->priv->stream_mode); _write_node_tree (writer, tree, data, length); } /** * wocky_xmpp_writer_flush: * @writer: a WockyXmppWriter * * Flushes and frees the internal data buffer */ void wocky_xmpp_writer_flush (WockyXmppWriter *writer) { WockyXmppWriterPrivate *priv = writer->priv; xmlBufferFree (priv->buffer); priv->buffer = xmlBufferCreate (); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-loopback-stream.c0000644000175000017500000003532512735676345026340 0ustar00gkiagiagkiagia00000000000000/* * wocky-loopback-stream.c - Source for WockyLoopbackStream * Copyright (C) 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "wocky-loopback-stream.h" enum { PROP_IO_INPUT_STREAM = 1, PROP_IO_OUTPUT_STREAM }; static GType wocky_loopback_input_stream_get_type (void); static GType wocky_loopback_output_stream_get_type (void); struct _WockyLoopbackStreamPrivate { GInputStream *input; GOutputStream *output; }; typedef struct { GOutputStream parent; GAsyncQueue *queue; GError *write_error /* no, this is not a coding style violation */; gboolean dispose_has_run; } WockyLoopbackOutputStream; typedef struct { GOutputStreamClass parent_class; } WockyLoopbackOutputStreamClass; typedef struct { GInputStream parent; GAsyncQueue *queue; guint offset; GArray *out_array; GSimpleAsyncResult *read_result; GCancellable *read_cancellable; gulong read_cancellable_sig_id; void *buffer; gsize count; GError *read_error /* no, this is not a coding style violation */; gboolean dispose_has_run; } WockyLoopbackInputStream; typedef struct { GOutputStreamClass parent_class; } WockyLoopbackInputStreamClass; G_DEFINE_TYPE (WockyLoopbackStream, wocky_loopback_stream, G_TYPE_IO_STREAM); G_DEFINE_TYPE (WockyLoopbackInputStream, wocky_loopback_input_stream, G_TYPE_INPUT_STREAM); G_DEFINE_TYPE (WockyLoopbackOutputStream, wocky_loopback_output_stream, G_TYPE_OUTPUT_STREAM); #define WOCKY_TYPE_LOOPBACK_INPUT_STREAM (wocky_loopback_input_stream_get_type ()) #define WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM (wocky_loopback_output_stream_get_type ()) #define WOCKY_LOOPBACK_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_LOOPBACK_INPUT_STREAM, \ WockyLoopbackInputStream)) #define WOCKY_LOOPBACK_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM, \ WockyLoopbackOutputStream)) static gboolean wocky_loopback_input_stream_try_read (WockyLoopbackInputStream *self); static void output_data_written_cb (GOutputStream *output, WockyLoopbackInputStream *input_stream) { wocky_loopback_input_stream_try_read (input_stream); } /* connection */ static void wocky_loopback_stream_init (WockyLoopbackStream *self) { WockyLoopbackStreamPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_LOOPBACK_STREAM, WockyLoopbackStreamPrivate); priv = self->priv; priv->output = g_object_new (WOCKY_TYPE_LOOPBACK_OUTPUT_STREAM, NULL); priv->input = g_object_new (WOCKY_TYPE_LOOPBACK_INPUT_STREAM, NULL); WOCKY_LOOPBACK_INPUT_STREAM (priv->input)->queue = g_async_queue_ref ( WOCKY_LOOPBACK_OUTPUT_STREAM (priv->output)->queue); g_signal_connect (priv->output, "data-written", G_CALLBACK (output_data_written_cb), priv->input); } static void wocky_loopback_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyLoopbackStream *self = WOCKY_LOOPBACK_STREAM (object); WockyLoopbackStreamPrivate *priv = self->priv; switch (property_id) { case PROP_IO_INPUT_STREAM: g_value_set_object (value, priv->input); break; case PROP_IO_OUTPUT_STREAM: g_value_set_object (value, priv->output); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_loopback_stream_dispose (GObject *object) { WockyLoopbackStream *self = WOCKY_LOOPBACK_STREAM (object); WockyLoopbackStreamPrivate *priv = self->priv; if (G_OBJECT_CLASS (wocky_loopback_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_stream_parent_class)->dispose (object); g_object_unref (priv->input); g_object_unref (priv->output); } static GInputStream * wocky_loopback_stream_get_input_stream (GIOStream *stream) { return WOCKY_LOOPBACK_STREAM (stream)->priv->input; } static GOutputStream * wocky_loopback_stream_get_output_stream (GIOStream *stream) { return WOCKY_LOOPBACK_STREAM (stream)->priv->output; } static void wocky_loopback_stream_class_init ( WockyLoopbackStreamClass *wocky_loopback_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_stream_class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS ( wocky_loopback_stream_class); g_type_class_add_private (wocky_loopback_stream_class, sizeof (WockyLoopbackStreamPrivate)); obj_class->dispose = wocky_loopback_stream_dispose; obj_class->get_property = wocky_loopback_stream_get_property; stream_class->get_input_stream = wocky_loopback_stream_get_input_stream; stream_class->get_output_stream = wocky_loopback_stream_get_output_stream; g_object_class_install_property (obj_class, PROP_IO_INPUT_STREAM, g_param_spec_object ("input-stream", "Input stream", "the input stream", G_TYPE_INPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (obj_class, PROP_IO_OUTPUT_STREAM, g_param_spec_object ("output-stream", "Output stream", "the output stream", G_TYPE_OUTPUT_STREAM, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); } GIOStream * wocky_loopback_stream_new (void) { return g_object_new (WOCKY_TYPE_LOOPBACK_STREAM, NULL); } /* Input stream */ static gssize wocky_loopback_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); gsize written = 0; if (self->out_array == NULL) { g_assert (self->offset == 0); self->out_array = g_async_queue_pop (self->queue); } do { gsize towrite; if (self->offset == 0) { towrite = MIN (count - written, MAX (self->out_array->len/2, 1)); } else { towrite = MIN (count - written, self->out_array->len - self->offset); } memcpy ((guchar *) buffer + written, self->out_array->data + self->offset, towrite); self->offset += towrite; written += towrite; if (self->offset == self->out_array->len) { g_array_unref (self->out_array); self->out_array = g_async_queue_try_pop (self->queue); self->offset = 0; } else { break; } } while (written < count && self->out_array != NULL); return written; } static void read_async_complete (WockyLoopbackInputStream *self) { GSimpleAsyncResult *r = self->read_result; if (self->read_cancellable != NULL) { g_signal_handler_disconnect (self->read_cancellable, self->read_cancellable_sig_id); g_object_unref (self->read_cancellable); self->read_cancellable = NULL; } self->read_result = NULL; g_simple_async_result_complete_in_idle (r); g_object_unref (r); } static void read_cancelled_cb (GCancellable *cancellable, WockyLoopbackInputStream *self) { g_simple_async_result_set_error (self->read_result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Reading cancelled"); self->buffer = NULL; read_async_complete (self); } static void wocky_loopback_input_stream_read_async (GInputStream *stream, void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); g_assert (self->buffer == NULL); g_assert (self->read_result == NULL); g_assert (self->read_cancellable == NULL); self->buffer = buffer; self->count = count; self->read_result = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_loopback_input_stream_read_async); if (self->read_error != NULL) { g_simple_async_result_set_from_error (self->read_result, self->read_error); g_error_free (self->read_error); self->read_error = NULL; read_async_complete (self); return; } if (cancellable != NULL) { self->read_cancellable = g_object_ref (cancellable); self->read_cancellable_sig_id = g_signal_connect (cancellable, "cancelled", G_CALLBACK (read_cancelled_cb), self); } wocky_loopback_input_stream_try_read (self); } static gssize wocky_loopback_input_stream_read_finish (GInputStream *stream, GAsyncResult *result, GError **error) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (stream); gssize len = -1; if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) goto out; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_loopback_input_stream_read_async), -1); len = wocky_loopback_input_stream_read (stream, self->buffer, self->count, NULL, error); out: self->buffer = NULL; return len; } static gboolean wocky_loopback_input_stream_try_read (WockyLoopbackInputStream *self) { if (self->read_result == NULL) /* No pending read operation */ return FALSE; if (self->out_array == NULL && g_async_queue_length (self->queue) == 0) return FALSE; read_async_complete (self); return TRUE; } static void wocky_loopback_input_stream_init (WockyLoopbackInputStream *self) { } static void wocky_loopback_input_stream_dispose (GObject *object) { WockyLoopbackInputStream *self = WOCKY_LOOPBACK_INPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; if (self->out_array != NULL) g_array_unref (self->out_array); self->out_array = NULL; if (self->queue != NULL) g_async_queue_unref (self->queue); self->queue = NULL; g_warn_if_fail (self->read_result == NULL); g_warn_if_fail (self->read_cancellable == NULL); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_loopback_input_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_input_stream_parent_class)->dispose (object); } static void wocky_loopback_input_stream_class_init ( WockyLoopbackInputStreamClass *wocky_loopback_input_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_input_stream_class); GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (wocky_loopback_input_stream_class); obj_class->dispose = wocky_loopback_input_stream_dispose; stream_class->read_fn = wocky_loopback_input_stream_read; stream_class->read_async = wocky_loopback_input_stream_read_async; stream_class->read_finish = wocky_loopback_input_stream_read_finish; } /* Output stream */ enum { OUTPUT_DATA_WRITTEN, LAST_SIGNAL }; static guint output_signals[LAST_SIGNAL] = {0}; static gssize wocky_loopback_output_stream_write (GOutputStream *stream, const void *buffer, gsize count, GCancellable *cancellable, GError **error) { WockyLoopbackOutputStream *self = WOCKY_LOOPBACK_OUTPUT_STREAM (stream); GArray *data; data = g_array_sized_new (FALSE, FALSE, sizeof (guint8), count); g_array_insert_vals (data, 0, buffer, count); g_async_queue_push (self->queue, data); g_signal_emit (self, output_signals[OUTPUT_DATA_WRITTEN], 0); return count; } static void wocky_loopback_output_stream_write_async (GOutputStream *stream, const void *buffer, gsize count, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; GError *error = NULL; gssize result; result = wocky_loopback_output_stream_write (stream, buffer, count, cancellable, &error); simple = g_simple_async_result_new (G_OBJECT (stream), callback, user_data, wocky_loopback_output_stream_write_async); if (result == -1) { g_simple_async_result_set_from_error (simple, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gssize (simple, result); } g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static gssize wocky_loopback_output_stream_write_finish (GOutputStream *stream, GAsyncResult *result, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) return -1; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (stream), wocky_loopback_output_stream_write_async), -1); return g_simple_async_result_get_op_res_gssize ( G_SIMPLE_ASYNC_RESULT (result)); } static void wocky_loopback_output_stream_dispose (GObject *object) { WockyLoopbackOutputStream *self = WOCKY_LOOPBACK_OUTPUT_STREAM (object); if (self->dispose_has_run) return; self->dispose_has_run = TRUE; g_async_queue_push (self->queue, g_array_sized_new (FALSE, FALSE, sizeof (guint8), 0)); g_async_queue_unref (self->queue); /* release any references held by the object here */ if (G_OBJECT_CLASS (wocky_loopback_output_stream_parent_class)->dispose) G_OBJECT_CLASS (wocky_loopback_output_stream_parent_class)->dispose (object); } static void queue_destroyed (gpointer data) { g_array_free ((GArray *) data, TRUE); } static void wocky_loopback_output_stream_init (WockyLoopbackOutputStream *self) { self->queue = g_async_queue_new_full (queue_destroyed); } static void wocky_loopback_output_stream_class_init ( WockyLoopbackOutputStreamClass *wocky_loopback_output_stream_class) { GObjectClass *obj_class = G_OBJECT_CLASS (wocky_loopback_output_stream_class); GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (wocky_loopback_output_stream_class); obj_class->dispose = wocky_loopback_output_stream_dispose; stream_class->write_fn = wocky_loopback_output_stream_write; stream_class->write_async = wocky_loopback_output_stream_write_async; stream_class->write_finish = wocky_loopback_output_stream_write_finish; output_signals[OUTPUT_DATA_WRITTEN] = g_signal_new ("data-written", G_OBJECT_CLASS_TYPE(wocky_loopback_output_stream_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-ll-contact.h0000644000175000017500000000507212735676345025316 0ustar00gkiagiagkiagia00000000000000/* * wocky-ll-contact.h - Header for WockyLLContact * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_LL_CONTACT_H__ #define __WOCKY_LL_CONTACT_H__ #include #include #include "wocky-types.h" #include "wocky-contact.h" G_BEGIN_DECLS typedef struct _WockyLLContactClass WockyLLContactClass; typedef struct _WockyLLContactPrivate WockyLLContactPrivate; typedef GList * (*WockyLLContactGetAddressesImpl) (WockyLLContact *); struct _WockyLLContactClass { WockyContactClass parent_class; WockyLLContactGetAddressesImpl get_addresses; }; struct _WockyLLContact { WockyContact parent; WockyLLContactPrivate *priv; }; GType wocky_ll_contact_get_type (void); #define WOCKY_TYPE_LL_CONTACT \ (wocky_ll_contact_get_type ()) #define WOCKY_LL_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_LL_CONTACT, \ WockyLLContact)) #define WOCKY_LL_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_LL_CONTACT, \ WockyLLContactClass)) #define WOCKY_IS_LL_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_LL_CONTACT)) #define WOCKY_IS_LL_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_LL_CONTACT)) #define WOCKY_LL_CONTACT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_LL_CONTACT, \ WockyLLContactClass)) WockyLLContact * wocky_ll_contact_new (const gchar *jid); const gchar *wocky_ll_contact_get_jid (WockyLLContact *contact); gboolean wocky_ll_contact_equal (WockyLLContact *a, WockyLLContact *b); GList * wocky_ll_contact_get_addresses (WockyLLContact *self); gboolean wocky_ll_contact_has_address (WockyLLContact *self, GInetAddress *address); G_END_DECLS #endif /* #ifndef __WOCKY_LL_CONTACT_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-pubsub-node.c0000644000175000017500000010747012735676345025501 0ustar00gkiagiagkiagia00000000000000/* * wocky-pubsub-node.c - WockyPubsubNode * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-pubsub-node.h" #include "wocky-pubsub-node-protected.h" #include "wocky-pubsub-node-internal.h" #include "wocky-namespaces.h" #include "wocky-porter.h" #include "wocky-pubsub-helpers.h" #include "wocky-pubsub-service-protected.h" #include "wocky-signals-marshal.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_PUBSUB #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyPubsubNode, wocky_pubsub_node, G_TYPE_OBJECT) enum { SIG_EVENT_RECEIVED, SIG_SUB_STATE_CHANGED, SIG_DELETED, LAST_SIGNAL, }; static guint signals[LAST_SIGNAL] = {0}; enum { PROP_SERVICE = 1, PROP_NAME, }; /* private structure */ struct _WockyPubsubNodePrivate { WockyPubsubService *service; WockyPorter *porter; gchar *service_jid; gchar *name; gboolean dispose_has_run; }; static void wocky_pubsub_node_init (WockyPubsubNode *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_PUBSUB_NODE, WockyPubsubNodePrivate); } static void wocky_pubsub_node_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; switch (property_id) { case PROP_SERVICE: priv->service = g_value_dup_object (value); break; case PROP_NAME: priv->name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_node_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; switch (property_id) { case PROP_SERVICE: g_value_set_object (value, priv->service); break; case PROP_NAME: g_value_set_string (value, priv->name); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_pubsub_node_dispose (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; g_object_unref (priv->service); g_object_unref (priv->porter); if (G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->dispose) G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->dispose (object); } static void wocky_pubsub_node_finalize (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; g_free (priv->name); g_free (priv->service_jid); G_OBJECT_CLASS (wocky_pubsub_node_parent_class)->finalize (object); } static void wocky_pubsub_node_constructed (GObject *object) { WockyPubsubNode *self = WOCKY_PUBSUB_NODE (object); WockyPubsubNodePrivate *priv = self->priv; WockySession *session; g_assert (priv->service != NULL); g_assert (priv->name != NULL); g_object_get (priv->service, "jid", &(priv->service_jid), "session", &session, NULL); g_assert (priv->service_jid != NULL); g_assert (session != NULL); priv->porter = wocky_session_get_porter (session); g_object_ref (priv->porter); g_object_unref (session); } static void wocky_pubsub_node_emit_event_received ( WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node, GList *items) { g_signal_emit (self, signals[SIG_EVENT_RECEIVED], 0, event_stanza, event_node, items_node, items); } static void wocky_pubsub_node_emit_subscription_state_changed ( WockyPubsubNode *self, WockyStanza *stanza, WockyNode *event_node, WockyNode *subscription_node, WockyPubsubSubscription *subscription) { g_signal_emit (self, signals[SIG_SUB_STATE_CHANGED], 0, stanza, event_node, subscription_node, subscription); } static void wocky_pubsub_node_emit_deleted ( WockyPubsubNode *self, WockyStanza *stanza, WockyNode *event_node, WockyNode *delete_node) { g_signal_emit (self, signals[SIG_DELETED], 0, stanza, event_node, delete_node); } static void wocky_pubsub_node_class_init ( WockyPubsubNodeClass *wocky_pubsub_node_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_pubsub_node_class); GType ctype = G_OBJECT_CLASS_TYPE (wocky_pubsub_node_class); GParamSpec *param_spec; g_type_class_add_private (wocky_pubsub_node_class, sizeof (WockyPubsubNodePrivate)); object_class->set_property = wocky_pubsub_node_set_property; object_class->get_property = wocky_pubsub_node_get_property; object_class->dispose = wocky_pubsub_node_dispose; object_class->finalize = wocky_pubsub_node_finalize; object_class->constructed = wocky_pubsub_node_constructed; param_spec = g_param_spec_object ("service", "service", "the Wocky Pubsub service associated with this pubsub node", WOCKY_TYPE_PUBSUB_SERVICE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE, param_spec); param_spec = g_param_spec_string ("name", "name", "The name of the pubsub node", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, param_spec); /** * WockyPubsubNode::event-received: * @node: a pubsub node * @event_stanza: the message/event stanza in its entirity * @event_node: the event node from the stanza * @items_node: the items node from the stanza * @items: a list of WockyNode *s for each item child of @items_node */ signals[SIG_EVENT_RECEIVED] = g_signal_new ("event-received", ctype, 0, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER_POINTER, G_TYPE_NONE, 4, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); /** * WockyPubsubNode::subscription-state-changed: * @node: a pubsub node * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @subscription_node: the subscription node from @stanza * @subscription: subscription information parsed from @subscription_node */ signals[SIG_SUB_STATE_CHANGED] = g_signal_new ("subscription-state-changed", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER_BOXED, G_TYPE_NONE, 4, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER, WOCKY_TYPE_PUBSUB_SUBSCRIPTION); /** * WockyPubsubNode::deleted * @node: a pubsub node * @stanza: the message/event stanza in its entirety * @event_node: the event node from @stanza * @delete_node: the delete node from @stanza * * Emitted when a notification of this node's deletion is received from the * server. */ signals[SIG_DELETED] = g_signal_new ("deleted", ctype, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _wocky_signals_marshal_VOID__OBJECT_POINTER_POINTER, G_TYPE_NONE, 3, WOCKY_TYPE_STANZA, G_TYPE_POINTER, G_TYPE_POINTER); } static void pubsub_node_handle_items_event (WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *items_node) { WockyNode *item_node; GQueue items = G_QUEUE_INIT; WockyNodeIter iter; wocky_node_iter_init (&iter, items_node, "item", NULL); while (wocky_node_iter_next (&iter, &item_node)) g_queue_push_tail (&items, item_node); DEBUG_STANZA (event_stanza, "extracted %u items", items.length); wocky_pubsub_node_emit_event_received (self, event_stanza, event_node, items_node, items.head); g_queue_clear (&items); } static void pubsub_node_handle_subscription_event (WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *subscription_node) { WockyPubsubNodePrivate *priv = self->priv; WockyPubsubSubscription *sub; GError *error = NULL; sub = wocky_pubsub_service_parse_subscription (priv->service, subscription_node, NULL, &error); if (sub == NULL) { DEBUG ("received unparseable subscription state change notification: %s", error->message); g_clear_error (&error); } else { wocky_pubsub_node_emit_subscription_state_changed (self, event_stanza, event_node, subscription_node, sub); wocky_pubsub_subscription_free (sub); } } static const WockyPubsubNodeEventMapping mappings[] = { { "items", pubsub_node_handle_items_event, }, { "subscription", pubsub_node_handle_subscription_event, }, { "delete", wocky_pubsub_node_emit_deleted, }, { NULL, } }; const WockyPubsubNodeEventMapping * _wocky_pubsub_node_get_event_mappings (guint *n_mappings) { if (n_mappings != NULL) *n_mappings = G_N_ELEMENTS (mappings) - 1; return mappings; } const gchar * wocky_pubsub_node_get_name (WockyPubsubNode *self) { WockyPubsubNodePrivate *priv = self->priv; return priv->name; } WockyStanza * wocky_pubsub_node_make_publish_stanza (WockyPubsubNode *self, WockyNode **pubsub_out, WockyNode **publish_out, WockyNode **item_out) { WockyPubsubNodePrivate *priv = self->priv; return wocky_pubsub_make_publish_stanza (priv->service_jid, priv->name, pubsub_out, publish_out, item_out); } static WockyStanza * pubsub_node_make_action_stanza (WockyPubsubNode *self, WockyStanzaSubType sub_type, const gchar *pubsub_ns, const gchar *action_name, const gchar *jid, WockyNode **pubsub_node, WockyNode **action_node) { WockyPubsubNodePrivate *priv = self->priv; WockyStanza *stanza; WockyNode *action; g_assert (pubsub_ns != NULL); g_assert (action_name != NULL); stanza = wocky_pubsub_make_stanza (priv->service_jid, sub_type, pubsub_ns, action_name, pubsub_node, &action); wocky_node_set_attribute (action, "node", priv->name); if (jid != NULL) wocky_node_set_attribute (action, "jid", jid); if (action_node != NULL) *action_node = action; return stanza; } WockyStanza * wocky_pubsub_node_make_subscribe_stanza (WockyPubsubNode *self, const gchar *jid, WockyNode **pubsub_node, WockyNode **subscribe_node) { /* TODO: when the connection/porter/session/something knows our own JID, we * should provide an easy way to say “my bare JID” or “my full JID”. Could be * really evil and use 0x1 and 0x3 or something on the assumption that those * will never be strings.... */ g_return_val_if_fail (jid != NULL, NULL); return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "subscribe", jid, pubsub_node, subscribe_node); } static void subscribe_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyPubsubNodePrivate *priv = self->priv; WockyNodeTree *sub_tree; WockyPubsubSubscription *sub = NULL; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB, "subscription", &sub_tree, &error)) { WockyNode *subscription_node = wocky_node_tree_get_top_node (sub_tree); sub = wocky_pubsub_service_parse_subscription (priv->service, subscription_node, NULL, &error); g_object_unref (sub_tree); } if (sub != NULL) { g_simple_async_result_set_op_res_gpointer (simple, sub, (GDestroyNotify) wocky_pubsub_subscription_free); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_subscribe_async: * @self: a pubsub node * @jid: the JID to use as the subscribed JID (usually the connection's bare or * full JID); may not be %NULL * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Attempts to subscribe to @self. */ void wocky_pubsub_node_subscribe_async (WockyPubsubNode *self, const gchar *jid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_subscribe_async); WockyStanza *stanza; g_return_if_fail (jid != NULL); stanza = wocky_pubsub_node_make_subscribe_stanza (self, jid, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, subscribe_cb, simple); g_object_unref (stanza); } WockyPubsubSubscription * wocky_pubsub_node_subscribe_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), wocky_pubsub_node_subscribe_async), NULL); simple = (GSimpleAsyncResult *) result; if (g_simple_async_result_propagate_error (simple, error)) return NULL; else return wocky_pubsub_subscription_copy ( g_simple_async_result_get_op_res_gpointer (simple)); } WockyStanza * wocky_pubsub_node_make_unsubscribe_stanza (WockyPubsubNode *self, const gchar *jid, const gchar *subid, WockyNode **pubsub_node, WockyNode **unsubscribe_node) { WockyStanza *stanza; WockyNode *unsubscribe; /* TODO: when the connection/porter/session/something knows our own JID, we * should provide an easy way to say “my bare JID” or “my full JID”. Could be * really evil and use 0x1 and 0x3 or something on the assumption that those * will never be strings.... */ g_return_val_if_fail (jid != NULL, NULL); stanza = pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB, "unsubscribe", jid, pubsub_node, &unsubscribe); if (subid != NULL) wocky_node_set_attribute (unsubscribe, "subid", subid); if (unsubscribe_node != NULL) *unsubscribe_node = unsubscribe; return stanza; } static void pubsub_node_void_iq_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); GError *error = NULL; if (!wocky_pubsub_distill_void_iq_reply (source, res, &error)) { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); } /** * wocky_pubsub_node_unsubscribe_async: * @self: a pubsub node * @jid: the JID subscribed to @self (usually the connection's bare or * full JID); may not be %NULL * @subid: the identifier associated with the subscription * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Attempts to unsubscribe from @self. */ void wocky_pubsub_node_unsubscribe_async (WockyPubsubNode *self, const gchar *jid, const gchar *subid, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_unsubscribe_async); WockyStanza *stanza; g_return_if_fail (jid != NULL); stanza = wocky_pubsub_node_make_unsubscribe_stanza (self, jid, subid, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, pubsub_node_void_iq_cb, simple); g_object_unref (stanza); } gboolean wocky_pubsub_node_unsubscribe_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_unsubscribe_async); } WockyStanza * wocky_pubsub_node_make_delete_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **delete_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB_OWNER, "delete", NULL, pubsub_node, delete_node); } void wocky_pubsub_node_delete_async (WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; WockyStanza *stanza; GSimpleAsyncResult *result; stanza = wocky_pubsub_node_make_delete_stanza (self, NULL, NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_delete_async); wocky_porter_send_iq_async (priv->porter, stanza, NULL, pubsub_node_void_iq_cb, result); g_object_unref (stanza); } gboolean wocky_pubsub_node_delete_finish (WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_delete_async); } WockyStanza * wocky_pubsub_node_make_list_subscribers_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **subscriptions_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "subscriptions", NULL, pubsub_node, subscriptions_node); } static void list_subscribers_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyPubsubNodePrivate *priv = self->priv; WockyNodeTree *subs_tree; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB_OWNER, "subscriptions", &subs_tree, &error)) { GList *subs = wocky_pubsub_service_parse_subscriptions (priv->service, wocky_node_tree_get_top_node (subs_tree), NULL); g_simple_async_result_set_op_res_gpointer (simple, subs, (GDestroyNotify) wocky_pubsub_subscription_list_free); g_object_unref (subs_tree); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_list_subscribers_async: * @self: a pubsub node * @cancellable: optional #GCancellable object * @callback: function to call when the subscribers have been retrieved or an * error has occured * @user_data: data to pass to @callback. * * Retrieves the list of subscriptions to a node you own. @callback may * complete the call using wocky_pubsub_node_list_subscribers_finish(). * * (A note on naming: this is §8.8.1 — Retrieve Subscriptions List — in * XEP-0060, not to be confused with §5.6 — Retrieve Subscriptions. The * different terminology in Wocky is intended to help disambiguate!) */ void wocky_pubsub_node_list_subscribers_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_list_subscribers_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_list_subscribers_stanza (self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, list_subscribers_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_list_subscribers_finish: * @self: a pubsub node * @result: the result passed to a callback * @subscribers: location at which to store a list of #WockyPubsubSubscription * pointers, or %NULL * @error: location at which to store an error, or %NULL * * Completes a call to wocky_pubsub_node_list_subscribers_async(). The list * returned in @subscribers should be freed with * wocky_pubsub_subscription_list_free() when it is no longer needed. * * Returns: %TRUE if the list of subscribers was successfully retrieved; %FALSE * and sets @error if an error occured. */ gboolean wocky_pubsub_node_list_subscribers_finish ( WockyPubsubNode *self, GAsyncResult *result, GList **subscribers, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_pubsub_node_list_subscribers_async, wocky_pubsub_subscription_list_copy, subscribers); } WockyStanza * wocky_pubsub_node_make_list_affiliates_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **affiliations_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", NULL, pubsub_node, affiliations_node); } GList * wocky_pubsub_node_parse_affiliations ( WockyPubsubNode *self, WockyNode *affiliations_node) { GQueue affs = G_QUEUE_INIT; WockyNodeIter i; WockyNode *n; wocky_node_iter_init (&i, affiliations_node, "affiliation", NULL); while (wocky_node_iter_next (&i, &n)) { const gchar *jid = wocky_node_get_attribute (n, "jid"); const gchar *affiliation = wocky_node_get_attribute (n, "affiliation"); gint state; if (jid == NULL) { DEBUG (" missing jid=''; skipping"); continue; } if (affiliation == NULL) { DEBUG (" missing affiliation=''; skipping"); continue; } if (!wocky_enum_from_nick (WOCKY_TYPE_PUBSUB_AFFILIATION_STATE, affiliation, &state)) { DEBUG ("unknown affiliation '%s'; skipping", affiliation); continue; } g_queue_push_tail (&affs, wocky_pubsub_affiliation_new (self, jid, state)); } return affs.head; } static void list_affiliates_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data); WockyPubsubNode *self = WOCKY_PUBSUB_NODE ( g_async_result_get_source_object (user_data)); WockyNodeTree *affs_tree; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, res, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", &affs_tree, &error)) { WockyNode *affiliations_node = wocky_node_tree_get_top_node (affs_tree); g_simple_async_result_set_op_res_gpointer (simple, wocky_pubsub_node_parse_affiliations (self, affiliations_node), (GDestroyNotify) wocky_pubsub_affiliation_list_free); g_object_unref (affs_tree); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); g_object_unref (self); } /** * wocky_pubsub_node_list_affiliates_async: * @self: a pubsub node * @cancellable: optional #GCancellable object * @callback: function to call when the affiliates have been retrieved or an * error has occured * @user_data: data to pass to @callback. * * Retrieves the list of entities affilied to a node you own. @callback may * complete the call using wocky_pubsub_node_list_affiliates_finish(). * * (A note on naming: this is §8.9.1 — Retrieve Affiliations List — in * XEP-0060, not to be confused with §5.7 — Retrieve Affiliations. The * slightly different terminology in Wocky is intended to help disambiguate!) */ void wocky_pubsub_node_list_affiliates_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_list_affiliates_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_list_affiliates_stanza (self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, list_affiliates_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_list_affiliates_finish: * @self: a pubsub node * @result: the result passed to a callback * @affiliates: location at which to store a list of #WockyPubsubAffiliation * pointers, or %NULL * @error: location at which to store an error, or %NULL * * Completes a call to wocky_pubsub_node_list_affiliates_async(). The list * returned in @affiliates should be freed with * wocky_pubsub_affiliation_list_free() when it is no longer needed. * * Returns: %TRUE if the list of subscribers was successfully retrieved; %FALSE * and sets @error if an error occured. */ gboolean wocky_pubsub_node_list_affiliates_finish ( WockyPubsubNode *self, GAsyncResult *result, GList **affiliates, GError **error) { wocky_implement_finish_copy_pointer (self, wocky_pubsub_node_list_affiliates_async, wocky_pubsub_affiliation_list_copy, affiliates); } /** * wocky_pubsub_node_make_modify_affiliates_stanza: * @self: a pubsub node * @affiliates: a list of #WockyPubsubAffiliation structures, describing only * the affiliations which should be changed. * @pubsub_node: location at which to store a pointer to the <pubsub/> * node, or %NULL * @affiliations_node: location at which to store a pointer to the * <affiliations/> node, or %NULL * * Returns: an IQ stanza to modify the entities affiliated to a node that you * own. */ WockyStanza * wocky_pubsub_node_make_modify_affiliates_stanza ( WockyPubsubNode *self, GList *affiliates, WockyNode **pubsub_node, WockyNode **affiliations_node) { WockyStanza *stanza; WockyNode *affiliations; GList *l; stanza = pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_SET, WOCKY_XMPP_NS_PUBSUB_OWNER, "affiliations", NULL, pubsub_node, &affiliations); for (l = affiliates; l != NULL; l = l->next) { const WockyPubsubAffiliation *aff = l->data; WockyNode *affiliation = wocky_node_add_child (affiliations, "affiliation"); const gchar *state = wocky_enum_to_nick ( WOCKY_TYPE_PUBSUB_AFFILIATION_STATE, aff->state); if (aff->jid == NULL) { g_warning ("Affiliate JID may not be NULL"); continue; } if (state == NULL) { g_warning ("Invalid WockyPubsubAffiliationState %u", aff->state); continue; } /* Let's allow the API user to leave node as NULL in each element in the * list of updates, given that we know which node they want to update. * But if they *do* specify it, it'd better be this node. */ if (aff->node != NULL && aff->node != self) { g_warning ("Tried to update affiliates for %s, passing a " "WockyPubsubAffiliation for %s", wocky_pubsub_node_get_name (self), wocky_pubsub_node_get_name (aff->node)); continue; } wocky_node_set_attribute (affiliation, "jid", aff->jid); wocky_node_set_attribute (affiliation, "affiliation", state); } if (affiliations_node != NULL) *affiliations_node = affiliations; return stanza; } /** * wocky_pubsub_node_modify_affiliates_async: * @self: a pubsub node * @affiliates: a list of #WockyPubsubAffiliation structures, describing only * the affiliations which should be changed. * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Modifies the entities affiliated to a node that you own. */ void wocky_pubsub_node_modify_affiliates_async ( WockyPubsubNode *self, GList *affiliates, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_modify_affiliates_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_modify_affiliates_stanza ( self, affiliates, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, pubsub_node_void_iq_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_modify_affiliates_finish: * @self: a node * @result: the result * @error: location at which to store an error, if one occurred. * * Complete a call to wocky_pubsub_node_modify_affiliates_async(). * * Returns: %TRUE if the affiliates were successfully modified; %FALSE and sets * @error otherwise. */ gboolean wocky_pubsub_node_modify_affiliates_finish ( WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_void (self, wocky_pubsub_node_modify_affiliates_async); } /** * wocky_pubsub_node_make_get_configuration_stanza: * @self: a pubsub node * @pubsub_node: location at which to store a pointer to the <pubsub/> * node, or %NULL * @configure_node: location at which to store a pointer to the * <configure/> node, or %NULL * * Returns: an IQ stanza to retrieve the configuration of @self */ WockyStanza * wocky_pubsub_node_make_get_configuration_stanza ( WockyPubsubNode *self, WockyNode **pubsub_node, WockyNode **configure_node) { return pubsub_node_make_action_stanza (self, WOCKY_STANZA_SUB_TYPE_GET, WOCKY_XMPP_NS_PUBSUB_OWNER, "configure", NULL, pubsub_node, configure_node); } static void get_configuration_iq_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GSimpleAsyncResult *simple = user_data; WockyNodeTree *conf_tree; WockyDataForm *form = NULL; GError *error = NULL; if (wocky_pubsub_distill_iq_reply (source, result, WOCKY_XMPP_NS_PUBSUB_OWNER, "configure", &conf_tree, &error)) { form = wocky_data_form_new_from_form ( wocky_node_tree_get_top_node (conf_tree), &error); g_object_unref (conf_tree); } if (form != NULL) { g_simple_async_result_set_op_res_gpointer (simple, form, g_object_unref); } else { g_simple_async_result_set_from_error (simple, error); g_clear_error (&error); } g_simple_async_result_complete (simple); g_object_unref (simple); } /** * wocky_pubsub_node_get_configuration_async: * @self: a node * @cancellable: optional GCancellable object, %NULL to ignore * @callback: a callback to call when the request is completed * @user_data: data to pass to @callback * * Retrieves the current configuration for a node owned by the user. */ void wocky_pubsub_node_get_configuration_async ( WockyPubsubNode *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { WockyPubsubNodePrivate *priv = self->priv; GSimpleAsyncResult *simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, wocky_pubsub_node_get_configuration_async); WockyStanza *stanza; stanza = wocky_pubsub_node_make_get_configuration_stanza ( self, NULL, NULL); wocky_porter_send_iq_async (priv->porter, stanza, cancellable, get_configuration_iq_cb, simple); g_object_unref (stanza); } /** * wocky_pubsub_node_get_configuration_finish: * @self: a node * @result: the result * @error: location at which to store an error, if one occurred. * * Complete a call to wocky_pubsub_node_get_configuration_async(). * * Returns: a form representing the node configuration on success; %NULL and * sets @error otherwise */ WockyDataForm * wocky_pubsub_node_get_configuration_finish ( WockyPubsubNode *self, GAsyncResult *result, GError **error) { wocky_implement_finish_return_copy_pointer (self, wocky_pubsub_node_get_configuration_async, g_object_ref); } WockyPorter * wocky_pubsub_node_get_porter (WockyPubsubNode *self) { WockyPubsubNodePrivate *priv = self->priv; return priv->porter; } /* WockyPubsubAffiliation boilerplate */ /** * WockyPubsubAffiliation: * @node: the node to which this affiliation relates * @jid: the bare JID affiliated to @node * @state: the state of @jid's affiliation to @node * * Represents an affiliation to a node, as returned by * wocky_pubsub_node_list_affiliates_finish(). */ /** * WockyPubsubAffiliationState: * @WOCKY_PUBSUB_AFFILIATION_OWNER: Owner * @WOCKY_PUBSUB_AFFILIATION_PUBLISHER: Publisher * @WOCKY_PUBSUB_AFFILIATION_PUBLISH_ONLY: Publish-Only * @WOCKY_PUBSUB_AFFILIATION_MEMBER: Member * @WOCKY_PUBSUB_AFFILIATION_NONE: None * @WOCKY_PUBSUB_AFFILIATION_OUTCAST: Outcast * * Possible affiliations to a PubSub node, which determine privileges an entity * has. See XEP-0060 * §4.1 for the details. */ GType wocky_pubsub_affiliation_get_type (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = g_boxed_type_register_static ("WockyPubsubAffiliation", (GBoxedCopyFunc) wocky_pubsub_affiliation_copy, (GBoxedFreeFunc) wocky_pubsub_affiliation_free); return t; } /** * wocky_pubsub_affiliation_new: * @node: a node * @jid: the JID affiliated to @node * @state: the state of @jid's affiliation to @node * * * * Returns: a new structure representing an affiliation, which should * ultimately be freed with wocky_pubsub_affiliation_free() */ WockyPubsubAffiliation * wocky_pubsub_affiliation_new ( WockyPubsubNode *node, const gchar *jid, WockyPubsubAffiliationState state) { WockyPubsubAffiliation aff = { NULL, g_strdup (jid), state }; g_return_val_if_fail (node != NULL, NULL); aff.node = g_object_ref (node); return g_slice_dup (WockyPubsubAffiliation, &aff); } /** * wocky_pubsub_affiliation_copy: * @aff: an existing affiliation structure * * * * Returns: a duplicate of @aff; the duplicate should ultimately be freed * with wocky_pubsub_affiliation_free() */ WockyPubsubAffiliation * wocky_pubsub_affiliation_copy ( WockyPubsubAffiliation *aff) { g_return_val_if_fail (aff != NULL, NULL); return wocky_pubsub_affiliation_new (aff->node, aff->jid, aff->state); } /** * wocky_pubsub_affiliation_free: * @aff: an affiliation * * Frees an affiliation, previously allocated with * wocky_pubsub_affiliation_new() or wocky_pubsub_affiliation_copy() */ void wocky_pubsub_affiliation_free (WockyPubsubAffiliation *aff) { g_return_if_fail (aff != NULL); g_object_unref (aff->node); g_free (aff->jid); g_slice_free (WockyPubsubAffiliation, aff); } /** * wocky_pubsub_affiliation_list_copy: * @affs: a list of #WockyPubsubAffiliation * * Shorthand for manually copying @affs, duplicating each element with * wocky_pubsub_affiliation_copy(). * * Returns: a deep copy of @affs, which should ultimately be freed with * wocky_pubsub_affiliation_list_free(). */ GList * wocky_pubsub_affiliation_list_copy (GList *affs) { return wocky_list_deep_copy ( (GBoxedCopyFunc) wocky_pubsub_affiliation_copy, affs); } /** * wocky_pubsub_affiliation_list_free: * @affs: a list of #WockyPubsubAffiliation * * Frees a list of WockyPubsubAffiliation structures, as shorthand for calling * wocky_pubsub_affiliation_free() for each element, followed by g_list_free(). */ void wocky_pubsub_affiliation_list_free (GList *affs) { g_list_foreach (affs, (GFunc) wocky_pubsub_affiliation_free, NULL); g_list_free (affs); } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-debug-internal.h0000644000175000017500000000406112735676345026153 0ustar00gkiagiagkiagia00000000000000#if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef WOCKY_DEBUG_INTERNAL_H #define WOCKY_DEBUG_INTERNAL_H #include "config.h" #include #include "wocky-debug.h" #include "wocky-stanza.h" G_BEGIN_DECLS #ifdef ENABLE_DEBUG void wocky_debug_set_flags_from_env (void); gboolean wocky_debug_flag_is_set (WockyDebugFlags flag); void wocky_debug_valist (WockyDebugFlags flag, const gchar *format, va_list args); void wocky_debug (WockyDebugFlags flag, const gchar *format, ...) G_GNUC_PRINTF (2, 3); void wocky_debug_stanza (WockyDebugFlags flag, WockyStanza *stanza, const gchar *format, ...) G_GNUC_PRINTF (3, 4); void wocky_debug_node_tree (WockyDebugFlags flag, WockyNodeTree *tree, const gchar *format, ...) G_GNUC_PRINTF (3, 4); void wocky_debug_node (WockyDebugFlags flag, WockyNode *node, const gchar *format, ...) G_GNUC_PRINTF (3, 4); #ifdef WOCKY_DEBUG_FLAG #define DEBUG(format, ...) \ wocky_debug (WOCKY_DEBUG_FLAG, "%s: %s: " format, G_STRFUNC, G_STRLOC, \ ##__VA_ARGS__) #define DEBUG_STANZA(stanza, format, ...) \ wocky_debug_stanza (WOCKY_DEBUG_FLAG, stanza, "%s: " format, G_STRFUNC,\ ##__VA_ARGS__) #define DEBUG_NODE_TREE(tree, format, ...) \ wocky_debug_node_tree (WOCKY_DEBUG_FLAG, tree, "%s: " format, G_STRFUNC,\ ##__VA_ARGS__) #define DEBUG_NODE(node, format, ...) \ wocky_debug_node (WOCKY_DEBUG_FLAG, node, "%s: " format, G_STRFUNC,\ ##__VA_ARGS__) #define DEBUGGING wocky_debug_flag_is_set(WOCKY_DEBUG_FLAG) #endif /* WOCKY_DEBUG_FLAG */ #else /* ENABLE_DEBUG */ #ifdef WOCKY_DEBUG_FLAG static inline void DEBUG ( const gchar *format, ...) { /* blah blah blah */ } static inline void DEBUG_STANZA (WockyStanza *stanza, const gchar *format, ...) { } static inline void DEBUG_NODE_TREE (WockyNodeTree *tree, const gchar *format, ...) { } static inline void DEBUG_NODE (WockyNode *node, const gchar *format, ...) { } #define DEBUGGING 0 #endif /* WOCKY_DEBUG_FLAG */ #endif /* ENABLE_DEBUG */ G_END_DECLS #endif telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-session.c0000644000175000017500000001636212735676345024740 0ustar00gkiagiagkiagia00000000000000/* * wocky-session.c - Source for WockySession * Copyright (C) 2009 Collabora Ltd. * @author Guillaume Desmottes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-session * @title: WockySession * @short_description: * @include: wocky/wocky-session.h * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-session.h" #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "wocky-signals-marshal.h" #include "wocky-utils.h" #include "wocky-c2s-porter.h" #include "wocky-meta-porter.h" G_DEFINE_TYPE (WockySession, wocky_session, G_TYPE_OBJECT) /* properties */ enum { PROP_CONNECTION = 1, PROP_PORTER, PROP_CONTACT_FACTORY, PROP_FULL_JID, }; /* signal enum */ enum { LAST_SIGNAL, }; /* static guint signals[LAST_SIGNAL] = {0}; */ /* private structure */ struct _WockySessionPrivate { gboolean dispose_has_run; gchar *full_jid; WockyXmppConnection *connection; WockyPorter *porter; WockyContactFactory *contact_factory; }; static void wocky_session_init (WockySession *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_SESSION, WockySessionPrivate); self->priv->contact_factory = wocky_contact_factory_new (); } static void wocky_session_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: priv->connection = g_value_dup_object (value); break; case PROP_FULL_JID: priv->full_jid = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_session_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, priv->connection); break; case PROP_PORTER: g_value_set_object (value, priv->porter); break; case PROP_CONTACT_FACTORY: g_value_set_object (value, priv->contact_factory); break; case PROP_FULL_JID: g_value_set_string (value, priv->full_jid); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_session_constructed (GObject *object) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; if (priv->connection != NULL) priv->porter = wocky_c2s_porter_new (priv->connection, priv->full_jid); else priv->porter = wocky_meta_porter_new (priv->full_jid, priv->contact_factory); } static void wocky_session_dispose (GObject *object) { WockySession *self = WOCKY_SESSION (object); WockySessionPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->connection != NULL) { g_object_unref (priv->connection); priv->connection = NULL; } g_object_unref (priv->porter); g_object_unref (priv->contact_factory); if (G_OBJECT_CLASS (wocky_session_parent_class)->dispose) G_OBJECT_CLASS (wocky_session_parent_class)->dispose (object); } static void wocky_session_finalize (GObject *object) { WockySession *self = WOCKY_SESSION (object); g_free (self->priv->full_jid); G_OBJECT_CLASS (wocky_session_parent_class)->finalize (object); } static void wocky_session_class_init (WockySessionClass *wocky_session_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_session_class); GParamSpec *spec; g_type_class_add_private (wocky_session_class, sizeof (WockySessionPrivate)); object_class->constructed = wocky_session_constructed; object_class->set_property = wocky_session_set_property; object_class->get_property = wocky_session_get_property; object_class->dispose = wocky_session_dispose; object_class->finalize = wocky_session_finalize; spec = g_param_spec_object ("connection", "Connection", "The WockyXmppConnection associated with this session", WOCKY_TYPE_XMPP_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, spec); spec = g_param_spec_object ("porter", "Porter", "The WockyPorter associated with this session", WOCKY_TYPE_PORTER, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PORTER, spec); spec = g_param_spec_object ("contact-factory", "Contact factory", "The WockyContactFactory associated with this session", WOCKY_TYPE_CONTACT_FACTORY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_FACTORY, spec); spec = g_param_spec_string ("full-jid", "Full JID", "The user's JID in this session", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FULL_JID, spec); } WockySession * wocky_session_new_with_connection (WockyXmppConnection *conn, const gchar *full_jid) { g_return_val_if_fail (WOCKY_IS_XMPP_CONNECTION (conn), NULL); g_return_val_if_fail (full_jid != NULL, NULL); return g_object_new (WOCKY_TYPE_SESSION, "connection", conn, "full-jid", full_jid, NULL); } WockySession * wocky_session_new_ll (const gchar *full_jid) { return g_object_new (WOCKY_TYPE_SESSION, "full-jid", full_jid, NULL); } void wocky_session_start (WockySession *self) { WockySessionPrivate *priv = self->priv; wocky_porter_start (priv->porter); } WockyPorter * wocky_session_get_porter (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->porter; } WockyContactFactory * wocky_session_get_contact_factory (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->contact_factory; } void wocky_session_set_jid (WockySession *self, const gchar *jid) { WockySessionPrivate *priv = self->priv; g_free (priv->full_jid); priv->full_jid = g_strdup (jid); if (WOCKY_IS_META_PORTER (priv->porter)) { wocky_meta_porter_set_jid (WOCKY_META_PORTER (priv->porter), priv->full_jid); } } const gchar * wocky_session_get_jid (WockySession *self) { WockySessionPrivate *priv = self->priv; return priv->full_jid; } telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-pubsub-node-internal.h0000644000175000017500000000302412735676345027306 0ustar00gkiagiagkiagia00000000000000/* * wocky-pubsub-node-internal.h - internal methods on WockyPubsubNode * used by WockyPubsubService * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_COMPILATION) # error "This is an internal header." #endif #ifndef WOCKY_PUBSUB_NODE_INTERNAL_H #define WOCKY_PUBSUB_NODE_INTERNAL_H #include "wocky-pubsub-node.h" typedef void (*WockyPubsubNodeEventHandler) ( WockyPubsubNode *self, WockyStanza *event_stanza, WockyNode *event_node, WockyNode *action_node); typedef struct { const gchar *action; WockyPubsubNodeEventHandler method; } WockyPubsubNodeEventMapping; const WockyPubsubNodeEventMapping *_wocky_pubsub_node_get_event_mappings ( guint *n_mappings); #endif /* WOCKY_PUBSUB_NODE_INTERNAL_H */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-pubsub-service-protected.h0000644000175000017500000000417712735676345030210 0ustar00gkiagiagkiagia00000000000000/* * wocky-pubsub-service-protected.h - protected methods on WockyPubsubService * Copyright © 2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef WOCKY_PUBSUB_SERVICE_PROTECTED_H #define WOCKY_PUBSUB_SERVICE_PROTECTED_H #include "wocky-pubsub-service.h" WockyStanza *wocky_pubsub_service_create_retrieve_subscriptions_stanza ( WockyPubsubService *self, WockyPubsubNode *node, WockyNode **pubsub_node, WockyNode **subscriptions_node); WockyPubsubSubscription * wocky_pubsub_service_parse_subscription (WockyPubsubService *self, WockyNode *subscription_node, const gchar *parent_node_attr, GError **error); GList * wocky_pubsub_service_parse_subscriptions (WockyPubsubService *self, WockyNode *subscriptions_node, GList **subscription_nodes); WockyStanza *wocky_pubsub_service_create_create_node_stanza ( WockyPubsubService *self, const gchar *name, WockyDataForm *config, WockyNode **pubsub_node, WockyNode **create_node); WockyPubsubNode *wocky_pubsub_service_handle_create_node_reply ( WockyPubsubService *self, WockyNodeTree *create_tree, const gchar *requested_name, GError **error); WockyPorter *wocky_pubsub_service_get_porter (WockyPubsubService *self); #endif /* WOCKY_PUBSUB_SERVICE_PROTECTED_H */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-tls-handler.h0000644000175000017500000000735012735676345025474 0ustar00gkiagiagkiagia00000000000000/* * wocky-tls-handler.h - Header for WockyTLSHandler * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_TLS_HANDLER_H__ #define __WOCKY_TLS_HANDLER_H__ #include #include "wocky-tls.h" G_BEGIN_DECLS typedef struct _WockyTLSHandler WockyTLSHandler; /** * WockyTLSHandlerClass: * @verify_async_func: a function to call to start an asychronous * verify operation; see wocky_tls_handler_verify_async() for more * details * @verify_finish_func: a function to call to finish an asychronous * verify operation; see wocky_tls_handler_verify_finish() for more * details * * The class of a #WockyTLSHandler. */ typedef struct _WockyTLSHandlerClass WockyTLSHandlerClass; typedef struct _WockyTLSHandlerPrivate WockyTLSHandlerPrivate; typedef void (*WockyTLSHandlerVerifyAsyncFunc) (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data); typedef gboolean (*WockyTLSHandlerVerifyFinishFunc) (WockyTLSHandler *self, GAsyncResult *res, GError **error); struct _WockyTLSHandlerClass { /**/ GObjectClass parent_class; /**/ WockyTLSHandlerVerifyAsyncFunc verify_async_func; WockyTLSHandlerVerifyFinishFunc verify_finish_func; }; struct _WockyTLSHandler { /**/ GObject parent; WockyTLSHandlerPrivate *priv; }; GType wocky_tls_handler_get_type (void); #define WOCKY_TYPE_TLS_HANDLER \ (wocky_tls_handler_get_type ()) #define WOCKY_TLS_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), WOCKY_TYPE_TLS_HANDLER, WockyTLSHandler)) #define WOCKY_TLS_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), WOCKY_TYPE_TLS_HANDLER, \ WockyTLSHandlerClass)) #define WOCKY_IS_TLS_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), WOCKY_TYPE_TLS_HANDLER)) #define WOCKY_IS_TLS_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), WOCKY_TYPE_TLS_HANDLER)) #define WOCKY_TLS_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), WOCKY_TYPE_TLS_HANDLER, \ WockyTLSHandlerClass)) WockyTLSHandler * wocky_tls_handler_new (gboolean ignore_ssl_errors); void wocky_tls_handler_verify_async (WockyTLSHandler *self, WockyTLSSession *tls_session, const gchar *peername, GStrv extra_identities, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_tls_handler_verify_finish (WockyTLSHandler *self, GAsyncResult *result, GError **error); gboolean wocky_tls_handler_add_ca (WockyTLSHandler *self, const gchar *path); void wocky_tls_handler_forget_cas (WockyTLSHandler *self); gboolean wocky_tls_handler_add_crl (WockyTLSHandler *self, const gchar *path); GSList *wocky_tls_handler_get_cas (WockyTLSHandler *self); GSList *wocky_tls_handler_get_crl (WockyTLSHandler *self); G_END_DECLS #endif /* #ifndef __WOCKY_TLS_HANDLER_H__*/ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-xmpp-error.h0000644000175000017500000003707012735676345025374 0ustar00gkiagiagkiagia00000000000000/* * wocky-xmpp-error.h - Header for Wocky's XMPP error handling API * Copyright (C) 2006-2009 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION) # error "Only can be included directly." #endif #ifndef __WOCKY_XMPP_ERROR_H__ #define __WOCKY_XMPP_ERROR_H__ #include #include #include "wocky-enumtypes.h" #include "wocky-node.h" /** * WockyXmppErrorType: * @WOCKY_XMPP_ERROR_TYPE_CANCEL: do not retry (the error is * unrecoverable) * @WOCKY_XMPP_ERROR_TYPE_CONTINUE: proceed (the condition was only a * warning) * @WOCKY_XMPP_ERROR_TYPE_MODIFY: retry after changing the data sent * @WOCKY_XMPP_ERROR_TYPE_AUTH: retry after providing credentials * @WOCKY_XMPP_ERROR_TYPE_WAIT: retry after waiting (the error is * temporary) * * XMPP error types as described in RFC 3920 §9.3.2. */ /*< prefix=WOCKY_XMPP_ERROR_TYPE >*/ typedef enum { WOCKY_XMPP_ERROR_TYPE_CANCEL, WOCKY_XMPP_ERROR_TYPE_CONTINUE, WOCKY_XMPP_ERROR_TYPE_MODIFY, WOCKY_XMPP_ERROR_TYPE_AUTH, WOCKY_XMPP_ERROR_TYPE_WAIT } WockyXmppErrorType; /** * WockyXmppError: * @WOCKY_XMPP_ERROR_UNDEFINED_CONDITION: the error condition is not one * of those defined by the other conditions in this list * @WOCKY_XMPP_ERROR_REDIRECT: the recipient or server is redirecting * requests for this information to another entity * @WOCKY_XMPP_ERROR_GONE: the recipient or server can no longer be * contacted at this address * @WOCKY_XMPP_ERROR_BAD_REQUEST: the sender has sent XML that is * malformed or that cannot be processed * @WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST: the recipient or server * understood the request but was not expecting it at this time * @WOCKY_XMPP_ERROR_JID_MALFORMED: the sending entity has provided or * communicated an XMPP address * @WOCKY_XMPP_ERROR_NOT_AUTHORIZED: the sender must provide proper * credentials before being allowed to perform the action, or has * provided improper credentials * @WOCKY_XMPP_ERROR_PAYMENT_REQUIRED: the requesting entity is not * authorized to access the requested service because payment is * required. This code is no longer defined in RFC 6120, the current version * of XMPP Core. It's preserved here for interoperability, but new * applications should not send it. * @WOCKY_XMPP_ERROR_FORBIDDEN: the requesting entity does not possess * the required permissions to perform the action * @WOCKY_XMPP_ERROR_ITEM_NOT_FOUND: the addressed JID or item requested * cannot be found * @WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE: the intended recipient is * temporarily unavailable * @WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND: a remote server or * service specified as part or all of the JID of the intended * recipient does not exist * @WOCKY_XMPP_ERROR_NOT_ALLOWED: the recipient or server does not * allow any entity to perform the action * @WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: the recipient or server * understands the request but is refusing to process it because it * does not meet criteria defined by the recipient or server * @WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED: the requesting entity is * not authorized to access the requested service because * registration is required * @WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED: the requesting entity is * not authorized to access the requested service because a * subscription is required * @WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT: a remote server or service * specified as part or all of the JID of the intended recipient (or * required to fulfill a request) could not be contacted within a * reasonable amount of time * @WOCKY_XMPP_ERROR_CONFLICT: access cannot be granted because an * existing resource or session exists with the same name or address * @WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR: the server could not * process the stanza because of a misconfiguration or an * otherwise-undefined internal server error * @WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT: the server or recipient lacks * the system resources necessary to service the request * @WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED: the feature requested is * not implemented by the recipient or server and therefore cannot * be processed * @WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE: the server or recipient does * not currently provide the requested service * @WOCKY_XMPP_ERROR_POLICY_VIOLATION: the entity has violated some local * service policy (e.g., a message contains words that are prohibited by the * service) and the server MAY choose to specify the policy as the text of * the error or in an application-specific condition element; the associated * error type SHOULD be %WOCKY_XMPP_ERROR_TYPE_MODIFY or * %WOCKY_XMPP_ERROR_TYPE_WAIT depending on the policy being violated. * * Possible stanza-level errors, as defined by RFC 6210 * §8.3.3. */ /*< prefix=WOCKY_XMPP_ERROR >*/ typedef enum { WOCKY_XMPP_ERROR_UNDEFINED_CONDITION = 0, /* 500 */ WOCKY_XMPP_ERROR_REDIRECT, /* 302 */ WOCKY_XMPP_ERROR_GONE, /* 302 */ WOCKY_XMPP_ERROR_BAD_REQUEST, /* 400 */ WOCKY_XMPP_ERROR_UNEXPECTED_REQUEST, /* 400 */ WOCKY_XMPP_ERROR_JID_MALFORMED, /* 400 */ WOCKY_XMPP_ERROR_NOT_AUTHORIZED, /* 401 */ WOCKY_XMPP_ERROR_PAYMENT_REQUIRED, /* 402 */ WOCKY_XMPP_ERROR_FORBIDDEN, /* 403 */ WOCKY_XMPP_ERROR_ITEM_NOT_FOUND, /* 404 */ WOCKY_XMPP_ERROR_RECIPIENT_UNAVAILABLE, /* 404 */ WOCKY_XMPP_ERROR_REMOTE_SERVER_NOT_FOUND, /* 404 */ WOCKY_XMPP_ERROR_NOT_ALLOWED, /* 405 */ WOCKY_XMPP_ERROR_NOT_ACCEPTABLE, /* 406 */ WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED, /* 407 */ WOCKY_XMPP_ERROR_SUBSCRIPTION_REQUIRED, /* 407 */ WOCKY_XMPP_ERROR_REMOTE_SERVER_TIMEOUT, /* 408, 504 */ WOCKY_XMPP_ERROR_CONFLICT, /* 409 */ WOCKY_XMPP_ERROR_INTERNAL_SERVER_ERROR, /* 500 */ WOCKY_XMPP_ERROR_RESOURCE_CONSTRAINT, /* 500 */ WOCKY_XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, /* 501 */ WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE, /* 502, 503, 510 */ WOCKY_XMPP_ERROR_POLICY_VIOLATION, /*< private >*/ NUM_WOCKY_XMPP_ERRORS /*< skip >*/ /* don't want this in the GEnum */ } WockyXmppError; GQuark wocky_xmpp_error_quark (void); #define WOCKY_XMPP_ERROR (wocky_xmpp_error_quark ()) /** * WockyXmppErrorSpecialization: * @description: description of the error * @specializes: which #WockyXmppError this error specializes * @override_type: %TRUE if @type should be used, or %FALSE if the * default error type for @specializes should be used * @type: the XMPP error type * * A struct to represent a specialization of an existing * #WockyXmppError member. */ typedef struct _WockyXmppErrorSpecialization WockyXmppErrorSpecialization; struct _WockyXmppErrorSpecialization { const gchar *description; WockyXmppError specializes; gboolean override_type; WockyXmppErrorType type; }; /** * WockyXmppErrorDomain: * @domain: a #GQuark of the error domain * @enum_type: the #GType of the error enum * @codes: a %NULL-terminated array of of #WockyXmppErrorSpecializations * * A struct to represent extra XMPP error domains added. */ typedef struct _WockyXmppErrorDomain WockyXmppErrorDomain; struct _WockyXmppErrorDomain { GQuark domain; GType enum_type; WockyXmppErrorSpecialization *codes; }; void wocky_xmpp_error_register_domain (WockyXmppErrorDomain *domain); /** * WockyJingleError: * @WOCKY_JINGLE_ERROR_OUT_OF_ORDER: the request cannot occur at this * point in the state machine * @WOCKY_JINGLE_ERROR_TIE_BREAK: the request is rejected because it * was sent while the initiator was awaiting a reply on a similar * request * @WOCKY_JINGLE_ERROR_UNKNOWN_SESSION: the 'sid' attribute specifies * a session that is unknown to the recipient * @WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO: the recipient does not * support the informational payload of a session-info action. * * Jingle specific errors. */ /*< prefix=WOCKY_JINGLE_ERROR >*/ typedef enum { WOCKY_JINGLE_ERROR_OUT_OF_ORDER, WOCKY_JINGLE_ERROR_TIE_BREAK, WOCKY_JINGLE_ERROR_UNKNOWN_SESSION, WOCKY_JINGLE_ERROR_UNSUPPORTED_INFO } WockyJingleError; GQuark wocky_jingle_error_quark (void); #define WOCKY_JINGLE_ERROR (wocky_jingle_error_quark ()) /** * WockySIError: * @WOCKY_SI_ERROR_NO_VALID_STREAMS: none of the available streams are * acceptable * @WOCKY_SI_ERROR_BAD_PROFILE: the profile is not understood or * invalid * * SI specific errors. */ /*< prefix=WOCKY_SI_ERROR >*/ typedef enum { WOCKY_SI_ERROR_NO_VALID_STREAMS, WOCKY_SI_ERROR_BAD_PROFILE } WockySIError; GQuark wocky_si_error_quark (void); #define WOCKY_SI_ERROR (wocky_si_error_quark ()) /** * WockyXmppStreamError: * @WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT: the entity has sent XML that * cannot be processed * @WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX: the entity has sent * a namespace prefix that is unsupported, or has sent no namespace * prefix on an element that requires such a prefix * @WOCKY_XMPP_STREAM_ERROR_CONFLICT: the server is closing the active * stream for this entity because a new stream has been initiated * that conflicts with the existing stream * @WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT: the entity has not * generated any traffic over the stream for some period of time * @WOCKY_XMPP_STREAM_ERROR_HOST_GONE: the value of the 'to' attribute * provided by the initiating entity in the stream header * corresponds to a hostname that is no longer hosted by the server * @WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN: the value of the 'to' * attribute provided by the initiating entity in the stream header * does not correspond to a hostname that is hosted by the server * @WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING: a stanza sent between * two servers lacks a 'to' or 'from' attribute (or the attribute * has no value) * @WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR: the server has * experienced a misconfiguration or an otherwise-undefined internal * error that prevents it from servicing the stream * @WOCKY_XMPP_STREAM_ERROR_INVALID_FROM: the JID or hostname provided * in a 'from' address does not match an authorized JID or validated * domain negotiated between servers via SASL or dialback, or * between a client and a server via authentication and resource * binding * @WOCKY_XMPP_STREAM_ERROR_INVALID_ID: the stream ID or dialback ID * is invalid or does not match an ID previously provided * @WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE: the streams namespace * name is something other than "http://etherx.jabber.org/streams" * or the dialback namespace name is something other than * "jabber:server:dialback" * @WOCKY_XMPP_STREAM_ERROR_INVALID_XML: the entity has sent invalid * XML over the stream to a server that performs validation * @WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED: the entity has attempted * to send data before the stream has been authenticated, or * otherwise is not authorized to perform an action related to * stream negotiation * @WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION: the entity has violated * some local service policy * @WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED: the server is * unable to properly connect to a remote entity that is required * for authentication or authorization * @WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT: the server lacks the * system resources necessary to service the stream * @WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML: the entity has attempted * to send restricted XML features such as a comment, processing * instruction, DTD, entity reference, or unescaped character * @WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST: the server will not * provide service to the initiating entity but is redirecting * traffic to another host * @WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN: the server is being shut * down and all active streams are being closed * @WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION: the error condition * is not one of those defined by the other conditions in this list * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING: the initiating * entity has encoded the stream in an encoding that is not * supported by the server * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE: the initiating * entity has sent a first-level child of the stream that is not * supported by the server * @WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION: the value of the * 'version' attribute provided by the initiating entity in the * stream header specifies a version of XMPP that is not supported * by the server * @WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED: the initiating entity * has sent XML that is not well-formed * @WOCKY_XMPP_STREAM_ERROR_UNKNOWN: an unknown stream error * * Stream-level error conditions as described in RFC 3920 §4.7.3. */ /*< prefix=WOCKY_XMPP_STREAM_ERROR >*/ typedef enum { WOCKY_XMPP_STREAM_ERROR_BAD_FORMAT, WOCKY_XMPP_STREAM_ERROR_BAD_NAMESPACE_PREFIX, WOCKY_XMPP_STREAM_ERROR_CONFLICT, WOCKY_XMPP_STREAM_ERROR_CONNECTION_TIMEOUT, WOCKY_XMPP_STREAM_ERROR_HOST_GONE, WOCKY_XMPP_STREAM_ERROR_HOST_UNKNOWN, WOCKY_XMPP_STREAM_ERROR_IMPROPER_ADDRESSING, WOCKY_XMPP_STREAM_ERROR_INTERNAL_SERVER_ERROR, WOCKY_XMPP_STREAM_ERROR_INVALID_FROM, WOCKY_XMPP_STREAM_ERROR_INVALID_ID, WOCKY_XMPP_STREAM_ERROR_INVALID_NAMESPACE, WOCKY_XMPP_STREAM_ERROR_INVALID_XML, WOCKY_XMPP_STREAM_ERROR_NOT_AUTHORIZED, WOCKY_XMPP_STREAM_ERROR_POLICY_VIOLATION, WOCKY_XMPP_STREAM_ERROR_REMOTE_CONNECTION_FAILED, WOCKY_XMPP_STREAM_ERROR_RESOURCE_CONSTRAINT, WOCKY_XMPP_STREAM_ERROR_RESTRICTED_XML, WOCKY_XMPP_STREAM_ERROR_SEE_OTHER_HOST, WOCKY_XMPP_STREAM_ERROR_SYSTEM_SHUTDOWN, WOCKY_XMPP_STREAM_ERROR_UNDEFINED_CONDITION, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_ENCODING, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE, WOCKY_XMPP_STREAM_ERROR_UNSUPPORTED_VERSION, WOCKY_XMPP_STREAM_ERROR_XML_NOT_WELL_FORMED, WOCKY_XMPP_STREAM_ERROR_UNKNOWN, } WockyXmppStreamError; GQuark wocky_xmpp_stream_error_quark (void); /** * WOCKY_XMPP_STREAM_ERROR: * * Get access to the error quark of the xmpp stream errors. */ #define WOCKY_XMPP_STREAM_ERROR (wocky_xmpp_stream_error_quark ()) const gchar *wocky_xmpp_error_string (WockyXmppError error); const gchar *wocky_xmpp_error_description (WockyXmppError error); GError *wocky_xmpp_stream_error_from_node (WockyNode *error); WockyNode *wocky_stanza_error_to_node (const GError *error, WockyNode *parent_node); const gchar *wocky_xmpp_stanza_error_to_string (GError *error); void wocky_xmpp_error_extract (WockyNode *error, WockyXmppErrorType *type, GError **core, GError **specialized, WockyNode **specialized_node); void wocky_xmpp_error_init (void); void wocky_xmpp_error_deinit (void); #endif /* __WOCKY_XMPP_ERROR_H__ */ telepathy-gabble-0.18.4/lib/ext/wocky/wocky/wocky-data-form.c0000644000175000017500000007056112735676345025130 0ustar00gkiagiagkiagia00000000000000/* * wocky-data-form.c - WockyDataForm * Copyright © 2009–2010 Collabora Ltd. * Copyright © 2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: wocky-data-form * @title: WockyDataForm * @short_description: An object to represent an XMPP data form * @include: wocky/wocky-data-form.h * * An object that represents an XMPP data form as described in * XEP-0004. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "wocky-data-form.h" #include #include "wocky-namespaces.h" #include "wocky-utils.h" #define WOCKY_DEBUG_FLAG WOCKY_DEBUG_DATA_FORM #include "wocky-debug-internal.h" G_DEFINE_TYPE (WockyDataForm, wocky_data_form, G_TYPE_OBJECT) /* properties */ enum { PROP_TITLE = 1, PROP_INSTRUCTIONS, }; /* private structure */ struct _WockyDataFormPrivate { gchar *title; gchar *instructions; /* (gchar *) => owned (WockyDataFormField *) */ GHashTable *reported; gboolean dispose_has_run; }; GQuark wocky_data_form_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("wocky-data-form-error"); return quark; } static WockyDataFormFieldOption * wocky_data_form_field_option_new (const gchar *label, const gchar *value) { WockyDataFormFieldOption *option; g_assert (value != NULL); option = g_slice_new0 (WockyDataFormFieldOption); option->label = g_strdup (label); option->value = g_strdup (value); return option; } static void wocky_data_form_field_option_free (WockyDataFormFieldOption *option) { g_free (option->label); g_free (option->value); g_slice_free (WockyDataFormFieldOption, option); } /* pass ownership of the default_value, raw_value_contents, the value * and the options list */ static WockyDataFormField * wocky_data_form_field_new ( WockyDataFormFieldType type, const gchar *var, const gchar *label, const gchar *desc, gboolean required, GValue *default_value, gchar **raw_value_contents, GValue *value, GSList *options) { WockyDataFormField *field; field = g_slice_new0 (WockyDataFormField); field->type = type; field->var = g_strdup (var); field->label = g_strdup (label); field->desc = g_strdup (desc); field->required = required; field->default_value = default_value; field->raw_value_contents = raw_value_contents; field->value = value; field->options = options; return field; } static void wocky_data_form_field_free (WockyDataFormField *field) { if (field == NULL) return; g_free (field->var); g_free (field->label); g_free (field->desc); g_strfreev (field->raw_value_contents); if (field->default_value != NULL) wocky_g_value_slice_free (field->default_value); if (field->value != NULL) wocky_g_value_slice_free (field->value); g_slist_foreach (field->options, (GFunc) wocky_data_form_field_option_free, NULL); g_slist_free (field->options); g_slice_free (WockyDataFormField, field); } static void wocky_data_form_init (WockyDataForm *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, WOCKY_TYPE_DATA_FORM, WockyDataFormPrivate); self->fields = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); self->fields_list = NULL; self->priv->reported = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) wocky_data_form_field_free); self->results = NULL; } static void wocky_data_form_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; switch (property_id) { case PROP_TITLE: priv->title = g_value_dup_string (value); break; case PROP_INSTRUCTIONS: priv->instructions = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_data_form_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; switch (property_id) { case PROP_TITLE: g_value_set_string (value, priv->title); break; case PROP_INSTRUCTIONS: g_value_set_string (value, priv->instructions); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void wocky_data_form_dispose (GObject *object) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (G_OBJECT_CLASS (wocky_data_form_parent_class)->dispose) G_OBJECT_CLASS (wocky_data_form_parent_class)->dispose (object); } static void data_form_field_list_free (GSList *fields) { g_slist_foreach (fields, (GFunc) wocky_data_form_field_free, NULL); g_slist_free (fields); } static void wocky_data_form_finalize (GObject *object) { WockyDataForm *self = WOCKY_DATA_FORM (object); WockyDataFormPrivate *priv = self->priv; g_free (priv->title); g_free (priv->instructions); g_hash_table_unref (self->fields); data_form_field_list_free (self->fields_list); g_slist_foreach (self->results, (GFunc) data_form_field_list_free, NULL); g_slist_free (self->results); g_hash_table_unref (priv->reported); G_OBJECT_CLASS (wocky_data_form_parent_class)->finalize (object); } static void wocky_data_form_class_init ( WockyDataFormClass *wocky_data_form_class) { GObjectClass *object_class = G_OBJECT_CLASS (wocky_data_form_class); GParamSpec *param_spec; g_type_class_add_private (wocky_data_form_class, sizeof (WockyDataFormPrivate)); object_class->set_property = wocky_data_form_set_property; object_class->get_property = wocky_data_form_get_property; object_class->dispose = wocky_data_form_dispose; object_class->finalize = wocky_data_form_finalize; param_spec = g_param_spec_string ("title", "title", "Title", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TITLE, param_spec); param_spec = g_param_spec_string ("instructions", "instructions", "Instructions", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INSTRUCTIONS, param_spec); } static const gchar * type_to_str (WockyDataFormFieldType type) { return wocky_enum_to_nick (WOCKY_TYPE_DATA_FORM_FIELD_TYPE, type); } /* * extract_options_list: * @node: a node * * Returns: a list of (WockyDataFormFieldOption *) containing all the *