aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-provider.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-04-27 03:52:33 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-04-27 03:52:33 +0800
commit82ac8c3819b5227de647edb28769d03ddf161ec9 (patch)
tree004f7a1018715bad7b1b87a6c1337f3d9693171c /camel/camel-provider.c
parent8ee6239978c34f08d83dc8dcd9870b4ab8a2665b (diff)
downloadgsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar.gz
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar.bz2
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar.lz
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar.xz
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.tar.zst
gsoc2013-evolution-82ac8c3819b5227de647edb28769d03ddf161ec9.zip
New function to auto-detect configuration settings.
2002-04-26 Jeffrey Stedfast <fejj@ximian.com> * camel-provider.c (camel_provider_auto_detect): New function to auto-detect configuration settings. svn path=/trunk/; revision=16599
Diffstat (limited to 'camel/camel-provider.c')
-rw-r--r--camel/camel-provider.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index a9afc0fa22..30d5f729f9 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -153,3 +153,39 @@ camel_provider_load (CamelSession *session, const char *path, CamelException *ex
camel_provider_module_init (session);
}
+
+
+/**
+ * camel_provider_auto_detect:
+ * @provider: camel provider
+ * @settings: currently set settings
+ * @auto_detected: output hash table of auto-detected values
+ * @ex: exception
+ *
+ * After filling in the standard Username/Hostname/Port/Path settings
+ * (which must be set in @settings), if the provider supports it, you
+ * may wish to have the provider auto-detect further settings based on
+ * the aformentioned settings.
+ *
+ * If the provider does not support auto-detection, @auto_detected
+ * will be set to %NULL. Otherwise the provider will attempt to
+ * auto-detect whatever it can and file them into @auto_detected. If
+ * for some reason it cannot auto-detect anything (not enough
+ * information provided in @settings?) then @auto_deetected will be
+ * set to %NULL and an exception may be set to explain why it failed.
+ *
+ * Returns 0 on success or -1 on fail.
+ **/
+int
+camel_provider_auto_detect (CamelProvider *provider, GHashTable *settings,
+ GHashTable **auto_detected, CamelException *ex)
+{
+ g_return_val_if_fail (provider != NULL, -1);
+
+ if (provider->auto_detect) {
+ return provider->auto_detect (settings, auto_detected, ex);
+ } else {
+ *auto_detected = NULL;
+ return 0;
+ }
+}