EDataServer.webdav_discover_sources_sync
Description: Reference for EDataServer.webdav_discover_sources_sync

### Function

# EDataServerwebdav_discover_sources_sync

since: 3.18

#### Declaration [src]

    gboolean
    e_webdav_discover_sources_sync (
      ESource* source,
      const gchar* url_use_path,
      guint32 only_supports,
      const ENamedParameters* credentials,
      gchar** out_certificate_pem,
      GTlsCertificateFlags* out_certificate_errors,
      GSList** out_discovered_sources,
      GSList** out_calendar_user_addresses,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Synchronously runs discovery of the WebDAV sources (CalDAV and CardDAV), eventually limited by the `only_supports` filter, which can be `E_WEBDAV_DISCOVER_SUPPORTS_NONE` to search all types. Note that the list of returned calendars can be more general, thus check for its actual support type for further filtering of the results. The `url_use_path` can be used to override actual server path, or even complete URL, for the given `source`.

If an error occurred, the function will set `error` and return `FALSE`. The function can return success and no discovered sources, the same as it can return failure, but still set some output arguments, like the certificate related output arguments with G_TLS_ERROR_BAD_CERTIFICATE error.

The return value of `out_certificate_pem` should be freed with `g_free()` when no longer needed.

The return value of `out_discovered_sources` should be freed with `e_webdav_discover_free_discovered_sources()` when no longer needed.

The return value of `out_calendar_user_addresses` should be freed with g_slist_free_full (calendar_user_addresses, g_free); when no longer needed.

Available since: 3.18

#### Parameters

`source`

  Type: `ESource`

  An `ESource` from which to take connection details.

  The data is owned by the caller of the function.

`url_use_path`

  Type: `const gchar*`

  Optional URL override, or `NULL`.

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

`only_supports`

  Type: `guint32`

  Bit-or of EWebDAVDiscoverSupports, to limit what type of sources to search.

`credentials`

  Type: `ENamedParameters`

  Credentials to use for authentication to the server.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`out_certificate_pem`

  Type: `gchar**`

  Optional return location for a server SSL certificate in PEM format, when the operation failed with an SSL error.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`out_certificate_errors`

  Type: `GTlsCertificateFlags`

  Optional `GTlsCertificateFlags`, with certificate error flags when the operation failed with SSL error.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`out_discovered_sources`

  Type: A list of `EWebDAVDiscoveredSource*`

  A `GSList` of all discovered sources.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`out_calendar_user_addresses`

  Type: A list of `utf8`

  A `GSList` of all discovered mail addresses for calendar sources.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.
  Each element is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`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 function 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` on success, `FALSE` on failure.