2 * Copyright (c) Zmanda, Inc. All Rights Reserved.
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
6 * as published by the Free Software Foundation.
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.
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.
17 * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300
18 * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
21 %module "Amanda::Types"
22 %include "amglue/amglue.swg"
23 %include "exception.i"
26 #include "fileheader.h"
32 Amanda::Types - Amanda data structures that are shared by several modules
36 This module includes several types which are not specific to any
41 New structures may be added, but existing types are stable.
45 An in-memory representation of an Amanda header, with keys
61 =item C<encrypt_suffix>;
63 =item C<name> -- hostname or label;
73 =item C<clntcompprog>;
77 =item C<clnt_encrypt>;
81 =item C<uncompress_cmd>;
87 =item C<srv_decrypt_opt>;
89 =item C<clnt_decrypt_opt>;
91 =item C<cont_filename>;
99 =item C<totalparts> (-1 == UNKNOWN); and
105 where C<type> is one of the following constants, which are availble
106 for import in the tag C<:filetype_t>:
114 =item C<F_TAPESTART>;
120 =item C<F_CONT_DUMPFILE>;
122 =item C<F_SPLIT_DUMPFILE>; or
128 NOTE: no methods are currently defined on C<dumpfile_t>; interfaces
129 can be written as needed. A new dumpfile is created with
131 my $hdr = Amanda::Types::dumpfile_t->new();
136 amglue_add_flag_tag_fns(filetype_t);
137 amglue_add_constant(F_UNKNOWN, filetype_t);
138 amglue_add_constant(F_WEIRD, filetype_t);
139 amglue_add_constant(F_TAPESTART, filetype_t);
140 amglue_add_constant(F_TAPEEND, filetype_t);
141 amglue_add_constant(F_DUMPFILE, filetype_t);
142 amglue_add_constant(F_CONT_DUMPFILE, filetype_t);
143 amglue_add_constant(F_SPLIT_DUMPFILE, filetype_t);
144 amglue_add_constant(F_EMPTY, filetype_t);
146 typedef char string_t[STRMAX];
147 %typemap(memberin) string_t {
148 strncpy($1, $input, STRMAX);
149 if ($1[STRMAX-1] != '\0')
150 SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
160 string_t comp_suffix;
161 string_t encrypt_suffix;
162 string_t name; /* hostname or label */
165 string_t application;
166 string_t srvcompprog;
167 string_t clntcompprog;
168 string_t srv_encrypt;
169 string_t clnt_encrypt;
170 string_t recover_cmd;
171 string_t uncompress_cmd;
172 string_t encrypt_cmd;
173 string_t decrypt_cmd;
174 string_t srv_decrypt_opt;
175 string_t clnt_decrypt_opt;
176 string_t cont_filename;
180 int totalparts; /* -1 == UNKNOWN */
186 dumpfile_t *df = malloc(sizeof(*df));
198 /* TODO: rename to dump_header */