2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 2009-2012 Zmanda, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
20 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
24 #include "xfer-device.h"
26 static GObjectClass *parent_class = NULL;
29 * Method implementation
34 XferDestTaper *self G_GNUC_UNUSED,
35 const char *filename G_GNUC_UNUSED,
36 off_t offset G_GNUC_UNUSED,
37 off_t length G_GNUC_UNUSED)
46 elt->can_generate_eof = FALSE;
51 XferDestTaperClass * selfc)
53 XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
55 selfc->cache_inform = cache_inform_impl;
57 klass->perl_class = "Amanda::Xfer::Dest::Taper";
59 parent_class = g_type_class_peek_parent(selfc);
63 xfer_dest_taper_get_type (void)
65 static GType type = 0;
67 if G_UNLIKELY(type == 0) {
68 static const GTypeInfo info = {
69 sizeof (XferDestTaperClass),
71 (GBaseFinalizeFunc) NULL,
72 (GClassInitFunc) class_init,
73 (GClassFinalizeFunc) NULL,
74 NULL /* class_data */,
75 sizeof (XferDestTaper),
77 (GInstanceInitFunc) instance_init,
81 type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestTaper", &info, 0);
92 xfer_dest_taper_start_part(
97 XferDestTaperClass *klass;
98 g_assert(IS_XFER_DEST_TAPER(elt));
100 klass = XFER_DEST_TAPER_GET_CLASS(elt);
101 klass->start_part(XFER_DEST_TAPER(elt), retry_part, header);
105 xfer_dest_taper_use_device(
109 XferDestTaperClass *klass;
110 g_assert(IS_XFER_DEST_TAPER(elt));
112 klass = XFER_DEST_TAPER_GET_CLASS(elt);
113 klass->use_device(XFER_DEST_TAPER(elt), device);
117 xfer_dest_taper_cache_inform(
119 const char *filename,
123 XferDestTaperClass *klass;
124 g_assert(IS_XFER_DEST_TAPER(elt));
126 klass = XFER_DEST_TAPER_GET_CLASS(elt);
127 klass->cache_inform(XFER_DEST_TAPER(elt), filename, offset, length);
131 xfer_dest_taper_get_part_bytes_written(
132 XferElement *elt G_GNUC_UNUSED)
134 XferDestTaperClass *klass;
135 g_assert(IS_XFER_DEST_TAPER(elt));
137 klass = XFER_DEST_TAPER_GET_CLASS(elt);
138 if (klass->get_part_bytes_written)
139 return klass->get_part_bytes_written(XFER_DEST_TAPER(elt));