Skip to content
Commits on Source (17)
build
*.swp
*.swo
*~
image: fedora:latest
stages:
- test
- docs
- deploy
build:
stage: test
script:
- sudo dnf install 'dnf-command(builddep)' -y
- sudo dnf builddep jsonrpc-glib-devel -y
- meson _build
- ninja -C _build
- ninja -C _build test
reference:
stage: docs
script:
- sudo dnf install 'dnf-command(builddep)' -y
- sudo dnf builddep jsonrpc-glib-devel -y
- sudo dnf install gi-docgen -y
- mkdir -p pfx/
- meson --prefix=${PWD}/pfx -Denable_gtk_doc=true _build
- ninja -C _build install
- mkdir -p _reference/
- mv pfx/share/doc/jsonrpc-glib/* _reference/
artifacts:
paths:
- _reference
pages:
stage: deploy
needs: ['reference']
script:
- mv _reference public
artifacts:
paths:
- public
only:
- main
==============
Version 3.42.0
==============
• Documentation improvements to use gi-docgen
• Introspection fixes
==============
Version 3.41.0
==============
......
......@@ -17,5 +17,4 @@ ninja install
## Documentation
You can read the documentation online at https://people.gnome.org/~chergert/docs/jsonrpc-glib/
Nightly documentations can be found at https://gnome.pages.gitlab.gnome.org/jsonrpc-glib/
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/jsonrpc-glib/"
repository_url = "https://gitlab.gnome.org/GNOME/jsonrpc-glib.git"
website_url = "https://gitlab.gnome.org/GNOME/jsonrpc-glib/"
docs_url = "https://gnome.pages.gitlab.gnome.org/jsonrpc-glib/"
authors = "Christian Hergert"
license = "LGPL-2.1"
description = "A GNOME library to communicate with JSON-RPC based peers"
dependencies = [ "GObject-2.0", "GLib-2.0", "Gio-2.0"]
devhelp = true
search_index = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."GLib-2.0"]
name = "GLib"
description = "The base type system library"
docs_url = "https://docs.gtk.org/glib/"
[dependencies."Gio-2.0"]
name = "GIO"
description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
docs_url = "https://docs.gtk.org/gio/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/jsonrpc-glib/-/blob/main/"
[extra]
urlmap_file = "urlmap.js"
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<book id="index">
<bookinfo>
<title>&package_name; Reference Manual</title>
<releaseinfo>
<para>This document is the API reference for for &package_name; &package_version;.</para>
<para>
The latest version of this API reference is also available
<ulink role="online-location" url="https://developer.gnome.org/jsonrpc/">online</ulink>.
</para>
<para>
If you find any issues in this API reference, please report it
using <ulink type="http" url="&package_bugreport;">the online
bug reporting tool</ulink> at bugzilla.gnome.org.
</para>
</releaseinfo>
<copyright>
<year>2016-2017</year>
<holder>Christian Hergert</holder>
</copyright>
<legalnotice>
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the <citetitle>GNU Free
Documentation License</citetitle>, Version 1.1 or any later
version published by the Free Software Foundation with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. You may obtain a copy of the <citetitle>GNU Free
Documentation License</citetitle> from the Free Software
Foundation by visiting <ulink type="http"
url="http://www.fsf.org">their Web site</ulink> or by writing
to:
<address>
The Free Software Foundation, Inc.,
<street>59 Temple Place</street> - Suite 330,
<city>Boston</city>, <state>MA</state> <postcode>02111-1307</postcode>,
<country>USA</country>
</address>
</para>
</legalnotice>
</bookinfo>
<chapter>
<title>Jsonrpc-GLib API Reference</title>
<xi:include href="xml/jsonrpc-client.xml"/>
<xi:include href="xml/jsonrpc-server.xml"/>
<xi:include href="xml/jsonrpc-message.xml"/>
<xi:include href="xml/jsonrpc-input-stream.xml"/>
<xi:include href="xml/jsonrpc-output-stream.xml"/>
</chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="deprecated-api-index" role="deprecated">
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>
subdir('xml')
if get_option('enable_gtk_doc') and not get_option('with_introspection')
error('API reference requires introspection.')
endif
private_headers = [
'config.h',
'jsonrpc-glib.h',
'jsonrpc-version.h',
]
toml_conf = configuration_data()
toml_conf.set('version', meson.project_version())
gidocgen = find_program('gi-docgen', required: get_option('enable_gtk_doc'))
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
json_prefix = dependency('json-glib-1.0').get_pkgconfig_variable('prefix')
json_docpath = join_paths(json_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
gidocgen_common_args = [
'--quiet',
'--no-namespace-dir',
]
gnome.gtkdoc('jsonrpc-glib',
main_xml: 'jsonrpc-glib-docs.sgml',
src_dir: [
join_paths(meson.source_root(), 'src'),
join_paths(meson.build_root(), 'src'),
],
if get_option('werror')
gidocgen_common_args += ['--fatal-warnings']
endif
dependencies: libjsonrpc_glib_dep,
gobject_typesfile: 'jsonrpc-glib.types',
scan_args: [
'--rebuild-types',
'--ignore-decorators=_JSONRPC_EXTERN',
'--ignore-headers=' + ' '.join(private_headers),
],
docs_dir = datadir / 'doc'
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(json_docpath),
],
install: true)
if get_option('enable_gtk_doc')
source_toml = configure_file(
input: 'Jsonrpc.toml.in',
output: 'Jsonrpc.toml',
configuration: toml_conf,
install: true,
install_dir: docs_dir / 'jsonrpc-glib',
)
custom_target('jsonrpc-glib-doc',
input: [ source_toml, libjsonrpc_glib_gir[0] ],
output: 'jsonrpc-glib',
command: [
gidocgen,
'generate',
gidocgen_common_args,
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
endif
// A map between namespaces and base URLs for their online documentation
baseURLs = [
[ 'GLib', 'https://docs.gtk.org/glib/' ],
[ 'GObject', 'https://docs.gtk.org/gobject/' ],
[ 'Gio', 'https://docs.gtk.org/gio/' ],
]
<!ENTITY package "@PACKAGE@">
<!ENTITY package_bugreport "@PACKAGE_BUGREPORT@">
<!ENTITY package_name "@PACKAGE_NAME@">
<!ENTITY package_string "@PACKAGE_STRING@">
<!ENTITY package_tarname "@PACKAGE_TARNAME@">
<!ENTITY package_url "@PACKAGE_URL@">
<!ENTITY package_version "@PACKAGE_VERSION@">
<!ENTITY package_api_version "@PACKAGE_API_VERSION@">
ent_conf = configuration_data()
ent_conf.set('PACKAGE', 'Jsonrpc-GLib')
ent_conf.set('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=jsonrpc-glib')
ent_conf.set('PACKAGE_NAME', 'Jsonrpc-GLib')
ent_conf.set('PACKAGE_STRING', 'jsonrpc-glib')
ent_conf.set('PACKAGE_TARNAME', 'jsonrpc-glib-' + meson.project_version())
ent_conf.set('PACKAGE_URL', 'http://wiki.gnome.org/Apps/Builder')
ent_conf.set('PACKAGE_VERSION', meson.project_version())
ent_conf.set('PACKAGE_API_VERSION', apiversion)
configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf)
project('jsonrpc-glib', 'c',
version: '3.41.0',
version: '3.42.0',
license: 'LGPLv2.1+',
meson_version: '>= 0.49.2',
default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
......@@ -28,6 +28,10 @@ libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, revision)]
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'libjsonrpc_glib')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
......
......@@ -21,33 +21,33 @@
#include "config.h"
/**
* SECTION:jsonrpc-client
* @title: JsonrpcClient
* @short_description: a client for JSON-RPC communication
* JsonrpcClient:
*
* A client for JSON-RPC communication
*
* The #JsonrpcClient class provides a convenient API to coordinate with a
* JSON-RPC server. You can provide the underlying #GIOStream to communicate
* JSON-RPC server. You can provide the underlying [class@Gio.IOStream] to communicate
* with allowing you to control the negotiation of how you setup your
* communications channel. One such method might be to use a #GSubprocess and
* communications channel. One such method might be to use a [class@Gio.Subprocess] and
* communicate over stdin and stdout.
*
* Because JSON-RPC allows for out-of-band notifications from the server to
* the client, it is important that the consumer of this API calls
* jsonrpc_client_close() or jsonrpc_client_close_async() when they no longer
* [method@Client.close] or [method@Client.close_async] when they no longer
* need the client. This is because #JsonrpcClient contains an asynchronous
* read-loop to process incoming messages. Until jsonrpc_client_close() or
* jsonrpc_client_close_async() have been called, this read loop will prevent
* read-loop to process incoming messages. Until [method@Client.close] or
* [method@Client.close_async] have been called, this read loop will prevent
* the object from finalizing (being freed).
*
* To make an RPC call, use jsonrpc_client_call() or
* jsonrpc_client_call_async() and provide the method name and the parameters
* as a #GVariant for call.
* To make an RPC call, use [method@Client.call] or
* [method@Client.call_async] and provide the method name and the parameters
* as a [struct@GLib.Variant] for call.
*
* It is a programming error to mix synchronous and asynchronous API calls
* of the #JsonrpcClient class.
*
* For synchronous calls, #JsonrpcClient will use the thread-default
* #GMainContext. If you have special needs here ensure you've set the context
* [struct@GLib.MainContext]. If you have special needs here ensure you've set the context
* before calling into any #JsonrpcClient API.
*
* Since: 3.26
......@@ -456,7 +456,7 @@ jsonrpc_client_class_init (JsonrpcClientClass *klass)
/**
* JsonrpcClient:io-stream:
*
* The "io-stream" property is the #GIOStream to use for communicating
* The "io-stream" property is the [class@Gio.IOStream] to use for communicating
* with a JSON-RPC peer.
*
* Since: 3.26
......@@ -471,14 +471,14 @@ jsonrpc_client_class_init (JsonrpcClientClass *klass)
/**
* JsonrpcClient:use-gvariant:
*
* The "use-gvariant" property denotes if #GVariant should be used to
* The "use-gvariant" property denotes if [struct@GLib.Variant] should be used to
* communicate with the peer instead of JSON. You should only set this
* if you know the peer is also a Jsonrpc-GLib based client.
*
* Setting this property allows the peers to communicate using GVariant
* instead of JSON. This means that we can access the messages without
* expensive memory allocations and parsing costs associated with JSON.
* #GVariant is much more optimal for memory-bassed message passing.
* [struct@GLib.Variant] is much more optimal for memory-bassed message passing.
*
* Since: 3.26
*/
......@@ -511,8 +511,8 @@ jsonrpc_client_class_init (JsonrpcClientClass *klass)
/**
* JsonrpcClient::handle-call:
* @self: A #JsonrpcClient
* @method: (not nullable): the method name
* @id: (not nullable): The "id" field of the JSONRPC message
* @method: The method name
* @id: The "id" field of the JSONRPC message
* @params: (nullable): The "params" field of the JSONRPC message
*
* This signal is emitted when an RPC has been received from the peer we
......@@ -521,8 +521,7 @@ jsonrpc_client_class_init (JsonrpcClientClass *klass)
* synthesized.
*
* If you handle the message, you are responsible for replying to the peer
* in a timely manner using jsonrpc_client_reply() or
* jsonrpc_client_reply_async().
* in a timely manner using [method@Client.reply] or [method@Client.reply_async].
*
* Additionally, since 3.28 you may connect to the "detail" of this signal
* to handle a specific method call. Use the method name as the detail of
......@@ -549,11 +548,11 @@ jsonrpc_client_class_init (JsonrpcClientClass *klass)
/**
* JsonrpcClient::notification:
* @self: A #JsonrpcClient
* @method: the method name of the notification
* @params: (nullable): params for the notification
* @method: The method name of the notification
* @params: (nullable): Params for the notification
*
* This signal is emitted when a notification has been received from a
* peer. Unlike #JsonrpcClient::handle-call, this does not have an "id"
* peer. Unlike [signal@Client::handle-call], this does not have an "id"
* parameter because notifications do not have ids. They do not round
* trip.
*
......@@ -587,13 +586,13 @@ jsonrpc_client_init (JsonrpcClient *self)
/**
* jsonrpc_client_new:
* @io_stream: (not nullable): A #GIOStream
* @io_stream: A [class@Gio.IOStream]
*
* Creates a new #JsonrpcClient instance.
*
* If you want to communicate with a process using stdin/stdout, consider using
* #GSubprocess to launch the process and create a #GSimpleIOStream using the
* g_subprocess_get_stdin_pipe() and g_subprocess_get_stdout_pipe().
* [class@Gio.Subprocess] to launch the process and create a [class@Gio.SimpleIOStream] using the
* [method@Gio.Subprocess.get_stdin_pipe] and [method@Gio.Subprocess.get_stdout_pipe].
*
* Returns: (transfer full): A newly created #JsonrpcClient
*
......@@ -882,10 +881,10 @@ jsonrpc_client_call_sync_cb (GObject *object,
/**
* jsonrpc_client_call:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer none) (nullable): A #GVariant of parameters or %NULL
* @method: The name of the method to call
* @params: (transfer none) (nullable): A [struct@GLib.Variant] of parameters or %NULL
* @cancellable: (nullable): A #GCancellable or %NULL
* @return_value: (nullable) (out): A location for a #GVariant
* @return_value: (nullable) (out): A location for a [struct@GLib.Variant]
*
* Synchronously calls @method with @params on the remote peer.
*
......@@ -943,21 +942,21 @@ jsonrpc_client_call (JsonrpcClient *self,
/**
* jsonrpc_client_call_with_id_async:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer none) (nullable): A #GVariant of parameters or %NULL
* @id: (out) (transfer full) (optional): a location for a #GVariant
* @method: The name of the method to call
* @params: (transfer none) (nullable): A [struct@GLib.Variant] of parameters or %NULL
* @id: (out) (transfer full) (optional): A location for a [struct@GLib.Variant]
* describing the identifier used for the method call, or %NULL.
* @cancellable: (nullable): A #GCancellable or %NULL
* @callback: a callback to executed upon completion
* @user_data: user data for @callback
* @callback: Callback to executed upon completion
* @user_data: User data for @callback
*
* Asynchronously calls @method with @params on the remote peer.
*
* Upon completion or failure, @callback is executed and it should
* call jsonrpc_client_call_finish() to complete the request and release
* call [method@Client.call_finish] to complete the request and release
* any memory held.
*
* This function is similar to jsonrpc_client_call_async() except that
* This function is similar to [method@Client.call_async] except that
* it allows the caller to get the id of the command which might be useful
* in systems where you can cancel the operation (such as the Language
* Server Protocol).
......@@ -1041,8 +1040,8 @@ jsonrpc_client_call_with_id_async (JsonrpcClient *self,
/**
* jsonrpc_client_call_async:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer none) (nullable): A #GVariant of parameters or %NULL
* @method: The name of the method to call
* @params: (transfer none) (nullable): A [struct@GLib.Variant] of parameters or %NULL
* @cancellable: (nullable): A #GCancellable or %NULL
* @callback: a callback to executed upon completion
* @user_data: user data for @callback
......@@ -1050,7 +1049,7 @@ jsonrpc_client_call_with_id_async (JsonrpcClient *self,
* Asynchronously calls @method with @params on the remote peer.
*
* Upon completion or failure, @callback is executed and it should
* call jsonrpc_client_call_finish() to complete the request and release
* call [method@Client.call_finish] to complete the request and release
* any memory held.
*
* If @params is floating, the floating reference is consumed.
......@@ -1071,11 +1070,11 @@ jsonrpc_client_call_async (JsonrpcClient *self,
/**
* jsonrpc_client_call_finish:
* @self: A #JsonrpcClient.
* @result: A #GAsyncResult provided to the callback in jsonrpc_client_call_async()
* @return_value: (out) (nullable): A location for a #GVariant or %NULL
* @result: A #GAsyncResult provided to the callback in [method@Client.call_async]
* @return_value: (out) (nullable): A location for a [struct@GLib.Variant] or %NULL
* @error: a location for a #GError or %NULL
*
* Completes an asynchronous call to jsonrpc_client_call_async().
* Completes an asynchronous call to [method@Client.call_async].
*
* Returns: %TRUE if successful and @return_value is set, otherwise %FALSE and @error is set.
*
......@@ -1130,11 +1129,12 @@ jsonrpc_client_send_notification_write_cb (GObject *object,
/**
* jsonrpc_client_send_notification:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer none) (nullable): A #GVariant of parameters or %NULL
* @method: The name of the method to call
* @params: (transfer none) (nullable): A [struct@GLib.Variant] of parameters or %NULL
* @cancellable: (nullable): A #GCancellable or %NULL
*
* Synchronously calls @method with @params on the remote peer.
*
* This function will not wait or expect a reply from the peer.
*
* If @params is floating then the reference is consumed.
......@@ -1181,11 +1181,12 @@ jsonrpc_client_send_notification (JsonrpcClient *self,
/**
* jsonrpc_client_send_notification_async:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer none) (nullable): A #GVariant of parameters or %NULL
* @method: The name of the method to call
* @params: (transfer none) (nullable): A [struct@GLib.Variant] of parameters or %NULL
* @cancellable: (nullable): A #GCancellable or %NULL
*
* Asynchronously calls @method with @params on the remote peer.
*
* This function will not wait or expect a reply from the peer.
*
* This function is useful when the caller wants to be notified that
......@@ -1243,13 +1244,13 @@ jsonrpc_client_send_notification_async (JsonrpcClient *self,
* jsonrpc_client_send_notification_finish:
* @self: A #JsonrpcClient
*
* Completes an asynchronous call to jsonrpc_client_send_notification_async().
* Completes an asynchronous call to [method@Client.send_notification_async].
*
* Successful completion of this function only indicates that the request
* has been written to the underlying buffer, not that the peer has received
* the notification.
*
* Returns: %TRUE if the bytes have been flushed to the #GIOStream; otherwise
* Returns: %TRUE if the bytes have been flushed to the [class@Gio.IOStream]; otherwise
* %FALSE and @error is set.
*
* Since: 3.26
......@@ -1270,7 +1271,9 @@ jsonrpc_client_send_notification_finish (JsonrpcClient *self,
* @self: A #JsonrpcClient
*
* Closes the underlying streams and cancels any inflight operations of the
* #JsonrpcClient. This is important to call when you are done with the
* #JsonrpcClient.
*
* This is important to call when you are done with the
* client so that any outstanding operations that have caused @self to
* hold additional references are cancelled.
*
......@@ -1324,7 +1327,7 @@ jsonrpc_client_close (JsonrpcClient *self,
* jsonrpc_client_close_async:
* @self: A #JsonrpcClient.
*
* Asynchronous version of jsonrpc_client_close()
* Asynchronous version of [method@Client.close].
*
* Currently this operation is implemented synchronously, but in the future may
* be converted to using asynchronous operations.
......@@ -1357,9 +1360,9 @@ jsonrpc_client_close_async (JsonrpcClient *self,
/**
* jsonrpc_client_close_finish:
* @self A #JsonrpcClient.
* @self: A #JsonrpcClient.
*
* Completes an asynchronous request of jsonrpc_client_close_async().
* Completes an asynchronous request of [method@Client.close_async].
*
* Returns: %TRUE if successful; otherwise %FALSE and @error is set.
*
......@@ -1397,17 +1400,17 @@ jsonrpc_client_reply_error_cb (GObject *object,
/**
* jsonrpc_client_reply_error_async:
* @self: a #JsonrpcClient
* @id: (transfer none): a #GVariant containing the call id
* @code: the error code
* @message: (nullable): an optional error message
* @cancellable: (nullable): a #GCancellable, or %NULL
* @callback: (nullable): a #GAsyncReadyCallback or %NULL
* @user_data: closure data for @callback
* @self: A #JsonrpcClient
* @id: (transfer none): A [struct@GLib.Variant] containing the call id
* @code: The error code
* @message: (nullable): An optional error message
* @cancellable: (nullable): A #GCancellable, or %NULL
* @callback: (nullable): A #GAsyncReadyCallback or %NULL
* @user_data: Closure data for @callback
*
* Asynchronously replies to the peer, sending a JSON-RPC error message.
*
* Call jsonrpc_client_reply_error_finish() to get the result of this operation.
* Call [method@Client.reply_error_finish] to get the result of this operation.
*
* If @id is floating, it's floating reference is consumed.
*
......@@ -1478,13 +1481,13 @@ jsonrpc_client_reply_error_finish (JsonrpcClient *self,
/**
* jsonrpc_client_reply:
* @self: a #JsonrpcClient
* @id: (transfer none) (not nullable): the id of the message to reply
* @result: (transfer none) (nullable): the return value or %NULL
* @cancellable: (nullable): a #GCancellable, or %NULL
* @error: a #GError, or %NULL
* @self: A #JsonrpcClient
* @id: (transfer none): The id of the message to reply
* @result: (transfer none) (nullable): The return value or %NULL
* @cancellable: (nullable): A #GCancellable, or %NULL
* @error: A #GError, or %NULL
*
* Synchronous variant of jsonrpc_client_reply_async().
* Synchronous variant of [method@Client.reply_async].
*
* If @id or @result are floating, there floating references are consumed.
*
......@@ -1544,12 +1547,12 @@ jsonrpc_client_reply_cb (GObject *object,
/**
* jsonrcp_client_reply_async:
* @self: a #JsonrpcClient
* @id: (transfer none): the id of the message to reply
* @result: (transfer none) (nullable): the return value or %NULL
* @cancellable: a #GCancellable, or %NULL
* @callback: (nullable): a #GAsyncReadyCallback or %NULL
* @user_data: closure data for @callback
* @self: A #JsonrpcClient
* @id: (transfer none): The id of the message to reply
* @result: (transfer none) (nullable): The return value or %NULL
* @cancellable: A #GCancellable, or %NULL
* @callback: (nullable): A #GAsyncReadyCallback or %NULL
* @user_data: Closure data for @callback
*
* This function will reply to a method call identified by @id with the
* result provided. If @result is %NULL, then a null JSON node is returned
......@@ -1559,10 +1562,10 @@ jsonrpc_client_reply_cb (GObject *object,
* method is provided allowing #JsonrpcClient to be used for either
* side of communications.
*
* If no signal handler has handled #JsonrpcClient::handle-call then
* If no signal handler has handled [signal@Client::handle-call] then
* an error will be synthesized to the peer.
*
* Call jsonrpc_client_reply_finish() to complete the operation. Note
* Call [method@Client.reply_finish] to complete the operation. Note
* that since the peer does not reply to replies, completion of this
* asynchronous message does not indicate that the peer has received
* the message.
......@@ -1616,11 +1619,11 @@ jsonrpc_client_reply_async (JsonrpcClient *self,
/**
* jsonrpc_client_reply_finish:
* @self: a #JsonrpcClient
* @self: A #JsonrpcClient
* @result: A #GAsyncResult
* @error: a location for a #GError or %NULL
* @error: A location for a #GError or %NULL
*
* Completes an asynchronous request to jsonrpc_client_reply_async().
* Completes an asynchronous request to [method@Client.reply_async].
*
* Returns: %TRUE if successful; otherwise %FALSE and @error is set.
*
......@@ -1639,7 +1642,7 @@ jsonrpc_client_reply_finish (JsonrpcClient *self,
/**
* jsonrpc_client_start_listening:
* @self: a #JsonrpcClient
* @self: A #JsonrpcClient
*
* This function requests that client start processing incoming
* messages from the peer.
......@@ -1678,13 +1681,13 @@ jsonrpc_client_start_listening (JsonrpcClient *self)
/**
* jsonrpc_client_get_use_gvariant:
* @self: a #JsonrpcClient
* @self: A #JsonrpcClient
*
* Gets the #JsonrpcClient:use-gvariant property.
* Gets the [property@Client:use-gvariant] property.
*
* Indicates if #GVariant is being used to communicate with the peer.
* Indicates if [struct@GLib.Variant] is being used to communicate with the peer.
*
* Returns: %TRUE if #GVariant is being used; otherwise %FALSE.
* Returns: %TRUE if [struct@GLib.Variant] is being used; otherwise %FALSE.
*
* Since: 3.26
*/
......@@ -1700,15 +1703,15 @@ jsonrpc_client_get_use_gvariant (JsonrpcClient *self)
/**
* jsonrpc_client_set_use_gvariant:
* @self: a #JsonrpcClient
* @use_gvariant: if #GVariant should be used
* @self: A #JsonrpcClient
* @use_gvariant: If [struct@GLib.Variant] should be used
*
* Sets the #JsonrpcClient:use-gvariant property.
* Sets the [property@Client:use-gvariant] property.
*
* This function sets if #GVariant should be used to communicate with the
* This function sets if [struct@GLib.Variant] should be used to communicate with the
* peer. Doing so can allow for more efficient communication by avoiding
* expensive parsing overhead and memory allocations. However, it requires
* that the peer also supports #GVariant encoding.
* that the peer also supports [struct@GLib.Variant] encoding.
*
* Since: 3.26
*/
......
......@@ -28,13 +28,13 @@
#include "jsonrpc-server.h"
/**
* SECTION:jsonrpc-server
* @title: JsonrpcServer
* @short_description: A server for JSON-RPC communication
* JsonrpcServer:
*
* A server for JSON-RPC communication
*
* The #JsonrpcServer class can help you implement a JSON-RPC server. You can
* accept connections and then communicate with clients using the
* #JsonrpcClient API.
* [class@Client] API.
*/
typedef struct
......@@ -133,16 +133,16 @@ jsonrpc_server_class_init (JsonrpcServerClass *klass)
/**
* JsonrpcServer::handle-call:
* @self: a #JsonrpcServer
* @client: a #JsonrpcClient
* @method: the method that was called
* @id: the identifier of the method call
* @params: the parameters of the method call
* @self: A #JsonrpcServer
* @client: A #JsonrpcClient
* @method: The method that was called
* @id: The identifier of the method call
* @params: The parameters of the method call
*
* This method is emitted when the client requests a method call.
*
* If you return %TRUE from this function, you should reply to it (even upon
* failure), using jsonrpc_client_reply() or jsonrpc_client_reply_async().
* failure), using [method@Client.reply] or [method@Client.reply_async].
*
* Returns: %TRUE if the request was handled.
*
......@@ -169,8 +169,8 @@ jsonrpc_server_class_init (JsonrpcServerClass *klass)
* JsonrpcServer::notification:
* @self: A #JsonrpcServer
* @client: A #JsonrpcClient
* @method: the notification name
* @id: the params for the notification
* @method: The notification name
* @id: The params for the notification
*
* This signal is emitted when the client has sent a notification to us.
*
......@@ -323,7 +323,7 @@ jsonrpc_server_client_notification (JsonrpcServer *self,
/**
* jsonrpc_server_accept_io_stream:
* @self: a #JsonrpcServer
* @self: A #JsonrpcServer
* @io_stream: A #GIOStream
*
* This function accepts @io_stream as a new client to the #JsonrpcServer
......@@ -385,13 +385,13 @@ sort_by_method (gconstpointer a,
* @method: A method to handle
* @handler: (closure handler_data) (destroy handler_data_destroy): A handler to
* execute when an incoming method matches @methods
* @handler_data: user data for @handler
* @handler_data_destroy: a destroy callback for @handler_data
* @handler_data: User data for @handler
* @handler_data_destroy: A destroy callback for @handler_data
*
* Adds a new handler that will be dispatched when a matching @method arrives.
*
* Returns: A handler id that can be used to remove the handler with
* jsonrpc_server_remove_handler().
* [method@Server.remove_handler].
*
* Since: 3.26
*/
......@@ -422,10 +422,10 @@ jsonrpc_server_add_handler (JsonrpcServer *self,
/**
* jsonrpc_server_remove_handler:
* @self: a #JsonrpcServer
* @handler_id: a handler returned from jsonrpc_server_add_handler()
* @self: A #JsonrpcServer
* @handler_id: A handler returned from [method@Server.add_handler]
*
* Removes a handler that was previously registered with jsonrpc_server_add_handler().
* Removes a handler that was previously registered with [method@Server.add_handler].
*
* Since: 3.26
*/
......@@ -452,9 +452,9 @@ jsonrpc_server_remove_handler (JsonrpcServer *self,
/**
* jsonrpc_server_foreach:
* @self: a #JsonrpcServer
* @foreach_func: (scope call): a callback for each client
* @user_data: closure data for @foreach_func
* @self: A #JsonrpcServer
* @foreach_func: (scope call): A callback for each client
* @user_data: Closure data for @foreach_func
*
* Calls @foreach_func for every client connected.
*
......
......@@ -83,8 +83,9 @@ if get_option('with_introspection')
namespace: 'Jsonrpc',
symbol_prefix: 'jsonrpc',
identifier_prefix: 'Jsonrpc',
export_packages: 'jsonrpc-glib-@0@'.format(apiversion),
link_with: libjsonrpc_glib,
includes: [ 'Gio-2.0', 'Json-1.0' ],
includes: ['GObject-2.0', 'GLib-2.0', 'Gio-2.0'],
install: true,
install_dir_gir: girdir,
install_dir_typelib: typelibdir,
......