From: Dan Winship Date: Wed, 27 Aug 2003 13:13:30 +0000 (+0000) Subject: New header with typedefs, to avoid #include loops among other headers. X-Git-Tag: LIBSOUP_2_1_2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3594d2168cfa7505f66ebb7991fb9f3a3d5edd41;p=platform%2Fupstream%2Flibsoup.git New header with typedefs, to avoid #include loops among other headers. * libsoup/soup-types.h: New header with typedefs, to avoid #include loops among other headers. * libsoup/Makefile.am (libsoupinclude_HEADERS): add it * libsoup/*.[ch], tests/*.c: Update for soup-types.h --- diff --git a/ChangeLog b/ChangeLog index 52788d9..05ed0d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-08-27 Dan Winship + + * libsoup/soup-types.h: New header with typedefs, to avoid + #include loops among other headers. + + * libsoup/Makefile.am (libsoupinclude_HEADERS): add it + + * libsoup/*.[ch], tests/*.c: Update for soup-types.h + 2003-08-26 Dan Winship * libsoup/soup-message-client-io.c (soup_message_write_request, diff --git a/libsoup/Makefile.am b/libsoup/Makefile.am index 4a6397e..90ec79f 100644 --- a/libsoup/Makefile.am +++ b/libsoup/Makefile.am @@ -41,6 +41,7 @@ libsoupinclude_HEADERS = \ soup-server-message.h \ soup-server.h \ soup-socket.h \ + soup-types.h \ soup-uri.h lib_LTLIBRARIES = libsoup-2.2.la diff --git a/libsoup/soup-address.h b/libsoup/soup-address.h index 5de2b09..ba066de 100644 --- a/libsoup/soup-address.h +++ b/libsoup/soup-address.h @@ -6,11 +6,10 @@ #ifndef SOUP_ADDRESS_H #define SOUP_ADDRESS_H -#include #include #include -#include +#include #define SOUP_TYPE_ADDRESS (soup_address_get_type ()) #define SOUP_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_ADDRESS, SoupAddress)) @@ -21,11 +20,11 @@ typedef struct SoupAddressPrivate SoupAddressPrivate; -typedef struct { +struct SoupAddress { GObject parent; SoupAddressPrivate *priv; -} SoupAddress; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-auth.h b/libsoup/soup-auth.h index 017331d..2e936a3 100644 --- a/libsoup/soup-auth.h +++ b/libsoup/soup-auth.h @@ -6,9 +6,7 @@ #ifndef SOUP_AUTH_H #define SOUP_AUTH_H 1 -#include -#include -#include +#include #define SOUP_TYPE_AUTH (soup_auth_get_type ()) #define SOUP_AUTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_AUTH, SoupAuth)) diff --git a/libsoup/soup-connection.h b/libsoup/soup-connection.h index 723450f..e9b17f8 100644 --- a/libsoup/soup-connection.h +++ b/libsoup/soup-connection.h @@ -8,9 +8,7 @@ #include -#include -#include -#include +#include #define SOUP_TYPE_CONNECTION (soup_connection_get_type ()) #define SOUP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CONNECTION, SoupConnection)) @@ -21,11 +19,11 @@ typedef struct SoupConnectionPrivate SoupConnectionPrivate; -typedef struct { +struct SoupConnection { GObject parent; SoupConnectionPrivate *priv; -} SoupConnection; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-context.c b/libsoup/soup-context.c index cc0cee4..49cc62c 100644 --- a/libsoup/soup-context.c +++ b/libsoup/soup-context.c @@ -23,6 +23,7 @@ #include "soup-auth.h" #include "soup-auth-ntlm.h" +#include "soup-connection.h" #include "soup-context.h" #include "soup-message-private.h" #include "soup-private.h" diff --git a/libsoup/soup-context.h b/libsoup/soup-context.h index f8d54e7..e105e47 100644 --- a/libsoup/soup-context.h +++ b/libsoup/soup-context.h @@ -6,9 +6,7 @@ #ifndef SOUP_CONTEXT_H #define SOUP_CONTEXT_H 1 -#include -#include -#include +#include #define SOUP_TYPE_CONTEXT (soup_context_get_type ()) #define SOUP_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CONTEXT, SoupContext)) @@ -19,11 +17,11 @@ typedef struct SoupContextPrivate SoupContextPrivate; -typedef struct { +struct SoupContext { GObject parent; SoupContextPrivate *priv; -} SoupContext; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-error.h b/libsoup/soup-error.h index 717e7fa..04fbd25 100644 --- a/libsoup/soup-error.h +++ b/libsoup/soup-error.h @@ -1,11 +1,8 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * soup-error.h: HTTP Errorcode and Errorclass definitions + * soup-error.h: HTTP error code and error class definitions * - * Authors: - * Alex Graveley (alex@ximian.com) - * - * Copyright (C) 2001-2002, Ximian, Inc. + * Copyright (C) 2001-2003, Ximian, Inc. */ #ifndef SOUP_ERROR_H diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c index 292294a..fdf814f 100644 --- a/libsoup/soup-message-io.c +++ b/libsoup/soup-message-io.c @@ -16,6 +16,7 @@ #include "soup-message-private.h" #include "soup-misc.h" #include "soup-private.h" +#include "soup-socket.h" typedef struct { guint idle_tag; diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c index 87868c7..35f0b23 100644 --- a/libsoup/soup-message.c +++ b/libsoup/soup-message.c @@ -8,6 +8,7 @@ #include #include "soup-auth.h" +#include "soup-connection.h" #include "soup-error.h" #include "soup-marshal.h" #include "soup-message.h" diff --git a/libsoup/soup-message.h b/libsoup/soup-message.h index 66959d6..c40abb4 100644 --- a/libsoup/soup-message.h +++ b/libsoup/soup-message.h @@ -6,10 +6,8 @@ #ifndef SOUP_MESSAGE_H #define SOUP_MESSAGE_H 1 -#include -#include +#include #include -#include #define SOUP_TYPE_MESSAGE (soup_message_get_type ()) #define SOUP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_MESSAGE, SoupMessage)) @@ -38,7 +36,7 @@ typedef struct { guint length; } SoupDataBuffer; -typedef struct { +struct SoupMessage { GObject parent; SoupMessagePrivate *priv; @@ -54,7 +52,7 @@ typedef struct { SoupDataBuffer response; GHashTable *response_headers; -} SoupMessage; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-private.h b/libsoup/soup-private.h index 0c8bf99..05cc1a1 100644 --- a/libsoup/soup-private.h +++ b/libsoup/soup-private.h @@ -1,16 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * soup-private.h: Asyncronous Callback-based HTTP Request Queue. - * - * Authors: - * Alex Graveley (alex@ximian.com) - * - * Copyright (C) 2000-2002, Ximian, Inc. - */ - -/* - * All the things Soup users shouldn't need to know about except under - * extraneous circumstances. + * Copyright (C) 2000-2003, Ximian, Inc. */ #ifndef SOUP_PRIVATE_H @@ -20,17 +10,9 @@ #include #endif -#include -#include -#include - +#include #include -#include -#include -#include -#include -#include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/libsoup/soup-queue.c b/libsoup/soup-queue.c index b41652c..02c0d3e 100644 --- a/libsoup/soup-queue.c +++ b/libsoup/soup-queue.c @@ -21,13 +21,14 @@ #include "soup-queue.h" #include "soup-auth.h" +#include "soup-connection.h" #include "soup-message.h" #include "soup-message-private.h" #include "soup-context.h" #include "soup-headers.h" #include "soup-misc.h" #include "soup-private.h" -#include "soup-ssl.h" +#include "soup-socket.h" static GSList *soup_active_requests = NULL, *soup_active_request_next = NULL; diff --git a/libsoup/soup-server-auth.c b/libsoup/soup-server-auth.c index d44ca86..8f0a519 100644 --- a/libsoup/soup-server-auth.c +++ b/libsoup/soup-server-auth.c @@ -2,10 +2,7 @@ /* * soup-server-auth.c: Server-side authentication handling * - * Authors: - * Alex Graveley (alex@ximian.com) - * - * Copyright (C) 2001-2002, Ximian, Inc. + * Copyright (C) 2001-2003, Ximian, Inc. */ #include @@ -18,6 +15,8 @@ #include "md5-utils.h" #include "soup-headers.h" +#include "soup-misc.h" +#include "soup-uri.h" typedef struct { const gchar *scheme; diff --git a/libsoup/soup-server-auth.h b/libsoup/soup-server-auth.h index e387c9c..b50412b 100644 --- a/libsoup/soup-server-auth.h +++ b/libsoup/soup-server-auth.h @@ -2,28 +2,20 @@ /* * soup-server-auth.h: Server-side authentication handling * - * Authors: - * Alex Graveley (alex@ximian.com) - * - * Copyright (C) 2001-2002, Ximian, Inc. + * Copyright (C) 2001-2003, Ximian, Inc. */ #ifndef SOUP_SERVER_AUTH_H #define SOUP_SERVER_AUTH_H 1 -#include -#include -#include - -typedef union _SoupServerAuth SoupServerAuth; -typedef struct _SoupServerAuthContext SoupServerAuthContext; +#include typedef gboolean (*SoupServerAuthCallbackFn) (SoupServerAuthContext *auth_ctx, SoupServerAuth *auth, SoupMessage *msg, gpointer data); -struct _SoupServerAuthContext { +struct SoupServerAuthContext { guint types; SoupServerAuthCallbackFn callback; gpointer user_data; @@ -74,7 +66,7 @@ typedef struct { const gchar *request_method; } SoupServerAuthDigest; -union _SoupServerAuth { +union SoupServerAuth { SoupAuthType type; SoupServerAuthBasic basic; SoupServerAuthDigest digest; diff --git a/libsoup/soup-server-message.c b/libsoup/soup-server-message.c index 43642f5..d67b495 100644 --- a/libsoup/soup-server-message.c +++ b/libsoup/soup-server-message.c @@ -17,6 +17,8 @@ #include "soup-server-message.h" #include "soup-message-private.h" #include "soup-private.h" +#include "soup-server.h" +#include "soup-socket.h" struct SoupServerMessagePrivate { SoupServer *server; diff --git a/libsoup/soup-server-message.h b/libsoup/soup-server-message.h index 5798960..8522ac4 100644 --- a/libsoup/soup-server-message.h +++ b/libsoup/soup-server-message.h @@ -7,7 +7,6 @@ #define SOUP_SERVER_MESSAGE_H 1 #include -#include #define SOUP_TYPE_SERVER_MESSAGE (soup_server_message_get_type ()) #define SOUP_SERVER_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SERVER_MESSAGE, SoupServerMessage)) @@ -18,11 +17,11 @@ typedef struct SoupServerMessagePrivate SoupServerMessagePrivate; -typedef struct { +struct SoupServerMessage { SoupMessage parent; SoupServerMessagePrivate *priv; -} SoupServerMessage; +}; typedef struct { SoupMessageClass parent_class; diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c index 53d2dbc..8cd7f7c 100644 --- a/libsoup/soup-server.c +++ b/libsoup/soup-server.c @@ -19,10 +19,13 @@ #include #include "soup-server.h" +#include "soup-address.h" #include "soup-headers.h" #include "soup-private.h" #include "soup-message-private.h" -#include "soup-ssl.h" +#include "soup-server-auth.h" +#include "soup-server-message.h" +#include "soup-socket.h" #define PARENT_TYPE G_TYPE_OBJECT static GObjectClass *parent_class; @@ -40,13 +43,6 @@ struct SoupServerPrivate { SoupServerHandler *default_handler; }; -struct SoupServerMessage { - SoupMessage *msg; - GSList *chunks; /* CONTAINS: SoupDataBuffer* */ - gboolean started; - gboolean finished; -}; - static void init (GObject *object) { diff --git a/libsoup/soup-server.h b/libsoup/soup-server.h index 6eb8198..9ccb100 100644 --- a/libsoup/soup-server.h +++ b/libsoup/soup-server.h @@ -6,13 +6,9 @@ #ifndef SOUP_SERVER_H #define SOUP_SERVER_H 1 -#include -#include +#include #include -#include -#include #include -#include #define SOUP_TYPE_SERVER (soup_server_get_type ()) #define SOUP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SERVER, SoupServer)) @@ -23,11 +19,11 @@ typedef struct SoupServerPrivate SoupServerPrivate; -typedef struct { +struct SoupServer { GObject parent; SoupServerPrivate *priv; -} SoupServer; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c index 1b6ec44..715e701 100644 --- a/libsoup/soup-socket.c +++ b/libsoup/soup-socket.c @@ -15,12 +15,15 @@ #include #include +#include "soup-address.h" #include "soup-private.h" #include "soup-socket.h" #include "soup-marshal.h" #include "soup-ssl.h" +#include #include +#include #include #define PARENT_TYPE G_TYPE_OBJECT diff --git a/libsoup/soup-socket.h b/libsoup/soup-socket.h index 45300a2..67a6c00 100644 --- a/libsoup/soup-socket.h +++ b/libsoup/soup-socket.h @@ -6,9 +6,7 @@ #ifndef SOUP_SOCKET_H #define SOUP_SOCKET_H 1 -#include -#include -#include +#include #define SOUP_TYPE_SOCKET (soup_socket_get_type ()) #define SOUP_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SOCKET, SoupSocket)) @@ -19,11 +17,11 @@ typedef struct SoupSocketPrivate SoupSocketPrivate; -typedef struct { +struct SoupSocket { GObject parent; SoupSocketPrivate *priv; -} SoupSocket; +}; typedef struct { GObjectClass parent_class; diff --git a/libsoup/soup-types.h b/libsoup/soup-types.h new file mode 100644 index 0000000..580a09d --- /dev/null +++ b/libsoup/soup-types.h @@ -0,0 +1,25 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2003, Ximian, Inc. + */ + +#ifndef SOUP_TYPES_H +#define SOUP_TYPES_H 1 + +#include +#include + +#include + +typedef struct SoupAddress SoupAddress; +typedef struct SoupConnection SoupConnection; +typedef struct SoupContext SoupContext; +typedef struct SoupMessage SoupMessage; +typedef struct SoupServer SoupServer; +typedef union SoupServerAuth SoupServerAuth; +typedef struct SoupServerAuthContext SoupServerAuthContext; +typedef struct SoupServerMessage SoupServerMessage; +typedef struct SoupSocket SoupSocket; +typedef struct SoupUri SoupUri; + +#endif diff --git a/libsoup/soup-uri.h b/libsoup/soup-uri.h index 2f560d1..0d737ae 100644 --- a/libsoup/soup-uri.h +++ b/libsoup/soup-uri.h @@ -9,13 +9,13 @@ #ifndef SOUP_URI_H #define SOUP_URI_H 1 -#include +#include typedef GQuark SoupProtocol; #define SOUP_PROTOCOL_HTTP (g_quark_from_static_string ("http")) #define SOUP_PROTOCOL_HTTPS (g_quark_from_static_string ("https")) -typedef struct { +struct SoupUri { SoupProtocol protocol; char *user; @@ -29,7 +29,7 @@ typedef struct { char *query; char *fragment; -} SoupUri; +}; SoupUri *soup_uri_new_with_base (const SoupUri *base, const char *uri_string); diff --git a/tests/revserver.c b/tests/revserver.c index 839603a..3620887 100644 --- a/tests/revserver.c +++ b/tests/revserver.c @@ -8,7 +8,8 @@ #include #include -#include +#include +#include static void rev_read (SoupSocket *sock, GString *buf); static void rev_write (SoupSocket *sock, GString *buf); diff --git a/tests/simple-httpd.c b/tests/simple-httpd.c index 15df196..e34f013 100644 --- a/tests/simple-httpd.c +++ b/tests/simple-httpd.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include diff --git a/tests/simple-proxy.c b/tests/simple-proxy.c index 4495aa7..7063d5b 100644 --- a/tests/simple-proxy.c +++ b/tests/simple-proxy.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include diff --git a/tests/uri-parsing.c b/tests/uri-parsing.c index 2861dd5..5bd43be 100644 --- a/tests/uri-parsing.c +++ b/tests/uri-parsing.c @@ -110,7 +110,7 @@ do_uri (SoupUri *base_uri, const char *base_str, int main (int argc, char **argv) { - SoupUri *base_uri, *uri; + SoupUri *base_uri; char *uri_string; int i, errs = 0;