summaryrefslogtreecommitdiffstats
path: root/g13/backend.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-10-13 21:17:24 +0200
committerWerner Koch <wk@gnupg.org>2009-10-13 21:17:24 +0200
commit536b6ab09fa3e17f955c8b55e8469f3265a1936f (patch)
treea06fba4fb448cc70de12a470d7dde7f22c3eaf8f /g13/backend.c
parentReplace C99 style vararg macro which was anyway not correct. (diff)
downloadgnupg2-536b6ab09fa3e17f955c8b55e8469f3265a1936f.tar.xz
gnupg2-536b6ab09fa3e17f955c8b55e8469f3265a1936f.zip
Keep on hacking on g13. A simple --create and --mount does now work.
A hacked up encfs is required.
Diffstat (limited to 'g13/backend.c')
-rw-r--r--g13/backend.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/g13/backend.c b/g13/backend.c
index a6f38719a..08aec324f 100644
--- a/g13/backend.c
+++ b/g13/backend.c
@@ -41,6 +41,22 @@ no_such_backend (int conttype)
}
+/* Return true if CONTTYPE is supported by us. */
+int
+be_is_supported_conttype (int conttype)
+{
+ switch (conttype)
+ {
+ case CONTTYPE_ENCFS:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+
+
/* If the backend requires a separate file or directory for the
container, return its name by computing it from FNAME which gives
the g13 filename. The new file name is allocated and stored at
@@ -81,3 +97,37 @@ be_create_new_keys (int conttype, membuf_t *mb)
}
}
+
+/* Dispatcher to the backend's create function. */
+gpg_error_t
+be_create_container (ctrl_t ctrl, int conttype,
+ const char *fname, int fd, tupledesc_t tuples)
+{
+ (void)fd; /* Not yet used. */
+
+ switch (conttype)
+ {
+ case CONTTYPE_ENCFS:
+ return be_encfs_create_container (ctrl, fname, tuples);
+
+ default:
+ return no_such_backend (conttype);
+ }
+}
+
+
+/* Dispatcher to the backend's mount function. */
+gpg_error_t
+be_mount_container (ctrl_t ctrl, int conttype,
+ const char *fname, const char *mountpoint,
+ tupledesc_t tuples)
+{
+ switch (conttype)
+ {
+ case CONTTYPE_ENCFS:
+ return be_encfs_mount_container (ctrl, fname, mountpoint, tuples);
+
+ default:
+ return no_such_backend (conttype);
+ }
+}