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., 505 N Mathlida Ave, Suite 120
18 * Sunnyvale, CA 94085, 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
53 =item C<encrypt_suffix>;
54 =item C<name> -- hostname or label;
59 =item C<clntcompprog>;
61 =item C<clnt_encrypt>;
63 =item C<uncompress_cmd>;
66 =item C<srv_decrypt_opt>;
67 =item C<clnt_decrypt_opt>;
68 =item C<cont_filename>;
71 =item C<totalparts> (-1 == UNKNOWN); and
75 where C<type> is one of the following constants, which are availble
76 for import in the tag C<:filetype_t>:
83 =item C<F_CONT_DUMPFILE>;
84 =item C<F_SPLIT_DUMPFILE>; or
88 NOTE: no methods are currently defined on C<dumpfile_t>; interfaces
89 can be written as needed.
94 amglue_add_flag_tag_fns(filetype_t);
95 amglue_add_constant(F_UNKNOWN, filetype_t);
96 amglue_add_constant(F_WEIRD, filetype_t);
97 amglue_add_constant(F_TAPESTART, filetype_t);
98 amglue_add_constant(F_TAPEEND, filetype_t);
99 amglue_add_constant(F_DUMPFILE, filetype_t);
100 amglue_add_constant(F_CONT_DUMPFILE, filetype_t);
101 amglue_add_constant(F_SPLIT_DUMPFILE, filetype_t);
102 amglue_add_constant(F_EMPTY, filetype_t);
104 typedef char string_t[STRMAX];
105 %typemap(memberin) string_t {
106 strncpy($1, $input, STRMAX);
107 if ($1[STRMAX-1] != '\0')
108 SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
118 string_t comp_suffix;
119 string_t encrypt_suffix;
120 string_t name; /* hostname or label */
124 string_t srvcompprog;
125 string_t clntcompprog;
126 string_t srv_encrypt;
127 string_t clnt_encrypt;
128 string_t recover_cmd;
129 string_t uncompress_cmd;
130 string_t encrypt_cmd;
131 string_t decrypt_cmd;
132 string_t srv_decrypt_opt;
133 string_t clnt_decrypt_opt;
134 string_t cont_filename;
137 int totalparts; /* -1 == UNKNOWN */
143 dumpfile_t *df = malloc(sizeof(*df));
155 /* TODO: rename to dump_header */