~ubuntu-branches/ubuntu/maverick/speech-tools/maverick

« back to all changes in this revision

Viewing changes to wrappers/interface/perl5/EST_typemaps.i

  • Committer: Bazaar Package Importer
  • Author(s): Kumar Appaiah, Kartik Mistry, Kumar Appaiah
  • Date: 2010-07-17 11:32:04 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100717113204-mnse3jo236j107q8
Tags: 1:2.0.95~beta-1
[ Kartik Mistry ]
* debian/control:
  + [Lintian] Added missing ${misc:Depends}
  + Updated Standards-Version to 3.8.4 (no changes needed)
* debian/patches/const_char.diff:
  + Added missing patch header
* Removed unused patch invalid_const_char_conversion_fixes.diff

[ Kumar Appaiah ]
* New upstream release.
* Standards Version is now 3.9.0 (No changes needed)
* Update debian/rules to specify version numbers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*************************************************************************/
 
2
/*                                                                       */
 
3
/*                Centre for Speech Technology Research                  */
 
4
/*                 (University of Edinburgh, UK) and                     */
 
5
/*                           Korin Richmond                              */
 
6
/*                         Copyright (c) 2003                            */
 
7
/*                         All Rights Reserved.                          */
 
8
/*                                                                       */
 
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:                                            */
 
15
/*                                                                       */
 
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        */
 
22
/*      permission.                                                      */
 
23
/*                                                                       */
 
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       */
 
32
/*  THIS SOFTWARE.                                                       */
 
33
/*                                                                       */
 
34
/*************************************************************************/
 
35
/*                       Author :  Korin Richmond                        */
 
36
/*                       Date   :  14 Apr 2003                           */
 
37
/* --------------------------------------------------------------------- */
 
38
/*                                                                       */
 
39
/* Swig Perl type maps for some speech tools types                       */
 
40
/*                                                                       */
 
41
/*************************************************************************/
 
42
 
 
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 );
 
46
  $1 = &temp;
 
47
}
 
48
 
 
49
/* new - need typechecking for overloaded function dispatcher */
 
50
%typemap(typecheck) EST_String& = char *;
 
51
 
 
52
 
 
53
%typemap(in) EST_String {
 
54
  STRLEN len; const char* str = SvPV($input, len);
 
55
  $1 = EST_String( str, len, 0, len );
 
56
}
 
57
 
 
58
/* new - need typechecking for overloaded function dispatcher */
 
59
%typemap(typecheck) EST_String = char *;
 
60
 
 
61
%typemap(out) EST_String
 
62
  "ST(argvi) = sv_newmortal();
 
63
   sv_setpvn((SV*)ST(argvi++),(char *)$1, $1.length());";
 
64
 
 
65
%typemap(out) EST_String&, EST_String*
 
66
  "ST(argvi) = sv_newmortal();
 
67
   sv_setpvn((SV*)ST(argvi++),(char *)(*$1), $1->length());";
 
68
 
 
69