summaryrefslogtreecommitdiff
path: root/common/gmountspec.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:25:55 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:25:55 +0000
commit2e6f0c31af7c2b1262db3e84654c1c2ed082a18a (patch)
tree21eec64a5d41bfbb087289d533d90cfab6b6b0df /common/gmountspec.c
parent5950303721316b204dd2e98323e3696dcc59c328 (diff)
downloadgvfs-2e6f0c31af7c2b1262db3e84654c1c2ed082a18a.tar.gz
More work on mounting. Automount of smb now works (test).
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1170415025 +0100 svn path=/trunk/; revision=296
Diffstat (limited to 'common/gmountspec.c')
-rw-r--r--common/gmountspec.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c
index 5c657677..f77fe597 100644
--- a/common/gmountspec.c
+++ b/common/gmountspec.c
@@ -27,7 +27,7 @@ g_mount_spec_new (const char *type)
spec->items = g_array_new (FALSE, TRUE, sizeof (GMountSpecItem));
if (type != NULL)
- g_mount_spec_add_item (spec, "type", type);
+ g_mount_spec_set (spec, "type", type);
return spec;
}
@@ -47,9 +47,9 @@ add_item (GMountSpec *spec,
void
-g_mount_spec_add_item (GMountSpec *spec,
- const char *key,
- const char *value)
+g_mount_spec_set (GMountSpec *spec,
+ const char *key,
+ const char *value)
{
add_item (spec, key, g_strdup (value));
g_array_sort (spec->items, item_compare);
@@ -253,7 +253,8 @@ g_mount_spec_match (GMountSpec *mount,
}
const char *
-g_mount_spec_get_type (GMountSpec *spec)
+g_mount_spec_get (GMountSpec *spec,
+ const char *key)
{
int i;
@@ -261,9 +262,16 @@ g_mount_spec_get_type (GMountSpec *spec)
{
GMountSpecItem *item = &g_array_index (spec->items, GMountSpecItem, i);
- if (strcmp (item->key, "type") == 0)
+ if (strcmp (item->key, key) == 0)
return item->value;
}
return NULL;
}
+
+const char *
+g_mount_spec_get_type (GMountSpec *spec)
+{
+ return g_mount_spec_get (spec, "type");
+}
+