Method

BirbResponseStreamadd_response

since: 0.6

Declaration [src]

gboolean
birb_response_stream_add_response (
  BirbResponseStream* stream,
  const char* pattern,
  const char* response,
  GError** error
)

Description [src]

Adds the given regex pattern and response pair.

If pattern is NULL, response will be emitted immediately.

If response is NULL, no data will be written to the output stream. This is useful if you want to easily match multiple inputs before responding.

Available since: 0.6

Parameters

pattern

Type: const char*

The regex pattern to match.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
response

Type: const char*

The response to send.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

True if the regex pattern was valid and added successfully.