#include <config.h>
#endif
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-
-#include <gio/gio.h>
#include "soup-address.h"
-#include "soup-enum-types.h"
+#include "soup.h"
#include "soup-marshal.h"
-#include "soup-misc.h"
/**
* SECTION:soup-address
#include <string.h>
#include "soup-auth-basic.h"
-#include "soup-headers.h"
-#include "soup-message.h"
-#include "soup-misc.h"
-#include "soup-uri.h"
+#include "soup.h"
typedef struct {
char *token;
#include <config.h>
#endif
-#include <stdio.h>
#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "soup-auth-digest.h"
-#include "soup-headers.h"
-#include "soup-message.h"
+#include "soup.h"
#include "soup-message-private.h"
-#include "soup-misc.h"
-#include "soup-uri.h"
typedef struct {
char *user;
if (qop) {
char tmp[9];
- snprintf (tmp, 9, "%.8x", nc);
+ g_snprintf (tmp, 9, "%.8x", nc);
g_checksum_update (checksum, (guchar *)tmp, strlen (tmp));
g_checksum_update (checksum, (guchar *)":", 1);
g_checksum_update (checksum, (guchar *)cnonce, strlen (cnonce));
#include <string.h>
#include "soup-auth-domain-basic.h"
-#include "soup-headers.h"
+#include "soup.h"
#include "soup-marshal.h"
-#include "soup-message.h"
/**
* SECTION:soup-auth-domain-basic
#include <stdlib.h>
#include "soup-auth-domain-digest.h"
+#include "soup.h"
#include "soup-auth-digest.h"
-#include "soup-headers.h"
#include "soup-marshal.h"
-#include "soup-message.h"
-#include "soup-uri.h"
/**
* SECTION:soup-auth-domain-digest
#include <string.h>
#include "soup-auth-domain.h"
-#include "soup-message.h"
+#include "soup.h"
#include "soup-path-map.h"
-#include "soup-uri.h"
/**
* SECTION:soup-auth-domain
#endif
#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
-#include <glib.h>
-#ifdef USE_NTLM_AUTH
-#include <stdlib.h>
-#include <errno.h>
-#endif
#include "soup-auth-manager-ntlm.h"
+#include "soup.h"
#include "soup-auth-ntlm.h"
-#include "soup-message.h"
#include "soup-message-private.h"
-#include "soup-misc.h"
-#include "soup-session.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
static void soup_auth_manager_ntlm_session_feature_init (SoupSessionFeatureInterface *feature_interface, gpointer interface_data);
static SoupSessionFeatureInterface *soup_auth_manager_parent_feature_interface;
#include <string.h>
#include "soup-auth-manager.h"
-#include "soup-address.h"
-#include "soup-headers.h"
+#include "soup.h"
#include "soup-marshal.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
#include "soup-path-map.h"
-#include "soup-session.h"
-#include "soup-session-feature.h"
#include "soup-session-private.h"
-#include "soup-uri.h"
static void soup_auth_manager_session_feature_init (SoupSessionFeatureInterface *feature_interface, gpointer interface_data);
static SoupSessionFeatureInterface *soup_session_feature_default_interface;
#include <string.h>
#include "soup-auth-ntlm.h"
-#include "soup-headers.h"
-#include "soup-message.h"
-#include "soup-misc.h"
-#include "soup-uri.h"
+#include "soup.h"
typedef struct {
char *username, *password;
#include <string.h>
#include "soup-auth.h"
-#include "soup-auth-basic.h"
-#include "soup-auth-digest.h"
#include "soup-headers.h"
#include "soup-marshal.h"
#include "soup-uri.h"
#endif
#include <stdlib.h>
-#include <string.h>
-#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include "soup-body-input-stream.h"
-#include "soup-enum-types.h"
+#include "soup.h"
#include "soup-filter-input-stream.h"
#include "soup-marshal.h"
-#include "soup-message-headers.h"
typedef enum {
SOUP_BODY_INPUT_STREAM_STATE_CHUNK_SIZE,
#include <config.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include <gio/gio.h>
#include "soup-body-output-stream.h"
-#include "soup-enum-types.h"
-#include "soup-message-headers.h"
+#include "soup.h"
typedef enum {
SOUP_BODY_OUTPUT_STREAM_STATE_CHUNK_SIZE,
switch (bostream->priv->chunked_state) {
case SOUP_BODY_OUTPUT_STREAM_STATE_CHUNK_SIZE:
- snprintf (buf, sizeof (bostream->priv->buf),
- "%lx\r\n", (gulong)count);
+ g_snprintf (buf, sizeof (bostream->priv->buf),
+ "%lx\r\n", (gulong)count);
len = strlen (buf);
if (count > 0)
#include <config.h>
#endif
-#include <stdlib.h>
#include <string.h>
-#include <gio/gio.h>
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-cache.h"
#include "soup-cache-private.h"
-#include "soup-date.h"
-#include "soup-enum-types.h"
-#include "soup-headers.h"
-#include "soup-session.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
+#include "soup.h"
static SoupSessionFeatureInterface *soup_cache_default_feature_interface;
static void soup_cache_session_feature_init (SoupSessionFeatureInterface *feature_interface, gpointer interface_data);
#include <config.h>
#endif
-#include <gio/gio.h>
-
#include "soup-client-input-stream.h"
+#include "soup.h"
#include "soup-marshal.h"
-#include "soup-message.h"
#include "soup-message-private.h"
struct _SoupClientInputStreamPrivate {
#include <config.h>
#endif
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include "soup-address.h"
#include "soup-connection.h"
+#include "soup.h"
#include "soup-marshal.h"
-#include "soup-message.h"
-#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc.h"
#include "soup-misc-private.h"
-#include "soup-proxy-uri-resolver.h"
-#include "soup-proxy-resolver-default.h"
-#include "soup-socket.h"
-#include "soup-uri.h"
-#include "soup-enum-types.h"
typedef struct {
SoupSocket *socket;
#include <config.h>
#endif
-#include <string.h>
-#include <gio/gio.h>
-
#include "soup-content-decoder.h"
-#include "soup-enum-types.h"
-#include "soup-message.h"
+#include "soup.h"
#include "soup-message-private.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
/**
* SECTION:soup-content-decoder
#endif
#include <string.h>
-#include <gio/gio.h>
#include "soup-content-sniffer-stream.h"
-#include "soup-content-sniffer.h"
-#include "soup-message.h"
+#include "soup.h"
static void soup_content_sniffer_stream_pollable_init (GPollableInputStreamInterface *pollable_interface, gpointer interface_data);
#include <string.h>
#include "soup-content-sniffer.h"
-#include "soup-enum-types.h"
-#include "soup-message.h"
+#include "soup.h"
#include "soup-message-private.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
/**
* SECTION:soup-content-sniffer
#include <glib/gi18n-lib.h>
#include "soup-converter-wrapper.h"
-#include "soup-message.h"
+#include "soup.h"
/* SoupConverterWrapper is a GConverter that wraps another GConverter.
* Mostly it is transparent, but it implements three special fallbacks
#include <config.h>
#endif
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+
#include <sqlite3.h>
#include "soup-cookie-jar-sqlite.h"
-#include "soup-cookie.h"
-#include "soup-date.h"
+#include "soup.h"
/**
* SECTION:soup-cookie-jar-sqlite
#include <string.h>
#include "soup-cookie-jar-text.h"
-#include "soup-cookie.h"
-#include "soup-date.h"
+#include "soup.h"
/**
* SECTION:soup-cookie-jar-text
#include <config.h>
#endif
-#include <stdio.h>
#include <string.h>
-#include "soup-cookie.h"
#include "soup-cookie-jar.h"
-#include "soup-date.h"
-#include "soup-enum-types.h"
+#include "soup.h"
#include "soup-marshal.h"
-#include "soup-message.h"
-#include "soup-session-feature.h"
-#include "soup-tld.h"
-#include "soup-uri.h"
/**
* SECTION:soup-cookie-jar
#include <string.h>
#include "soup-cookie.h"
-#include "soup-date.h"
-#include "soup-headers.h"
-#include "soup-message.h"
-#include "soup-message-headers.h"
-#include "soup-uri.h"
+#include "soup.h"
/**
* SECTION:soup-cookie
#include <stdlib.h>
#include <string.h>
-#include <glib.h>
#include "soup-date.h"
+#include "soup.h"
/**
* SoupDate:
#include <config.h>
#endif
-#include "soup-directory-input-stream.h"
-
-#include <libsoup/soup.h>
-#include <stdio.h>
#include <string.h>
+#include "soup-directory-input-stream.h"
+#include "soup.h"
+
#define INIT_STRING "<html>\n<body>\n<table><th align=\"left\">Name</th><th>Size</th><th>Date Modified</th>\n"
#define ROW_FORMAT "<td><a href=\"%s\">%s</a></td><td align=\"right\">%s</td><td align=\"right\" margin=8>%s</td>\n"
#define EXIT_STRING "</table>\n</html>\n"
#include <config.h>
#endif
-#include <stdlib.h>
#include <string.h>
-#include <gio/gio.h>
#include "soup-filter-input-stream.h"
+#include "soup.h"
/* This is essentially a subset of GDataInputStream, except that we
* can do the equivalent of "fill_nonblocking()" on it. (We could use
#include <string.h>
#include "soup-form.h"
-#include "soup-message.h"
-#include "soup-uri.h"
+#include "soup.h"
/**
* SECTION:soup-form
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
#include "soup-headers.h"
-#include "soup-misc.h"
-#include "soup-uri.h"
+#include "soup.h"
/**
* soup_headers_parse:
#include <config.h>
#endif
-#include <gio/gio.h>
-
#include "soup-io-stream.h"
+#include "soup.h"
#include "soup-filter-input-stream.h"
struct _SoupIOStreamPrivate {
#include <string.h>
#include "soup-logger.h"
-#include "soup-message.h"
-#include "soup-session.h"
-#include "soup-session-feature.h"
-#include "soup-socket.h"
-#include "soup-uri.h"
+#include "soup.h"
/**
* SECTION:soup-logger
#include <string.h>
#include "soup-message-body.h"
+#include "soup.h"
/**
* SECTION:soup-message-body
#include "config.h"
#endif
-#include <stdlib.h>
#include <string.h>
+#include "soup.h"
#include "soup-connection.h"
#include "soup-message-private.h"
-#include "soup-auth.h"
-#include "soup-connection.h"
-#include "soup-headers.h"
#include "soup-message-queue.h"
#include "soup-misc-private.h"
-#include "soup-session-async.h"
-#include "soup-uri.h"
static guint
parse_response_headers (SoupMessage *req,
* Copyright (C) 2007, 2008 Red Hat, Inc.
*/
-#include <stdio.h>
#include <string.h>
#include "soup-message-headers.h"
-#include "soup-headers.h"
-#include "soup-misc.h"
+#include "soup.h"
/**
* SECTION:soup-message-headers
{
char length[128];
- snprintf (length, sizeof (length), "%" G_GUINT64_FORMAT,
- content_length);
+ g_snprintf (length, sizeof (length), "%" G_GUINT64_FORMAT,
+ content_length);
soup_message_headers_remove (hdrs, "Transfer-Encoding");
soup_message_headers_replace (hdrs, "Content-Length", length);
}
#include "config.h"
#endif
-#include <stdlib.h>
-#include <string.h>
-
#include <glib/gi18n-lib.h>
+#include "soup.h"
#include "soup-body-input-stream.h"
#include "soup-body-output-stream.h"
#include "soup-client-input-stream.h"
#include "soup-content-sniffer-stream.h"
#include "soup-converter-wrapper.h"
#include "soup-filter-input-stream.h"
-#include "soup-message.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc.h"
#include "soup-misc-private.h"
typedef enum {
#endif
#include "soup-message-queue.h"
-#include "soup-uri.h"
+#include "soup.h"
/* This is an internal structure used by #SoupSession and its
* subclasses to keep track of the status of messages currently being
#include "config.h"
#endif
-#include <stdlib.h>
#include <string.h>
+#include "soup.h"
#include "soup-message-private.h"
-#include "soup-address.h"
-#include "soup-auth.h"
-#include "soup-headers.h"
#include "soup-misc-private.h"
-#include "soup-multipart.h"
-#include "soup-server.h"
-#include "soup-socket.h"
static guint
parse_request_headers (SoupMessage *msg, char *headers, guint headers_len,
* Copyright (C) 2000-2003, Ximian, Inc.
*/
-#include <stdlib.h>
-#include <string.h>
+//#include <stdlib.h>
+//#include <string.h>
-#include "soup-address.h"
-#include "soup-auth.h"
+#include "soup-message.h"
+#include "soup.h"
#include "soup-connection.h"
-#include "soup-enum-types.h"
#include "soup-marshal.h"
-#include "soup-message.h"
#include "soup-message-private.h"
-#include "soup-misc.h"
-#include "soup-socket.h"
-#include "soup-uri.h"
/**
* SECTION:soup-message
* Copyright (C) 2000-2003, Ximian, Inc.
*/
-#include <ctype.h>
#include <string.h>
#include "soup-misc.h"
#include <string.h>
#include "soup-multipart.h"
-#include "soup-headers.h"
+#include "soup.h"
/**
* SECTION:soup-multipart
#include <config.h>
#endif
+#include <gnome-keyring.h>
+
#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
#include "soup-password-manager-gnome.h"
-#include "soup-auth.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
-
-#include <gnome-keyring.h>
+#include "soup.h"
static void soup_password_manager_gnome_interface_init (SoupPasswordManagerInterface *password_manager_interface);
#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
#include "soup-password-manager.h"
-#include "soup-session-feature.h"
+#include "soup.h"
G_DEFINE_INTERFACE_WITH_CODE (SoupPasswordManager, soup_password_manager, G_TYPE_OBJECT,
g_type_interface_add_prerequisite (g_define_type_id, SOUP_TYPE_SESSION_FEATURE);
* Copyright (C) 2007 Novell, Inc.
*/
-#include "soup-path-map.h"
#include <string.h>
+#include "soup-path-map.h"
+
/* This could be replaced with something more clever, like a Patricia
* trie, but it's probably not worth it since the total number of
* mappings is likely to always be small. So we keep an array of
#include <config.h>
#endif
-#include <string.h>
-#include <stdlib.h>
-
#include "soup-proxy-resolver-default.h"
-#include "soup-proxy-uri-resolver.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
+#include "soup.h"
/**
* SoupProxyResolverDefault:
#include <string.h>
#include "soup-proxy-resolver-gnome.h"
+#include "soup.h"
G_DEFINE_TYPE (SoupProxyResolverGNOME, soup_proxy_resolver_gnome, SOUP_TYPE_PROXY_RESOLVER_DEFAULT)
#include <config.h>
#endif
-#include <string.h>
-
#include "soup-proxy-resolver-static.h"
-#include "soup-address.h"
-#include "soup-message.h"
-#include "soup-misc.h"
-#include "soup-session-feature.h"
+#include "soup.h"
typedef struct {
SoupURI *proxy_uri;
#endif
#include "soup-proxy-resolver.h"
-#include "soup-proxy-uri-resolver.h"
-#include "soup-address.h"
-#include "soup-message.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
+#include "soup.h"
static void soup_proxy_resolver_default_init (SoupProxyResolverInterface *iface);
static void soup_proxy_resolver_uri_resolver_interface_init (SoupProxyURIResolverInterface *uri_resolver_interface);
#endif
#include "soup-proxy-uri-resolver.h"
-#include "soup-session-feature.h"
+#include "soup.h"
G_DEFINE_INTERFACE (SoupProxyURIResolver, soup_proxy_uri_resolver, G_TYPE_OBJECT)
#include <config.h>
#endif
+#include <glib/gi18n-lib.h>
+
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-request-data.h"
-
-#include "soup-requester.h"
+#include "soup.h"
#include "soup-misc-private.h"
-#include <libsoup/soup.h>
-#include <glib/gi18n.h>
G_DEFINE_TYPE (SoupRequestData, soup_request_data, SOUP_TYPE_REQUEST)
#include <config.h>
#endif
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
+#include <glib/gi18n-lib.h>
-#include <glib/gi18n.h>
+#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-request-file.h"
+#include "soup.h"
#include "soup-directory-input-stream.h"
#include "soup-requester.h"
-#include "soup-uri.h"
G_DEFINE_TYPE (SoupRequestFile, soup_request_file, SOUP_TYPE_REQUEST)
#include <config.h>
#endif
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-request-http.h"
-#include "soup-cache.h"
+#include "soup.h"
#include "soup-cache-private.h"
-#include "soup-message.h"
-#include "soup-session.h"
#include "soup-session-private.h"
-#include "soup-uri.h"
G_DEFINE_TYPE (SoupRequestHTTP, soup_request_http, SOUP_TYPE_REQUEST)
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-request.h"
+#include "soup.h"
#include "soup-requester.h"
-#include "soup-session.h"
-#include "soup-uri.h"
/**
* SECTION:soup-request
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include "soup-requester.h"
+#include "soup.h"
#include "soup-request-data.h"
#include "soup-request-file.h"
#include "soup-request-http.h"
-#include "soup-session-feature.h"
-#include "soup-uri.h"
static SoupSessionFeatureInterface *soup_requester_default_feature_interface;
static void soup_requester_session_feature_init (SoupSessionFeatureInterface *feature_interface, gpointer interface_data);
#include <config.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "soup-server.h"
-#include "soup-address.h"
-#include "soup-auth-domain.h"
-#include "soup-date.h"
-#include "soup-form.h"
-#include "soup-headers.h"
+#include "soup.h"
#include "soup-message-private.h"
#include "soup-marshal.h"
#include "soup-path-map.h"
-#include "soup-socket.h"
/**
* SECTION:soup-server
#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-#include "soup-address.h"
#include "soup-session-async.h"
+#include "soup.h"
#include "soup-session-private.h"
-#include "soup-address.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc.h"
-#include "soup-password-manager.h"
-#include "soup-uri.h"
/**
* SECTION:soup-session-async
#endif
#include "soup-session-feature.h"
+#include "soup.h"
#include "soup-message-private.h"
/**
#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-#include "soup-address.h"
#include "soup-session-sync.h"
+#include "soup.h"
#include "soup-session-private.h"
-#include "soup-address.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc.h"
-#include "soup-password-manager.h"
-#include "soup-uri.h"
/**
* SECTION:soup-session-sync
#include <config.h>
#endif
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
#include <glib/gi18n-lib.h>
-#include "soup-auth.h"
-#include "soup-auth-basic.h"
-#include "soup-auth-digest.h"
+#include "soup-session.h"
+#include "soup.h"
#include "soup-auth-manager-ntlm.h"
#include "soup-connection.h"
#include "soup-marshal.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc.h"
#include "soup-proxy-resolver-static.h"
-#include "soup-proxy-uri-resolver.h"
-#include "soup-session.h"
-#include "soup-session-feature.h"
#include "soup-session-private.h"
-#include "soup-socket.h"
-#include "soup-uri.h"
#define HOST_KEEP_ALIVE 5 * 60 * 1000 /* 5 min in msecs */
#include <config.h>
#endif
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <string.h>
-#include <unistd.h>
#include "soup-socket.h"
-#include "soup-address.h"
+#include "soup.h"
#include "soup-filter-input-stream.h"
#include "soup-io-stream.h"
#include "soup-marshal.h"
-#include "soup-misc.h"
#include "soup-misc-private.h"
-#include "soup-uri.h"
/**
* SECTION:soup-socket
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "config.h"
-
-#include <glib.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include "soup-status.h"
+#include "soup.h"
/**
* SECTION:soup-status
#include <config.h>
#endif
-#include <gio/gio.h>
-#include <glib/gi18n-lib.h>
#include <string.h>
+#include <glib/gi18n-lib.h>
+
#include "soup-tld.h"
+#include "soup.h"
#include "soup-tld-private.h"
static void soup_tld_ensure_rules_hash_table (void);
#ifndef __SOUP_TLD_H__
#define __SOUP_TLD_H__
+#include <libsoup/soup-types.h>
+
G_BEGIN_DECLS
const char *soup_tld_get_base_domain (const char *hostname,
* Copyright 1999-2003 Ximian, Inc.
*/
-#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "soup-uri.h"
+#include "soup.h"
#include "soup-misc-private.h"
-#include "soup-form.h"
-#include "soup-misc.h"
/**
* SECTION:soup-uri
* Copyright (C) 2007 Red Hat, Inc.
*/
-#include "soup-value-utils.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <string.h>
+#include "soup-value-utils.h"
+
/**
* SECTION:soup-value-utils
* @short_description: #GValue utilities
#endif
#include <string.h>
-#include <time.h>
#include <libxml/tree.h>
#include "soup-xmlrpc.h"
-#include "soup-value-utils.h"
-#include "soup-date.h"
-#include "soup-message.h"
-#include "soup-misc.h"
-#include "soup-session.h"
+#include "soup.h"
/**
* SECTION:soup-xmlrpc
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "libsoup/soup.h"
-#include "libsoup/soup-auth.h"
-#include "libsoup/soup-session.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
msg = soup_message_new_from_uri (SOUP_METHOD_GET, soup_uri);
soup_uri_free (soup_uri);
if (!msg) {
- fprintf (stderr, "auth-test: Could not parse URI\n");
+ g_printerr ("auth-test: Could not parse URI\n");
exit (1);
}
* Copyright (C) 2008 Red Hat, Inc.
*/
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib.h>
-#include <libsoup/soup.h>
-
#include "test-utils.h"
typedef struct {
* Copyright (C) 2011 Igalia, S.L.
*/
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-#include <libsoup/soup-request-http.h>
-
#include "test-utils.h"
SoupServer *server;
* Copyright 2007-2012 Red Hat, Inc.
*/
-#include <string.h>
-
-#include <libsoup/soup.h>
-
#include "test-utils.h"
SoupServer *server;
* Copyright (C) 2007 Red Hat, Inc.
*/
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <libsoup/soup-address.h>
-#include <libsoup/soup-message.h>
-#include <libsoup/soup-misc.h>
-#include <libsoup/soup-server.h>
-#include <libsoup/soup-session-async.h>
-#include <libsoup/soup-session-sync.h>
-
#include "test-utils.h"
static char *base_uri;
* Copyright (C) 2007 Novell, Inc.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <libsoup/soup.h>
-#include <libsoup/soup-auth-domain-basic.h>
-#include <libsoup/soup-server.h>
-
#include "test-utils.h"
#define SHORT_BODY "This is a test.\r\n"
* Copyright (C) 2010 Igalia S.L.
*/
-#include <string.h>
-
-#include <glib.h>
-#include <libsoup/soup.h>
-
#include "test-utils.h"
SoupServer *server;
* Copyright (C) 2005 Novell, Inc.
*/
-#include <stdio.h>
-#include <string.h>
-
-#include <libsoup/soup-date.h>
-#include <glib.h>
-
#include "test-utils.h"
static gboolean check_ok (const char *strdate, SoupDate *date);
-#include <config.h>
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libsoup/soup-address.h"
+#include "test-utils.h"
static GMainLoop *loop;
static int nlookups = 0;
resolve_callback (SoupAddress *addr, guint status, gpointer data)
{
if (status == SOUP_STATUS_OK) {
- printf ("Name: %s\n", soup_address_get_name (addr));
- printf ("Address: %s\n", soup_address_get_physical (addr));
+ g_print ("Name: %s\n", soup_address_get_name (addr));
+ g_print ("Address: %s\n", soup_address_get_physical (addr));
} else {
- printf ("Name: %s\n", soup_address_get_name (addr));
- printf ("Error: %s\n", soup_status_get_phrase (status));
+ g_print ("Name: %s\n", soup_address_get_name (addr));
+ g_print ("Error: %s\n", soup_status_get_phrase (status));
}
- printf ("\n");
+ g_print ("\n");
g_object_unref (addr);
static void
usage (void)
{
- fprintf (stderr, "Usage: dns hostname ...\n");
+ g_printerr ("Usage: dns hostname ...\n");
exit (1);
}
for (i = 1; i < argc; i++) {
addr = soup_address_new (argv[i], 0);
if (!addr) {
- fprintf (stderr, "Could not parse address %s\n", argv[1]);
+ g_printerr ("Could not parse address %s\n", argv[1]);
exit (1);
}
* Copyright (C) 2007, 2008 Red Hat, Inc.
*/
-#include "config.h"
-
-#include <ctype.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <libsoup/soup.h>
-
#include "test-utils.h"
static struct {
hello_callback, NULL, NULL);
soup_server_add_handler (server, "/md5",
md5_callback, NULL, NULL);
- port = soup_server_get_port (server);
+ port = soup_server_get_port (server);
loop = g_main_loop_new (NULL, TRUE);
do_form_decode_test ();
} else {
- printf ("Listening on port %d\n", port);
+ g_print ("Listening on port %d\n", port);
g_main_loop_run (loop);
}
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
+#include "test-utils.h"
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <libsoup/soup.h>
static SoupSession *session;
static GMainLoop *loop;
const char *hname, *value;
char *path = soup_uri_to_string (soup_message_get_uri (msg), TRUE);
- printf ("%s %s HTTP/1.%d\n", method, path,
- soup_message_get_http_version (msg));
+ g_print ("%s %s HTTP/1.%d\n", method, path,
+ soup_message_get_http_version (msg));
soup_message_headers_iter_init (&iter, msg->request_headers);
while (soup_message_headers_iter_next (&iter, &hname, &value))
- printf ("%s: %s\r\n", hname, value);
- printf ("\n");
+ g_print ("%s: %s\r\n", hname, value);
+ g_print ("\n");
- printf ("HTTP/1.%d %d %s\n",
- soup_message_get_http_version (msg),
- msg->status_code, msg->reason_phrase);
+ g_print ("HTTP/1.%d %d %s\n",
+ soup_message_get_http_version (msg),
+ msg->status_code, msg->reason_phrase);
soup_message_headers_iter_init (&iter, msg->response_headers);
while (soup_message_headers_iter_next (&iter, &hname, &value))
- printf ("%s: %s\r\n", hname, value);
- printf ("\n");
+ g_print ("%s: %s\r\n", hname, value);
+ g_print ("\n");
} else if (msg->status_code == SOUP_STATUS_SSL_FAILED) {
GTlsCertificateFlags flags;
if (soup_message_get_https_status (msg, NULL, &flags))
- printf ("%s: %d %s (0x%x)\n", name, msg->status_code, msg->reason_phrase, flags);
+ g_print ("%s: %d %s (0x%x)\n", name, msg->status_code, msg->reason_phrase, flags);
else
- printf ("%s: %d %s (no handshake status)\n", name, msg->status_code, msg->reason_phrase);
+ g_print ("%s: %d %s (no handshake status)\n", name, msg->status_code, msg->reason_phrase);
} else if (!quiet || SOUP_STATUS_IS_TRANSPORT_ERROR (msg->status_code))
- printf ("%s: %d %s\n", name, msg->status_code, msg->reason_phrase);
+ g_print ("%s: %d %s\n", name, msg->status_code, msg->reason_phrase);
if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
header = soup_message_headers_get_one (msg->response_headers,
char *uri_string;
if (!debug && !quiet)
- printf (" -> %s\n", header);
+ g_print (" -> %s\n", header);
uri = soup_uri_new_with_base (soup_message_get_uri (msg), header);
uri_string = soup_uri_to_string (uri, FALSE);
static void
usage (void)
{
- fprintf (stderr, "Usage: get [-c CAfile] [-p proxy URL] [-h] [-d] URL\n");
+ g_printerr ("Usage: get [-c CAfile] [-p proxy URL] [-h] [-d] URL\n");
exit (1);
}
case 'p':
proxy = soup_uri_new (optarg);
if (!proxy) {
- fprintf (stderr, "Could not parse %s as URI\n",
- optarg);
+ g_printerr ("Could not parse %s as URI\n",
+ optarg);
exit (1);
}
break;
url = argv[0];
parsed = soup_uri_new (url);
if (!parsed) {
- fprintf (stderr, "Could not parse '%s' as a URL\n", url);
+ g_printerr ("Could not parse '%s' as a URL\n", url);
exit (1);
}
soup_uri_free (parsed);
-#include <config.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <libsoup/soup.h>
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
* Copyright 2007-2012 Red Hat, Inc.
*/
-#include <string.h>
-
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-
#include "test-utils.h"
SoupServer *server, *ssl_server;
* set in the right messages.
*/
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <libsoup/soup-address.h>
-#include <libsoup/soup-auth.h>
-#include <libsoup/soup-message.h>
-#include <libsoup/soup-server.h>
-#include <libsoup/soup-session-async.h>
-
#include "test-utils.h"
typedef enum {
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-#include <libsoup/soup-request-http.h>
#include "test-utils.h"
typedef struct {
msg = soup_message_new (SOUP_METHOD_GET, url);
if (!msg) {
- fprintf (stderr, "proxy-test: Could not parse URI\n");
+ g_printerr ("proxy-test: Could not parse URI\n");
exit (1);
}
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "libsoup/soup.h"
-#include "libsoup/soup-session.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
msg = soup_message_new (SOUP_METHOD_GET, uri);
soup_session_send_message (session, msg);
if (msg->status_code != SOUP_STATUS_OK) {
- fprintf (stderr, "Could not fetch %s: %d %s\n", uri,
- msg->status_code, msg->reason_phrase);
+ g_printerr ("Could not fetch %s: %d %s\n", uri,
+ msg->status_code, msg->reason_phrase);
exit (1);
}
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "libsoup/soup.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
GError *error = NULL;
if (!g_file_get_contents (SRCDIR "/index.txt", &contents, &length, &error)) {
- fprintf (stderr, "Could not read index.txt: %s\n",
- error->message);
+ g_printerr ("Could not read index.txt: %s\n",
+ error->message);
exit (1);
}
* Copyright (C) 2008 Red Hat, Inc.
*/
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib.h>
-
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-#include <libsoup/soup-request-http.h>
-
#include "test-utils.h"
char *server2_uri;
do_connection_test (base_uri);
soup_uri_free (base_uri);
} else {
- printf ("Listening on port %d\n", port);
+ g_print ("Listening on port %d\n", port);
g_main_loop_run (loop);
}
* Copyright (C) 2011 Red Hat, Inc.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-#include <libsoup/soup-request-http.h>
-
#include "test-utils.h"
SoupServer *server;
GError *error = NULL;
if (!g_file_get_contents (SRCDIR "/index.txt", &contents, &length, &error)) {
- fprintf (stderr, "Could not read index.txt: %s\n",
- error->message);
+ g_printerr ("Could not read index.txt: %s\n",
+ error->message);
exit (1);
}
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "config.h"
-
-#include <ctype.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <libsoup/soup-address.h>
-#include <libsoup/soup-auth-domain-basic.h>
-#include <libsoup/soup-auth-domain-digest.h>
-#include <libsoup/soup-message.h>
-#include <libsoup/soup-server.h>
-
#include "test-utils.h"
static struct {
do_auth_tests (uri);
soup_uri_free (uri);
} else {
- printf ("Listening on port %d\n", soup_server_get_port (server));
+ g_print ("Listening on port %d\n", soup_server_get_port (server));
g_main_loop_run (loop);
}
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "config.h"
+#include "test-utils.h"
-#include <ctype.h>
#include <dirent.h>
-#include <fcntl.h>
#include <errno.h>
-#include <signal.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/stat.h>
-#include <unistd.h>
#ifdef HAVE_MMAP
#include <sys/mman.h>
#endif
-#include <libsoup/soup.h>
-
#ifdef HAVE_MMAP
struct mapping {
void *start;
SoupMessageHeadersIter iter;
const char *name, *value;
- printf ("%s %s HTTP/1.%d\n", msg->method, path,
- soup_message_get_http_version (msg));
+ g_print ("%s %s HTTP/1.%d\n", msg->method, path,
+ soup_message_get_http_version (msg));
soup_message_headers_iter_init (&iter, msg->request_headers);
while (soup_message_headers_iter_next (&iter, &name, &value))
- printf ("%s: %s\n", name, value);
+ g_print ("%s: %s\n", name, value);
if (msg->request_body->length)
- printf ("%s\n", msg->request_body->data);
+ g_print ("%s\n", msg->request_body->data);
file_path = g_strdup_printf (".%s", path);
soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED);
g_free (file_path);
- printf (" -> %d %s\n\n", msg->status_code, msg->reason_phrase);
+ g_print (" -> %d %s\n\n", msg->status_code, msg->reason_phrase);
}
static void
ssl_port = atoi (optarg);
break;
default:
- fprintf (stderr, "Usage: %s [-p port] [-c ssl-cert-file -k ssl-key-file [-s ssl-port]]\n",
- argv[0]);
+ g_printerr ("Usage: %s [-p port] [-c ssl-cert-file -k ssl-key-file [-s ssl-port]]\n",
+ argv[0]);
exit (1);
}
}
SOUP_SERVER_SERVER_HEADER, "simple-httpd ",
NULL);
if (!server) {
- fprintf (stderr, "Unable to bind to server port %d\n", port);
+ g_printerr ("Unable to bind to server port %d\n", port);
exit (1);
}
soup_server_add_handler (server, NULL,
server_callback, NULL, NULL);
- printf ("\nStarting Server on port %d\n",
- soup_server_get_port (server));
+ g_print ("\nStarting Server on port %d\n",
+ soup_server_get_port (server));
soup_server_run_async (server);
if (ssl_cert_file && ssl_key_file) {
NULL);
if (!ssl_server) {
- fprintf (stderr, "Unable to bind to SSL server port %d\n", ssl_port);
+ g_printerr ("Unable to bind to SSL server port %d\n", ssl_port);
exit (1);
}
soup_server_add_handler (ssl_server, NULL,
server_callback, NULL, NULL);
- printf ("Starting SSL Server on port %d\n",
- soup_server_get_port (ssl_server));
+ g_print ("Starting SSL Server on port %d\n",
+ soup_server_get_port (ssl_server));
soup_server_run_async (ssl_server);
}
- printf ("\nWaiting for requests...\n");
+ g_print ("\nWaiting for requests...\n");
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <libsoup/soup.h>
+#include "test-utils.h"
/* WARNING: this is really really really not especially compliant with
* RFC 2616. But it does work for basic stuff.
static void
send_headers (SoupMessage *from, SoupMessage *to)
{
- printf ("[%p] HTTP/1.%d %d %s\n", to,
- soup_message_get_http_version (from),
- from->status_code, from->reason_phrase);
+ g_print ("[%p] HTTP/1.%d %d %s\n", to,
+ soup_message_get_http_version (from),
+ from->status_code, from->reason_phrase);
soup_message_set_status_full (to, from->status_code,
from->reason_phrase);
static void
send_chunk (SoupMessage *from, SoupBuffer *chunk, SoupMessage *to)
{
- printf ("[%p] writing chunk of %lu bytes\n", to,
- (unsigned long)chunk->length);
+ g_print ("[%p] writing chunk of %lu bytes\n", to,
+ (unsigned long)chunk->length);
soup_message_body_append_buffer (to->response_body, chunk);
soup_server_unpause_message (server, to);
{
SoupMessage *msg = data;
- printf ("[%p] done\n\n", msg);
+ g_print ("[%p] done\n\n", msg);
g_signal_handlers_disconnect_by_func (msg, client_msg_failed, msg2);
soup_message_body_complete (msg->response_body);
char *uristr;
uristr = soup_uri_to_string (soup_message_get_uri (msg), FALSE);
- printf ("[%p] %s %s HTTP/1.%d\n", msg, msg->method, uristr,
- soup_message_get_http_version (msg));
+ g_print ("[%p] %s %s HTTP/1.%d\n", msg, msg->method, uristr,
+ soup_message_get_http_version (msg));
if (msg->method == SOUP_METHOD_CONNECT) {
soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED);
port = atoi (optarg);
break;
default:
- fprintf (stderr, "Usage: %s [-p port] [-n]\n",
- argv[0]);
+ g_printerr ("Usage: %s [-p port] [-n]\n",
+ argv[0]);
exit (1);
}
}
server = soup_server_new (SOUP_SERVER_PORT, port,
NULL);
if (!server) {
- fprintf (stderr, "Unable to bind to server port %d\n", port);
+ g_printerr ("Unable to bind to server port %d\n", port);
exit (1);
}
soup_server_add_handler (server, NULL,
g_object_unref (auth_domain);
}
- printf ("\nStarting proxy on port %d\n",
- soup_server_get_port (server));
+ g_print ("\nStarting proxy on port %d\n",
+ soup_server_get_port (server));
soup_server_run_async (server);
session = soup_session_async_new ();
- printf ("\nWaiting for requests...\n");
+ g_print ("\nWaiting for requests...\n");
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
* Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>.
*/
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <libsoup/soup.h>
-
#include "test-utils.h"
SoupSession *session;
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "libsoup/soup.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
* Copyright (C) 2008 Red Hat, Inc.
*/
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib.h>
-#include <libsoup/soup.h>
-
#include "test-utils.h"
#define RESPONSE_CHUNK_SIZE 1024
&full_response,
&full_response_length,
&error)) {
- fprintf (stderr, "Could not read index file %s: %s\n",
- SRCDIR "/index.txt", error->message);
+ g_printerr ("Could not read index file %s: %s\n",
+ SRCDIR "/index.txt", error->message);
g_error_free (error);
exit (1);
}
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
-#include "libsoup/soup.h"
+
+#include <glib/gprintf.h>
#include <locale.h>
#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#ifdef HAVE_APACHE
static gboolean apache_running;
g_option_context_add_main_entries (opts, entries, NULL);
if (!g_option_context_parse (opts, &argc, &argv, &error)) {
- fprintf (stderr, "Could not parse arguments: %s\n",
- error->message);
- fprintf (stderr, "%s",
- g_option_context_get_help (opts, TRUE, NULL));
+ g_printerr ("Could not parse arguments: %s\n",
+ error->message);
+ g_printerr ("%s",
+ g_option_context_get_help (opts, TRUE, NULL));
exit (1);
}
g_option_context_free (opts);
debug_printf (1, "\n");
if (errors) {
- printf ("%s: %d error(s).%s\n",
- g_get_prgname (), errors,
- debug_level == 0 ? " Run with '-d' for details" : "");
+ g_print ("%s: %d error(s).%s\n",
+ g_get_prgname (), errors,
+ debug_level == 0 ? " Run with '-d' for details" : "");
} else
- printf ("%s: OK\n", g_get_prgname ());
+ g_print ("%s: OK\n", g_get_prgname ());
}
void
return;
va_start (args, format);
- vprintf (format, args);
+ g_vprintf (format, args);
va_end (args);
}
apache_init (void)
{
if (!apache_cmd ("start")) {
- fprintf (stderr, "Could not start apache\n");
+ g_printerr ("Could not start apache\n");
exit (1);
}
apache_running = TRUE;
g_main_context_unref (async_context);
if (!server) {
- fprintf (stderr, "Unable to create server\n");
+ g_printerr ("Unable to create server\n");
exit (1);
}
#include "config.h"
#endif
-#include "libsoup/soup-types.h"
+#include <string.h>
+#include <stdlib.h>
+
+#define LIBSOUP_USE_UNSTABLE_REQUEST_API
+
+#include "libsoup/soup.h"
+#include "libsoup/soup-requester.h"
+#include "libsoup/soup-request-data.h"
+#include "libsoup/soup-request-file.h"
+#include "libsoup/soup-request-http.h"
void test_init (int argc, char **argv, GOptionEntry *entries);
void test_cleanup (void);
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "libsoup/soup.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
* Copyright (C) 2012 Igalia S.L.
*/
-#include <glib.h>
-#include <libsoup/soup.h>
-#include <string.h>
-
#include "test-utils.h"
/* From http://publicsuffix.org/list/test.txt */
-#include <config.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "libsoup/soup-uri.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include "test-utils.h"
debug_printf (1, "\nRelative URI parsing\n");
base_uri = soup_uri_new (base);
if (!base_uri) {
- fprintf (stderr, "Could not parse %s!\n", base);
+ g_printerr ("Could not parse %s!\n", base);
exit (1);
}
uri_string = soup_uri_to_string (base_uri, FALSE);
if (strcmp (uri_string, base) != 0) {
- fprintf (stderr, "URI <%s> unparses to <%s>\n",
- base, uri_string);
+ g_printerr ("URI <%s> unparses to <%s>\n",
+ base, uri_string);
errors++;
}
g_free (uri_string);
* Copyright (C) 2008 Red Hat, Inc.
*/
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/wait.h>
-
-#include <libsoup/soup.h>
-
#include "test-utils.h"
#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (status == G_IO_STATUS_NORMAL) {
/* Don't print the exit status, just the debug stuff */
if (strncmp (line, "xmlrpc-test:", strlen ("xmlrpc-test:")) != 0)
- printf ("%s", line);
+ g_print ("%s", line);
g_free (line);
return TRUE;
} else if (status == G_IO_STATUS_AGAIN)
g_free (argv[3]);
if (!ok) {
- printf ("Could not run xmlrpc-test: %s\n", error->message);
+ g_print ("Could not run xmlrpc-test: %s\n", error->message);
errors++;
return;
}
do_xmlrpc_tests (uri);
soup_uri_free (uri);
} else
- printf ("Listening on port %d\n", soup_server_get_port (server));
+ g_print ("Listening on port %d\n", soup_server_get_port (server));
g_main_loop_run (loop);
g_main_loop_unref (loop);
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <libsoup/soup.h>
-
#include "test-utils.h"
#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
ints = g_value_array_new (10);
for (i = sum = 0; i < 10; i++) {
- val = rand () % 100;
+ val = g_random_int_range (0, 100);
debug_printf (2, "%s%d", i == 0 ? "[" : ", ", val);
soup_value_array_append (ints, G_TYPE_INT, val);
sum += val;
bools = g_value_array_new (10);
for (i = trues = falses = 0; i < 10; i++) {
- val = rand () > (RAND_MAX / 2);
+ val = g_random_boolean ();
debug_printf (2, "%s%c", i == 0 ? "[" : ", ", val ? 'T' : 'F');
soup_value_array_append (bools, G_TYPE_BOOLEAN, val);
if (val)
data = g_byte_array_new ();
g_byte_array_set_size (data, 256);
for (i = 0; i < data->len; i++)
- data->data[i] = (char)(rand ());
+ data->data[i] = (char)(g_random_int_range (0, 256));
checksum = g_checksum_new (G_CHECKSUM_MD5);
g_checksum_update (checksum, data->data, data->len);
debug_printf (1, "dateChange (date, struct of ints -> time): ");
- date = soup_date_new (1970 + (rand () % 50),
- 1 + rand () % 12,
- 1 + rand () % 28,
- rand () % 24,
- rand () % 60,
- rand () % 60);
+ date = soup_date_new (1970 + (g_random_int_range (0, 50)),
+ 1 + g_random_int_range (0, 12),
+ 1 + g_random_int_range (0, 28),
+ g_random_int_range (0, 24),
+ g_random_int_range (0, 60),
+ g_random_int_range (0, 60));
if (debug_level >= 2) {
timestamp = soup_date_to_string (date, SOUP_DATE_ISO8601_XMLRPC);
debug_printf (2, "date: %s, {", timestamp);
structval = soup_value_hash_new ();
- if (rand () % 3) {
- date->year = 1970 + (rand () % 50);
+#define MAYBE (g_random_int_range (0, 3) != 0)
+
+ if (MAYBE) {
+ date->year = 1970 + (g_random_int_range (0, 50));
debug_printf (2, "tm_year: %d, ", date->year - 1900);
soup_value_hash_insert (structval, "tm_year",
G_TYPE_INT, date->year - 1900);
}
- if (rand () % 3) {
- date->month = 1 + rand () % 12;
+ if (MAYBE) {
+ date->month = 1 + g_random_int_range (0, 12);
debug_printf (2, "tm_mon: %d, ", date->month - 1);
soup_value_hash_insert (structval, "tm_mon",
G_TYPE_INT, date->month - 1);
}
- if (rand () % 3) {
- date->day = 1 + rand () % 28;
+ if (MAYBE) {
+ date->day = 1 + g_random_int_range (0, 28);
debug_printf (2, "tm_mday: %d, ", date->day);
soup_value_hash_insert (structval, "tm_mday",
G_TYPE_INT, date->day);
}
- if (rand () % 3) {
- date->hour = rand () % 24;
+ if (MAYBE) {
+ date->hour = g_random_int_range (0, 24);
debug_printf (2, "tm_hour: %d, ", date->hour);
soup_value_hash_insert (structval, "tm_hour",
G_TYPE_INT, date->hour);
}
- if (rand () % 3) {
- date->minute = rand () % 60;
+ if (MAYBE) {
+ date->minute = g_random_int_range (0, 60);
debug_printf (2, "tm_min: %d, ", date->minute);
soup_value_hash_insert (structval, "tm_min",
G_TYPE_INT, date->minute);
}
- if (rand () % 3) {
- date->second = rand () % 60;
+ if (MAYBE) {
+ date->second = g_random_int_range (0, 60);
debug_printf (2, "tm_sec: %d, ", date->second);
soup_value_hash_insert (structval, "tm_sec",
G_TYPE_INT, date->second);
uri = default_uri;
}
- srand (time (NULL));
-
session = soup_test_session_new (SOUP_TYPE_SESSION_SYNC, NULL);
if (!test_sum ())