mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable). However, if it is an (inout) or (out) parameter, (optional) is sufficient. It looks like (nullable) could be used for everything according to the Annotation documentation, but (optional) is more specific.
This commit is contained in:
@@ -2295,7 +2295,7 @@ g_socket_multicast_group_operation (GSocket *socket,
|
||||
* g_socket_join_multicast_group:
|
||||
* @socket: a #GSocket.
|
||||
* @group: a #GInetAddress specifying the group address to join.
|
||||
* @iface: (allow-none): Name of the interface to use, or %NULL
|
||||
* @iface: (nullable): Name of the interface to use, or %NULL
|
||||
* @source_specific: %TRUE if source-specific multicast should be used
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
@@ -2329,7 +2329,7 @@ g_socket_join_multicast_group (GSocket *socket,
|
||||
* g_socket_leave_multicast_group:
|
||||
* @socket: a #GSocket.
|
||||
* @group: a #GInetAddress specifying the group address to leave.
|
||||
* @iface: (allow-none): Interface used
|
||||
* @iface: (nullable): Interface used
|
||||
* @source_specific: %TRUE if source-specific multicast was used
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
@@ -2404,7 +2404,7 @@ g_socket_speaks_ipv4 (GSocket *socket)
|
||||
/**
|
||||
* g_socket_accept:
|
||||
* @socket: a #GSocket.
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Accept incoming connections on a connection-based socket. This removes
|
||||
@@ -2517,7 +2517,7 @@ g_socket_accept (GSocket *socket,
|
||||
* g_socket_connect:
|
||||
* @socket: a #GSocket.
|
||||
* @address: a #GSocketAddress specifying the remote address.
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Connect the socket to the specified remote address.
|
||||
@@ -2831,7 +2831,7 @@ g_socket_receive_with_timeout (GSocket *socket,
|
||||
* @buffer: (array length=size) (element-type guint8): a buffer to
|
||||
* read data into (which should be at least @size bytes long).
|
||||
* @size: the number of bytes you want to read from the socket
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Receive data (up to @size bytes) from a socket. This is mainly used by
|
||||
@@ -2882,7 +2882,7 @@ g_socket_receive (GSocket *socket,
|
||||
* read data into (which should be at least @size bytes long).
|
||||
* @size: the number of bytes you want to read from the socket
|
||||
* @blocking: whether to do blocking or non-blocking I/O
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* This behaves exactly the same as g_socket_receive(), except that
|
||||
@@ -2909,12 +2909,12 @@ g_socket_receive_with_blocking (GSocket *socket,
|
||||
/**
|
||||
* g_socket_receive_from:
|
||||
* @socket: a #GSocket
|
||||
* @address: (out) (allow-none): a pointer to a #GSocketAddress
|
||||
* @address: (out) (optional): a pointer to a #GSocketAddress
|
||||
* pointer, or %NULL
|
||||
* @buffer: (array length=size) (element-type guint8): a buffer to
|
||||
* read data into (which should be at least @size bytes long).
|
||||
* @size: the number of bytes you want to read from the socket
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Receive data (up to @size bytes) from a socket.
|
||||
@@ -3025,7 +3025,7 @@ g_socket_send_with_timeout (GSocket *socket,
|
||||
* @buffer: (array length=size) (element-type guint8): the buffer
|
||||
* containing the data to send.
|
||||
* @size: the number of bytes to send
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Tries to send @size bytes from @buffer on the socket. This is
|
||||
@@ -3067,7 +3067,7 @@ g_socket_send (GSocket *socket,
|
||||
* containing the data to send.
|
||||
* @size: the number of bytes to send
|
||||
* @blocking: whether to do blocking or non-blocking I/O
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* This behaves exactly the same as g_socket_send(), except that
|
||||
@@ -3094,11 +3094,11 @@ g_socket_send_with_blocking (GSocket *socket,
|
||||
/**
|
||||
* g_socket_send_to:
|
||||
* @socket: a #GSocket
|
||||
* @address: (allow-none): a #GSocketAddress, or %NULL
|
||||
* @address: (nullable): a #GSocketAddress, or %NULL
|
||||
* @buffer: (array length=size) (element-type guint8): the buffer
|
||||
* containing the data to send.
|
||||
* @size: the number of bytes to send
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Tries to send @size bytes from @buffer to @address. If @address is
|
||||
@@ -3665,7 +3665,7 @@ socket_source_new (GSocket *socket,
|
||||
* g_socket_create_source: (skip)
|
||||
* @socket: a #GSocket
|
||||
* @condition: a #GIOCondition mask to monitor
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
*
|
||||
* Creates a #GSource that can be attached to a %GMainContext to monitor
|
||||
* for the availability of the specified @condition on the socket. The #GSource
|
||||
@@ -3770,7 +3770,7 @@ g_socket_condition_check (GSocket *socket,
|
||||
* g_socket_condition_wait:
|
||||
* @socket: a #GSocket
|
||||
* @condition: a #GIOCondition mask to wait for
|
||||
* @cancellable: (allow-none): a #GCancellable, or %NULL
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL
|
||||
* @error: a #GError pointer, or %NULL
|
||||
*
|
||||
* Waits for @condition to become true on @socket. When the condition
|
||||
@@ -3805,7 +3805,7 @@ g_socket_condition_wait (GSocket *socket,
|
||||
* @socket: a #GSocket
|
||||
* @condition: a #GIOCondition mask to wait for
|
||||
* @timeout: the maximum time (in microseconds) to wait, or -1
|
||||
* @cancellable: (allow-none): a #GCancellable, or %NULL
|
||||
* @cancellable: (nullable): a #GCancellable, or %NULL
|
||||
* @error: a #GError pointer, or %NULL
|
||||
*
|
||||
* Waits for up to @timeout microseconds for @condition to become true
|
||||
@@ -4184,14 +4184,14 @@ input_message_from_msghdr (const struct msghdr *msg,
|
||||
/**
|
||||
* g_socket_send_message:
|
||||
* @socket: a #GSocket
|
||||
* @address: (allow-none): a #GSocketAddress, or %NULL
|
||||
* @address: (nullable): a #GSocketAddress, or %NULL
|
||||
* @vectors: (array length=num_vectors): an array of #GOutputVector structs
|
||||
* @num_vectors: the number of elements in @vectors, or -1
|
||||
* @messages: (array length=num_messages) (allow-none): a pointer to an
|
||||
* @messages: (array length=num_messages) (nullable): a pointer to an
|
||||
* array of #GSocketControlMessages, or %NULL.
|
||||
* @num_messages: number of elements in @messages, or -1.
|
||||
* @flags: an int containing #GSocketMsgFlags flags
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Send data to @address on @socket. For sending multiple messages see
|
||||
@@ -4455,7 +4455,7 @@ g_socket_send_message_with_timeout (GSocket *socket,
|
||||
* @messages: (array length=num_messages): an array of #GOutputMessage structs
|
||||
* @num_messages: the number of elements in @messages
|
||||
* @flags: an int containing #GSocketMsgFlags flags
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore.
|
||||
*
|
||||
* Send multiple data messages from @socket in one go. This is the most
|
||||
@@ -4941,7 +4941,7 @@ g_socket_receive_message_with_timeout (GSocket *socket,
|
||||
* @messages: (array length=num_messages): an array of #GInputMessage structs
|
||||
* @num_messages: the number of elements in @messages
|
||||
* @flags: an int containing #GSocketMsgFlags flags for the overall operation
|
||||
* @cancellable: (allow-none): a %GCancellable or %NULL
|
||||
* @cancellable: (nullable): a %GCancellable or %NULL
|
||||
* @error: #GError for error reporting, or %NULL to ignore
|
||||
*
|
||||
* Receive multiple data messages from @socket in one go. This is the most
|
||||
@@ -5218,11 +5218,11 @@ g_socket_receive_messages_with_timeout (GSocket *socket,
|
||||
/**
|
||||
* g_socket_receive_message:
|
||||
* @socket: a #GSocket
|
||||
* @address: (out) (nullable): a pointer to a #GSocketAddress
|
||||
* @address: (out) (optional): a pointer to a #GSocketAddress
|
||||
* pointer, or %NULL
|
||||
* @vectors: (array length=num_vectors): an array of #GInputVector structs
|
||||
* @num_vectors: the number of elements in @vectors, or -1
|
||||
* @messages: (array length=num_messages) (out) (nullable): a pointer which
|
||||
* @messages: (array length=num_messages) (out) (optional): a pointer which
|
||||
* may be filled with an array of #GSocketControlMessages, or %NULL
|
||||
* @num_messages: (out): a pointer which will be filled with the number of
|
||||
* elements in @messages, or %NULL
|
||||
|
Reference in New Issue
Block a user