[gvfs] AFP: create backend stub



commit 9772efdf9ff5907a3e49083b7acba8d230ede963
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Mon May 23 01:06:21 2011 +0200

    AFP: create backend stub

 daemon/Makefile.am      |   21 ++++++++++++--
 daemon/afp.mount.in     |    8 +++++
 daemon/gvfsbackendafp.c |   68 +++++++++++++++++++++++++++++++++++++++++++++++
 daemon/gvfsbackendafp.h |   54 +++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+), 3 deletions(-)
---
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 4ea55e6..4001068 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -40,10 +40,10 @@ service_DATA = gvfs-daemon.service
 %.mount: %.mount.in ../config.log
 	$(AM_V_GEN) $(SED) -e "s|\ libexecdir\@|$(libexecdir)|" $< > $@
 
-libexec_PROGRAMS=gvfsd gvfsd-sftp gvfsd-trash gvfsd-computer gvfsd-burn gvfsd-localtest gvfsd-ftp gvfsd-network
+libexec_PROGRAMS=gvfsd gvfsd-sftp gvfsd-trash gvfsd-computer gvfsd-burn gvfsd-localtest gvfsd-ftp gvfsd-network gvfsd-afp
 
-mount_in_files = sftp.mount.in trash.mount.in computer.mount.in burn.mount.in localtest.mount.in network.mount.in
-mount_DATA =  sftp.mount trash.mount computer.mount burn.mount localtest.mount network.mount
+mount_in_files = sftp.mount.in trash.mount.in computer.mount.in burn.mount.in localtest.mount.in network.mount.in afp.mount.in
+mount_DATA =  sftp.mount trash.mount computer.mount burn.mount localtest.mount network.mount afp.mount.in
 
 mount_in_files += http.mount.in dav.mount.in dav+sd.mount.in ftp.mount.in 
 if HAVE_HTTP
@@ -472,6 +472,21 @@ gvfsd_afc_LDADD = \
 	$(libraries) \
 	$(AFC_LIBS)
 
+gvfsd_afp_SOURCES = \
+	gvfsbackendafp.c gvfsbackendafp.h \
+	daemon-main.c daemon-main.h \
+	daemon-main-generic.c
+
+gvfsd_afp_CPPFLAGS = \
+	-DBACKEND_HEADER=gvfsbackendafp.h \
+	-DDEFAULT_BACKEND_TYPE=afp \
+	-DMAX_JOB_THREADS=1 \
+	$(AFC_CFLAGS) \
+	-DBACKEND_TYPES='"afp", G_VFS_TYPE_BACKEND_AFP,'
+
+gvfsd_afp_LDADD = \
+	$(libraries) \
+	$(AFC_LIBS)
 
 # GSettings stuff
 gsettings_ENUM_NAMESPACE = org.gnome.system.gvfs
diff --git a/daemon/afp.mount.in b/daemon/afp.mount.in
new file mode 100644
index 0000000..3952c31
--- /dev/null
+++ b/daemon/afp.mount.in
@@ -0,0 +1,8 @@
+[Mount]
+Type=ftp
+Exec= libexecdir@/gvfsd-afp
+AutoMount=false
+Scheme=afp
+DefaultPort=548
+HostnameIsInetAddress=true
+
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
new file mode 100644
index 0000000..acc30b2
--- /dev/null
+++ b/daemon/gvfsbackendafp.c
@@ -0,0 +1,68 @@
+ /* GIO - GLib Input, Output and Streaming Library
+ * 
+ * Copyright (C) Carl-Anton Ingmarsson 2011 <ca ingmarsson gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
+ */
+
+#include <config.h>
+
+#include "gvfsjobmount.h"
+
+
+#include "gvfsbackendafp.h"
+
+
+
+G_DEFINE_TYPE (GVfsBackendAfp, g_vfs_backend_afp, G_VFS_TYPE_BACKEND);
+
+static gboolean
+try_mount (GVfsBackend *backend,
+           GVfsJobMount *job,
+           GMountSpec *mount_spec,
+           GMountSource *mount_source,
+           gboolean is_automount)
+{
+	return FALSE;
+}
+
+static void
+g_vfs_backend_afp_init (GVfsBackendAfp *object)
+{
+	/* TODO: Add initialization code here */
+}
+
+static void
+g_vfs_backend_afp_finalize (GObject *object)
+{
+	/* TODO: Add deinitalization code here */
+
+	G_OBJECT_CLASS (g_vfs_backend_afp_parent_class)->finalize (object);
+}
+
+static void
+g_vfs_backend_afp_class_init (GVfsBackendAfpClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS (klass);
+
+	object_class->finalize = g_vfs_backend_afp_finalize;
+
+	backend_class->try_mount = try_mount;
+}
+
diff --git a/daemon/gvfsbackendafp.h b/daemon/gvfsbackendafp.h
new file mode 100644
index 0000000..4edf2ac
--- /dev/null
+++ b/daemon/gvfsbackendafp.h
@@ -0,0 +1,54 @@
+ /* GIO - GLib Input, Output and Streaming Library
+ * 
+ * Copyright (C) Carl-Anton Ingmarsson 2011 <ca ingmarsson gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
+ */
+
+#ifndef _GVFSBACKENDAFP_H_
+#define _GVFSBACKENDAFP_H_
+
+#include <gvfsbackend.h>
+
+G_BEGIN_DECLS
+
+#define G_VFS_TYPE_BACKEND_AFP             (g_vfs_backend_afp_get_type ())
+#define G_VFS_BACKEND_AFP(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VFS_BACKEND_AFP, GVfsBackendAfp))
+#define G_VFS_BACKEND_AFP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_VFS_BACKEND_AFP, GVfsBackendAfpClass))
+#define G_IS_VFS_BACKEND_AFP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_VFS_BACKEND_AFP))
+#define G_IS_VFS_BACKEND_AFP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_VFS_BACKEND_AFP))
+#define G_VFS_BACKEND_AFP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_VFS_BACKEND_AFP, GVfsBackendAfpClass))
+
+typedef struct _GVfsBackendAfpClass GVfsBackendAfpClass;
+typedef struct _GVfsBackendAfp GVfsBackendAfp;
+
+struct _GVfsBackendAfpClass
+{
+	GVfsBackendClass parent_class;
+};
+
+struct _GVfsBackendAfp
+{
+	GVfsBackend parent_instance;
+};
+
+GType g_vfs_backend_afp_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* _GVFSBACKENDAFP_H_ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]