Home
Tcl Extension Building With SWIG
Contents
1. Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 30 Notes On Unix a shared library will be created using a Makefile similar to the following will vary on every machine Makefile for OpenGL linux INTERFACE opengl i WRAPFILE INTERFACE i _wrap c WRAPOBJ INTERFACE i _wrap o TARGET opengl so Use this kind of target for dynamic loading ole gcc CFLAGS INCLUDE I usr local src Mesa 2 5 LIBS L usr local src Mesa 2 5 lib lMesaaux lMesatk lMesaGLU lMesaGL lXext OBJS R SWIG Options SWIG swigl 2 SWIGOPT tcl Shared libraries CCSHARED fpic BUILD gcc shared Tcl installation where is Tcl Tk located TCL_INCLUDE I usr include TCL_LIB L usr local lib ll all TARGET Create opengl_wrap o from opengl_wrap c S WRAPOBJ WRAPFILE CC c CCSHARED CFLAGS WRAPFILE INCLUDE TCL_INCLUDE Create the opengl_wrap c from an interface file S WRAPFILE INTERFACE SWIG SWIGOPT o WRAPFILE SWIGLIB INTERFACE Create the shared library TARGET WRAPOBJ OBJS BUILD WRAPOBJ OBJS LIBS o TARGET Setting up the Files The module consists of the following two files opendgl i SWIG input opengl_wrap c SWIG output Add both files to the project and customize opengl i as follows Project Settings 21x Settings For win32 De
2. Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 18 Notes When SWIG is processing C libraries it uses the default copy constructor instead For example Vector wrap_cross_product Vector a Vector b Vector result new Vector cross_product a b return result Helper Functions Sometimes it is useful to write supporting functions e Creation and destruction of objects e Providing access to arrays e Accessing internal pieces of data structures e Can use the inline directive to add new C functions to an interface These functions become part of our Tcl interface Sinline double new_darray int size return double malloc size sizeof double double darray_get double a int index return a index void darray_set double a int index double value a index value void delete_darray double a free a Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 19 Notes The following Tcl functions show how the above C functions might be used Turn a Tcl list into a C double array proc createfromlist 1 set len llength 1 set d new_darray len for set i 0 Si lt Srem incr i 1 darray_set d i lindex 1 Si return d Print out some elements of an array proc printelements a first last for set i first i lt Slast incr i 1 puts darray
3. Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 25 A SWIG Example OpenGL Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 26 Building a Tcl Interface to OpenGL OpenGL e A widely available library for 3D graphics e Consists of more than 300 functions and about 500 constants e Available on most machines Mesa is a public domain version Why OpenGL e It s real package that does something more than hello world e It s available everywhere e An early SWIG user wrapped it in only 10 minutes as his first use of SWIG For this example we ll use e SWIG1 2a1 on Windows NT 4 0 e Microsoft Visual C 5 0 e Microsoft s implementation of OpenGL e Tcl 8 0 See notes for Unix information Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 27 Notes A Unix version of this example can be built using the Mesa library available at http www ssec wisc edu brianp Mesa html Any number of commercial OpenGL implementations should also work Interface Building Strategy Locate the OpenGL header files lt GL gl h gt Main OpenGL header fil lt GL glu h gt Utility functions lt Gl glaux h gt Some useful utility functions The plan e Write a separate SWIG interface file for each header gl i glu i glaux i Combine everything using an interface file similar to
4. FA include vector h 3 Vector create_vector double x double y double dot_product Vector a Vector b double z load example so set v create_vector 1 set w create_vector 4 puts dot_product v w 32 0 puts v _1008fea8_Vector_p e Can use C C objects without knowing their definition However can t peer inside objects to view their internal representation e SWIG does not complain about undefined datatypes see note 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Tcl Extension Building With SWIG Notes Whenever SWIG encounters an unknown datatype it assumes that it is a derived datatype and manipulates it by reference Unlike the C compiler SWIG will never generate an error about undefined datatypes While this may sound strange it makes it possible for SWIG to build interfaces with a minimal amount of additional information For example if SWIG sees a datatype Matrix it s obviously a pointer to something from the syntax From SWIG s perspective it doesn t really matter what the pointer is actually pointing to As a result the definition of an object is not needed in the interface file Passing Objects by Value What if a program passes objects by value double dot_product Vector a Vector b e SWIG converts pass by value arguments into pointers and creates a wrapper equivalent to the following double wrap_dot_product Vector a Vector b
5. Tcl Extension Building With SWIG David M Beazley Department of Computer Science University of Chicago Chicago Illinois 60637 beazley cs uchicago edu Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 1 Tcl Extension Building Interfacing Tcl and C C is relatively easy e Tcl provides a nice C API Can add new commands variables objects widgets etc e Tcl was designed to be extended with compiled code but you knew this However there are downsides e Tedious if you have a large library do you write wrappers for hundreds of functions e Working with structures and C classes is difficult Compatibility the Tcl C API has been known to change from time to time e Difficult to manage rapid change since wrappers must be changed e Do you really want to write all of that extension code anyways There must be a better way Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 2 Notes Extension Building Tools A variety of tools have been developed e SWIG jWrap e ITcl cpptcl e Tclobj e Embedded Tk ET e Object Tcl e TclObjCommand e Modular Tcl e Check the FAQ and contributed archive for more Two basic types of tools e Interface compilers e Extensions to the Tcl C API All tools are different try a few and use what you like Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Co
6. define _ANSI_ARGS a a A macro define FOO BAR BAR is undefined Pointers Pointer support is critical e Arrays e Objects e Most C programs have tons of pointers floating around SWIG type checked pointers e C pointers are mapped to Tcl strings containing the pointer value and type _1001fa80_Matrix_p bas DA Value hex Type e Type signature is used to perform run time checking e Type violations result in a Tcl error e Pointers work exactly like in C except that they can t be dereferenced in Tcl Similar to Tcl handles e Pointer value is a name for an underlying C C object e SWIG version is more flexible although perhaps a little more dangerous Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 12 Notes SWIG allows you to pass pointers to C objects around inside Tcl scripts pass pointers to other C functions and so forth In many cases this can be done without ever knowing the underlying structure of an object or having to convert C data structures into Tcl data structures SWIG does not support pointers to C member functions This is because such pointers can not be properly cast to a pointer of type void the type that SWIG generated extensions use internally The NULL pointer is represented by the string NULL Run time type checking is essential for reliable operation because the dynamic nature of Tcl effectively bypasses all type checking that w
7. return dot_product a b e Transforms all pass by value arguments into pass by reference Is this safe e Works fine with C programs e Seems to work fine with C if you aren t being too clever Caveat e Make sure you tell SWIG about typedef declarations see notes Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 17 Notes SWIG converts all undefined types into pointers As a result it is important to use typedef correctly For example void foo Real a Real is unknown Use as a pointer would get wrapped as follows void wrap_foo Real a foo a In constrast the following declarations would be wrapped correctly typedef double Real void foo Real a Real is just a double Return by Value Return by value is more difficult Vector cross_product Vector a Vector b e What are we supposed to do with the return value e Can t generate a Tcl representation of it well not easily can t throw it away e SWIG is forced to perform a memory allocation and return a pointer Vector wrap_cross_product Vector a Vector b Vector result Vector malloc sizeof Vector result cross_product a b return result Isn t this a huge memory leak e Yes e It is the user s responsibility to free the memory used by the result e Better to allow such a function with a leak than not at all
8. set r add 3 0 4 5 puts r Tss e The behavior of double INPUT and double OUTPUT have been modified e Use of the C function has been completely changed no longer requires pointers 58 Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Notes o swig tcl co Makefile Support Files Need a Tcl Makefile in a hurry 5 ae FE JE OSE SE OE SR FRE SRCS CXXS Tcl Extension Building With SWIG Makefil RCS Ce fSEC Lae checked out from the SWIG library e Copies a preconfigured Tcl Makefile from the library into the current directory e Edit it and you re off and running Generated automatically from Makefile in by configure Header SWIG Tcl Tk Makefile This file can be used to build various Tcl extensions with SWIG By default this file is set up for dynamic loading be easily customized for static extensions portions of the file but it can by modifying various 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Advanced SWIG Features Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 60 Exception Handling The except directive Allows you to define an application specific exception handler e Can catch C errors or C exceptions e Fully configurable you can define exception handlers as you wish Sexcept tcl try Sfunction This gets replac
9. Interface Generator A compiler for the automatic creation of scripting language extensions e Supports ANSI C C and Objective C e Creates modules for Tcl 7 x Tcl 8 x Perl5 Perl4 Python and Guile e Primary use is building scripting interfaces to existing C C programs Availability e http Awww swig org e Supports Unix Windows NT and Macintosh Resources e 340 page user manual included in the distribution e Active mailing list with about 400 subscribers swig cs utah edu Reference D M Beazley SWIG An Easy to Use Tool for Integrating Scripting Languages with C and C in 4th Tcl Tk Workshop 96 Monterey July 10 13 1996 USENIX p 129 139 Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 5 Notes Overview Topics e A tour of SWIG e Example Building a Tcl interface to OpenGL e Objects e The SWIG Library e Advanced features e Limitations and resources Prerequisites e You are an experienced ANSI C programmer e You have some familiarity with the Tcl C extension API e You have written some Tcl scripts e C optional but useful Many of the topics apply to other extension building tools e SWIG is not the only approach e Primary goal is to illustrate the use of a Tcl extension building tool in action Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 6 Notes SWIG Overview T
10. USENIX Tcl Tk Conference Sept 15 1998 62 Notes Typemap Example What is a typemap A special processing rule applied to a particular datatype name pair double spam int KIN double spam int a int e Can define rules for specific datatype name pairs e For example Stypemap tcl in inta if Tcl_GetInt interp source target TCL_ERROR return TCL_ERROR printf a Sd n target e This C code gets inserted into the wrapper functions created by SWIG e Ssource and target are tokens that get replaced with C variables e The in typemap is used to convert arguments from Tcl to C Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 63 Notes How Typemaps Work Stypemap tcl in int a see previous slide double spam int a int v static int _wrap_spam ClientData clientData Tcl_Interp interp int argc char argv double _result int _arg0 int _argl clientData clientData argv argv if arge lt 3 arge gt 3 4 Tcl_SetResult interp Wrong args spam a int TCL_STATIC return TCL_ERROR if Tcl_GetInt interp argv 1 _arg0 TCL_ERROR typemap return TCL_ERROR printf a d n _arg0 argl int atol argv 2 _result double spam _arg0 _argl Tcl_PrintDouble interp double _result interp gt result return TCL_OK Tcl Extensi
11. IG interface file example i Module Name module example Header Files gt include headers h 3 C declarations int fact int n double Foo define SPAM 42 Tcl Extension Building With SWIG Notes The module directive specifies the name of the Tcl extension module 6th Annual USENIX Tcl Tk Conference Sept 15 1998 9 The directive is used to insert literal C code into the extension module created by SWIG This code is simply copied directly into the output file and is not interpreted by the SWIG compiler other supporting functions that might be used in the interface Typically this is used to include header files and any A Simple SWIG Example cont Building a Tcl Interface Linux 2 swig tcl example i Generating wrappers for Tcl cc fpic c example c example_wrap c cc shared example o example_wrap o o example so e SWIG produces a file example_wrap c that is compiled into a Tcl module The name of the module and the shared library should match Using the module tclsh load example so fact 4 4 puts Foo puts SSPAM 42 e Can also use packages described in the SWIG Users Manual Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 10 Notes Shared libraries The process of compiling shared libraries varies on every machine The above example a
12. Lenum wrap_auxInitWindowA LPCSTR a auxInitWindowA a e However buried deep in Windows header files we find that LPCSTR is really a string define CONST const typedef char CHAR typedef CONST CHAR LPCSTR To fix put a typedef in the interface file typedef const char LPCSTR Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 38 Notes Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Notes Helper Functions Some functions may be difficult to use from Tcl void glMaterialfv GLenum face GLenum pname const GLfloat params params is supposed to be an array e How do we manufacture these arrays in Tcl and use them Write helper functions Sinline GLfloat newfv4 GLfloat a GLfloat b GLfloat c GLfloat d GLfloat f GLfloat malloc 4 sizeof GLfloat f 0 a f 1 b f 2 c f 3 d return f z Create a destructor delfv that is really just free Sname delfv void free void e Tcl lists can also be used as arrays see section on customization 39 Tcl OpenGL Example load opengl dll Open up a display window auxInitDisplayMode expr AUX_SINGLE AUX_RGBA SAUX_DEPTH auxInitPosition 0 0 500 500 auxInitWindow Lit Torus Set up the material properties set mat_specular newfv4 1 0 1 0 1 0 1 0 se
13. SENIX Tcl Tk Conference Sept 15 1998 54 The SWIG Library SWIG is packaged with a standard library e Think of it as the SWIG equivalent of the C library e It s an essential part of using SWIG Contents of the library e Interface definitions to common C libraries e Utility functions array creation pointer manipulation timers etc e SWIG extensions and customization files e Support files Makefiles Tcl scripts etc Using the library is easy just use the include directive sSmodule example Sinclude malloc i Sinclude pointer i Sinclude timers i e Code from the library files is simply inserted into your interface Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 55 Notes Rebuilding tclsh and wish An alternative to dynamic loading Smodule z include header h 5 unix gt swig tcl example i unix gt gcc example c example_wrap c I usr local include ltcl 1m o mytclsh Sinclude tclsh i Use include wish i for wish tclsh i and wish i are SWIG library files for rebuilding the Tcl interpreter e Just run SWIG compile and link No need to write Tcl_AppInit Or main Can also specify libraries on the SWIG command line swig tcl lwish i example i e Makes it easier to write makefiles that use either dynamic or static linking Tcl Extension Building With SWIG 6th Annual USENIX Tcl
14. Tk Conference Sept 15 1998 56 Notes The SWIG Pointer Library include pointer i e Provides high level creation manipulation and destruction of common C types e Can create arrays dereference values etc e The cool part uses the SWIG type checker to automatically infer types Smodule example Sinclude pointer i void add double a double b double result amp set a ptrcreate double 3 5 set b ptrcreate double 7 0 set c ptrcreate double 0 0 add a b c puts ptrvalue c 10 5 ptrset a 2 0 puts ptrvalue a 2 0 ptrfree Sa ptrfree Sb ptrfree c Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 57 Notes The SWIG pointer library can also perform type casting pointer arithmetic and the equivalent of a run time typedef One of the more useful features of the library is its dynamic deferencing operations For example pt rvalue will return the value of any pointer that is one of the built in C datatypes int long short char float double etc The type determination is made dynamically since all pointers are already encoded with that information Typemap Library The typemap library customizes SWIG described shortly e Can be used to handle input and output arguments smodule example Sinclude typemaps i void add double INPUT double INPUT double OUTPUT oa Tel load example so
15. _get Sa i Preprocessing SWIG has a C preprocessor e The SWIG symbol is defined whenever SWIG is being run e Can be used to make mixed SWIG C header files or for customization header h A mixed SWIG C header file ifdef SWIG Smodule example S include header h 5 endif define EXTERN extern ifdef CAN_PROTOTYPE define _ANSI_ARGS a a else define _ANSI_ARGS a fendif C declarations EXTERN int foo _ANSI_ARGS int double ifndef SWIG Don t wrap these declarations endif Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 20 Notes SWIG1 1 had a partial implementation of a preprocessor that allowed conditional compilation SWIG1 2 has a full implementation of a preprocessor that allows conditional compilation and macro expansion Preprocessing symbols can be specified on the SWIG command line using the D option For example swig DDEBUG foo i File Inclusion The include directive e Includes a file into the current interface file e Allows a large interface to be built out of smaller pieces e Allows for interface libraries and reuse smodule opengl i Sinclude gl i Sinclude glu i Sinclude aux i Sinclude vis h Sinclude helper i e File inclusion in SWIG is really like an import Files can only be included once and include guards are not required unlike C header files Note SWIG ignores include statement
16. able WINGDIAPI multiply defined 2nd definition ignored d Program Files DevStudio VC include GL gl h Line 39 Syntax error in input d Program Files DevStudio VC include GL gl h Line 1140 Variable WINGDIAPI multiply defined 2nd definition ignored d Program Files DevStudio VC include GL gl h Line 40 Syntax error in input d Program Files DevStudio VC include GL gl h Line 1141 Variable WINGDIAPI multiply defined 2nd definition ignored d Program Files DevStudio VC include GL gl h Line 41 Syntax error in input Confused by earlier errors Bailing out Hmmm This isn t too encouraging Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 33 Notes Fixing Parsing Problems Raw C header files are often problematic For example WINGDIAPI void APIENTRY glAccum GLenum op GLfloat val e SWIG has no idea what to do with macros or extensions to ANSI C Can use the SWIG preprocessor to fix many of these problems OpenGL Interface smodule opengl Define macros as empty not needed for SWIG define WINGDIAPI define APIENTRY define CALLBACK Sinclude gl i Sinclude glu i g Sinclude glaux i Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 34 Notes Second Attempt Getting much closer only 3 errors this time glu h Line 231 Error Function pointer not allowe
17. at double lt gt Tcl float echar char lt gt Tcl strings e void lt gt Empty string long long long double gt Currently unsupported e Tcl Objects are used if the tc18 option is given SWIG tries to create an interface that is a natural extension of the underlying C code Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 11 Notes Types of global variables Global variables are implemented using the Tcl variable linking mechanism This allows the Tcl interpreter to link to C variables of type int double and char As a result C variables of these types appear exactly like normal Tcl variables Unfortunately the linking mechanism does not work with all C datatypes For example short bar In this case SWIG generates a pair of accessor functions short bar_get return bar short bar_set short val bar val These functions would then be used in Tcl as follows puts bar_get 3 bar_set 6772 H More on constants SWIG creates constants from define const and enum declarations However define is also used to define preprocessor macros Therefore SWIG only creates a constant from a define if the value is fully defined For example the following declarations create constants define READ_MODE ii define PI 3 14159 define PI4 PI 4 The following declarations do not result in constants define USE_PROTOTYPES No value given
18. ate modeling Lotus Notes Robotics Computational chemistry Materials Modeling Software testing Computational steering Medical Imaging Spectrographic analysis Database Meteorological imaging Speech recognition Defibrillation modeling Microprocessor design Testing of telecom software Document management Military visualization Virtual reality Drawing Molecular dynamics Vision Economics Natural language processing Visual simulation Education Network management Weather forecasting Electronic Design Automation Neural nets X ray astrophysics analysis Electronic Commerce Oil exploration Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Notes 72 SWIG Resources Web page http www swig org Includes links to other extension building tools and general resources FTP server ftp ftp swig org Mailing list swig cs utah edu To subscribe send a message subscribe swig to majordomo cs utah edu Documentation SWIG comes with about 350 pages of tutorial style documentation it also supports Perl and Python so don t let the size scare you A variety of papers tutorials and other resources are also available Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 73
19. bug General Custom Build EME OpenGL Input file opengl openglwrap c Description swig Build commands Ixte d swig 2 swig exe tcl o ProDir InputName _wrap SWIG command line Output file s Ke Ss SWIG output file ProjDir InputN ame _wrap c Directory Fjes v Dependencies Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 31 Notes To customize the opengl i simply select the project gt settings menu in Visual C The full SWIG command line might look like the following d swigl 2 swig exe tcl o ProjDir InputName _wrap c I d Program Files DevStudio Vc include GL InputPath The output files should look like this S ProjDir InputName _wrap c Note the file opengl_wrap c should be added to the project even though it does not exist yet Visual C will notice that the file doesn t exist but will ask you if its okay to proceed anyways Include Files and Libraries Don t forget the Tcl include directory and libraries Project Settings 2 opengl_wrap c I Undetine all symbols Undefined symbols C C Link Resource Reset Additional include directories B devel telinclude T Ignore standard include paths Categor General Output file name Debug OpenGL dll Object library modules a devel tclib tclB0ve ib opengl32 lib glaux lib gl
20. cl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 7 An Introduction SWIG Simplified Wrapper and Interface Generator e SWIG is a compiler that turns ANSI C C declarations into scripting extensions e Completely automated produces a fully working Tcl extension module e Language neutral SWIG can also target Perl Python Guile MATLAB and Java ANSI C Declarations Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 8 Notes SWIG accepts input in the form of ANSI C C declarations that would typically be found in a header file Input generally comes from three sources C header files C source files and special SWIG interface files which are usually given a i suffix In most cases a combination of different files will be used to build an interface ANSI C C syntax was chosen because SWIG was designed to work with existing code The idea is that you can grab a C header file tweak it a little bit and produce a working scripting interface with minimal effort In other cases one might create a combined SWIG C header file that defines everything about your C library including the Tcl interface Compare to the interface specification approach used with CORBA IDL or COM Some C code A Simple SWIG Example example c double Foo 7 5 int fact int n if n lt 1 return 1 else return n fact n 1 A SW
21. d glu h Line 271 Error Function pointer not allowed glu h Line 354 Error Function pointer not allowed Problem SWIG parser doesn t currently allow function pointers To fix e Copy contents of glu hto glu i Edit out offending declarations include lt GL glu h gt Insert glu h here void APIENTRY gluQuadricCallback GLUquadric qobj GLenum which void CALLBACK fn Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 35 Notes Function pointers are not correctly parsed by SWIG1 1 SWIG1 2 will eventually eliminate these problems Pointers to functions can sometimes be handled using typedef For example the declaration void foo void pfen int int can be rewritten as typedef void PFI int int void foo PFI pfcn Pointers to function may be awkward or difficult to use from a Tcl interface While pointers to C functions can be passed around in Tcl it is not possible to implement callback functions in Tcl or use Tcl procedures in place of C functions well not without a little work Third Attempt The module now compiles e Only had to make a few minor changes to headers But the module still doesn t seem to work quite right load opengl dll auxInitDisplayMode expr SAUX_SINGLE SAUX_RGBA SAUX_DEPTH auxInitPosition 0 0 500 500 auxInitWindow Lit Torus ambig
22. ed by the real function call catch RangeError interp gt result Array index out of bounds return TCL_ERROR e Exception handling code gets inserted into all of the wrapper functions e Sfunction token is replaced by the real C C function call Note e Exception handling is different in Tcl 7 x and Tcl 8 x Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 61 Notes SWIG includes a library of exception handlers that are implemented in a portable manner To use the library you would simply write the following Sinclude exceptions i Sexcept try Sfunction catch RangeError SWIG_exception SWIG_IndexError index out of bounds In this case the macro SWIG_exception is translated into the appropriate Tcl code needed to indicate an error Typemaps Typemaps allow you to change the processing of any datatype e Handling of input output values Converting Tcl objects into C C equivalents e Telling SWIG to use new Tcl types Very flexible very powerful e You can do almost anything with typemaps e You can even blow your whole leg off not to mention your foot e Often a hot topic of discussion on the SWIG mailing list Caveats e Requires knowledge of Tcl s C API to use effectively e It s possible to break SWIG in bizarre ways e Impossible to cover in full detail here Tcl Extension Building With SWIG 6th Annual
23. ed with incomplete or partial information about the real C C object Again SWIG is avoiding the problem of object data representation and using a scheme that relies upon references Compare with CORBA COM and other systems C Inheritance and Pointers fies Shape public virtual double area 0 i class Circle public Shape public Circle double radius Circle double area he class Square public Shape Square double width Square double area he SWIG is aware of C inheritance hierarchies set c new_Circle 7 set s new_Square 10 puts Square_area s 100 0 puts Shape_area s 100 0 puts Shape_area c 153 938040046 puts Square_area c Type error in argument 1 of Square_area Expected _Square_p ole x e The run time type checker knows the inheritance hierarchy Type errors will be generated when violations are detected e C pointers are properly cast when necessary e Multiple inheritance is also supported Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 49 Notes The Object Interface SWIG can also create object like Tcl interfaces Stack s Create s class Stack s push Dave public s push John Stack s push Michelle Stack s pop void push char Michelle char pop puts s cget depth int depth 2 puts s ceget this _1008fe8_Stack_
24. erence Sept 15 1998 67 Notes SWIG Limitations cont Integration with Tcl e SWIG tries to keep a strict separation between C C and Tcl Appropriate for many applications e However you might want more flexibility or control e SWIG typemaps can sometimes be used e Other Tcl extension building tools may work better especially with object oriented systems e SWIG can be used with other extension tools if you know what you are doing Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 68 Notes Application Troubles Not all C C applications work well in a scripted environment e May crash e May operate in an unreliable manner e Very complex C systems may be very problematic compilation linking etc An API may be poorly suited to scripting i e difficult to use e Memory management woes Applications can also do bad things e Example char strcpy char s const char ct e Using this function from Tcl as is will likely corrupt the Tcl interpreter and crash Left as an exercise to the reader to figure out why Namespace clashes e C C functions may clash with Tcl commands e May clash with the C C implementation of Tcl or other extensions Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 69 Notes An excellent overview of building C Tcl extensions is available at http zeus informatik uni fra
25. estroyed by writing helper functions typedef struct double x y Z Vector SWIG Interface file tL Sinline Vector new_Vector double x double y double z Vector v Vector malloc sizeof Vector y Sep VAHL yp Veen z return v void delete_Vector Vector v free v Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 44 Notes Using these functions in Tcl is straightforward ole set v new_Vector 1 3 10 set w new_Vector 0 2 5 3 puts v _1100ef00_Vector_p puts Sw _1100ef20_Vector_p puts dot_product v w 7 5 set a cross_product v w puts Sa 1100ef80_Vector_p delete _ Vector v delete Vector w delete_Vector a ole oP W ol oe oe ole ol SWIG requires all objects to be explicitly created and destroyed While it may be sensible to apply a reference counting scheme to C C objects this proves to be problematic in practice There are several factors e We often don t know how a pointer was manufactured Unless it was created by malloc or new it would probably be a bad idea to automatically invoke a destructor on it e C C programs may use objects internally It would be a bad idea for Tcl to destroy an object that was still being used inside aC program Unfortunately there is no way for Tcl to know this e A C C program may be performing its own management reference count
26. f auxInitWindow everything GLenum auxInitWindow char title e Nothing was Tcl specific Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 41 Notes In this example a Tcl interface to OpenGL was built but no Tcl specific code was written As a result it is easy to retarget our interface for other languages For example swig python opengl i Build a Python interface to OpenGL swig perl5 opengl i Build a Perl5 interface to OpenGl Tcl Extension Building With SWIG Objects 6th Annual USENIX Tcl Tk Conference Sept 15 1998 42 Manipulating Objects The SWIG pointer model reprise e SWIG manages all structures unions and classes by reference i e pointers e Most C C programs pass objects around as pointers In many cases writing wrappers and passing opaque pointers is enough However in some cases you might want more than this Issues e How do you create and destroy C C objects in Tcl e How do you access the internals of C C objects in Tcl e How do you invoke C member functions from Tcl Concerns e Don t want to have to write a full C compiler to make it work a nightmare e Don t want to turn Tcl into C e Don t want to turn C into Tcl e Keep it simple Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 43 Notes Creating and Destroying Objects Objects can be created and d
27. ing smart pointers etc Tcl wouldn t know about this Accessing the Internals of an Object This is accomplished using accessor functions Sinline double Vector_x_get Vector v return v gt x void Vector_x_set Vector v double val v gt x val gt gt gt v new_Vector 1 3 10 gt gt gt print Vector_x_get v 1 0 gt gt gt Vector_x_set v 7 5 gt gt gt print Vector_x_get v Tad gt gt gt e Minimally you only need to provide access to the interesting parts of an object e Admittedly crude but conceptually simple Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 45 Notes Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 Notes Invoking C Member Functions You guessed it class Stack public Stack Stack void push Object Object pop Sinline void Stack_push Stack s Object o s gt push 0 Object Stack_pop Stack s return s gt pop e Basically we are just creating ANSI C wrappers around C methods 46 smodule stack class Stack public Stack Stack void push Object Object pop int depth Tcl Extension Building With SWIG Notes SWIG Automatic Creation of Accessor Functions SWIG automatically generates accessor functions if given structure union o
28. namespace support Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 23 Notes e Variable length argumen int fprintf FILI e Some declarations aren Unsupported Features SWIG is not a full C C parser e Pointers to functions and arrays are not fully supported void foo int a int double Error void bar int b 50 60 Error ts not supported E wk Ghar FEME sic 5 t parsed correctly a problem in early versions of SWIG const char const a Goal of SWIG is not to parse raw header files e ANSI C C syntax used because it is easy to remember and use e SWIG interfaces are usually a mix of ANSI C and special SWIG directives e Build interfaces by tweaking header files e There are workarounds to most parsing problems Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 24 Notes Quick Summary You know almost everything you need to know e C declarations are transformed into Tcl equivalents e C datatypes are mapped to an appropriate Tcl representation e Pointers can be manipulated and are type checked e Objects are managed by reference e SWIG provides special directives for renaming including files etc e SWIG is not a full C C parser This forms the foundation for discussing the rest of SWIG e Handling of structures unions and classes e Using the SWIG library e Customization
29. nference Sept 15 1998 3 Notes e SWIG http www swig org e jWrap http www fridu com Html jWrap html e ITcl http www9 informatik uni erlangen de eng research rendering vision itcl e Embedded Tk ET ftp ftp neosoft com languages tcl sorted devel et1_5 tar gz e cpptcl http www fas harvard edu darley EvoXandCpptcl html e Tclobj http zeus informatik uni frankfurt de fp Tcl tclobj e TclObjCommand http ftp austintx net users jatucker TclObjectCommand default htm e Modular Tcl http www amath washington edu lf software tcl e Object Tcl http www bblink com usr skunk src Tools ObjectTcl 1 1 docs cover html Why Use an Extension Tool Simplicity e Tools often simplify the construction of complex C C extensions e May hide nasty underlying details Automation works well for large packages Productivity e Using a tool is usually faster than writing everything by hand e Focus on the problem at hand not the creation of wrappers Better support for rapid change e Tools are less sensitive to changes in an application e Easier to manage new versions of Tcl e g Tcl 7 x to Tcl 8 x Allows Tcl to be used in new ways e As a C C software development tool e Testing debugging Extension tool for end users who may not know much about Tcl Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 4 Notes SWIG Simplified Wrapper and
30. nkfurt de fp Tcl Things to Keep in Mind Extension building tools don t necessarily result in a good interface Trying to wrap a raw header file is not guaranteed to work e Wrapping every function in a package is rarely necessary A little planning and design go a long way SWIG may be inappropriate for very large projects e Designed to be relatively informal and easy to use e Informality may be the exact opposite of what you want on a large project Shop around e We are fortunate that Tcl is so easy to extend and that there are many tools There is no silver bullet Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 70 Notes Tcl Extension Building With SWIG Summary 6th Annual USENIX Tcl Tk Conference Sept 15 1998 71 An Approach That Works Extension building tools are being used in a variety of projects e Simplify construction of large scripting interfaces e Improve productivity e Result in better applications A sampling of SWIG applications from a user survey 2 98 Animation Financial Palm Pilot Astrophysics Fortran Parallel computing Automotive R amp D Games Partial differential equation solvers CAD Tools Groupware Polarization microscopy CASE Tools Hardware control monitoring Protein sequence analysis COM Image processing PythonWin CORBA Integrated Development Environ Raytracing Chemical information systems Java Realtime automation Clim
31. o Tcl Objects A C structure struct Image int width int height Some C functions Image imgcreate int w int h void imgclear Image im int color void imgplot Image im int x int y int color Can radically alter the Tcl interface to existing C programs Smodule image struct Image int width int height saddmethods Image Image int w int h return imgcreate w h void clear int color return imgclear self color void plot int x int y int color return imgplot self x y color wee Tel Create an image Image img 500 500 Manipulate it img clear BLACK img plot 200 200 SWHITE 6th Annual USENIX Tcl Tk Conference Sept 15 1998 52 Objects and Pointers The object interface is built using pointers and accessor functions e However objects and pointers are generally not interchangable An object is simply a name pointer value is hidden away in clientData Extracting the pointer value from an object set ptr obj cget this e Extracts the pointer value from an object named ob gt Converting a pointer value into an object Object obj this Sptr e Creates an object named obj from the pointer value Sptr More details in the SWIG manual Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 53 Notes The SWIG Library Tcl Extension Building With SWIG 6th Annual U
32. on Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 64 Notes Typemap Methods Typemaps can be defined for a variety of purposes e Function input values in e Function output out e Default arguments e Ignored arguments e Returned arguments e Exceptions Constraints e Setting getting of structure members e Parameter initialization The SWIG Users Manual has all the gory details The bottom line e Typemaps are very powerful and very useful e Can customize SWIG in a variety of ways e But you have to know what you re doing Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 65 Notes Limitations Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 66 SWIG Limitations Not a full C C parser e C function overloading e C operator overloading Namespaces e Templates e Variable length arguments e Pointers to functions and pointers to arrays e Pointers to member functions e Problems with const e Can sometimes be difficult to track down parsing and code generation bugs e May be very hard to use with very complex header files May experience trouble with very large packages e C systems with hundreds of header files e May generate an excessive amount of code tens to hundreds of thousands of lines Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conf
33. ould have been performed by the C compiler Pointer Example Smodule example FILE fopen char filename char mode int fclose FILE f unsigned fread void ptr unsigned size unsigned nobj FILE unsigned fwrite void ptr unsigned size unsigned nobj FILE A memory allocation functions void malloc unsigned nbytes void free void load example so proc filecopy source target set f1 fopen Ssource r set f2 fopen target w set buffer malloc 8192 set nbytes fread buffer 1 8192 f1 while nbytes gt 0 fwrite buffer 1 nbytes f2 set nbytes fread buffer 1 8192 f1 fclose f1 fclose f2 free buffer Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 13 Notes In the example we didn t need to know what a FILE was to use it SWIG does not need to know anything about the data a pointer actually points to More About Pointers Type errors result in Tcl exceptions fclose buffer Type error in argument 1 of fclose Expected _FILE_p received _8062470_void_p e Type checking prevents most of the common errors e Has proven to be extremely reliable in practice Interesting features e Definitions of objects are not required in interface files e Almost any C C object can be manipulated with pointers Pitfall Pointers in Tcl are just like pointers in C e The same rules used in C apply to Tcl Use of malloc free o
34. p rename s Delete e Class is manipulated like a widget Data members accessed and modified using cget and configure e Interface is somewhat similar to incr Tcl e Object interface is built using low level accessor functions e Many more details in the SWIG manual Note SWIG is not an object oriented extension to Tcl e For instance you can t inherit from a SWIG object Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 50 Notes Extending Structures and Classes Object extension A cool trick for building Tcl interfaces e You can provide additional methods for use only in Tcl e Useful for debugging smodule example struct Vector double x y 2Z Attach some new methods to Vector Saddmethods Vector Vector double x double y double z Vector v new Vector Create a vector Vector v 1 0 2 0 3 5 Vi gt x X v gt y a Output its value y gt 2 Z v output return v void output printf g g g n self gt x self gt y self gt z Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 51 Notes The object extension mechanism works with both C and C Furthermore it does not rely upon any C magic nor does it affect the underlying objects in any way Tcl Extension Building With SWIG Notes Turning C Structures int
35. r class definitions 7 void void Stack Object S return new_Stack new Stack delete_Stack Stack s delete Stack_push Stack s Ss Object o s gt push o return return s gt dept tack_pop Stack s s gt pop Stack_depth_get Stack s s gt depth Stack_depth_set Stack s int d h d e Avoids the tedium of writing the accessor functions yourself 6th Annual USENIX Tcl Tk Conference Sept 15 1998 47 The creation of accessor functions is so straightforward it makes sense for SWIG to automate the process Parsing Support for Objects SWIG provides parsing support for the following e Basic structure and union definitions e Constructors destructors Member functions e Static member functions e Static data Enumerations e C inheritance Not currently supported mostly related to C e Template classes what is a template in Tcl e Operator overloading e Nested classes However SWIG can work with incomplete definitions e Just provide the pieces that you want to access e SWIG is only concerned with access to objects not the representation of objects Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 48 Notes It is important to remember that SWIG only turns object definitions into accessor functions This transformation can be easily perform
36. r new delete to create and destroy objects e Can have dangling pointers memory leaks and address violations e SWIG assumes you know what you are doing e Pointers in Tcl are no less safe than pointers in C Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 14 Notes Array Handling Arrays are pointers e Same as in C the value of an array is a pointer to the first element e Multidimensional arrays are supported e There is no difference between an ordinary pointer and an array in SWIG SWIG does not perform bounds or size checking smodule example double create_array int size void foo double a 10 10 10 set d create_array 1000 puts d 100f800_double_p foo d foo accepts any double Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 15 Notes No checks are made to insure that arrays are of the proper size or even initialized properly if not you ll probably get a segmentation fault It may be useful to re read the section on arrays in your favorite C programming book there are subtle differences between arrays and pointers unfortunately they are easy to overlook or forget Effective use of arrays may require the use of accessor functions to access individual members this is described later Objects SWIG manipulates all objects by reference i e pointers Smodule example
37. s e Blindly following all include statements is probably not the behavior you want Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 21 Notes Like the C compiler SWIG library directories can be specified using the I option For example swig tcl I home beazley SWIG lib example i double foo sreadonly double bar double spam Sreadwrite Tcl Extension Building With SWIG Notes Renaming Declarations The name directive can be used to change the name of the Tcl command Sname output Creating read only variables Y readonly and readwrite directives void print Global variabl Gl obal variab read only Renaming and Restricting e Usually used to resolve namespace conflicts between C and Tcl e read write e read only e Read only mode stays in effect until it is explicitly disabled 6th Annual USENIX Tcl Tk Conference Sept 15 1998 22 Miscellaneous Features Tcl8 0 wrappers e SWIG will generate wrappers for Tcl objects e Run SWIG with the tc18 option e Results in better performance Namespaces e Can install all of the wrappers in a Tcl8 namespace swig namespace Namespace name is the same as the module name e AC function bar in a module foo will be wrapped as foo bar Prefixes e Can attach a package prefix to functions swig prefix foo e Not really needed with
38. ssumes Linux The following examples show the procedure for Solaris and Irix Consult the man pages for your C compiler and linker e Solaris cc c example c wrapper c ld G example o wrapper o o example so e Trix cc c example c wrapper c ld shared example o wrapper o o example so Troubleshooting tips If you get the following error it usually means that the name of your module and the name of the shared library don t match 2 load example so couldn t find procedure Example_Init To fix this problem make sure the name given with module matches the name of the shared library The following error usually means your forgot to link everything or there is a missing library 2 load example so couldn t load file example so example so undefined symbol fact To fix this check the link line to make sure all of the required files and libraries are being used You need to link the SWIG wrapper file and the original C code together when creating a module If the original application is packaged as a library it should be included on the link line when creating the Tcl extension module What SWIG Does Basic C declarations e C functions become Tcl procedures or commands e C global variables become Tcl variables if possible see notes e C constants become Tcl variables Datatypes e C built in datatypes are mapped into the closest Tcl equivalent eint long short lt gt Tcl integers e flo
39. t mat_shininess newfv4 50 0 0 0 0 set light_position newfv4 1 0 1 0 1 0 0 0 glMaterialfv GL_FRONT GL_SPECULAR mat_specular glMaterialfv GL_FRONT GL_SHININESS mat_shininess glLightfv GL_LIGHTO GL_POSITION light_position glEnable GL_LIGHTING glEnable GL_LIGHTO glDepthFunc GL_LEQUAL glEnable GL_DEPTH_TEST Set up view glClearColor 0 0 0 0 glColor3f 1 0 1 0 1 0 glMatrixMode GL_PROJECTION glLoadIdentity glOrtho 1 1 11 11 glMatrixMode GL_MODELVIEW glLoadidentity glClear GL_COLOR_BUFFER_BIT glClear GL_DEPTH_BUFFER_BIT auxSolidTorus 0 10 0 50 Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 40 Notes Putting it All Together Interface building is often an iterative process e Start with header files e Fix parsing problems and make slight edits as necessary e Refine the interface to make it more usable Can be a very rapid process For OpenGL Smodule opengl Define problematic macros Had to define 3 macros define APIENTRY R define WINGDAPI Edit out some function pointers define CALLBACK e Supply a few typedefs Pi esotee a eypedet e Write a few helper functions typedef const Char sure tse include gl i Some things to think about sinclude glu i Sinclude glaux i e Raw headers might create an include help i unusable interface f Create a macro wrapper e It is rarely necessary to wrap unde
40. this SWIG interface to OpenGL Smodule opengl Sinclude gl i Sinclude glu i Sinclude glaux i e Write a few supporting functions to make the interface work a little better Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 28 Notes Preparing the Files gl i s include lt GL gl h gt Sinclude gl h OpenGL Interface Ssmodule opengl glu i include lt GLU glu h gt Sinclude gl i 3 ar gt 3 i Sinclude glu h Sinclude glu i Sinclude glaux i glaux i S include lt GL glaux h gt Sinclude glaux h Note This is only going to be a first attempt Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 29 Notes Creating a Project Extensions are compiled as DLLs New 21x Files Projects Workspaces Other Documents je ATL COM App wizard Project name A Custom Appwizard OpenGU SA ISAPI Extension Wizard Location Fel Makefile D Devel OpenGL E a MFC Activex Controlwizard 2 MFC Appw izard dl pata MFC App Wizard exe Create new workspace E Win32 Application Addite curent workspace P Win32 Console Application fm Dependency of Win32 Dynamic Link Library A S Win32 Static Library Platforms Mwin32 cen e Simply select a Win32 DLL when creating a new project
41. u32 lit I Generate debug info I Ignore all default libraries Link incrementally T Generate mapfile T Enable profiling T Ignore export library Project Options nologo MTd AW3 Gm GX Zi Od I d develMtcl include D WIN32 D _DEBUG D WINDOWS FR Debug coe Project Options kemel32 lib user32 lib gdi32 lib winspool lib comdlg32 lib advapi32 lib shell32 lib ole32 lib oleaut32 lib uuid lib odbe32 lib odbecp32 lib d devel tel lib tel80ve lib x Whew Almost ready to give it a try Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 32 Notes First Attempt Building our module now results in the following SWIG Making wrappers for Tcl d Program Files DevStudio VC include GL gl h Line 1135 Syntax error in input d Program Files DevStudio VC include GL gl h Line 1136 Syntax error in input Program Files DevStudio VC include GL gl h Line 1137 Variable WINGDIAPI multiply oat defined 2nd definition ignored d Program Files DevStudio VC include GL gl h Line 1137 Syntax error in input d Program Files DevStudio VC include GL gl h Line 1138 Variable WINGDIAPI multiply defined 2nd definition ignored d Program Files DevStudio VC include GL gl h Line 1138 Syntax error in input d Program Files DevStudio VC include GL gl h Line 1139 Vari
42. uous command name AuxInitWindow auxInitWindowA auxInitWindoww oe oe 7 oe oe Header files and libraries sometimes play tricks ifdef UNICODE define auxInitWindow auxInitWindowW ls define auxInitWindow auxInitWindowA nd GLenum API NTRY auxInitWindowA LPCSTR GLenum APIENTRY auxInitWindowW LPCWSTR Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 36 Notes Wrapping a raw header file might not result in a usable Tcl extension module SWIG does not create wrappers for C macros as shown above gl Wrapping Macros To wrap macros simply supply a C prototype with type information laux i incl und lude lt GL glaux h gt Clear the macro definition f auxInitWindow May need to Give SWIG a C prototype for the macro GLenum auxInitWindow char title look at interface files to identify other macros Tcl Extension Building With SWIG 6th Annual USENIX Tcl Tk Conference Sept 15 1998 37 Notes Type Problems SWIG only really understands a few basic datatypes int long short float double char void e Everything else is assumed to be a pointer Missing typedef s are sometimes a problem GLenum APIENTRY auxInitWindowA LPCSTR e SWIG assumes LPCSTR is a complex object and creates a wrapper like this G
Download Pdf Manuals
Related Search
Related Contents
Valueline VLCP60809B20 camera cable IS1001 Standalone User Manual Rev.4 (機)バキューム計取扱説明書 PDF RS-60 Sony 4-115-568-11(1) Flat Panel Television User Manual Fujitsu LIFEBOOK P702 M.150S Manuel d`utilisation Copyright © All rights reserved.
Failed to retrieve file