1
/*************************************************************************/
3
/* Centre for Speech Technology Research */
4
/* (University of Edinburgh, UK) and */
6
/* Copyright (c) 2003 */
7
/* All Rights Reserved. */
9
/* Permission is hereby granted, free of charge, to use and distribute */
10
/* this software and its documentation without restriction, including */
11
/* without limitation the rights to use, copy, modify, merge, publish, */
12
/* distribute, sublicense, and/or sell copies of this work, and to */
13
/* permit persons to whom this work is furnished to do so, subject to */
14
/* the following conditions: */
16
/* 1. The code must retain the above copyright notice, this list of */
17
/* conditions and the following disclaimer. */
18
/* 2. Any modifications must be clearly marked as such. */
19
/* 3. Original authors' names are not deleted. */
20
/* 4. The authors' names are not used to endorse or promote products */
21
/* derived from this software without specific prior written */
24
/* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
25
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
26
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT */
27
/* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
28
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
29
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
30
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
31
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
34
/*************************************************************************/
35
/* Author : Korin Richmond */
36
/* Date : 14 Apr 2003 */
37
/* --------------------------------------------------------------------- */
39
/* Swig Perl type maps for some speech tools types */
41
/*************************************************************************/
43
%typemap(in) EST_String & (EST_String temp) {
44
STRLEN len; const char* str = SvPV($input, len);
45
temp = EST_String( str, len, 0, len );
49
/* new - need typechecking for overloaded function dispatcher */
50
%typemap(typecheck) EST_String& = char *;
53
%typemap(in) EST_String {
54
STRLEN len; const char* str = SvPV($input, len);
55
$1 = EST_String( str, len, 0, len );
58
/* new - need typechecking for overloaded function dispatcher */
59
%typemap(typecheck) EST_String = char *;
61
%typemap(out) EST_String
62
"ST(argvi) = sv_newmortal();
63
sv_setpvn((SV*)ST(argvi++),(char *)$1, $1.length());";
65
%typemap(out) EST_String&, EST_String*
66
"ST(argvi) = sv_newmortal();
67
sv_setpvn((SV*)ST(argvi++),(char *)(*$1), $1->length());";