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
22 * This file contains SWIG macros to handle exports from perl modules using
23 * the Exporter paackage;
26 /* Initialization: SWIG sets up @EXPORT, but to be 'use strict'-compatible,
27 * we declare @EXPORT_OK and %EXPORT_TAGS.
34 /* Mark SYMBOLS as exported by default (in @EXPORT)
36 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
38 %define amglue_export(SYMBOLS)
40 push @EXPORT, qw(SYMBOLS);
44 /* Mark SYMBOLS as exported on request (in @EXPORT_OK)
46 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
48 %define amglue_export_ok(SYMBOLS)
50 push @EXPORT_OK, qw(SYMBOLS);
54 /* Mark SYMBOLS as exported for tag TAG (in $EXPORT_TAGS{TAG}); also
55 * adds SYMBOLS to EXPORT_OK.
57 * @param TAG: tag under which to export
58 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
60 %define amglue_export_tag(TAG, SYMBOLS)
62 push @EXPORT_OK, qw(SYMBOLS);
63 push @{$EXPORT_TAGS{`TAG`}}, qw(SYMBOLS);
67 /* Copy symbols in tag SRCTAG to tag DESTTAG; this is usually used to
68 * include enums or flags into a categorical tag.
70 * @param SRCTAG: tag to copy from
71 * @param DESTTAG: tag to copy to
73 %define amglue_copy_to_tag(SRCTAG, DESTTAG)
75 # copy symbols in SRCTAG to DESTTAG
76 push @{$EXPORT_TAGS{`DESTTAG`}}, @{$EXPORT_TAGS{`SRCTAG`}};