~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Lib/typemaps/primtypes.swg

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*
6
6
  This file provide fragments and macros for the C/C++ primitive types. 
7
7
 
8
 
  The file defines default fragments for the  following types:
 
8
  The file defines default fragments for the following types:
9
9
 
10
10
    bool
11
11
    signed char
20
20
    size_t
21
21
    ptrdiff_t
22
22
 
23
 
  which can always be redefined in the swig target languge if needed.
 
23
  which can always be redefined in the swig target language if needed.
24
24
  
25
25
  The fragments for the following types, however, need to be defined
26
26
  in the target language always:
41
41
    %typemaps_primitive(CheckCode, Type)
42
42
 
43
43
  which generate the typemaps for a primitive type with a given
44
 
  checkcode. It is assumed the the primitive type is 'normalized' and
 
44
  checkcode. It is assumed that the primitive type is 'normalized' and
45
45
  the corresponding SWIG_AsVal(Type) and SWIG_From(Type) methods are
46
46
  provided via fragments.
47
47
  
48
48
   
49
 
  The following auxiliar macros (explained with bash pseudo code) are
 
49
  The following auxiliary macros (explained with bash pseudo code) are
50
50
  also defined:
51
51
 
52
 
    %apply_ctypes(Macro)        
53
 
      for i in C Type 
54
 
      do
55
 
        Macro($i)
56
 
      done
57
 
 
58
 
    %apply_cpptypes(Macro) 
59
 
      for i in C++ Type 
60
 
      do
61
 
        Macro($i)
62
 
      done
63
 
 
64
 
    %apply_ctypes_2(Macro2)                                  
65
 
       for i in C Type                                       
66
 
       do                                                            
67
 
         for j in C Type                                             
68
 
         do                                                  
69
 
            Macro_2($i, $j)                                  
70
 
         done                                                
71
 
       done                                                  
72
 
                                                             
73
 
    %apply_cpptypes_2(Macro2)                                
74
 
       for i in C++ Type                                             
75
 
       do                                                            
76
 
         for j in C++ Type                                   
77
 
         do                                                  
78
 
            Macro_2($i, $j)                                  
79
 
         done                                                
80
 
       done                                                  
81
 
                                                             
 
52
    %apply_ctypes(Macro)
 
53
      for i in C Type
 
54
      do
 
55
        Macro($i)
 
56
      done
 
57
 
 
58
    %apply_cpptypes(Macro)
 
59
      for i in C++ Type
 
60
      do
 
61
        Macro($i)
 
62
      done
 
63
 
 
64
    %apply_ctypes_2(Macro2)
 
65
       for i in C Type
 
66
       do
 
67
         for j in C Type
 
68
         do
 
69
            Macro_2($i, $j)
 
70
         done
 
71
       done
 
72
 
 
73
    %apply_cpptypes_2(Macro2)
 
74
       for i in C++ Type
 
75
       do
 
76
         for j in C++ Type
 
77
         do
 
78
            Macro_2($i, $j)
 
79
         done
 
80
       done
 
81
 
82
82
    %apply_checkctypes(Macro2)
83
 
       for i in Check Type 
 
83
       for i in Check Type
84
84
       do
85
85
         Macro2(%checkcode($i), $i)
86
86
       done
141
141
 
142
142
%numeric_double(float,           "<float.h>", -FLT_MAX, FLT_MAX)
143
143
 
144
 
/* long/unsgined long */
 
144
/* long/unsigned long */
145
145
 
146
146
%ensure_type_fragments(long)
147
147
%ensure_type_fragments(unsigned long)
283
283
_apply_macro(Macro, std::size_t, Arg2);
284
284
_apply_macro(Macro, std::ptrdiff_t, Arg2);
285
285
_apply_macro(Macro, std::string, Arg2);
 
286
_apply_macro(Macro, std::wstring, Arg2);
286
287
_apply_macro(Macro, std::complex<float>, Arg2);
287
288
_apply_macro(Macro, std::complex<double>, Arg2);
288
289
%enddef