2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 2009, 2010 Zmanda, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
19 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
23 #include "xfer-device.h"
25 static GObjectClass *parent_class = NULL;
28 * Method implementation
33 XferDestTaper *self G_GNUC_UNUSED,
34 const char *filename G_GNUC_UNUSED,
35 off_t offset G_GNUC_UNUSED,
36 off_t length G_GNUC_UNUSED)
45 elt->can_generate_eof = FALSE;
50 XferDestTaperClass * selfc)
52 XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
54 selfc->cache_inform = cache_inform_impl;
56 klass->perl_class = "Amanda::Xfer::Dest::Taper";
58 parent_class = g_type_class_peek_parent(selfc);
62 xfer_dest_taper_get_type (void)
64 static GType type = 0;
66 if G_UNLIKELY(type == 0) {
67 static const GTypeInfo info = {
68 sizeof (XferDestTaperClass),
70 (GBaseFinalizeFunc) NULL,
71 (GClassInitFunc) class_init,
72 (GClassFinalizeFunc) NULL,
73 NULL /* class_data */,
74 sizeof (XferDestTaper),
76 (GInstanceInitFunc) instance_init,
80 type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestTaper", &info, 0);
91 xfer_dest_taper_start_part(
96 XferDestTaperClass *klass;
97 g_assert(IS_XFER_DEST_TAPER(elt));
99 klass = XFER_DEST_TAPER_GET_CLASS(elt);
100 klass->start_part(XFER_DEST_TAPER(elt), retry_part, header);
104 xfer_dest_taper_use_device(
108 XferDestTaperClass *klass;
109 g_assert(IS_XFER_DEST_TAPER(elt));
111 klass = XFER_DEST_TAPER_GET_CLASS(elt);
112 klass->use_device(XFER_DEST_TAPER(elt), device);
116 xfer_dest_taper_cache_inform(
118 const char *filename,
122 XferDestTaperClass *klass;
123 g_assert(IS_XFER_DEST_TAPER(elt));
125 klass = XFER_DEST_TAPER_GET_CLASS(elt);
126 klass->cache_inform(XFER_DEST_TAPER(elt), filename, offset, length);
130 xfer_dest_taper_get_part_bytes_written(
131 XferElement *elt G_GNUC_UNUSED)
133 XferDestTaperClass *klass;
134 g_assert(IS_XFER_DEST_TAPER(elt));
136 klass = XFER_DEST_TAPER_GET_CLASS(elt);
137 if (klass->get_part_bytes_written)
138 return klass->get_part_bytes_written(XFER_DEST_TAPER(elt));