2 * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
19 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
23 * This file contains SWIG macros to handle exports from perl modules using
24 * the Exporter paackage;
27 /* Initialization: SWIG sets up @EXPORT, but to be 'use strict'-compatible,
28 * we declare @EXPORT_OK and %EXPORT_TAGS.
35 /* Mark SYMBOLS as exported by default (in @EXPORT)
37 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
39 %define amglue_export(SYMBOLS)
41 push @EXPORT, qw(SYMBOLS);
45 /* Mark SYMBOLS as exported on request (in @EXPORT_OK)
47 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
49 %define amglue_export_ok(SYMBOLS)
51 push @EXPORT_OK, qw(SYMBOLS);
55 /* Mark SYMBOLS as exported for tag TAG (in $EXPORT_TAGS{TAG}); also
56 * adds SYMBOLS to EXPORT_OK.
58 * @param TAG: tag under which to export
59 * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
61 %define amglue_export_tag(TAG, SYMBOLS)
63 push @EXPORT_OK, qw(SYMBOLS);
64 push @{$EXPORT_TAGS{`TAG`}}, qw(SYMBOLS);
68 /* Copy symbols in tag SRCTAG to tag DESTTAG; this is usually used to
69 * include enums or flags into a categorical tag.
71 * @param SRCTAG: tag to copy from
72 * @param DESTTAG: tag to copy to
74 %define amglue_copy_to_tag(SRCTAG, DESTTAG)
76 # copy symbols in SRCTAG to DESTTAG
77 push @{$EXPORT_TAGS{`DESTTAG`}}, @{$EXPORT_TAGS{`SRCTAG`}};