annotate lib/swig/swigwin-2.0.11/UIControlModule_wrap.cxx @ 2164:f5e9ac04dd25

fixpoint_mul in ProcessPartyActions
author Ritor1
date Thu, 16 Jan 2014 00:08:27 +0600
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /* ----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * This file was automatically generated by SWIG (http://www.swig.org).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 * Version 2.0.11
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 * This file is not intended to be easily readable and contains a number of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * coding conventions designed to improve portability and efficiency. Do not make
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * changes to this file unless you know what you are doing--modify the SWIG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * interface file instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 #define SWIGLUA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 #define SWIG_LUA_MODULE_GLOBAL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 /* SwigValueWrapper is described in swig.swg */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 template<typename T> class SwigValueWrapper {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 struct SwigMovePointer {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20 T *ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 SwigMovePointer(T *p) : ptr(p) { }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 ~SwigMovePointer() { delete ptr; }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 } pointer;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 public:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 SwigValueWrapper() : pointer(0) { }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 operator T&() const { return *pointer.ptr; }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 T *operator&() { return pointer.ptr; }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 template <typename T> T SwigValueInit() {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 return T();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 * This section contains generic SWIG labels for method/variable
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 * declarations/attributes, and other compiler dependent labels.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 /* template workaround for compilers that cannot correctly implement the C++ standard */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 #ifndef SWIGTEMPLATEDISAMBIGUATOR
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 # define SWIGTEMPLATEDISAMBIGUATOR template
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 # elif defined(__HP_aCC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 # define SWIGTEMPLATEDISAMBIGUATOR template
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 # define SWIGTEMPLATEDISAMBIGUATOR
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 /* inline attribute */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 #ifndef SWIGINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 # define SWIGINLINE inline
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 # define SWIGINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 /* attribute recognised by some compilers to avoid 'unused' warnings */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67 #ifndef SWIGUNUSED
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68 # if defined(__GNUC__)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 # define SWIGUNUSED __attribute__ ((__unused__))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 # define SWIGUNUSED
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 # elif defined(__ICC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75 # define SWIGUNUSED __attribute__ ((__unused__))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 # define SWIGUNUSED
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81 #ifndef SWIG_MSC_UNSUPPRESS_4505
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82 # if defined(_MSC_VER)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 #ifndef SWIGUNUSEDPARM
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88 # ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89 # define SWIGUNUSEDPARM(p)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95 /* internal SWIG method */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 #ifndef SWIGINTERN
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97 # define SWIGINTERN static SWIGUNUSED
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100 /* internal inline SWIG method */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 #ifndef SWIGINTERNINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105 /* exporting methods */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107 # ifndef GCC_HASCLASSVISIBILITY
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 # define GCC_HASCLASSVISIBILITY
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112 #ifndef SWIGEXPORT
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 # if defined(STATIC_LINKED)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 # define SWIGEXPORT
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117 # define SWIGEXPORT __declspec(dllexport)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121 # define SWIGEXPORT __attribute__ ((visibility("default")))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 # define SWIGEXPORT
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 /* calling conventions for Windows */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129 #ifndef SWIGSTDCALL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131 # define SWIGSTDCALL __stdcall
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 # else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 # define SWIGSTDCALL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 # define _CRT_SECURE_NO_DEPRECATE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 # define _SCL_SECURE_NO_DEPRECATE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149 * swigrun.swg
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 * This file contains generic C API SWIG runtime support for pointer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
152 * type checking.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
153 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
154
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
155 /* This should only be incremented when either the layout of swig_type_info changes,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
156 or for whatever reason, the runtime changes incompatibly */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
157 #define SWIG_RUNTIME_VERSION "4"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
158
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
159 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
160 #ifdef SWIG_TYPE_TABLE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
161 # define SWIG_QUOTE_STRING(x) #x
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
162 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
163 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
164 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
165 # define SWIG_TYPE_TABLE_NAME
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
166 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
167
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
168 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
169 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
170 creating a static or dynamic library from the SWIG runtime code.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
171 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
172
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
173 But only do this if strictly necessary, ie, if you have problems
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
174 with your compiler or suchlike.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
175 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
176
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
177 #ifndef SWIGRUNTIME
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
178 # define SWIGRUNTIME SWIGINTERN
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
179 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
180
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
181 #ifndef SWIGRUNTIMEINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
182 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
183 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
184
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
185 /* Generic buffer size */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
186 #ifndef SWIG_BUFFER_SIZE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
187 # define SWIG_BUFFER_SIZE 1024
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
188 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
189
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
190 /* Flags for pointer conversions */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
191 #define SWIG_POINTER_DISOWN 0x1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
192 #define SWIG_CAST_NEW_MEMORY 0x2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
193
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
194 /* Flags for new pointer objects */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
195 #define SWIG_POINTER_OWN 0x1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
196
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
197
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
198 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
199 Flags/methods for returning states.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
200
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
201 The SWIG conversion methods, as ConvertPtr, return an integer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
202 that tells if the conversion was successful or not. And if not,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
203 an error code can be returned (see swigerrors.swg for the codes).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
204
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
205 Use the following macros/flags to set or process the returning
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
206 states.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
207
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
208 In old versions of SWIG, code such as the following was usually written:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
209
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
210 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
211 // success code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
212 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
213 //fail code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
214 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
215
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
216 Now you can be more explicit:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
217
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
218 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
219 if (SWIG_IsOK(res)) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
220 // success code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
221 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
222 // fail code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
223 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
224
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
225 which is the same really, but now you can also do
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
226
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
227 Type *ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
228 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
229 if (SWIG_IsOK(res)) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
230 // success code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
231 if (SWIG_IsNewObj(res) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
232 ...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
233 delete *ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
234 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
235 ...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
236 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
237 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
238 // fail code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
239 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
240
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
241 I.e., now SWIG_ConvertPtr can return new objects and you can
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
242 identify the case and take care of the deallocation. Of course that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
243 also requires SWIG_ConvertPtr to return new result values, such as
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
244
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
245 int SWIG_ConvertPtr(obj, ptr,...) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
246 if (<obj is ok>) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
247 if (<need new object>) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
248 *ptr = <ptr to new allocated object>;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
249 return SWIG_NEWOBJ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
250 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
251 *ptr = <ptr to old object>;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
252 return SWIG_OLDOBJ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
253 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
254 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
255 return SWIG_BADOBJ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
256 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
257 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
258
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
259 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
260 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
261 SWIG errors code.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
262
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
263 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
264 allows to return the 'cast rank', for example, if you have this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
265
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
266 int food(double)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
267 int fooi(int);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
268
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
269 and you call
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
270
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
271 food(1) // cast rank '1' (1 -> 1.0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
272 fooi(1) // cast rank '0'
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
273
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
274 just use the SWIG_AddCast()/SWIG_CheckState()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
275 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
276
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
277 #define SWIG_OK (0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
278 #define SWIG_ERROR (-1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
279 #define SWIG_IsOK(r) (r >= 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
280 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
281
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
282 /* The CastRankLimit says how many bits are used for the cast rank */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
283 #define SWIG_CASTRANKLIMIT (1 << 8)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
284 /* The NewMask denotes the object was created (using new/malloc) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
285 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
286 /* The TmpMask is for in/out typemaps that use temporal objects */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
287 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
288 /* Simple returning values */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
289 #define SWIG_BADOBJ (SWIG_ERROR)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
290 #define SWIG_OLDOBJ (SWIG_OK)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
291 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
292 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
293 /* Check, add and del mask methods */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
294 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
295 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
296 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
297 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
298 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
299 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
300
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
301 /* Cast-Rank Mode */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
302 #if defined(SWIG_CASTRANK_MODE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
303 # ifndef SWIG_TypeRank
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
304 # define SWIG_TypeRank unsigned long
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
305 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
306 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
307 # define SWIG_MAXCASTRANK (2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
308 # endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
309 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
310 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
311 SWIGINTERNINLINE int SWIG_AddCast(int r) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
312 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
313 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
314 SWIGINTERNINLINE int SWIG_CheckState(int r) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
315 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
316 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
317 #else /* no cast-rank mode */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
318 # define SWIG_AddCast(r) (r)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
319 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
320 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
321
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
322
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
323 #include <string.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
324
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
325 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
326 extern "C" {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
327 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
328
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
329 typedef void *(*swig_converter_func)(void *, int *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
330 typedef struct swig_type_info *(*swig_dycast_func)(void **);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
331
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
332 /* Structure to store information on one type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
333 typedef struct swig_type_info {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
334 const char *name; /* mangled name of this type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
335 const char *str; /* human readable name of this type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
336 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
337 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
338 void *clientdata; /* language specific type data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
339 int owndata; /* flag if the structure owns the clientdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
340 } swig_type_info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
341
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
342 /* Structure to store a type and conversion function used for casting */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
343 typedef struct swig_cast_info {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
344 swig_type_info *type; /* pointer to type that is equivalent to this type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
345 swig_converter_func converter; /* function to cast the void pointers */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
346 struct swig_cast_info *next; /* pointer to next cast in linked list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
347 struct swig_cast_info *prev; /* pointer to the previous cast */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
348 } swig_cast_info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
349
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
350 /* Structure used to store module information
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
351 * Each module generates one structure like this, and the runtime collects
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
352 * all of these structures and stores them in a circularly linked list.*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
353 typedef struct swig_module_info {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
354 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
355 size_t size; /* Number of types in this module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
356 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
357 swig_type_info **type_initial; /* Array of initially generated type structures */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
358 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
359 void *clientdata; /* Language specific module data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
360 } swig_module_info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
361
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
362 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
363 Compare two type names skipping the space characters, therefore
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
364 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
365
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
366 Return 0 when the two name types are equivalent, as in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
367 strncmp, but skipping ' '.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
368 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
369 SWIGRUNTIME int
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
370 SWIG_TypeNameComp(const char *f1, const char *l1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
371 const char *f2, const char *l2) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
372 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
373 while ((*f1 == ' ') && (f1 != l1)) ++f1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
374 while ((*f2 == ' ') && (f2 != l2)) ++f2;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
375 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
376 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
377 return (int)((l1 - f1) - (l2 - f2));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
378 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
379
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
380 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
381 Check type equivalence in a name list like <name1>|<name2>|...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
382 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
383 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
384 SWIGRUNTIME int
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
385 SWIG_TypeCmp(const char *nb, const char *tb) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
386 int equiv = 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
387 const char* te = tb + strlen(tb);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
388 const char* ne = nb;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
389 while (equiv != 0 && *ne) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
390 for (nb = ne; *ne; ++ne) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
391 if (*ne == '|') break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
392 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
393 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
394 if (*ne) ++ne;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
395 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
396 return equiv;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
397 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
398
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
399 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
400 Check type equivalence in a name list like <name1>|<name2>|...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
401 Return 0 if not equal, 1 if equal
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
402 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
403 SWIGRUNTIME int
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
404 SWIG_TypeEquiv(const char *nb, const char *tb) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
405 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
406 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
407
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
408 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
409 Check the typename
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
410 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
411 SWIGRUNTIME swig_cast_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
412 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
413 if (ty) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
414 swig_cast_info *iter = ty->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
415 while (iter) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
416 if (strcmp(iter->type->name, c) == 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
417 if (iter == ty->cast)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
418 return iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
419 /* Move iter to the top of the linked list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
420 iter->prev->next = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
421 if (iter->next)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
422 iter->next->prev = iter->prev;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
423 iter->next = ty->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
424 iter->prev = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
425 if (ty->cast) ty->cast->prev = iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
426 ty->cast = iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
427 return iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
428 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
429 iter = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
430 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
431 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
432 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
433 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
434
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
435 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
436 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
437 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
438 SWIGRUNTIME swig_cast_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
439 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
440 if (ty) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
441 swig_cast_info *iter = ty->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
442 while (iter) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
443 if (iter->type == from) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
444 if (iter == ty->cast)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
445 return iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
446 /* Move iter to the top of the linked list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
447 iter->prev->next = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
448 if (iter->next)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
449 iter->next->prev = iter->prev;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
450 iter->next = ty->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
451 iter->prev = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
452 if (ty->cast) ty->cast->prev = iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
453 ty->cast = iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
454 return iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
455 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
456 iter = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
457 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
458 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
459 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
460 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
461
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
462 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
463 Cast a pointer up an inheritance hierarchy
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
464 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
465 SWIGRUNTIMEINLINE void *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
466 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
467 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
468 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
469
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
470 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
471 Dynamic pointer casting. Down an inheritance hierarchy
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
472 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
473 SWIGRUNTIME swig_type_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
474 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
475 swig_type_info *lastty = ty;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
476 if (!ty || !ty->dcast) return ty;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
477 while (ty && (ty->dcast)) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
478 ty = (*ty->dcast)(ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
479 if (ty) lastty = ty;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
480 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
481 return lastty;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
482 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
483
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
484 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
485 Return the name associated with this type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
486 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
487 SWIGRUNTIMEINLINE const char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
488 SWIG_TypeName(const swig_type_info *ty) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
489 return ty->name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
490 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
491
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
492 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
493 Return the pretty name associated with this type,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
494 that is an unmangled type name in a form presentable to the user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
495 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
496 SWIGRUNTIME const char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
497 SWIG_TypePrettyName(const swig_type_info *type) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
498 /* The "str" field contains the equivalent pretty names of the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
499 type, separated by vertical-bar characters. We choose
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
500 to print the last name, as it is often (?) the most
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
501 specific. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
502 if (!type) return NULL;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
503 if (type->str != NULL) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
504 const char *last_name = type->str;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
505 const char *s;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
506 for (s = type->str; *s; s++)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
507 if (*s == '|') last_name = s+1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
508 return last_name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
509 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
510 else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
511 return type->name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
512 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
513
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
514 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
515 Set the clientdata field for a type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
516 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
517 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
518 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
519 swig_cast_info *cast = ti->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
520 /* if (ti->clientdata == clientdata) return; */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
521 ti->clientdata = clientdata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
522
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
523 while (cast) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
524 if (!cast->converter) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
525 swig_type_info *tc = cast->type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
526 if (!tc->clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
527 SWIG_TypeClientData(tc, clientdata);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
528 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
529 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
530 cast = cast->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
531 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
532 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
533 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
534 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
535 SWIG_TypeClientData(ti, clientdata);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
536 ti->owndata = 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
537 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
538
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
539 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
540 Search for a swig_type_info structure only by mangled name
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
541 Search is a O(log #types)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
542
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
543 We start searching at module start, and finish searching when start == end.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
544 Note: if start == end at the beginning of the function, we go all the way around
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
545 the circular list.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
546 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
547 SWIGRUNTIME swig_type_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
548 SWIG_MangledTypeQueryModule(swig_module_info *start,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
549 swig_module_info *end,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
550 const char *name) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
551 swig_module_info *iter = start;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
552 do {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
553 if (iter->size) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
554 register size_t l = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
555 register size_t r = iter->size - 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
556 do {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
557 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
558 register size_t i = (l + r) >> 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
559 const char *iname = iter->types[i]->name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
560 if (iname) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
561 register int compare = strcmp(name, iname);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
562 if (compare == 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
563 return iter->types[i];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
564 } else if (compare < 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
565 if (i) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
566 r = i - 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
567 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
568 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
569 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
570 } else if (compare > 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
571 l = i + 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
572 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
573 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
574 break; /* should never happen */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
575 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
576 } while (l <= r);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
577 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
578 iter = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
579 } while (iter != end);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
580 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
581 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
582
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
583 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
584 Search for a swig_type_info structure for either a mangled name or a human readable name.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
585 It first searches the mangled names of the types, which is a O(log #types)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
586 If a type is not found it then searches the human readable names, which is O(#types).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
587
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
588 We start searching at module start, and finish searching when start == end.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
589 Note: if start == end at the beginning of the function, we go all the way around
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
590 the circular list.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
591 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
592 SWIGRUNTIME swig_type_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
593 SWIG_TypeQueryModule(swig_module_info *start,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
594 swig_module_info *end,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
595 const char *name) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
596 /* STEP 1: Search the name field using binary search */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
597 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
598 if (ret) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
599 return ret;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
600 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
601 /* STEP 2: If the type hasn't been found, do a complete search
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
602 of the str field (the human readable name) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
603 swig_module_info *iter = start;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
604 do {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
605 register size_t i = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
606 for (; i < iter->size; ++i) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
607 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
608 return iter->types[i];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
609 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
610 iter = iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
611 } while (iter != end);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
612 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
613
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
614 /* neither found a match */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
615 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
616 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
617
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
618 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
619 Pack binary data into a string
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
620 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
621 SWIGRUNTIME char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
622 SWIG_PackData(char *c, void *ptr, size_t sz) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
623 static const char hex[17] = "0123456789abcdef";
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
624 register const unsigned char *u = (unsigned char *) ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
625 register const unsigned char *eu = u + sz;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
626 for (; u != eu; ++u) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
627 register unsigned char uu = *u;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
628 *(c++) = hex[(uu & 0xf0) >> 4];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
629 *(c++) = hex[uu & 0xf];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
630 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
631 return c;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
632 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
633
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
634 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
635 Unpack binary data from a string
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
636 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
637 SWIGRUNTIME const char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
638 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
639 register unsigned char *u = (unsigned char *) ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
640 register const unsigned char *eu = u + sz;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
641 for (; u != eu; ++u) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
642 register char d = *(c++);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
643 register unsigned char uu;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
644 if ((d >= '0') && (d <= '9'))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
645 uu = ((d - '0') << 4);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
646 else if ((d >= 'a') && (d <= 'f'))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
647 uu = ((d - ('a'-10)) << 4);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
648 else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
649 return (char *) 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
650 d = *(c++);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
651 if ((d >= '0') && (d <= '9'))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
652 uu |= (d - '0');
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
653 else if ((d >= 'a') && (d <= 'f'))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
654 uu |= (d - ('a'-10));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
655 else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
656 return (char *) 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
657 *u = uu;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
658 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
659 return c;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
660 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
661
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
662 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
663 Pack 'void *' into a string buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
664 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
665 SWIGRUNTIME char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
666 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
667 char *r = buff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
668 if ((2*sizeof(void *) + 2) > bsz) return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
669 *(r++) = '_';
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
670 r = SWIG_PackData(r,&ptr,sizeof(void *));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
671 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
672 strcpy(r,name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
673 return buff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
674 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
675
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
676 SWIGRUNTIME const char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
677 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
678 if (*c != '_') {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
679 if (strcmp(c,"NULL") == 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
680 *ptr = (void *) 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
681 return name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
682 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
683 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
684 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
685 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
686 return SWIG_UnpackData(++c,ptr,sizeof(void *));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
687 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
688
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
689 SWIGRUNTIME char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
690 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
691 char *r = buff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
692 size_t lname = (name ? strlen(name) : 0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
693 if ((2*sz + 2 + lname) > bsz) return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
694 *(r++) = '_';
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
695 r = SWIG_PackData(r,ptr,sz);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
696 if (lname) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
697 strncpy(r,name,lname+1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
698 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
699 *r = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
700 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
701 return buff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
702 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
703
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
704 SWIGRUNTIME const char *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
705 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
706 if (*c != '_') {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
707 if (strcmp(c,"NULL") == 0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
708 memset(ptr,0,sz);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
709 return name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
710 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
711 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
712 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
713 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
714 return SWIG_UnpackData(++c,ptr,sz);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
715 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
716
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
717 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
718 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
719 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
720
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
721 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
722 * luarun.swg
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
723 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
724 * This file contains the runtime support for Lua modules
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
725 * and includes code for managing global variables and pointer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
726 * type checking.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
727 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
728
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
729 #include "lib/lua/lua.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
730 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
731 extern "C" {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
732 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
733
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
734 //#include "lua.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
735 //#include "lauxlib.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
736 #include <stdlib.h> /* for malloc */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
737 #include <assert.h> /* for a few sanity tests */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
738
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
739 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
740 * Lua flavors
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
741 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
742
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
743 #define SWIG_LUA_FLAVOR_LUA 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
744 #define SWIG_LUA_FLAVOR_ELUA 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
745 #define SWIG_LUA_FLAVOR_ELUAC 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
746
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
747 #if !defined(SWIG_LUA_TARGET)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
748 # error SWIG_LUA_TARGET not defined
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
749 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
750
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
751 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
752 # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
753 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
754 # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
755 # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
756 #else /* SWIG_LUA_FLAVOR_LUA */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
757 # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
758 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
759 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
760 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
761 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
762
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
763 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
764 # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
765 # define LSTRVAL LRO_STRVAL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
766 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
767
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
768 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
769 * compatibility defines
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
770 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
771
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
772 /* History of Lua C API length functions: In Lua 5.0 (and before?)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
773 there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen",
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
774 but a compatibility define of "lua_strlen" was added. In Lua 5.2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
775 this function was again renamed, to "lua_rawlen" (to emphasize that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
776 it doesn't call the "__len" metamethod), and the compatibility
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
777 define of lua_strlen was removed. All SWIG uses have been updated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
778 to "lua_rawlen", and we add our own defines of that here for older
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
779 versions of Lua. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
780 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
781 # define lua_rawlen lua_strlen
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
782 #elif LUA_VERSION_NUM == 501
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
783 # define lua_rawlen lua_objlen
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
784 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
785
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
786
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
787 /* lua_pushglobaltable is the recommended "future-proof" way to get
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
788 the global table for Lua 5.2 and later. Here we define
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
789 lua_pushglobaltable ourselves for Lua versions before 5.2. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
790 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
791 # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
792 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
793
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
794
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
795 /* --------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
796 * Helper functions for error handling
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
797 * -------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
798
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
799 /* Push the string STR on the Lua stack, like lua_pushstring, but
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
800 prefixed with the the location of the innermost Lua call-point
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
801 (as formated by luaL_where). */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
802 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
803 SWIG_Lua_pusherrstring (lua_State *L, const char *str)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
804 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
805 luaL_where (L, 1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
806 lua_pushstring (L, str);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
807 lua_concat (L, 2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
808 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
809
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
810 /* Push a formatted string generated from FMT and following args on
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
811 the Lua stack, like lua_pushfstring, but prefixed with the the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
812 location of the innermost Lua call-point (as formated by luaL_where). */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
813 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
814 SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
815 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
816 va_list argp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
817 va_start(argp, fmt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
818 luaL_where(L, 1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
819 lua_pushvfstring(L, fmt, argp);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
820 va_end(argp);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
821 lua_concat(L, 2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
822 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
823
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
824
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
825 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
826 * global swig types
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
827 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
828 /* Constant table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
829 #define SWIG_LUA_INT 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
830 #define SWIG_LUA_FLOAT 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
831 #define SWIG_LUA_STRING 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
832 #define SWIG_LUA_POINTER 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
833 #define SWIG_LUA_BINARY 5
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
834 #define SWIG_LUA_CHAR 6
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
835
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
836 /* Structure for variable linking table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
837 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
838 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
839 lua_CFunction get;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
840 lua_CFunction set;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
841 } swig_lua_var_info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
842
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
843 /* Constant information structure */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
844 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
845 int type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
846 char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
847 long lvalue;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
848 double dvalue;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
849 void *pvalue;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
850 swig_type_info **ptype;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
851 } swig_lua_const_info;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
852
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
853 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
854 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
855 lua_CFunction method;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
856 } swig_lua_method;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
857
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
858 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
859 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
860 lua_CFunction getmethod;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
861 lua_CFunction setmethod;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
862 } swig_lua_attribute;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
863
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
864 // Can be used to create namespaces. Currently used to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
865 // wrap class static methods/variables/constants
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
866 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
867 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
868 swig_lua_method *ns_methods;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
869 swig_lua_attribute *ns_attributes;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
870 swig_lua_const_info *ns_constants;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
871 } swig_lua_namespace;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
872
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
873 typedef struct swig_lua_class {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
874 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
875 swig_type_info **type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
876 lua_CFunction constructor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
877 void (*destructor)(void *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
878 swig_lua_method *methods;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
879 swig_lua_attribute *attributes;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
880 swig_lua_namespace cls_static;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
881 struct swig_lua_class **bases;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
882 const char **base_names;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
883 } swig_lua_class;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
884
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
885 /* this is the struct for wrapping all pointers in SwigLua
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
886 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
887 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
888 swig_type_info *type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
889 int own; /* 1 if owned & must be destroyed */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
890 void *ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
891 } swig_lua_userdata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
892
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
893 /* this is the struct for wrapping arbitrary packed binary data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
894 (currently it is only used for member function pointers)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
895 the data ordering is similar to swig_lua_userdata, but it is currently not possible
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
896 to tell the two structures apart within SWIG, other than by looking at the type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
897 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
898 typedef struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
899 swig_type_info *type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
900 int own; /* 1 if owned & must be destroyed */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
901 char data[1]; /* arbitary amount of data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
902 } swig_lua_rawdata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
903
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
904 /* Common SWIG API */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
905 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
906 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
907 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
908 /* for C++ member pointers, ie, member methods */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
909 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
910 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
911
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
912 /* Runtime API */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
913 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
914 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
915 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
916
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
917 /* Contract support */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
918 #define SWIG_contract_assert(expr, msg) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
919 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
920
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
921
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
922 /* helper #defines */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
923 #define SWIG_fail {goto fail;}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
924 #define SWIG_fail_arg(func_name,argnum,type) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
925 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
926 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
927 goto fail;}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
928 #define SWIG_fail_ptr(func_name,argnum,type) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
929 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
930 #define SWIG_check_num_args(func_name,a,b) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
931 if (lua_gettop(L)<a || lua_gettop(L)>b) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
932 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
933 goto fail;}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
934
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
935
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
936 #define SWIG_Lua_get_table(L,n) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
937 (lua_pushstring(L, n), lua_rawget(L,-2))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
938
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
939 #define SWIG_Lua_add_function(L,n,f) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
940 (lua_pushstring(L, n), \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
941 lua_pushcfunction(L, f), \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
942 lua_rawset(L,-3))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
943
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
944 /* special helper for allowing 'nil' for usertypes */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
945 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
946
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
947 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
948 /* Special helper for member function pointers
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
949 it gets the address, casts it, then dereferences it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
950 //#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a)))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
951 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
952
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
953 /* storing/access of swig_module_info */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
954 SWIGRUNTIME swig_module_info *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
955 SWIG_Lua_GetModule(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
956 swig_module_info *ret = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
957 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
958 lua_rawget(L,LUA_REGISTRYINDEX);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
959 if (lua_islightuserdata(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
960 ret=(swig_module_info*)lua_touserdata(L,-1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
961 lua_pop(L,1); /* tidy */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
962 return ret;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
963 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
964
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
965 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
966 SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
967 /* add this all into the Lua registry: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
968 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
969 lua_pushlightuserdata(L,(void*)module);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
970 lua_rawset(L,LUA_REGISTRYINDEX);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
971 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
972
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
973 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
974 * global variable support code: modules
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
975 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
976
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
977 /* this function is called when trying to set an immutable.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
978 default action is to print an error.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
979 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
980 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
981 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
982 /* there should be 1 param passed in: the new value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
983 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
984 lua_pop(L,1); /* remove it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
985 luaL_error(L,"This variable is immutable");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
986 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
987 return 0; /* should not return anything */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
988 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
989
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
990 /* the module.get method used for getting linked data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
991 SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
992 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
993 /* there should be 2 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
994 (1) table (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
995 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
996 printf("SWIG_Lua_module_get %p(%s) '%s'\n",
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
997 lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
998 lua_tostring(L,2));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
999 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1000 /* get the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1001 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1002 assert(lua_isrotable(L,1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1003 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1004 assert(lua_istable(L,1)); /* default Lua action */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1005 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1006 lua_getmetatable(L,1); /* get the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1007 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1008 assert(lua_isrotable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1009 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1010 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1011 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1012 SWIG_Lua_get_table(L,".get"); /* get the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1013 lua_remove(L,3); /* remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1014 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1015 if (lua_isrotable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1016 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1017 if (lua_istable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1018 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1019 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1020 /* look for the key in the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1021 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1022 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1023 lua_remove(L,3); /* remove .get */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1024 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1025 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1026 lua_call(L,0,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1027 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1028 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1029 lua_pop(L,1); /* remove the top */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1030 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1031 lua_pop(L,1); /* remove the .get */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1032 lua_pushnil(L); /* return a nil */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1033 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1034 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1035
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1036 /* the module.set method used for setting linked data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1037 SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1038 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1039 /* there should be 3 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1040 (1) table (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1041 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1042 (3) any for the new value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1043 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1044 /* get the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1045 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1046 assert(lua_isrotable(L,1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1047 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1048 assert(lua_istable(L,1)); /* default Lua action */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1049 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1050 lua_getmetatable(L,1); /* get the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1051 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1052 assert(lua_isrotable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1053 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1054 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1055 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1056 SWIG_Lua_get_table(L,".set"); /* get the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1057 lua_remove(L,4); /* remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1058 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1059 if (lua_isrotable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1060 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1061 if (lua_istable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1062 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1063 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1064 /* look for the key in the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1065 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1066 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1067 lua_remove(L,4); /* remove .set */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1068 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1069 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1070 lua_pushvalue(L,3); /* value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1071 lua_call(L,1,0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1072 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1073 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1074 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1075 else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1076 return 0; // Exits stoically if an invalid key is initialized.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1077 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1078 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1079 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1080 lua_settop(L,3); /* reset back to start */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1081 /* we now have the table, key & new value, so just set directly */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1082 lua_rawset(L,1); /* add direct */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1083 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1084 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1085
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1086 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1087 /* registering a module in lua. Pushes the module table on the stack. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1088 SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1089 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1090 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1091 lua_pushstring(L,name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1092 lua_newtable(L); /* the table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1093 /* add meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1094 lua_newtable(L); /* the meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1095 SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1096 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1097 lua_pushstring(L,".get");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1098 lua_newtable(L); /* the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1099 lua_rawset(L,-3); /* add .get into metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1100 lua_pushstring(L,".set");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1101 lua_newtable(L); /* the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1102 lua_rawset(L,-3); /* add .set into metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1103 lua_setmetatable(L,-2); /* sets meta table in module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1104 #ifdef SWIG_LUA_MODULE_GLOBAL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1105 /* If requested, install the module directly into the global namespace. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1106 lua_rawset(L,-3); /* add module into parent */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1107 SWIG_Lua_get_table(L,name); /* get the table back out */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1108 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1109 /* Do not install the module table as global name. The stack top has
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1110 the module table with the name below. We pop the top and replace
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1111 the name with it. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1112 lua_replace(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1113 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1114 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1115
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1116 /* ending the register */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1117 SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1118 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1119 lua_pop(L,1); /* tidy stack (remove module) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1120 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1121
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1122 /* adding a linked variable to the module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1123 SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1124 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1125 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1126 lua_getmetatable(L,-1); /* get the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1127 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1128 SWIG_Lua_get_table(L,".get"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1129 assert(lua_istable(L,-1)); /* should be a table: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1130 SWIG_Lua_add_function(L,name,getFn);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1131 lua_pop(L,1); /* tidy stack (remove table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1132 if (setFn) /* if there is a set fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1133 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1134 SWIG_Lua_get_table(L,".set"); /* find the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1135 assert(lua_istable(L,-1)); /* should be a table: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1136 SWIG_Lua_add_function(L,name,setFn);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1137 lua_pop(L,1); /* tidy stack (remove table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1138 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1139 lua_pop(L,1); /* tidy stack (remove meta) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1140 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1141 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1142
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1143 /* adding a function module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1144 SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1145 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1146 SWIG_Lua_add_function(L,name,fn);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1147 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1148
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1149 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1150 * global variable support code: namespaces
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1151 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1152
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1153 SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1154 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1155 /* there should be 2 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1156 (1) table (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1157 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1158 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1159 assert(lua_istable(L,-2)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1160 lua_getmetatable(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1161 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1162 SWIG_Lua_get_table(L,".get"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1163 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1164 /* look for the key in the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1165 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1166 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1167 lua_remove(L,-2); /* stack tidy, remove .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1168 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1169 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1170 lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1171 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1172 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1173 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1174 lua_pop(L,1); /* remove whatever was there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1175 /* ok, so try the .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1176 SWIG_Lua_get_table(L,".fn"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1177 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1178 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1179 lua_rawget(L,-2); /* look for the fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1180 lua_remove(L,-2); /* stack tidy, remove .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1181 if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1182 { /* found it so return the fn & let lua call it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1183 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1184 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1185 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1186 lua_pop(L,1); /* remove whatever was there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1187 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1188 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1189
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1190 SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1191 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1192 /* there should be 3 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1193 (1) table (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1194 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1195 (3) any for the new value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1196 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1197
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1198 assert(lua_istable(L,1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1199 lua_getmetatable(L,1); /* get the meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1200 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1201
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1202 SWIG_Lua_get_table(L,".set"); /* find the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1203 if (lua_istable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1204 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1205 /* look for the key in the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1206 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1207 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1208 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1209 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1210 lua_pushvalue(L,3); /* value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1211 lua_call(L,1,0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1212 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1213 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1214 lua_pop(L,1); /* remove the value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1215 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1216 lua_pop(L,1); /* remove the value .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1217 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1218 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1219
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1220 SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1221 SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1222
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1223 /* helper function - register namespace methods and attributes into namespace */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1224 SWIGINTERN void SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1225 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1226 int i = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1227 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1228 /* There must be table at the top of the stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1229 SWIG_Lua_InstallConstants(L, ns->ns_constants);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1230
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1231 lua_getmetatable(L,-1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1232
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1233 /* add fns */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1234 for(i=0;ns->ns_attributes[i].name;i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1235 SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1236 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1237
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1238 /* add methods to the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1239 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1240 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1241 for(i=0;ns->ns_methods[i].name;i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1242 SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1243 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1244 lua_pop(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1245
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1246 /* clear stack - remove metatble */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1247 lua_pop(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1248
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1249 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1250
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1251 /* helper function. creates namespace table and add it to module table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1252 SWIGINTERN void SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1253 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1254 assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1255 lua_checkstack(L,5);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1256 lua_pushstring(L, ns->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1257 lua_newtable(L); /* namespace itself */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1258 lua_newtable(L); /* metatable for namespace */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1259
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1260 /* add a table called ".get" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1261 lua_pushstring(L,".get");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1262 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1263 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1264 /* add a table called ".set" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1265 lua_pushstring(L,".set");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1266 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1267 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1268 /* add a table called ".fn" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1269 lua_pushstring(L,".fn");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1270 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1271 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1272
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1273 /* add accessor fns for using the .get,.set&.fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1274 SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1275 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1276
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1277 lua_setmetatable(L,-2); /* set metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1278 lua_rawset(L,-3); /* add namespace to module table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1279 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1280 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1281 * global variable support code: classes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1282 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1283
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1284 /* the class.get method, performs the lookup of class attributes */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1285 SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1286 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1287 /* there should be 2 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1288 (1) userdata (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1289 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1290 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1291 assert(lua_isuserdata(L,-2)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1292 lua_getmetatable(L,-2); /* get the meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1293 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1294 SWIG_Lua_get_table(L,".get"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1295 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1296 /* look for the key in the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1297 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1298 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1299 lua_remove(L,-2); /* stack tidy, remove .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1300 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1301 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1302 lua_pushvalue(L,1); /* the userdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1303 lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1304 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1305 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1306 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1307 lua_pop(L,1); /* remove whatever was there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1308 /* ok, so try the .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1309 SWIG_Lua_get_table(L,".fn"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1310 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1311 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1312 lua_rawget(L,-2); /* look for the fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1313 lua_remove(L,-2); /* stack tidy, remove .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1314 if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1315 { /* found it so return the fn & let lua call it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1316 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1317 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1318 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1319 lua_pop(L,1); /* remove whatever was there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1320 /* NEW: looks for the __getitem() fn
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1321 this is a user provided get fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1322 SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1323 if (lua_iscfunction(L,-1)) /* if its there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1324 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1325 lua_pushvalue(L,1); /* the userdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1326 lua_pushvalue(L,2); /* the parameter */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1327 lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1328 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1329 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1330 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1331 return 0; /* sorry not known */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1332 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1333
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1334 /* the class.set method, performs the lookup of class attributes */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1335 SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1336 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1337 /* there should be 3 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1338 (1) table (not the meta table)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1339 (2) string name of the attribute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1340 (3) any for the new value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1341 printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1342 lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1343 lua_tostring(L,2),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1344 lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1345
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1346 assert(lua_isuserdata(L,1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1347 lua_getmetatable(L,1); /* get the meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1348 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1349
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1350 SWIG_Lua_get_table(L,".set"); /* find the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1351 if (lua_istable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1352 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1353 /* look for the key in the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1354 lua_pushvalue(L,2); /* key */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1355 lua_rawget(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1356 if (lua_iscfunction(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1357 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1358 lua_pushvalue(L,1); /* userdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1359 lua_pushvalue(L,3); /* value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1360 lua_call(L,2,0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1361 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1362 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1363 lua_pop(L,1); /* remove the value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1364 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1365 lua_pop(L,1); /* remove the value .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1366 /* NEW: looks for the __setitem() fn
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1367 this is a user provided set fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1368 SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1369 if (lua_iscfunction(L,-1)) /* if its there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1370 { /* found it so call the fn & return its value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1371 lua_pushvalue(L,1); /* the userdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1372 lua_pushvalue(L,2); /* the parameter */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1373 lua_pushvalue(L,3); /* the value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1374 lua_call(L,3,0); /* 3 values in ,0 out */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1375 lua_remove(L,-2); /* stack tidy, remove metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1376 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1377 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1378 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1379 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1380
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1381 /* the class.destruct method called by the interpreter */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1382 SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1383 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1384 /* there should be 1 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1385 (1) userdata (not the meta table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1386 swig_lua_userdata* usr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1387 swig_lua_class* clss;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1388 assert(lua_isuserdata(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1389 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1390 /* if must be destroyed & has a destructor */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1391 if (usr->own) /* if must be destroyed */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1392 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1393 clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1394 if (clss && clss->destructor) /* there is a destroy fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1395 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1396 clss->destructor(usr->ptr); /* bye bye */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1397 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1398 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1399 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1400 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1401
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1402 /* the class.__tostring method called by the interpreter and print */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1403 SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1404 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1405 /* there should be 1 param passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1406 (1) userdata (not the metatable) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1407 assert(lua_isuserdata(L,1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1408 unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1409 lua_getmetatable(L,1); /* get the meta table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1410 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1411
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1412 lua_getfield(L, -1, ".type");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1413 const char* className = lua_tostring(L, -1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1414
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1415 char output[256];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1416 sprintf(output, "<%s userdata: %lX>", className, userData);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1417
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1418 lua_pushstring(L, (const char*)output);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1419 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1420 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1421
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1422 /* to manually disown some userdata */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1423 SWIGINTERN int SWIG_Lua_class_disown(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1424 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1425 /* there should be 1 params passed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1426 (1) userdata (not the meta table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1427 swig_lua_userdata* usr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1428 assert(lua_isuserdata(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1429 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1430
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1431 usr->own = 0; /* clear our ownership */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1432 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1433 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1434
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1435 /* Constructor proxy. Used when class name entry in module is not class constructor,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1436 but special table instead. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1437 SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1438 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1439 /* unlimited number of parameters
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1440 First one is our proxy table and we should remove it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1441 Other we should pass to real constructor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1442 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1443 assert(lua_istable(L,1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1444 lua_pushstring(L,".constructor");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1445 lua_rawget(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1446 assert(!lua_isnil(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1447 lua_replace(L,1); /* replace our table with real constructor */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1448 lua_call(L,lua_gettop(L)-1,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1449 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1450 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1451
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1452 /* gets the swig class registry (or creates it) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1453 SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1454 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1455 /* add this all into the swig registry: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1456 lua_pushstring(L,"SWIG");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1457 lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1458 if (!lua_istable(L,-1)) /* not there */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1459 { /* must be first time, so add it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1460 lua_pop(L,1); /* remove the result */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1461 lua_pushstring(L,"SWIG");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1462 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1463 lua_rawset(L,LUA_REGISTRYINDEX);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1464 /* then get it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1465 lua_pushstring(L,"SWIG");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1466 lua_rawget(L,LUA_REGISTRYINDEX);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1467 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1468 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1469
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1470 /* helper fn to get the classes metatable from the register */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1471 SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1472 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1473 SWIG_Lua_get_class_registry(L); /* get the registry */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1474 lua_pushstring(L,cname); /* get the name */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1475 lua_rawget(L,-2); /* get it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1476 lua_remove(L,-2); /* tidy up (remove registry) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1477 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1478
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1479 /* helper add a variable to a registered class */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1480 SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1481 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1482 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1483 SWIG_Lua_get_table(L,".get"); /* find the .get table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1484 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1485 SWIG_Lua_add_function(L,name,getFn);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1486 lua_pop(L,1); /* tidy stack (remove table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1487 if (setFn)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1488 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1489 SWIG_Lua_get_table(L,".set"); /* find the .set table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1490 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1491 SWIG_Lua_add_function(L,name,setFn);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1492 lua_pop(L,1); /* tidy stack (remove table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1493 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1494 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1495
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1496 /* helper to recursively add class static details (static attributes, operations and constants) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1497 SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1498 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1499 int i = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1500 /* The class namespace table must be on the top of the stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1501 assert(lua_istable(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1502 /* call all the base classes first: we can then override these later: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1503 for(i=0;clss->bases[i];i++)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1504 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1505 SWIG_Lua_add_class_static_details(L,clss->bases[i]);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1506 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1507
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1508 SWIG_Lua_add_namespace_details(L, &clss->cls_static);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1509 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1510
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1511 /* helper to recursively add class details (attributes & operations) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1512 SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1513 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1514 int i;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1515 /* call all the base classes first: we can then override these later: */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1516 for(i=0;clss->bases[i];i++)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1517 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1518 SWIG_Lua_add_class_details(L,clss->bases[i]);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1519 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1520 /* add fns */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1521 for(i=0;clss->attributes[i].name;i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1522 SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1523 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1524 /* add methods to the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1525 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1526 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1527 for(i=0;clss->methods[i].name;i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1528 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1529 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1530 lua_pop(L,1); /* tidy stack (remove table) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1531 /* add operator overloads
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1532 these look ANY method which start with "__" and assume they
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1533 are operator overloads & add them to the metatable
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1534 (this might mess up is someone defines a method __gc (the destructor)*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1535 for(i=0;clss->methods[i].name;i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1536 if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1537 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1538 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1539 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1540 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1541
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1542 /* set up the base classes pointers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1543 Each class structure has a list of pointers to the base class structures.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1544 This function fills them.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1545 It cannot be done at compile time, as this will not work with hireachies
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1546 spread over more than one swig file.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1547 Therefore it must be done at runtime, querying the SWIG type system.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1548 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1549 SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1550 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1551 int i=0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1552 swig_module_info* module=SWIG_GetModule(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1553 for(i=0;clss->base_names[i];i++)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1554 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1555 if (clss->bases[i]==0) /* not found yet */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1556 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1557 /* lookup and cache the base class */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1558 swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1559 if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1560 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1561 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1562 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1563
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1564 /* Register class static methods,attributes etc as well as constructor proxy */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1565 SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1566 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1567 lua_checkstack(L,5); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1568 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1569 assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1570
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1571 SWIG_Lua_namespace_register(L,&clss->cls_static);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1572
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1573 SWIG_Lua_get_table(L,clss->name); // Get namespace table back
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1574 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1575
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1576 /* add its constructor to module with the name of the class
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1577 so you can do MyClass(...) as well as new_MyClass(...)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1578 BUT only if a constructor is defined
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1579 (this overcomes the problem of pure virtual classes without constructors)*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1580 if (clss->constructor)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1581 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1582 SWIG_Lua_add_function(L,".constructor", clss->constructor);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1583 lua_getmetatable(L,-1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1584 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1585 SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1586 lua_pop(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1587 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1588
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1589 assert(lua_istable(L,-1)); /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1590 SWIG_Lua_add_class_static_details(L, clss);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1591
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1592 /* clear stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1593 lua_pop(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1594 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1595
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1596 /* performs the entire class registration process */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1597 SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1598 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1599 SWIG_Lua_class_register_static(L,clss);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1600
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1601 SWIG_Lua_get_class_registry(L); /* get the registry */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1602 lua_pushstring(L,clss->name); /* get the name */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1603 lua_newtable(L); /* create the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1604 /* add string of class name called ".type" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1605 lua_pushstring(L,".type");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1606 lua_pushstring(L,clss->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1607 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1608 /* add a table called ".get" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1609 lua_pushstring(L,".get");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1610 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1611 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1612 /* add a table called ".set" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1613 lua_pushstring(L,".set");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1614 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1615 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1616 /* add a table called ".fn" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1617 lua_pushstring(L,".fn");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1618 lua_newtable(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1619 /* add manual disown method */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1620 SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1621 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1622 /* add accessor fns for using the .get,.set&.fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1623 SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1624 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1625 SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1626 /* add tostring method for better output */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1627 SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1628 /* add it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1629 lua_rawset(L,-3); /* metatable into registry */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1630 lua_pop(L,1); /* tidy stack (remove registry) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1631
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1632 SWIG_Lua_get_class_metatable(L,clss->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1633 SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1634 lua_pop(L,1); /* tidy stack (remove class metatable) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1635 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1636
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1637 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1638 * Class/structure conversion fns
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1639 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1640
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1641 /* helper to add metatable to new lua object */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1642 SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1643 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1644 if (type->clientdata) /* there is clientdata: so add the metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1645 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1646 SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1647 if (lua_istable(L,-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1648 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1649 lua_setmetatable(L,-2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1650 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1651 else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1652 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1653 lua_pop(L,1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1654 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1655 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1656 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1657
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1658 /* pushes a new object into the lua stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1659 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1660 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1661 swig_lua_userdata* usr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1662 if (!ptr){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1663 lua_pushnil(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1664 return;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1665 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1666 usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1667 usr->ptr=ptr; /* set the ptr */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1668 usr->type=type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1669 usr->own=own;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1670 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1671 _SWIG_Lua_AddMetatable(L,type); /* add metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1672 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1673 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1674
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1675 /* takes a object from the lua stack & converts it into an object of the correct type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1676 (if possible) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1677 SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1678 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1679 swig_lua_userdata* usr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1680 swig_cast_info *cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1681 if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1682 usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1683 if (usr)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1684 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1685 if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1686 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1687 usr->own=0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1688 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1689 if (!type) /* special cast void*, no casting fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1690 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1691 *ptr=usr->ptr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1692 return SWIG_OK; /* ok */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1693 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1694 cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1695 if (cast)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1696 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1697 int newmemory = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1698 *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1699 assert(!newmemory); /* newmemory handling not yet implemented */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1700 return SWIG_OK; /* ok */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1701 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1702 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1703 return SWIG_ERROR; /* error */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1704 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1705
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1706 SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1707 int argnum,const char* func_name){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1708 void* result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1709 if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1710 luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1711 func_name,(type && type->str)?type->str:"void*",argnum);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1712 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1713 return result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1714 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1715
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1716 /* pushes a packed userdata. user for member fn pointers only */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1717 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1718 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1719 swig_lua_rawdata* raw;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1720 assert(ptr); /* not acceptable to pass in a NULL value */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1721 raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1722 raw->type=type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1723 raw->own=0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1724 memcpy(raw->data,ptr,size); /* copy the data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1725 _SWIG_Lua_AddMetatable(L,type); /* add metatable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1726 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1727
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1728 /* converts a packed userdata. user for member fn pointers only */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1729 SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1730 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1731 swig_lua_rawdata* raw;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1732 raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1733 if (!raw) return SWIG_ERROR; /* error */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1734 if (type==0 || type==raw->type) /* void* or identical type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1735 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1736 memcpy(ptr,raw->data,size); /* copy it */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1737 return SWIG_OK; /* ok */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1738 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1739 return SWIG_ERROR; /* error */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1740 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1741
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1742 /* a function to get the typestring of a piece of data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1743 SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1744 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1745 swig_lua_userdata* usr;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1746 if (lua_isuserdata(L,tp))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1747 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1748 usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1749 if (usr && usr->type && usr->type->str)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1750 return usr->type->str;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1751 return "userdata (unknown type)";
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1752 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1753 return lua_typename(L,lua_type(L,tp));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1754 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1755
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1756 /* lua callable function to get the userdata's type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1757 SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1758 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1759 lua_pushstring(L,SWIG_Lua_typename(L,1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1760 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1761 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1762
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1763 /* lua callable function to compare userdata's value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1764 the issue is that two userdata may point to the same thing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1765 but to lua, they are different objects */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1766 SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1767 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1768 int result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1769 swig_lua_userdata *usr1,*usr2;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1770 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1771 return 0; /* nil reply */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1772 usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1773 usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1774 /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1775 result=(usr1->ptr==usr2->ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1776 lua_pushboolean(L,result);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1777 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1778 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1779
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1780 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1781 * global variable support code: class/struct typemap functions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1782 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1783
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1784 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1785 /* Install Constants */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1786 SWIGINTERN void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1787 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1788 int i;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1789 for (i = 0; constants[i].type; i++) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1790 switch(constants[i].type) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1791 case SWIG_LUA_INT:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1792 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1793 lua_pushnumber(L,(lua_Number)constants[i].lvalue);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1794 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1795 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1796 case SWIG_LUA_FLOAT:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1797 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1798 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1799 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1800 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1801 case SWIG_LUA_CHAR:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1802 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1803 lua_pushfstring(L,"%c",(char)constants[i].lvalue);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1804 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1805 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1806 case SWIG_LUA_STRING:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1807 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1808 lua_pushstring(L,(char *) constants[i].pvalue);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1809 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1810 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1811 case SWIG_LUA_POINTER:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1812 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1813 SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1814 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1815 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1816 case SWIG_LUA_BINARY:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1817 lua_pushstring(L,constants[i].name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1818 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1819 lua_rawset(L,-3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1820 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1821 default:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1822 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1823 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1824 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1825 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1826 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1827
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1828 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1829 * executing lua code from within the wrapper
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1830 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1831
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1832 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1833 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1834 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1835 /* Executes a C string in Lua which is a really simple way of calling lua from C
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1836 Unfortunately lua keeps changing its APIs, so we need a conditional compile
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1837 In lua 5.0.X its lua_dostring()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1838 In lua 5.1.X its luaL_dostring()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1839 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1840 SWIGINTERN int
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1841 SWIG_Lua_dostring(lua_State *L, const char* str) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1842 int ok,top;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1843 if (str==0 || str[0]==0) return 0; /* nothing to do */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1844 top=lua_gettop(L); /* save stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1845 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1846 ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1847 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1848 ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1849 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1850 if (ok!=0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1851 SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1852 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1853 lua_settop(L,top); /* restore the stack */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1854 return ok;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1855 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1856
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1857 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1858 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1859 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1860
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1861 /* ------------------------------ end luarun.swg ------------------------------ */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1862
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1863
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1864 /* -------- TYPES TABLE (BEGIN) -------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1865
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1866 #define SWIGTYPE_p_UIControl swig_types[0]
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1867 static swig_type_info *swig_types[2];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1868 static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1869 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1870 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1871
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1872 /* -------- TYPES TABLE (END) -------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1873
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1874 #define SWIG_name "UIControl"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1875 #define SWIG_init luaopen_UIControl
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1876 #define SWIG_init_user luaopen_UIControl_user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1877
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1878 #define SWIG_LUACODE luaopen_UIControl_luacode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1879
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1880 namespace swig {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1881 typedef struct{} LANGUAGE_OBJ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1882 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1883
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1884
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1885 #include "UIControl.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1886
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1887 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1888 extern "C" {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1889 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1890 static int _wrap_UIControl_Show(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1891 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1892 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1893
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1894 SWIG_check_num_args("UIControl::Show",1,1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1895 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::Show",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1896
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1897 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1898 SWIG_fail_ptr("UIControl_Show",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1899 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1900
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1901 (arg1)->Show();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1902
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1903 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1904
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1905 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1906
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1907 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1908 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1909 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1910 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1911
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1912
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1913 static int _wrap_UIControl_Focused(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1914 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1915 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1916 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1917
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1918 SWIG_check_num_args("UIControl::Focused",1,1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1919 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::Focused",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1920
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1921 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1922 SWIG_fail_ptr("UIControl_Focused",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1923 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1924
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1925 result = (bool)(arg1)->Focused();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1926 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1927 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1928
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1929 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1930
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1931 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1932 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1933 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1934 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1935
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1936
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1937 static int _wrap_UIControl_OnKey(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1938 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1939 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1940 int arg2 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1941 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1942
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1943 SWIG_check_num_args("UIControl::OnKey",2,2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1944 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::OnKey",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1945 if(!lua_isnumber(L,2)) SWIG_fail_arg("UIControl::OnKey",2,"int");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1946
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1947 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1948 SWIG_fail_ptr("UIControl_OnKey",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1949 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1950
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1951 arg2 = (int)lua_tonumber(L, 2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1952 result = (bool)(arg1)->OnKey(arg2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1953 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1954 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1955
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1956 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1957
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1958 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1959 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1960 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1961 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1962
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1963
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1964 static int _wrap_UIControl_OnMouseLeftClick(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1965 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1966 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1967 int arg2 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1968 int arg3 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1969 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1970
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1971 SWIG_check_num_args("UIControl::OnMouseLeftClick",3,3)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1972 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::OnMouseLeftClick",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1973 if(!lua_isnumber(L,2)) SWIG_fail_arg("UIControl::OnMouseLeftClick",2,"int");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1974 if(!lua_isnumber(L,3)) SWIG_fail_arg("UIControl::OnMouseLeftClick",3,"int");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1975
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1976 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1977 SWIG_fail_ptr("UIControl_OnMouseLeftClick",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1978 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1979
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1980 arg2 = (int)lua_tonumber(L, 2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1981 arg3 = (int)lua_tonumber(L, 3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1982 result = (bool)(arg1)->OnMouseLeftClick(arg2,arg3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1983 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1984 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1985
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1986 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1987
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1988 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1989 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1990 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1991 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1992
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1993
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1994 static int _wrap_UIControl_OnMouseRightClick(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1995 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1996 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1997 int arg2 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1998 int arg3 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1999 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2001 SWIG_check_num_args("UIControl::OnMouseRightClick",3,3)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2002 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::OnMouseRightClick",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2003 if(!lua_isnumber(L,2)) SWIG_fail_arg("UIControl::OnMouseRightClick",2,"int");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2004 if(!lua_isnumber(L,3)) SWIG_fail_arg("UIControl::OnMouseRightClick",3,"int");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2005
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2006 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2007 SWIG_fail_ptr("UIControl_OnMouseRightClick",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2008 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2009
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2010 arg2 = (int)lua_tonumber(L, 2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2011 arg3 = (int)lua_tonumber(L, 3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2012 result = (bool)(arg1)->OnMouseRightClick(arg2,arg3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2013 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2014 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2015
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2016 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2017
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2018 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2019 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2020 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2021 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2022
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2023
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2024 static int _wrap_UIControl_OnMouseEnter(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2025 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2026 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2027 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2028
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2029 SWIG_check_num_args("UIControl::OnMouseEnter",1,1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2030 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::OnMouseEnter",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2031
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2032 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2033 SWIG_fail_ptr("UIControl_OnMouseEnter",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2034 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2035
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2036 result = (bool)(arg1)->OnMouseEnter();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2037 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2038 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2039
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2040 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2041
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2042 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2043 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2044 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2045 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2046
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2047
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2048 static int _wrap_UIControl_OnMouseLeave(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2049 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2050 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2051 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2052
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2053 SWIG_check_num_args("UIControl::OnMouseLeave",1,1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2054 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::OnMouseLeave",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2055
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2056 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2057 SWIG_fail_ptr("UIControl_OnMouseLeave",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2058 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2059
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2060 result = (bool)(arg1)->OnMouseLeave();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2061 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2062 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2063
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2064 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2065
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2066 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2067 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2068 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2069 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2070
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2071
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2072 static int _wrap_UIControl_AddControl(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2073 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2074 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2075 UIControl *arg2 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2076 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2077
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2078 SWIG_check_num_args("UIControl::AddControl",2,2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2079 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::AddControl",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2080 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("UIControl::AddControl",2,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2081
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2082 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2083 SWIG_fail_ptr("UIControl_AddControl",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2084 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2085
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2086
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2087 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2088 SWIG_fail_ptr("UIControl_AddControl",2,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2089 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2090
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2091 result = (bool)(arg1)->AddControl(arg2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2092 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2093 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2094
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2095 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2096
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2097 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2098 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2099 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2100 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2101
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2102
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2103 static int _wrap_UIControl_RemoveControl(lua_State* L) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2104 int SWIG_arg = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2105 UIControl *arg1 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2106 UIControl *arg2 = (UIControl *) 0 ;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2107 bool result;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2108
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2109 SWIG_check_num_args("UIControl::RemoveControl",2,2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2110 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UIControl::RemoveControl",1,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2111 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("UIControl::RemoveControl",2,"UIControl *");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2112
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2113 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2114 SWIG_fail_ptr("UIControl_RemoveControl",1,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2115 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2116
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2117
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2118 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_UIControl,0))){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2119 SWIG_fail_ptr("UIControl_RemoveControl",2,SWIGTYPE_p_UIControl);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2120 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2121
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2122 result = (bool)(arg1)->RemoveControl(arg2);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2123 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2124 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2125
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2126 if(0) SWIG_fail;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2127
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2128 fail:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2129 lua_error(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2130 return SWIG_arg;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2131 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2132
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2133
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2134 static void swig_delete_UIControl(void *obj) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2135 UIControl *arg1 = (UIControl *) obj;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2136 delete arg1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2137 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2138 static swig_lua_method swig_UIControl_methods[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2139 {"Show", _wrap_UIControl_Show},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2140 {"Focused", _wrap_UIControl_Focused},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2141 {"OnKey", _wrap_UIControl_OnKey},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2142 {"OnMouseLeftClick", _wrap_UIControl_OnMouseLeftClick},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2143 {"OnMouseRightClick", _wrap_UIControl_OnMouseRightClick},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2144 {"OnMouseEnter", _wrap_UIControl_OnMouseEnter},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2145 {"OnMouseLeave", _wrap_UIControl_OnMouseLeave},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2146 {"AddControl", _wrap_UIControl_AddControl},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2147 {"RemoveControl", _wrap_UIControl_RemoveControl},
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2148 {0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2149 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2150 static swig_lua_attribute swig_UIControl_attributes[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2151 {0,0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2152 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2153 static swig_lua_attribute swig_UIControl_cls_attributes[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2154 {0,0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2155 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2156 static swig_lua_method swig_UIControl_cls_methods[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2157 {0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2158 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2159 static swig_lua_const_info swig_UIControl_cls_constants[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2160 {0,0,0,0,0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2161 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2162 static swig_lua_class *swig_UIControl_bases[] = {0};
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2163 static const char *swig_UIControl_base_names[] = {0};
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2164 static swig_lua_class _wrap_class_UIControl = { "UIControl", &SWIGTYPE_p_UIControl,0, swig_delete_UIControl, swig_UIControl_methods, swig_UIControl_attributes, { "UIControl", swig_UIControl_cls_methods, swig_UIControl_cls_attributes, swig_UIControl_cls_constants }, swig_UIControl_bases, swig_UIControl_base_names };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2165
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2166 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2167 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2168 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2169
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2170 static const struct luaL_Reg swig_commands[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2171 {0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2172 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2173
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2174 static swig_lua_var_info swig_variables[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2175 {0,0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2176 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2177
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2178 static swig_lua_const_info swig_constants[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2179 {0,0,0,0,0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2180 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2181
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2182 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2183
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2184 static swig_type_info _swigt__p_UIControl = {"_p_UIControl", "UIControl *", 0, 0, (void*)&_wrap_class_UIControl, 0};
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2185
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2186 static swig_type_info *swig_type_initial[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2187 &_swigt__p_UIControl,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2188 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2189
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2190 static swig_cast_info _swigc__p_UIControl[] = { {&_swigt__p_UIControl, 0, 0, 0},{0, 0, 0, 0}};
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2191
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2192 static swig_cast_info *swig_cast_initial[] = {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2193 _swigc__p_UIControl,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2194 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2195
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2196
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2197 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2198
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2199 /* -----------------------------------------------------------------------------
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2200 * Type initialization:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2201 * This problem is tough by the requirement that no dynamic
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2202 * memory is used. Also, since swig_type_info structures store pointers to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2203 * swig_cast_info structures and swig_cast_info structures store pointers back
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2204 * to swig_type_info structures, we need some lookup code at initialization.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2205 * The idea is that swig generates all the structures that are needed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2206 * The runtime then collects these partially filled structures.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2207 * The SWIG_InitializeModule function takes these initial arrays out of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2208 * swig_module, and does all the lookup, filling in the swig_module.types
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2209 * array with the correct data and linking the correct swig_cast_info
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2210 * structures together.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2211 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2212 * The generated swig_type_info structures are assigned staticly to an initial
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2213 * array. We just loop through that array, and handle each type individually.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2214 * First we lookup if this type has been already loaded, and if so, use the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2215 * loaded structure instead of the generated one. Then we have to fill in the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2216 * cast linked list. The cast data is initially stored in something like a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2217 * two-dimensional array. Each row corresponds to a type (there are the same
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2218 * number of rows as there are in the swig_type_initial array). Each entry in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2219 * a column is one of the swig_cast_info structures for that type.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2220 * The cast_initial array is actually an array of arrays, because each row has
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2221 * a variable number of columns. So to actually build the cast linked list,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2222 * we find the array of casts associated with the type, and loop through it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2223 * adding the casts to the list. The one last trick we need to do is making
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2224 * sure the type pointer in the swig_cast_info struct is correct.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2225 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2226 * First off, we lookup the cast->type name to see if it is already loaded.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2227 * There are three cases to handle:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2228 * 1) If the cast->type has already been loaded AND the type we are adding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2229 * casting info to has not been loaded (it is in this module), THEN we
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2230 * replace the cast->type pointer with the type pointer that has already
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2231 * been loaded.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2232 * 2) If BOTH types (the one we are adding casting info to, and the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2233 * cast->type) are loaded, THEN the cast info has already been loaded by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2234 * the previous module so we just ignore it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2235 * 3) Finally, if cast->type has not already been loaded, then we add that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2236 * swig_cast_info to the linked list (because the cast->type) pointer will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2237 * be correct.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2238 * ----------------------------------------------------------------------------- */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2239
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2240 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2241 extern "C" {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2242 #if 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2243 } /* c-mode */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2244 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2245 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2246
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2247 #if 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2248 #define SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2249 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2250
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2251
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2252 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2253 SWIG_InitializeModule(void *clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2254 size_t i;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2255 swig_module_info *module_head, *iter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2256 int found, init;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2257
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2258 /* check to see if the circular list has been setup, if not, set it up */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2259 if (swig_module.next==0) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2260 /* Initialize the swig_module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2261 swig_module.type_initial = swig_type_initial;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2262 swig_module.cast_initial = swig_cast_initial;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2263 swig_module.next = &swig_module;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2264 init = 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2265 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2266 init = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2267 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2268
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2269 /* Try and load any already created modules */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2270 module_head = SWIG_GetModule(clientdata);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2271 if (!module_head) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2272 /* This is the first module loaded for this interpreter */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2273 /* so set the swig module into the interpreter */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2274 SWIG_SetModule(clientdata, &swig_module);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2275 module_head = &swig_module;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2276 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2277 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2278 found=0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2279 iter=module_head;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2280 do {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2281 if (iter==&swig_module) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2282 found=1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2283 break;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2284 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2285 iter=iter->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2286 } while (iter!= module_head);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2287
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2288 /* if the is found in the list, then all is done and we may leave */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2289 if (found) return;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2290 /* otherwise we must add out module into the list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2291 swig_module.next = module_head->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2292 module_head->next = &swig_module;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2293 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2294
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2295 /* When multiple interpreters are used, a module could have already been initialized in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2296 a different interpreter, but not yet have a pointer in this interpreter.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2297 In this case, we do not want to continue adding types... everything should be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2298 set up already */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2299 if (init == 0) return;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2300
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2301 /* Now work on filling in swig_module.types */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2302 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2303 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2304 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2305 for (i = 0; i < swig_module.size; ++i) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2306 swig_type_info *type = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2307 swig_type_info *ret;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2308 swig_cast_info *cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2309
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2310 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2311 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2312 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2313
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2314 /* if there is another module already loaded */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2315 if (swig_module.next != &swig_module) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2316 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2317 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2318 if (type) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2319 /* Overwrite clientdata field */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2320 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2321 printf("SWIG_InitializeModule: found type %s\n", type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2322 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2323 if (swig_module.type_initial[i]->clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2324 type->clientdata = swig_module.type_initial[i]->clientdata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2325 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2326 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2327 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2328 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2329 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2330 type = swig_module.type_initial[i];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2331 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2332
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2333 /* Insert casting types */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2334 cast = swig_module.cast_initial[i];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2335 while (cast->type) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2336
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2337 /* Don't need to add information already in the list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2338 ret = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2339 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2340 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2341 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2342 if (swig_module.next != &swig_module) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2343 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2344 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2345 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2346 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2347 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2348 if (ret) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2349 if (type == swig_module.type_initial[i]) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2350 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2351 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2352 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2353 cast->type = ret;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2354 ret = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2355 } else {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2356 /* Check for casting already in the list */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2357 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2358 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2359 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2360 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2361 if (!ocast) ret = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2362 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2363 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2364
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2365 if (!ret) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2366 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2367 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2368 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2369 if (type->cast) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2370 type->cast->prev = cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2371 cast->next = type->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2372 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2373 type->cast = cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2374 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2375 cast++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2376 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2377 /* Set entry in modules->types array equal to the type */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2378 swig_module.types[i] = type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2379 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2380 swig_module.types[i] = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2381
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2382 #ifdef SWIGRUNTIME_DEBUG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2383 printf("**** SWIG_InitializeModule: Cast List ******\n");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2384 for (i = 0; i < swig_module.size; ++i) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2385 int j = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2386 swig_cast_info *cast = swig_module.cast_initial[i];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2387 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2388 while (cast->type) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2389 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2390 cast++;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2391 ++j;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2392 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2393 printf("---- Total casts: %d\n",j);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2394 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2395 printf("**** SWIG_InitializeModule: Cast List ******\n");
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2396 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2397 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2398
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2399 /* This function will propagate the clientdata field of type to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2400 * any new swig_type_info structures that have been added into the list
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2401 * of equivalent types. It is like calling
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2402 * SWIG_TypeClientData(type, clientdata) a second time.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2403 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2404 SWIGRUNTIME void
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2405 SWIG_PropagateClientData(void) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2406 size_t i;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2407 swig_cast_info *equiv;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2408 static int init_run = 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2409
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2410 if (init_run) return;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2411 init_run = 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2412
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2413 for (i = 0; i < swig_module.size; i++) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2414 if (swig_module.types[i]->clientdata) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2415 equiv = swig_module.types[i]->cast;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2416 while (equiv) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2417 if (!equiv->converter) {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2418 if (equiv->type && !equiv->type->clientdata)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2419 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2420 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2421 equiv = equiv->next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2422 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2423 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2424 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2425 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2426
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2427 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2428 #if 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2429 { /* c-mode */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2430 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2431 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2432 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2433
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2434
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2435
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2436 /* Forward declaration of where the user's %init{} gets inserted */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2437 void SWIG_init_user(lua_State* L );
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2438
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2439 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2440 extern "C" {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2441 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2442 /* this is the initialization function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2443 added at the very end of the code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2444 the function is always called SWIG_init, but an earlier #define will rename it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2445 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2446 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2447 LUALIB_API int SWIG_init(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2448 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2449 SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2450 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2451 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2452 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2453 int i;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2454 /* start with global table */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2455 lua_pushglobaltable (L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2456 /* SWIG's internal initalisation */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2457 SWIG_InitializeModule((void*)L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2458 SWIG_PropagateClientData();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2459 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2460
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2461 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2462 /* add a global fn */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2463 SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2464 SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2465 /* begin the module (its a table with the same name as the module) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2466 SWIG_Lua_module_begin(L,SWIG_name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2467 /* add commands/functions */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2468 for (i = 0; swig_commands[i].name; i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2469 SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2470 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2471 /* add variables */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2472 for (i = 0; swig_variables[i].name; i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2473 SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2474 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2475 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2476
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2477 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2478 /* set up base class pointers (the hierarchy) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2479 for (i = 0; swig_types[i]; i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2480 if (swig_types[i]->clientdata){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2481 SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2482 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2483 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2484 /* additional registration structs & classes in lua */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2485 for (i = 0; swig_types[i]; i++){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2486 if (swig_types[i]->clientdata){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2487 SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2488 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2489 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2490 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2491
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2492 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2493 /* constants */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2494 SWIG_Lua_InstallConstants(L,swig_constants);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2495 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2496
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2497 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2498 /* invoke user-specific initialization */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2499 SWIG_init_user(L);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2500 /* end module */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2501 /* Note: We do not clean up the stack here (Lua will do this for us). At this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2502 point, we have the globals table and out module table on the stack. Returning
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2503 one value makes the module table the result of the require command. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2504 return 1;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2505 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2506 return 0;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2507 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2508 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2509
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2510 #ifdef __cplusplus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2511 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2512 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2513
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2514
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2515 const char* SWIG_LUACODE=
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2516 "";
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2517
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2518 void SWIG_init_user(lua_State* L)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2519 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2520 /* exec Lua code if applicable */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2521 SWIG_Lua_dostring(L,SWIG_LUACODE);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2522 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2523