Imported Upstream version 2.6.0p2
[debian/amanda] / device-src / rait-device.h
1 /*
2  * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
3  * 
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 2.1 as 
6  * published by the Free Software Foundation.
7  * 
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
11  * License for more details.
12  * 
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation,
15  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
16  * 
17  * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
18  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
19  */
20
21 /* The RAIT device encapsulates some number of other devices into a single
22  * redundant device. */
23
24 #ifndef RAIT_DEVICE_H
25 #define RAIT_DEVICE_H
26
27 #include <glib.h>
28 #include <glib-object.h>
29 #include "device.h"
30
31 /*
32  * Type checking and casting macros
33  */
34 #define TYPE_RAIT_DEVICE        (rait_device_get_type())
35 #define RAIT_DEVICE(obj)        G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice)
36 #define RAIT_DEVICE_CONST(obj)  G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice const)
37 #define RAIT_DEVICE_CLASS(klass)        G_TYPE_CHECK_CLASS_CAST((klass), rait_device_get_type(), RaitDeviceClass)
38 #define IS_RAIT_DEVICE(obj)     G_TYPE_CHECK_INSTANCE_TYPE((obj), rait_device_get_type ())
39
40 #define RAIT_DEVICE_GET_CLASS(obj)      G_TYPE_INSTANCE_GET_CLASS((obj), rait_device_get_type(), RaitDeviceClass)
41
42 /*
43  * Main object structure
44  */
45 typedef struct RaitDevicePrivate_s RaitDevicePrivate;
46 typedef struct RaitDevice_s {
47     Device __parent__;
48
49     RaitDevicePrivate * private;
50 } RaitDevice;
51
52 /*
53  * Class definition
54  */
55 typedef struct _RaitDeviceClass RaitDeviceClass;
56 struct _RaitDeviceClass {
57     DeviceClass __parent__;
58 };
59
60
61 /*
62  * Public methods
63  */
64 GType   rait_device_get_type    (void);
65 Device * rait_device_factory    (char * type,
66                                  char * name);
67 /* Pass this factory a NULL-terminated array of Devices, and it will make a
68    RAIT out of them. The returned device refss the passed devices, so unref
69    them yourself. */
70 Device * rait_device_new_from_devices(Device ** devices);
71 void    rait_device_register    (void);
72
73 #ifdef __cplusplus
74 }
75 #endif /* __cplusplus */
76
77 #endif