PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/d/denums.swg

#
Unknown | 60 lines | 45 code | 15 blank | 0 comment | 0 complexity | 37745f89de2a9b660265e072c802ec0c MD5 | raw file
 1/* -----------------------------------------------------------------------------
 2 * denums.swg
 3 *
 4 * Typemaps for enumerations.
 5 * ----------------------------------------------------------------------------- */
 6
 7
 8/*
 9 * Typemaps for enumeration types.
10 */
11
12%typemap(ctype) enum SWIGTYPE "int"
13%typemap(imtype) enum SWIGTYPE "int"
14%typemap(dtype, cprimitive="1") enum SWIGTYPE "$dclassname"
15
16%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
17
18%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
19%typemap(out) enum SWIGTYPE %{ $result = $1; %}
20
21%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %}
22%typemap(directorin) enum SWIGTYPE "$input = $1;"
23%typemap(ddirectorin) enum SWIGTYPE "cast($dclassname)$winput"
24%typemap(ddirectorout) enum SWIGTYPE "cast(int)$dcall"
25
26%typemap(din) enum SWIGTYPE "cast(int)$dinput"
27%typemap(dout, excode=SWIGEXCODE) enum SWIGTYPE {
28  $dclassname ret = cast($dclassname)$imcall;$excode
29  return ret;
30}
31
32
33/*
34 * Typemaps for (const) references to enumeration types.
35 */
36
37%typemap(ctype) const enum SWIGTYPE & "int"
38%typemap(imtype) const enum SWIGTYPE & "int"
39%typemap(dtype) const enum SWIGTYPE & "$*dclassname"
40
41%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & ""
42
43%typemap(in) const enum SWIGTYPE & ($*1_ltype temp)
44%{ temp = ($*1_ltype)$input;
45   $1 = &temp; %}
46%typemap(out) const enum SWIGTYPE & %{ $result = *$1; %}
47
48%typemap(directorin) const enum SWIGTYPE & "$input = $1;"
49%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
50%{ static $*1_ltype temp = ($*1_ltype)$input;
51   $result = &temp; %}
52
53%typemap(ddirectorin) const enum SWIGTYPE & "cast($*dclassname)$winput"
54%typemap(ddirectorout) const enum SWIGTYPE & "cast(int)$dcall"
55
56%typemap(din) const enum SWIGTYPE & "cast(int)$dinput"
57%typemap(dout, excode=SWIGEXCODE) const enum SWIGTYPE & {
58  $*dclassname ret = cast($*dclassname)$imcall;$excode
59  return ret;
60}