2 * Copyright (c) 2007,2008,2009 Zmanda, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
8 * This program 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 General Public License
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18 * Sunnyvale, CA 94085, 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`}};