libsoup-2.4.pc.in \
libsoup-gnome-2.4.pc.in \
gtk-doc.make \
- libsoup-zip.in
+ libsoup-zip.in \
+ m4/introspection.m4
-DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
pkgconfigdir = $(libdir)/pkgconfig
dnl ***************
GTK_DOC_CHECK([1.10])
+dnl *****************************
+dnl *** gobject-introspection ***
+dnl *****************************
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
dnl *************************************
dnl *** Warnings to show if using GCC ***
<title>Index</title>
</index>
+ <xi:include href="xml/annotation-glossary.xml">
+ <xi:fallback />
+ </xi:include>
+
</book>
endif
+#
+# Introspection support
+#
+include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=.
+INTROSPECTION_COMPILER_ARGS = --includedir=.
+
+if HAVE_INTROSPECTION
+
+# Core library
+gi_soup_files = \
+ $(filter-out soup.h soup-enum-types.% soup-marshal.%,\
+ $(soup_headers) $(libsoup_2_4_la_SOURCES))
+gi_built_soup_files = soup-enum-types.h
+
+Soup-2.4.gir: libsoup-2.4.la
+Soup_2_4_gir_INCLUDES = Gio-2.0
+Soup_2_4_gir_CFLAGS = $(INCLUDES)
+Soup_2_4_gir_LIBS = libsoup-2.4.la
+Soup_2_4_gir_FILES = \
+ $(addprefix $(srcdir)/, $(gi_soup_files)) \
+ $(foreach f,$(gi_built_soup_files), \
+ $(if $(shell test -f $(addprefix $(srcdir)/,$(f)) && echo yes), \
+ $(addprefix $(srcdir)/,$(f)), \
+ $(f)))
+
+INTROSPECTION_GIRS += Soup-2.4.gir
+
+if BUILD_LIBSOUP_GNOME
+
+# GNOME extensions
+gi_soup_gnome_files = $(filter-out soup-gnome.h,\
+ $(libsoupgnomeinclude_HEADERS) \
+ $(libsoup_gnome_2_4_la_SOURCES))
+SoupGNOME-2.4.gir: libsoup-gnome-2.4.la Soup-2.4.gir
+SoupGNOME_2_4_gir_SCANNERFLAGS = --strip-prefix=soup
+SoupGNOME_2_4_gir_INCLUDES = Soup-2.4
+SoupGNOME_2_4_gir_CFLAGS = $(INCLUDES)
+SoupGNOME_2_4_gir_LIBS = libsoup-gnome-2.4.la
+SoupGNOME_2_4_gir_FILES = $(addprefix $(srcdir)/,$(gi_soup_gnome_files))
+
+INTROSPECTION_GIRS += SoupGNOME-2.4.gir
+
+endif
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
+
+endif
+
EXTRA_DIST= \
soup-marshal.list \
soup-enum-types.h.tmpl \
- soup-enum-types.c.tmpl
\ No newline at end of file
+ soup-enum-types.c.tmpl
* Returns a #SoupAddress equivalent to @sa (or %NULL if @sa's
* address family isn't supported)
*
- * Return value: the new #SoupAddress
+ * Return value: (allow-none): the new #SoupAddress
**/
SoupAddress *
soup_address_new_from_sockaddr (struct sockaddr *sa, int len)
* for @family (or %NULL if @family isn't supported), suitable for
* passing to soup_socket_server_new().
*
- * Return value: the new #SoupAddress
+ * Return value: (allow-none): the new #SoupAddress
**/
SoupAddress *
soup_address_new_any (SoupAddressFamily family, guint port)
* soup_address_is_resolved() to safely test whether or not an address
* is resolved before fetching its name or address.
*
- * Return value: the hostname, or %NULL if it is not known.
+ * Return value: (allow-none): the hostname, or %NULL if it is not known.
**/
const char *
soup_address_get_name (SoupAddress *addr)
* soup_address_is_resolved() to safely test whether or not an address
* is resolved before fetching its name or address.
*
- * Return value: the sockaddr, or %NULL
+ * Return value: (allow-none): the sockaddr, or %NULL
**/
struct sockaddr *
soup_address_get_sockaddr (SoupAddress *addr, int *len)
* soup_address_is_resolved() to safely test whether or not an address
* is resolved before fetching its name or address.
*
- * Return value: the physical address, or %NULL
+ * Return value: (allow-none): the physical address, or %NULL
**/
const char *
soup_address_get_physical (SoupAddress *addr)
* @addr: a #SoupAddress
* @async_context: the #GMainContext to call @callback from
* @cancellable: a #GCancellable object, or %NULL
- * @callback: callback to call with the result
+ * @callback: (scope async): callback to call with the result
* @user_data: data for @callback
*
* Asynchronously resolves the missing half of @addr (its IP address
* of @auth's protection space, unless otherwise discovered not to
* be.)
*
- * Return value: the list of paths, which must be freed with
+ * Return value: (element-type utf8): the list of paths, which can be freed with
* soup_auth_free_protection_space().
**/
GSList *
}
/**
- * soup_auth_free_protection_space:
+ * soup_auth_free_protection_space: (skip)
* @auth: a #SoupAuth
* @space: the return value from soup_auth_get_protection_space()
*
* #SoupCookie<!-- -->s. Cookies that do not specify "path" or
* "domain" attributes will have their values defaulted from @msg.
*
- * Return value: a #GSList of #SoupCookie<!-- -->s, which can be freed
- * with soup_cookies_free().
+ * Return value: (element-type SoupCookie): a #GSList of
+ * #SoupCookie<!-- -->s, which can be freed with soup_cookies_free().
*
* Since: 2.24
**/
* pass a cookie returned from this method directly to
* soup_cookies_to_response().)
*
- * Return value: a #GSList of #SoupCookie<!-- -->s, which can be freed
- * with soup_cookies_free().
+ * Return value: (element-type SoupCookie): a #GSList of
+ * #SoupCookie<!-- -->s, which can be freed with soup_cookies_free().
*
* Since: 2.24
**/
/**
* soup_cookies_to_response:
- * @cookies: a #GSList of #SoupCookie
+ * @cookies: (element-type SoupCookie): a #GSList of #SoupCookie
* @msg: a #SoupMessage
*
* Appends a "Set-Cookie" response header to @msg for each cookie in
/**
* soup_cookies_to_request:
- * @cookies: a #GSList of #SoupCookie
+ * @cookies: (element-type SoupCookie): a #GSList of #SoupCookie
* @msg: a #SoupMessage
*
* Adds the name and value of each cookie in @cookies to @msg's
}
/**
- * soup_cookies_free:
- * @cookies: a #GSList of #SoupCookie
+ * soup_cookies_free: (skip)
+ * @cookies: (element-type SoupCookie): a #GSList of #SoupCookie
*
* Frees @cookies.
*
/**
* soup_cookies_to_cookie_header:
- * @cookies: a #GSList of #SoupCookie
+ * @cookies: (element-type SoupCookie): a #GSList of #SoupCookie
*
* Serializes a #GSList of #SoupCookie into a string suitable for
* setting as the value of the "Cookie" header.
/**
* soup_date_to_timeval:
* @date: a #SoupDate
- * @time: a #GTimeVal structure in which to store the converted time.
+ * @time: (out): a #GTimeVal structure in which to store the converted time.
*
* Converts @date to a #GTimeVal.
*
* Decodes @form, which is an urlencoded dataset as defined in the
* HTML 4.01 spec.
*
- * Return value: a hash table containing the name/value pairs from
- * @encoded_form, which you can free with g_hash_table_destroy().
+ * Return value: (element-type utf8 utf8): a hash table containing the
+ * name/value pairs from @encoded_form, which you can free with
+ * g_hash_table_destroy().
**/
GHashTable *
soup_form_decode (const char *encoded_form)
/**
* soup_form_encode_hash:
- * @form_data_set: a hash table containing name/value pairs (as strings)
+ * @form_data_set: (element-type utf8 utf8): a hash table containing
+ * name/value pairs (as strings)
*
* Encodes @form_data_set into a value of type
* "application/x-www-form-urlencoded", as defined in the HTML 4.01
* soup_form_request_new_from_hash:
* @method: the HTTP method, either "GET" or "POST"
* @uri: the URI to send the form data to
- * @form_data_set: the data to send to @uri
+ * @form_data_set: (element-type utf8 utf8): the data to send to @uri
*
* Creates a new %SoupMessage and sets it up to send @form_data_set to
* @uri via @method, as with soup_form_request_new().
* @str: the header string (including the trailing blank line)
* @len: length of @str up to (but not including) the terminating blank line.
* @req_headers: #SoupMessageHeaders to store the header values in
- * @req_method: if non-%NULL, will be filled in with the request method
- * @req_path: if non-%NULL, will be filled in with the request path
- * @ver: if non-%NULL, will be filled in with the HTTP version
+ * @req_method: (out) (allow-none): if non-%NULL, will be filled in with the
+ * request method
+ * @req_path: (out) (allow-none): if non-%NULL, will be filled in with the
+ * request path
+ * @ver: (out) (allow-none): if non-%NULL, will be filled in with the HTTP
+ * version
*
* Parses the headers of an HTTP request in @str and stores the
* results in @req_method, @req_path, @ver, and @req_headers.
/**
* soup_headers_parse_status_line:
* @status_line: an HTTP Status-Line
- * @ver: if non-%NULL, will be filled in with the HTTP version
- * @status_code: if non-%NULL, will be filled in with the status code
- * @reason_phrase: if non-%NULL, will be filled in with the reason
- * phrase
+ * @ver: (out) (allow-none): if non-%NULL, will be filled in with the HTTP
+ * version
+ * @status_code: (out) (allow-none): if non-%NULL, will be filled in with
+ * the status code
+ * @reason_phrase: (out) (allow-none): if non-%NULL, will be filled in with
+ * the reason phrase
*
* Parses the HTTP Status-Line string in @status_line into @ver,
* @status_code, and @reason_phrase. @status_line must be terminated by
* @str: the header string (including the trailing blank line)
* @len: length of @str up to (but not including) the terminating blank line.
* @headers: #SoupMessageheaders to store the header values in
- * @ver: if non-%NULL, will be filled in with the HTTP version
- * @status_code: if non-%NULL, will be filled in with the status code
- * @reason_phrase: if non-%NULL, will be filled in with the reason
- * phrase
+ * @ver: (out) (allow-none): if non-%NULL, will be filled in with the HTTP
+ * version
+ * @status_code: (out) (allow-none): if non-%NULL, will be filled in with
+ * the status code
+ * @reason_phrase: (out) (allow-none): if non-%NULL, will be filled in with
+ * the reason phrase
*
* Parses the headers of an HTTP response in @str and stores the
* results in @ver, @status_code, @reason_phrase, and @headers.
/**
* soup_header_parse_quality_list:
* @header: a header value
- * @unacceptable: on return, will contain a list of unacceptable
- * values
+ * @unacceptable: (out) (allow-none): on return, will contain a list of
+ * unacceptable values
*
* Parses a header whose content is a list of items with optional
* "qvalue"s (eg, Accept, Accept-Charset, Accept-Encoding,
* soup_message_body_append:
* @body: a #SoupMessageBody
* @use: how to use @data
- * @data: data to append
+ * @data: (array length=length) (element-type uint8): data to append
* @length: length of @data
*
* Appends @length bytes from @data to @body according to @use.
/**
* soup_message_headers_iter_init:
- * @iter: a pointer to a %SoupMessageHeadersIter structure
+ * @iter: (out) (transfer none): a pointer to a %SoupMessageHeadersIter
+ * structure
* @hdrs: a %SoupMessageHeaders
*
* Initializes @iter for iterating @hdrs.
/**
* soup_message_headers_iter_next:
- * @iter: a %SoupMessageHeadersIter
- * @name: pointer to a variable to return the header name in
- * @value: pointer to a variable to return the header value in
+ * @iter: (inout) (transfer none): a %SoupMessageHeadersIter
+ * @name: (out) (transfer none): pointer to a variable to return
+ * the header name in
+ * @value: (out) (transfer none): pointer to a variable to return
+ * the header value in
*
* Yields the next name/value pair in the %SoupMessageHeaders being
* iterated by @iter. If @iter has already yielded the last header,
/**
* soup_message_set_response:
* @msg: the message
- * @content_type: MIME Content-Type of the body
+ * @content_type: (allow-none): MIME Content-Type of the body
* @resp_use: a #SoupMemoryUse describing how to handle @resp_body
- * @resp_body: a data buffer containing the body of the message response.
+ * @resp_body: (array length=resp_length) (element-type uint8): a data buffer
+ * containing the body of the message response.
* @resp_length: the byte length of @resp_body.
*
* Convenience function to set the response body of a #SoupMessage. If
* read-only; writing to it or modifiying it may cause @server to
* malfunction.
*
- * Return value: the listening socket.
+ * Return value: (transfer none): the listening socket.
**/
SoupSocket *
soup_server_get_listener (SoupServer *server)
* context, so you will need to ref it yourself if you want it to
* outlive its server.
*
- * Return value: @server's #GMainContext, which may be %NULL
+ * Return value: (transfer none): @server's #GMainContext, which may be %NULL
**/
GMainContext *
soup_server_get_async_context (SoupServer *server)
* not get fooled when the allocator reuses the memory address of a
* previously-destroyed socket to represent a new socket.
*
- * Return value: the #SoupSocket that @client is associated with.
+ * Return value: (transfer none): the #SoupSocket that @client is
+ * associated with.
**/
SoupSocket *
soup_client_context_get_socket (SoupClientContext *client)
* Retrieves the #SoupAddress associated with the remote end
* of a connection.
*
- * Return value: the #SoupAddress associated with the remote end of a
- * connection.
+ * Return value: (transfer none): the #SoupAddress associated with the
+ * remote end of a connection.
**/
SoupAddress *
soup_client_context_get_address (SoupClientContext *client)
* authenticated, and if so returns the #SoupAuthDomain that
* authenticated it.
*
- * Return value: a #SoupAuthDomain, or %NULL if the request was not
- * authenticated.
+ * Return value: (transfer none) (allow-none): a #SoupAuthDomain, or
+ * %NULL if the request was not authenticated.
**/
SoupAuthDomain *
soup_client_context_get_auth_domain (SoupClientContext *client)
* @server: the #SoupServer
* @msg: the message being processed
* @path: the path component of @msg's Request-URI
- * @query: the parsed query component of @msg's Request-URI
+ * @query: (element-type utf8 utf8) (allow-none): the parsed query
+ * component of @msg's Request-URI
* @client: additional contextual information about the client
* @user_data: the data passed to @soup_server_add_handler
*
/**
* soup_server_add_handler:
* @server: a #SoupServer
- * @path: the toplevel path for the handler
+ * @path: (allow-none): the toplevel path for the handler
* @callback: callback to invoke for requests under @path
* @user_data: data for @callback
* @destroy: destroy notifier to free @user_data
/**
* soup_session_queue_message:
* @session: a #SoupSession
- * @msg: the message to queue
- * @callback: a #SoupSessionCallback which will be called after the
- * message completes or when an unrecoverable error occurs.
- * @user_data: a pointer passed to @callback.
+ * @msg: (transfer full): the message to queue
+ * @callback: (allow-none) (scope async): a #SoupSessionCallback which will
+ * be called after the message completes or when an unrecoverable error occurs.
+ * @user_data: (allow-none): a pointer passed to @callback.
*
* Queues the message @msg for sending. All messages are processed
* while the glib main loop runs. If @msg has been processed before,
* soup_socket_connect_async:
* @sock: a client #SoupSocket (which must not already be connected)
* @cancellable: a #GCancellable, or %NULL
- * @callback: callback to call after connecting
+ * @callback: (scope async): callback to call after connecting
* @user_data: data to pass to @callback
*
* Begins asynchronously connecting to @sock's remote address. The
*
* Returns the #SoupAddress corresponding to the local end of @sock.
*
- * Return value: the #SoupAddress
+ * Return value: (transfer none): the #SoupAddress
**/
SoupAddress *
soup_socket_get_local_address (SoupSocket *sock)
*
* Returns the #SoupAddress corresponding to the remote end of @sock.
*
- * Return value: the #SoupAddress
+ * Return value: (transfer none): the #SoupAddress
**/
SoupAddress *
soup_socket_get_remote_address (SoupSocket *sock)
* soup_xmlrpc_parse_method_call:
* @method_call: the XML-RPC methodCall string
* @length: the length of @method_call, or -1 if it is NUL-terminated
- * @method_name: on return, the methodName from @method_call
- * @params: on return, the parameters from @method_call
+ * @method_name: (out): on return, the methodName from @method_call
+ * @params: (out): on return, the parameters from @method_call
*
* Parses @method_call to get the name and parameters, and returns the
* parameter values in a #GValueArray; see also
* soup_xmlrpc_extract_method_call:
* @method_call: the XML-RPC methodCall string
* @length: the length of @method_call, or -1 if it is NUL-terminated
- * @method_name: on return, the methodName from @method_call
+ * @method_name: (out): on return, the methodName from @method_call
* @...: return types and locations for parameters
*
* Parses @method_call to get the name and parameters, and puts
* soup_xmlrpc_parse_method_response:
* @method_response: the XML-RPC methodResponse string
* @length: the length of @method_response, or -1 if it is NUL-terminated
- * @value: on return, the return value from @method_call
+ * @value: (out): on return, the return value from @method_call
* @error: error return value
*
* Parses @method_response and returns the return value in @value. If
--- /dev/null
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+ dnl enable/disable introspection
+ m4_if([$2], [require],
+ [dnl
+ enable_introspection=yes
+ ],[dnl
+ AC_ARG_ENABLE(introspection,
+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+ [Enable introspection for this build]),,
+ [enable_introspection=auto])
+ ])dnl
+
+ AC_MSG_CHECKING([for gobject-introspection])
+
+ dnl presence/version checking
+ AS_CASE([$enable_introspection],
+ [no], [dnl
+ found_introspection="no (disabled, use --enable-introspection to enable)"
+ ],dnl
+ [yes],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+ found_introspection=yes,
+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+ ],dnl
+ [auto],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+ ],dnl
+ [dnl
+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+ ])dnl
+
+ AC_MSG_RESULT([$found_introspection])
+
+ INTROSPECTION_SCANNER=
+ INTROSPECTION_COMPILER=
+ INTROSPECTION_GENERATE=
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+ INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+ AC_SUBST(INTROSPECTION_COMPILER)
+ AC_SUBST(INTROSPECTION_GENERATE)
+ AC_SUBST(INTROSPECTION_GIRDIR)
+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
+
+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])